1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,546481,448459,343609,386403,270723,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(846932),i=e.i(131011),o=e.i(992580),a=e.i(389472),s=e.i(247103),c=e.i(844735),l=e.i(913107),u=e.i(427217),f=e.i(803884),d=e.i(705766),h=e.i(822617),p=e.i(168716),y=e.i(63495);let b={"To Do":"#9CA3AF","In Progress":"#6366F1",Review:"#F59E0B",Done:"#10B981",Complete:"#10B981",Stuck:"#EF4444"};function m({task:e}){let r=Array.isArray(e.assignees)?e.assignees.find(e=>e&&"object"==typeof e&&(e.name||e.image)):null;if(!r)return null;let n=(r.name||"").split(" ").filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join("");return r.image?(0,t.jsx)("img",{src:r.image,alt:r.name||"Assignee",title:r.name,className:"w-[18px] h-[18px] rounded-full object-cover flex-shrink-0",style:{border:"1.5px solid var(--border-subtle)"}}):(0,t.jsx)("span",{title:r.name,className:"w-[18px] h-[18px] rounded-full flex items-center justify-center text-[8px] font-bold text-white flex-shrink-0",style:{background:"linear-gradient(135deg, #6366F1, #8B5CF6)"},children:n})}let g={critical:"#EF4444",high:"#F97316",medium:"#F59E0B",low:"#9CA3AF"},v={day:64,week:24,month:8};function x(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function w(e){let t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}function _(e,t){let r=new Date(e);return r.setDate(r.getDate()+t),r}function S(e,t){return Math.round((x(e)-x(t))/864e5)}function j({zoom:e,onChange:r}){let n=["month","week","day"],a=n.indexOf(e);return(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)("button",{onClick:()=>r(n[Math.max(0,a-1)]),disabled:0===a,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all hover:bg-gray-100 dark:hover:bg-zinc-900 disabled:opacity-40",title:"Zoom out",children:(0,t.jsx)(o.MagnifyingGlassMinusIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})}),(0,t.jsx)("div",{className:"px-2 py-1 rounded-md text-[10px] font-bold uppercase tracking-wider",style:{background:"var(--surface-soft)",color:"var(--text-secondary)",minWidth:56,textAlign:"center"},children:e}),(0,t.jsx)("button",{onClick:()=>r(n[Math.min(n.length-1,a+1)]),disabled:a===n.length-1,className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all hover:bg-gray-100 dark:hover:bg-zinc-900 disabled:opacity-40",title:"Zoom in",children:(0,t.jsx)(i.MagnifyingGlassPlusIcon,{className:"w-3.5 h-3.5 text-gray-500 dark:text-zinc-400"})})]})}function k({rangeStart:e,totalDays:r,dayWidth:n,zoom:i}){let o=[];for(let t=0;t<=r;t++){let r=_(e,t),a=null,s=null,c=!1;"day"===i?(a=r.toLocaleDateString(void 0,{weekday:"short"}),s=`${r.getMonth()+1}/${r.getDate()}`,c=0===r.getDay()||6===r.getDay()):"week"===i&&1===r.getDay()?a=r.toLocaleDateString(void 0,{month:"short",day:"numeric"}):"month"===i&&1===r.getDate()&&(a=r.toLocaleDateString(void 0,{month:"short",year:"2-digit"})),a&&o.push({left:t*n,label:a,sub:s,weekend:c})}return(0,t.jsxs)("div",{className:"flex sticky top-0 z-20",style:{background:"var(--surface-frosted)",backdropFilter:"blur(8px)",borderBottom:"1px solid var(--border-subtle)"},children:[(0,t.jsx)("div",{className:"flex-shrink-0 px-4 py-2 border-r sticky left-0 z-30 flex items-center",style:{width:260,borderColor:"var(--border-subtle)",background:"var(--surface-frosted)",backdropFilter:"blur(8px)"},children:(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:"Milestone"})}),(0,t.jsx)("div",{className:"relative h-9",style:{width:r*n,flexShrink:0},children:o.map(e=>e.sub?(0,t.jsxs)("div",{className:"absolute top-0 bottom-0 flex flex-col items-center justify-center leading-none",style:{left:e.left,width:n,borderLeft:"1px solid var(--border-subtle)",background:e.weekend?"var(--surface-softer)":"transparent"},children:[(0,t.jsx)("span",{className:`text-[9px] font-semibold uppercase tracking-wider whitespace-nowrap ${e.weekend?"text-gray-400 dark:text-zinc-600":"text-gray-500 dark:text-zinc-400"}`,children:e.label}),(0,t.jsx)("span",{className:`text-[10px] font-bold whitespace-nowrap mt-0.5 ${e.weekend?"text-gray-400 dark:text-zinc-600":"text-gray-700 dark:text-zinc-200"}`,children:e.sub})]},e.left):(0,t.jsx)("div",{className:"absolute top-0 bottom-0 flex items-center px-1.5",style:{left:e.left,borderLeft:"1px solid var(--border-subtle)"},children:(0,t.jsx)("span",{className:"text-[9.5px] font-semibold uppercase tracking-wider text-gray-500 dark:text-zinc-400 whitespace-nowrap",children:e.label})},e.left))})]})}function O({rangeStart:e,dayWidth:r,height:n}){let i=260+S(x(new Date),e)*r;return(0,t.jsx)("div",{"aria-hidden":"true",className:"absolute top-0 pointer-events-none z-10",style:{left:i,width:2,height:n,background:"linear-gradient(180deg, rgba(236,72,153,0.6), rgba(249,115,22,0.6))",boxShadow:"0 0 12px rgba(236,72,153,0.45)"}})}function $({milestone:e,top:n,rangeStart:i,totalDays:o,dayWidth:a,isExpanded:u,onToggleExpand:d,onClick:p,onAddTask:y,onShift:b,dependsOnTitles:m,earliestStart:g,onHover:v,isLinked:x=!1,onDropTask:_}
1){let[j,k]=(0,r.useState)(!1),O=e.startDate?w(e.startDate):null,E=e.endDate?w(e.endDate):null,N=!!O&&!!E&&E>=O,P=N?S(O,i)*a:0,M=N?Math.max(a,(S(E,O)+1)*a):0,D=e.color||"#F97316",I="completed"===e.status?100:e.taskCount>0?Math.round((e.doneTaskCount||0)/e.taskCount*100):0,T=e.baselineEndDate&&e.endDate?(0,h.businessDaysBetween)(e.baselineEndDate,e.endDate):0;return(0,t.jsxs)("div",{className:"absolute left-0 w-full flex items-center border-b",style:{top:n,height:56,borderColor:"var(--surface-softer)",background:j?"rgba(249,115,22,0.10)":void 0,boxShadow:j?`inset 0 0 0 2px ${D}88`:void 0,transition:"background 120ms ease, box-shadow 120ms ease"},onMouseEnter:()=>v?.(!0),onMouseLeave:()=>v?.(!1),onDragOver:e=>{Array.from(e.dataTransfer?.types||[]).includes("application/x-scout-task-id")&&(e.preventDefault(),e.dataTransfer.dropEffect="move",j||k(!0))},onDragLeave:()=>k(!1),onDrop:e=>{let t=e.dataTransfer?.getData("application/x-scout-task-id");k(!1),t&&(e.preventDefault(),_?.(t))},children:[(0,t.jsxs)("div",{className:"group flex-shrink-0 pl-3 pr-2 h-full flex items-center gap-1.5 sticky left-0 z-[12] border-r",style:{width:260,background:"var(--surface-frosted)",backdropFilter:"blur(8px)",borderColor:"var(--border-subtle)"},children:[(0,t.jsx)("button",{onClick:d,className:"w-6 h-6 flex-shrink-0 rounded-md flex items-center justify-center hover:bg-gray-100 dark:hover:bg-zinc-900",title:u?"Collapse tasks":"Expand tasks",children:u?(0,t.jsx)(c.ChevronDownIcon,{className:"w-3.5 h-3.5 text-gray-400 dark:text-zinc-500"}):(0,t.jsx)(s.ChevronRightIcon,{className:"w-3.5 h-3.5 text-gray-400 dark:text-zinc-500"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 cursor-pointer",onClick:p,children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:D}}),(0,t.jsx)("span",{className:"text-[12.5px] font-semibold text-gray-900 dark:text-zinc-100 truncate",children:e.title})]}),m.length>0&&(0,t.jsx)("div",{className:"flex items-center gap-1 mt-0.5 overflow-hidden",children:(0,t.jsxs)("span",{className:"text-[9.5px] text-gray-400 dark:text-zinc-500 truncate",children:["after ",m.slice(0,2).join(", "),m.length>2?` +${m.length-2}`:""]})})]}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),y?.()},className:"w-6 h-6 flex-shrink-0 rounded-md flex items-center justify-center opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity hover:bg-orange-50 dark:hover:bg-orange-500/10",title:"Add task to this milestone","aria-label":"Add task to this milestone",children:(0,t.jsx)(l.PlusIcon,{className:"w-3.5 h-3.5",style:{color:"#F97316"}})})]}),(0,t.jsxs)("div",{className:"relative h-full flex-shrink-0",style:{width:o*a},children:[N&&x&&(0,t.jsx)("span",{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4 rounded-full flex items-center justify-center z-[6] pointer-events-none",style:{left:P-9,background:"var(--surface-frosted)",border:`1.5px solid ${D}`,boxShadow:"0 1px 4px rgba(0,0,0,0.12)"},title:m.length?`after ${m.join(", ")}`:"waits on tasks",children:(0,t.jsx)(f.LinkIcon,{className:"w-2.5 h-2.5",style:{color:D}})}),N?(0,t.jsx)(A,{milestone:e,start:O,end:E,barLeft:P,barWidth:M,dayWidth:a,color:D,fillPct:I,slipDays:T>0?T:0,earliestStart:g,onClick:p,onShift:b}):(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 left-2 px-2 py-0.5 rounded text-[10px] font-medium cursor-pointer",style:{background:"var(--surface-soft)",color:"var(--text-tertiary)",border:"1px dashed var(--border-default)"},onClick:p,title:"Set dates or attach tasks",children:"no dates yet"})]})]})}function A({start:e,end:n,barLeft:i,barWidth:o,dayWidth:a,color:s,fillPct:c,slipDays:l,milestone:u,earliestStart:f,onClick:d,onShift:y}){let b=f&&e?Math.min(0,S(f,e)):null,[m,g]=(0,r.useState)(null),[v,x]=(0,r.useState)(i),j=(0,r.useRef)(!1);(0,r.useEffect)(()=>{m||x(i)},[i,m]);let[k,O]=(0,r.useState)(0);(0,r.useEffect)(()=>{if(m)return window.addEventListener("mousemove",t),window.addEventListener("mouseup",r),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",r)};function t(e){let t=e.clientX-m.originX;Math.abs(t)>3&&(j.current=!0);let r=Math.round(t/a);null!==b&&r<b&&(r=b),O(r);let n=t;null!==b&&n<b*a&&(n=b*a),x(i+n)}function r(t){let r=Math.round((t.clientX-m.originX)/a);if(null!==b&&r<b&&(r=b),g(null),O(0),0===r)return void x(i);let n=w(u.endDate),o=_(n,r),s=r>0?(0,h.businessDaysBetween)(n,o):-(0,h.businessDaysBetween)(o,n);0===s?x(i):(x(i+S((0,p.addBusinessDays)(e,s),e)*a),y?.(s))}},[m,a,i,u,y,b]);let $=(()=>
1{if(!m||!e||!n)return null;let t=k>0?(0,h.businessDaysBetween)(n,_(n,k)):-(0,h.businessDaysBetween)(_(n,k),n),r=(0,p.addBusinessDays)(e,t),i=(0,p.addBusinessDays)(n,t),o=e=>e.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}),a=null!==b&&k<=b&&k<0;if(0===k)return{text:0===b&&f?`${o(r)} â ${o(i)} \xb7 can't start earlier (waits on work due ${o(_(f,-1))})`:`${o(r)} â ${o(i)}`,tone:"neutral"};let s=t>0?"+":"â",c=k<0?a?" · earliest possible":" · downstream comes along":"";return{text:`${o(r)} â ${o(i)} \xb7 ${s}${Math.abs(t)} business day${1===Math.abs(t)?"":"s"}${c}`,tone:0!==t?a?"bound":"ok":"blocked"}})();return(0,t.jsxs)("div",{className:"absolute top-1/2 -translate-y-1/2 group",style:{left:v,width:o,height:28,zIndex:m?40:void 0,transition:m?"none":"left 180ms cubic-bezier(0.2, 0, 0, 1)"},title:`${u.title}${l>0?` â slipping +${l}d`:""}`,children:[$&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"aria-hidden":"true",className:"absolute pointer-events-none",style:{left:o-1+(n?S((0,p.addBusinessDays)(n,k>0?(0,h.businessDaysBetween)(n,_(n,k)):-(0,h.businessDaysBetween)(_(n,k),n)),n)*a:0)-(v-i),top:-14,width:2,height:56,background:"blocked"===$.tone?"rgba(239,68,68,0.6)":`${s}AA`,boxShadow:`0 0 8px ${"blocked"===$.tone?"rgba(239,68,68,0.5)":s+"66"}`}}),(0,t.jsx)("div",{className:"absolute left-0 -top-8 whitespace-nowrap px-2.5 py-1 rounded-lg text-[10.5px] font-bold text-white shadow-lg pointer-events-none",style:{background:"blocked"===$.tone?"linear-gradient(135deg, #EF4444, #DC2626)":"bound"===$.tone?"linear-gradient(135deg, #F59E0B, #D97706)":`linear-gradient(135deg, ${s}, ${s}CC)`},children:$.text})]}),(0,t.jsxs)("div",{onMouseDown:function(e){e.stopPropagation(),e.preventDefault(),j.current=!1,g({originX:e.clientX})},onClick:e=>{if(e.stopPropagation(),j.current){j.current=!1;return}m||d?.()},className:"absolute inset-0 rounded-md cursor-grab active:cursor-grabbing overflow-hidden",style:{background:`${s}25`,border:`1px solid ${s}55`},children:[(0,t.jsx)("div",{className:"h-full transition-all duration-500",style:{width:`${c}%`,background:`linear-gradient(135deg, ${s}DD, ${s}AA)`}}),(0,t.jsxs)("span",{className:"absolute inset-0 flex items-center px-2 truncate text-[10.5px] font-bold text-gray-900 dark:text-zinc-100 mix-blend-normal",children:[c,"%"]})]}),l>0&&(0,t.jsxs)("span",{className:"absolute -top-2 -right-1.5 text-[9px] font-black px-1.5 py-0.5 rounded-full",style:{background:"#EF4444",color:"white",boxShadow:"0 2px 6px rgba(239,68,68,0.4)"},children:["+",l,"d"]}),"stuck"===u.status&&(0,t.jsx)("span",{className:"absolute -top-2 -left-1.5 text-[9px] font-black px-1.5 py-0.5 rounded-full uppercase tracking-wide",style:{background:"#EF4444",color:"white",boxShadow:"0 2px 6px rgba(239,68,68,0.4)"},children:"Stuck"})]})}function E({milestone:e,top:n,width:i,teamMembers:o,onSubmit:a,onClose:s}){let[c,l]=(0,r.useState)(!1),f=e.color||"#F97316";return(0,t.jsx)("div",{className:"absolute left-0 w-full flex items-center border-b",style:{top:n,height:52,borderColor:"var(--surface-softer)"},onKeyDown:e=>{"Escape"===e.key&&s()},children:(0,t.jsxs)("div",{className:"flex items-center h-full sticky left-0 z-[12] pl-7",style:{width:i,maxWidth:"100%",background:"var(--surface-soft)"},children:[(0,t.jsx)("div",{className:"flex-1 min-w-0 [&>div]:border-b-0 [&>div]:px-3 [&>div]:py-1",children:(0,t.jsx)(y.default,{teamMembers:o,groupColor:f,portalPopovers:!0,clearOnSubmit:!0,placeholder:`New task in ${e.title} â @ to assign, type a date`,onSubmit:async e=>{if(c)return!1;l(!0);let t=await a(e);return l(!1),t},onCancel:s})}),(0,t.jsx)("button",{type:"button",onClick:s,className:"w-7 h-7 mr-2 rounded-md flex-shrink-0 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-zinc-900",title:"Close","aria-label":"Close",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-400 dark:text-zinc-500"})})]})})}function N({task:e,top:r,rangeStart:n,totalDays:i,dayWidth:o,onUpdate:a,onClick:s,earliestStart:c=null}){let l=e.startDate||e.dueDate,u=l?w(l):null,f=e.dueDate?w(e.dueDate):null,d=!!u&&!!f&&f>=u,h=d?S(u,n)*o:0,p=d?Math.max(o,(S(f,u)+1)*o):0,y=b[e.status]||"#9CA3AF",v=g[e.priority]||y;return(0,t.jsxs)("div",{className:"absolute left-0 w-full flex items-center border-b",style:{to
1p:r,height:40,borderColor:"var(--surface-softer)"},children:[(0,t.jsxs)("div",{className:"flex-shrink-0 pl-11 pr-2.5 cursor-pointer hover:bg-gray-50/50 dark:hover:bg-zinc-900/30 h-full flex items-center gap-1.5 sticky left-0 z-[12] border-r",style:{width:260,background:"var(--surface-frosted)",backdropFilter:"blur(8px)",borderColor:"var(--border-subtle)"},onClick:s,title:`${e.title}${e.status?` \xb7 ${e.status}`:""}`,children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:b[e.status]||"#9CA3AF"},title:e.status||"To Do"}),(0,t.jsx)("span",{className:"text-[11.5px] font-medium text-gray-600 dark:text-zinc-400 truncate flex-1 min-w-0",children:e.title}),(0,t.jsx)(m,{task:e})]}),(0,t.jsx)("div",{className:"relative h-full flex-shrink-0",style:{width:i*o},children:d?(0,t.jsx)(P,{task:e,start:u,end:f,barLeft:h,barWidth:p,dayWidth:o,accent:y,edgeColor:v,startInferred:!e.startDate,earliestStart:c,onUpdate:a,onClick:s}):(0,t.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 left-2 px-2 py-0.5 rounded text-[10px] font-medium",style:{background:"var(--surface-soft)",color:"var(--text-tertiary)",border:"1px dashed var(--border-default)"},title:"Add a due date to plot this task",children:"no due date"})})]})}function P({task:e,start:n,end:i,barLeft:o,barWidth:a,dayWidth:s,accent:c,edgeColor:l,startInferred:u,earliestStart:f=null,onUpdate:d,onClick:h}){var p;let y=f?x(f).getTime():null,[b,m]=(0,r.useState)(null),[g,v]=(0,r.useState)(o),[w,S]=(0,r.useState)(a),j=(0,r.useRef)(!1);function k(e){return t=>{t.stopPropagation(),t.preventDefault(),j.current=!1,m({mode:e,originX:t.clientX,origStart:n.getTime(),origEnd:i.getTime()})}}(0,r.useEffect)(()=>{b||(v(o),S(a))},[o,a,b]),(0,r.useEffect)(()=>{if(b)return window.addEventListener("mousemove",r),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",n)};function t(e){let t=Math.round(e/s),r=b.origStart,n=b.origEnd;if("move"===b.mode){if(r+=864e5*t,n+=864e5*t,null!==y&&r<y){let e=n-r;r=y,n=y+e}}else"left"===b.mode?(r+=864e5*t,null!==y&&r<y&&(r=y),r>n&&(r=n)):"right"===b.mode&&(n+=864e5*t)<r&&(n=r);return{nextStart:r,nextEnd:n}}function r(e){let r=e.clientX-b.originX;if(Math.abs(r)>3&&(j.current=!0),"move"===b.mode){let e=r;if(null!==y){let t=(y-b.origStart)/864e5*s;e<t&&(e=t)}v(o+e),S(a);return}let{nextStart:n,nextEnd:i}=t(r),c=(n-b.origStart)/864e5,l=(i-n-(b.origEnd-b.origStart))/864e5;v(o+c*s),S(a+l*s)}function n(r){let{nextStart:n,nextEnd:i}=t(r.clientX-b.originX);if(n!==b.origStart||i!==b.origEnd){let t={};n!==b.origStart&&(t.startDate=new Date(n).toISOString()),i!==b.origEnd&&(t.dueDate=new Date(i).toISOString());let r=(n-b.origStart)/864e5,c=(i-n-(b.origEnd-b.origStart))/864e5;v(o+r*s),S(a+c*s),d?.(e._id,t)}m(null)}},[b,s,o,a,d,e._id]);let O=new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric"}),$=new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"}),A=`${e.title} 2${O} â ${$}${u?" (no start date â plotted at its due date; drag the left edge to set one)":""}`,E=(()=>{if(!b)return null;let e=Math.round((g-o)/s),t=Math.round((w-a)/s),r=_(n,e),c=_(i,e+t),l=e=>e.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}),u=null!==y&&r.getTime()<=y&&"right"!==b.mode?" · earliest (blocked by another task)":"";return"left"===b.mode?`Start: ${l(r)}${u}`:"right"===b.mode?`Due: ${l(c)}`:`${l(r)} â ${l(c)}${u}`})();return(0,t.jsxs)("div",{className:"absolute top-1/2 -translate-y-1/2 group",style:{left:g,width:w,height:22,zIndex:b?40:void 0,transition:b?"none":"left 180ms cubic-bezier(0.2, 0, 0, 1), width 180ms cubic-bezier(0.2, 0, 0, 1)"},title:A,children:[E&&(0,t.jsx)("div",{className:"absolute -top-7 whitespace-nowrap px-2 py-0.5 rounded-md text-[10px] font-bold text-white shadow-lg pointer-events-none",style:{left:"right"===b.mode?void 0:0,right:"right"===b.mode?0:void 0,background:`linear-gradient(135deg, ${c}, ${c}CC)`},children:E}),(0,t.jsx)("div",{onMouseDown:k("left"),className:"absolute left-0 top-0 bottom-0 w-2 cursor-ew-resize z-10 opacity-0 group-hover:opacity-100 transition-opacity",style:{background:`linear-gradient(90deg, ${c}, transparent)`}}),(0,t.jsx)("div",{onMouseDown:k("right"),className:"absolute right-0 top-0 bottom-0 w-2 cursor-ew-resize z-10 opacity-0 group-hover:opacity-100 transition-opacity",style:{background:`linear-gradient(270deg, ${c}, transparent)`}}),(0,t.jsxs)("div",{onMouseDown:k("move"),onClick:e=>{if(e.stopPropagation(),j.current){j.current=!1;return}b||h?.()},className:"absolute inset-0 rounded-md cursor-grab active:cursor-grabbing",style:{background:`linear-gradient(135deg, ${c}30, ${c}1C)`,border:u?`1px dashed ${c}88`:`1px solid ${c}66`},children:[(0,t.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-[3px] rounded-l-md",style:{background:l||c}}),(0,t.jsx)("span",{className:"absolute inset-0 flex items-center pl-2.5 pr-2 truncate text-[9.5px] font-semibold text-gray-700 dark:text-zinc-200 tracking-wide",children:"Done"===(p=e.status)||"Complete"===p?(0,t.jsx)("s",{className:"opacity-70",children:e.title}):e.title})]})]})}e.s(["default",0,function({milestones:e=[],onMilestoneClick:i,onTaskClick:o,applyMilestoneSync:s,applyShiftResult:c,campaignId:u,owner:f=null,refetch:h,patchTaskLocal:y,shiftMilestoneLocal:b,teamMembers:m=[],defaultBoardId:A=null,onTaskDrop:P}){let[M,D]=(0,r.useState)("week"),I=v[M],T=(0,r.useRef)(null),[C,B]=(0,r.useState)(()=>new Set),[R,L]=(0,r.useState)(null),[z,F]=(0,r.useState)(null);function U(e){let t=String(e);B(e=>
2e.has(t)?e:new Set(e).add(t)),L(t)}async function q(e,t){let r=(t?.title||"").trim();if(!r)return!1;try{let n=t.dueDate||function(e){if(!e)return"";let t=new Date(e);if(isNaN(t.getTime()))return"";let r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0");return`${r}-${n}-${i}`}(e.endDate||e.startDate||new Date),i={...t,title:r,milestone:e._id,...f?.type==="deal"?{parentDeal:t.parentDeal||f.id}:{linkedCampaign:t.linkedCampaign||u||f?.id||e.campaign},dueDate:n,startDate:t.startDate||n,...A?{board:A}:{}},o=await fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),a=await o.json().catch(()=>({}));if(!o.ok)return d.default.error(a.error||"Failed to create task"),!1;return d.default.success("Task added"),s?.(a.milestoneSync),await h?.(),!0}catch{return d.default.error("Failed to create task"),!1}}let V=(0,r.useMemo)(()=>[...e||[]].sort((e,t)=>(e.position??0)!==(t.position??0)?(e.position??0)-(t.position??0):new Date(e.createdAt||0)-new Date(t.createdAt||0)),[e]),{rangeStart:K,rangeEnd:H}=(0,r.useMemo)(()=>(function(e){let t=x(new Date),r=_(t,-7),n=_(t,30);for(let t of e||[]){if(t.startDate){let e=w(t.startDate);e<r&&(r=e)}if(t.endDate){let e=w(t.endDate);e>n&&(n=e)}for(let e of t.tasks||[]){let t=e.startDate||e.dueDate;if(t){let e=w(t);e<r&&(r=e)}if(e.dueDate){let t=w(e.dueDate);t>n&&(n=t)}}}return{rangeStart:_(r,-2),rangeEnd:_(n,2)}})(V),[V]),W=Math.max(1,S(H,K)),J=W*I;(0,r.useEffect)(()=>{if(!T.current)return;let e=S(x(new Date),K)*I;T.current.scrollLeft=Math.max(0,e-200)},[M,K,I]);let G=(0,r.useMemo)(()=>{let e=0,t=[];for(let r of V){let n=e;e+=56;let i=[];if(C.has(String(r._id))){for(let t of r.tasks||[])i.push({task:t,top:e}),e+=40;let t=R===String(r._id);i.push({add:t,ghost:!t,top:e}),e+=t?52:40}t.push({milestone:r,top:n,taskRows:i})}return{rows:t,totalHeight:Math.max(e,1)}},[V,C,R]),Y=(0,r.useMemo)(()=>new Map(G.rows.map(e=>[String(e.milestone._id),e])),[G]),X=(0,r.useMemo)(()=>{let e=new Map;for(let t of G.rows)for(let r of t.milestone.tasks||[]){let n=t.taskRows.find(e=>e.task&&String(e.task._id)===String(r._id));e.set(String(r._id),{task:r,ownerRow:t,visibleTop:n?n.top:null})}return e},[G]),Q=(0,r.useMemo)(()=>{let e=new Map;for(let t of V){let r=null,n=e=>{if(!e)return;let t=w(e);(!r||t>r)&&(r=t)};for(let e of t.dependsOn||[])n(Y.get(String(e))?.milestone.endDate);for(let e of t.dependsOnTasks||[])n(X.get(String(e))?.task.dueDate);e.set(String(t._id),r?(0,p.addBusinessDays)(r,1):null)}return e},[V,Y,X]),Z=(0,r.useMemo)(()=>{let e=[];for(let t of G.rows){let r=t.milestone;for(let n of r.dependsOn||[]){let i=Y.get(String(n));i&&e.push({key:`${n}-${r._id}`,from:i,to:t})}for(let n of r.dependsOnTasks||[]){let i=X.get(String(n));i&&i.task.dueDate&&e.push({key:`t${n}-${r._id}`,fromTask:i,to:t})}}return e},[G,Y,X]);async function ee(e,t){y?.(e,t);try{let r=await fetch(`/api/tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json().catch(()=>({}));if(!r.ok){d.default.error(n.error||"Failed to update task"),h?.();return}n.task&&y?.(e,{startDate:n.task.startDate,dueDate:n.task.dueDate,status:n.task.status}),s?.(n.milestoneSync)}catch{d.default.error("Failed to update task"),h?.()}}async function et(e,t){if(Number.isFinite(t)&&0!==t){b?.(e,t);try{let r=await fetch(`/api/milestones/${e}/shift`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deltaDays:t})}),n=await r.json().catch(()=>({}));if(!r.ok){d.default.error(n.error||"Failed to shift milestone"),h?.();return}c?.(n);let i=Math.abs(t),o=Math.max(0,(n.shifted?.length||1)-1);d.default.success(`Moved ${t>0?"later":"earlier"} ${i} business day${1===i?"":"s"}${o>0?` â ${o} downstream milestone${1===o?"":"s"} came along`:""}`)}catch{d.default.error("Failed to shift milestone")}}}return(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25},className:"rounded-2xl border overflow-hidden",style:{borderColor:"var(--border-subtle)",background:"var(--surface-frosted)",backdropFilter:"blur(20px)",boxShadow:"0 8px 40px var(--surface-softer)"},children:[(0,t.jsx)("div",{className:"h-[3px] w-full bg-gradient-to-r from-pink-500/60 via-orange-400/60 to-violet-500/60"}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b",style:{borderColor:"var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.CalendarDaysIcon,{className:"w-4 h-4 text-pink-500"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-gray-500 dark:text-zinc-400",children:"Gantt"})]}),(0,t.jsx)(j,{zoom:M,onChange:D})]}),(0,t.jsx)("div",{ref:T,className:"overflow-x-auto",children:(0,t.jsxs)("div",{style:{width:260+J,minWidth:"100%"},children:[(0,t.jsx)(k,{rangeStart:K,totalDays:W,dayWidth:I,zoom:M}),(0,t.jsxs)("div",{className:"relative",style:{height:G.totalHeight},children:[(0,t.jsx)(O,{rangeStart:K,dayWidth:I,height:G.totalHeight}),(0,t.jsx)("svg",{"aria-hidden":"true",className:"absolute top-0 pointer-events-none z-[5]",style:{left:260,width:J,height:G.totalHeight,overflow:"visible"},children:Z.map(({key:e,from:r,fromTask:n,to:i})=>{let o,a,s,c,l=n?String(n.ownerRow.milestone._id):String(r.milestone._id),u=String(i.milestone._id),f=z&&(z===l||z===u);if(n)o=w(n.task.dueDate),a=null!=n.visibleTop?n.visibleTop+20:n.ownerRow.top+28,
2s=g[n.task.priority]||n.ownerRow.milestone.color||"#9CA3AF";else{let e=r.milestone.startDate?w(r.milestone.startDate):K;o=r.milestone.endDate?w(r.milestone.endDate):e,a=r.top+28,s=r.milestone.color||"#F97316"}let d=S(o,K)*I+I,h=i.milestone.startDate?w(i.milestone.startDate):K,p=S(h,K)*I,y=i.top+28,b=h<=o;if(!f&&!b)return null;let m=y>a,v=m?1:-1,x=(e,t,r)=>`A 6 6 0 0 ${r} ${e} ${t}`;if(p>=d+10+12){let e=d+10;c=[`M ${d} ${a}`,`L ${e-6} ${a}`,x(e,a+6*v,+!!m),`L ${e} ${y-6*v}`,x(e+6,y,+!m),`L ${p} ${y}`].join(" ")}else{let e=m?i.top-2:(n?a:r.top)-2,t=d+10,o=p-10;c=[`M ${d} ${a}`,`L ${t-6} ${a}`,x(t,a+6*v,+!!m),`L ${t} ${e-6*v}`,x(t-6,e,+!!m),`L ${o+6} ${e}`,x(o,e+6*v,+!m),`L ${o} ${y-6*v}`,x(o+6,y,+!m),`L ${p} ${y}`].join(" ")}let _=b?"#EF4444":s;return(0,t.jsxs)("g",{style:{transition:"opacity 120ms ease"},children:[(0,t.jsx)("path",{d:c,fill:"none",stroke:_,strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:b?"4 3":void 0,opacity:b&&!f?.7:1}),(0,t.jsx)("circle",{cx:d,cy:a,r:"2.5",fill:_}),(0,t.jsx)("path",{d:`M ${p-4} ${y-3.6} L ${p} ${y} L ${p-4} ${y+3.6} Z`,fill:_})]},e)})}),G.rows.map(({milestone:e,top:r,taskRows:n})=>(0,t.jsxs)("div",{children:[(0,t.jsx)($,{milestone:e,top:r,rangeStart:K,totalDays:W,dayWidth:I,isExpanded:C.has(String(e._id)),onHover:t=>F(t?String(e._id):null),onDropTask:t=>P?.(t,String(e._id)),isLinked:(e.dependsOn||[]).length>0||(e.dependsOnTasks||[]).length>0,onToggleExpand:()=>{var t;return t=e._id,void B(e=>{let r=new Set(e),n=String(t);return r.has(n)?r.delete(n):r.add(n),r})},onClick:()=>i?.(e),onAddTask:()=>U(e._id),earliestStart:Q.get(String(e._id))||null,onShift:t=>et(e._id,t),dependsOnTitles:(e.dependsOn||[]).map(e=>V.find(t=>String(t._id)===String(e))?.title).filter(Boolean)}),n.map((r,n)=>r.add?(0,t.jsx)(E,{milestone:e,top:r.top,width:Math.min(640,260+J),teamMembers:m,onSubmit:t=>q(e,t),onClose:()=>L(null)},`add-${e._id}`):r.ghost?(0,t.jsx)("div",{className:"absolute left-0 w-full flex items-center",style:{top:r.top,height:40},children:(0,t.jsxs)("button",{type:"button",onClick:()=>U(e._id),className:"flex-shrink-0 h-full flex items-center gap-1.5 pl-11 pr-3 text-[11px] font-semibold hover:bg-gray-50/50 dark:hover:bg-zinc-900/30 text-left sticky left-0 z-[12] border-r",style:{width:260,color:"#F97316",background:"var(--surface-frosted)",backdropFilter:"blur(8px)",borderColor:"var(--border-subtle)"},children:[(0,t.jsx)(l.PlusIcon,{className:"w-3 h-3"}),0===(e.tasks||[]).length?"No tasks yet â add one":"Add task"]})},`ghost-${e._id}`):(0,t.jsx)(N,{task:r.task,top:r.top,rangeStart:K,totalDays:W,dayWidth:I,onUpdate:ee,onClick:()=>o?.(r.task),earliestStart:(()=>{let e=null;for(let t of r.task.blockedBy||[]){let r=X.get(String(t?._id||t))?.task;if(!r?.dueDate)continue;let n=w(r.dueDate);(!e||n>e)&&(e=n)}return e?_(e,1):null})()},r.task._id))]},e._id)),0===V.length&&(0,t.jsx)("div",{className:"text-center py-12 text-[12px]",style:{color:"var(--text-tertiary)"},children:"No milestones to plot"})]})]})})]})}],546481);var M=e.i(460759),D=e.i(370221),I=e.i(787906),T=e.i(174080);class C extends Error{constructor(e="CYCLE: dependency graph contains a cycle"){super(e),this.name="GraphCycleError",this.code="CYCLE"}}function B(e){if(null!=e.id)return String(e.id);if(null!=e.key)return String(e.key);if(null!=e._id)return String(e._id);throw Error("graph: node is missing an id/key/_id field")}function R(e){return(e.dependsOn||[]).map(e=>String(e))}function L(e){let t=e||[],r=new Map(t.map(e=>[B(e),e])),n=new Map,i=new Map;for(let e of t){let t=B(e);n.has(t)||n.set(t,0),i.has(t)||i.set(t,[])}for(let e of t){let t=B(e);for(let o of R(e))r.has(o)&&(n.set(t,(n.get(t)||0)+1),i.get(o).push(t))}let o=[];for(let[e,t]of n.entries())0===t&&o.push(e);o.sort((e,r)=>t.findIndex(t=>B(t)===e)-t.findIndex(e=>B(e)===r));let a=[],s=new Set;for(;o.length>0;){let e=o.shift();if(s.has(e))continue;s.add(e),a.push(r.get(e));let c=[];for(let t of i.get(e)||[])n.set(t,n.get(t)-1),0===n.get(t)&&c.push(t);c.sort((e,r)=>t.findIndex(t=>B(t)===e)-t.findIndex(e=>B(e)===r)),o.push(...c)}if(a.length!==t.length)throw new C;return a}var z=e.i(482395),F=e.i(750320);let U=["#F97316","#3B82F6","#10B981","#8B5CF6","#F59E0B","#EC4899","#EF4444","#6366F1","#14B8A6","#06B6D4"];e.s(["MILESTONE_COLORS",0,U,"default",0,function({campaignId:e=null,owner:i=null,milestones:o=[],onClose:a,onCreated:s}){let c=i?(0,F.ownerListPath)(i):e?`/api/campaigns/${e}/milestones`:null,[l,f]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[y,b]=(0,r.useState)(U[0]),[m,g]=(0,r.useState)([]),[v,x]=(0,r.useState)(""),[w,_]=(0,r.useState)(""),[S,j]=(0,r.useState)(!1);async function k(){if(l.trim()&&c){j(!0);try{let e={title:l.trim(),description:h.trim(),color:y,dependsOn:m};v&&(e.startDate=v),w&&(e.endDate=w);let t=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json().catch(()=>({}));if(!t.ok)return void d.default.error(r.error||"Failed to create milestone");let n={...r.milestone,tasks:r.milestone.tasks||[]};d.default.success(`Milestone "${n.title}" created`),s?.(n),a()}catch{d.default.error("Failed to create milestone")}finally{j(!1)}}}return(0,T.createPortal)((0,t.jsx)(n.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[110] flex items-center justify-center p-4 bg-black/30 backdrop-blur-sm",onClick:a,children:(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.96},transition:{duration:.25,ease:[.25,.46,.45,.94]},className:"relative w-full max-w-lg rounded-2xl overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 20px 60px var(--shadow-ambient-2xl)",border:"1px solid var(--border-subtle)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"h-[3px] w-full bg-gradient-to-r from-pink-500 via-orange-400 to-violet-500"}),(0,t.jsxs)("div",{className:"px-6 pt-5 pb-3 flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(249,115,22,0.15), rgba(236,72,153,0.15))",border:"1px solid rgba(249,115,22,0.2)"},children:(0,t.jsx)(z.FlagIcon,{className:"w-4 h-4 text-orange-500"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:"New milestone"}),(0,t.jsx)("h3",{className:"text-base font-black text-gray-900 dark:text-zinc-100 tracking-tight",children:"Create a milestone"})]})]}),(0,t.jsx)("button",{onClick:a,className:"w-7 h-7 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-zinc-900",children:(0,t.jsx)(u.XMarkIcon,{className:"w-4 h-4 text-gray-400 dark:text-zinc-500"})})]}),(0,t.jsxs)("div",{className:"px-6 pb-5 space-y-5 max-h-[calc(85vh-120px)] overflow-y-auto",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Title"}),(0,t.jsx)("input",{autoFocus:!0,value:l,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"===e.key&&l.trim()&&k()},placeholder:"e.g. Content Production",className:"w-full text-sm font-medium px-3.5 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:["Description",(0,t.jsx)("span",{className:"ml-1.5 text-gray-300 dark:text-zinc-700 normal-case tracking-normal font-normal",children:"optional"})]}),(0,t.jsx)("textarea",{value:h,onChange:e=>p(e.target.value),rows:2,placeholder:"What does this milestone cover?",className:"w-full text-sm px-3.5 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all resize-none",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 block",children:"Color"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:U.map(e=>(0,t.jsx)("button",{onClick:()=>b(e),className:"w-7 h-7 rounded-full flex-shrink-0 transition-transform hover:scale-110",style:{background:e,boxShadow:y===e?`0 0 0 2px var(--surface-panel), 0 0 0 4px ${e}`:"none"},"aria-label":e},e))})]}),o.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 block",children:["Depends on",(0,t.jsx)("span",{className:"ml-1.5 text-gray-300 dark:text-zinc-700 normal-case tracking-normal font-normal",children:"optional"})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 rounded-xl p-2",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"},children:o.map(e=>{let r=m.includes(e._id);return(0,t.jsx)("button",{onClick:()=>{var t;return t=e._id,void g(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"text-[11px] font-semibold px-2.5 py-1 rounded-full transition-all",style:{background:r?`${e.color||"#F97316"}20`:"var(--surface-panel)",color:r?e.color||"#F97316":"var(--text-tertiary)",border:`1px solid ${r?`${e.color||"#F97316"}45`:"var(--border-subtle)"}`},children:e.title},e._id)})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:["Start date",(0,t.jsx)("span",{className:"ml-1.5 text-gray-300 dark:text-zinc-700 normal-case tracking-normal font-normal",children:"optional"})]}
2),(0,t.jsx)("input",{type:"date",value:v,onChange:e=>x(e.target.value),className:"w-full text-sm px-3 py-2 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:["End date",(0,t.jsx)("span",{className:"ml-1.5 text-gray-300 dark:text-zinc-700 normal-case tracking-normal font-normal",children:"optional"})]}),(0,t.jsx)("input",{type:"date",value:w,onChange:e=>_(e.target.value),className:"w-full text-sm px-3 py-2 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}})]})]}),(0,t.jsx)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 -mt-2",children:"Dates only matter until you attach tasks â after that they're derived automatically."})]}),(0,t.jsxs)("div",{className:"px-6 py-3.5 flex items-center justify-end gap-2 border-t",style:{borderColor:"var(--border-subtle)",background:"var(--shadow-ambient-xs)"},children:[(0,t.jsx)("button",{onClick:a,className:"text-xs font-semibold px-3 py-2 rounded-xl text-gray-600 dark:text-zinc-400 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:"Cancel"}),(0,t.jsx)("button",{onClick:k,disabled:!l.trim()||S,className:"text-xs font-bold px-4 py-2 text-white rounded-xl disabled:opacity-40 transition-all duration-300 hover:shadow-md hover:-translate-y-0.5",style:{background:"linear-gradient(135deg, #F97316, #EC4899)",boxShadow:"0 4px 12px rgba(236,72,153,0.25)"},children:S?"Creatingâ¦":"Create milestone"})]})]})}),document.body)}],448459);var q=e.i(518763);let V=[{key:"not_started",label:"Not started",color:"#9CA3AF"},{key:"in_progress",label:"In progress",color:"#F59E0B"},{key:"stuck",label:"Stuck",color:"#EF4444"},{key:"completed",label:"Completed",color:"#10B981"}],K={task_due_changed:"Task due date changed",task_completed_late:"Task completed late",overdue_rollover:"Rolled over (overdue)",manual_shift:"Manually shifted",upstream_shift:"Shifted by upstream dependency"};function H(e){return e?new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):"â"}function W(e){return e?new Date(e).toISOString().slice(0,10):""}e.s(["default",0,function({milestone:e,siblingMilestones:i=[],campaignId:o,owner:a=null,onClose:s,applyMilestoneSync:c,refetch:p,onTaskClick:b,teamMembers:m=[],defaultBoardId:g=null}){let v,x,[w,_]=(0,r.useState)(e?.title||""),[S,j]=(0,r.useState)(e?.description||""),[k,O]=(0,r.useState)(null),[$,A]=(0,r.useState)(!1),[E,N]=(0,r.useState)(""),[P,C]=(0,r.useState)(""),[L,z]=(0,r.useState)(!1),[F,J]=(0,r.useState)([]),[G,Y]=(0,r.useState)([]),[X,Q]=(0,r.useState)(!1),[Z,ee]=(0,r.useState)(!1),[et,er]=(0,r.useState)(!1),{setFilterPanelOpen:en}=(0,q.useAI)();(0,r.useEffect)(()=>(en(!0),()=>en(!1)),[en]);let ei=(0,r.useMemo)(()=>i.map(e=>({id:String(e._id),dependsOn:(e.dependsOn||[]).map(String)})),[i]);if(!e)return null;let eo=new Set((e.dependsOn||[]).map(String)),ea=(e.taskCount||0)>0,es=e.baselineEndDate&&e.endDate?Math.max(0,(0,h.businessDaysBetween)(e.baselineEndDate,e.endDate)):0;async function ec(t,{silent:r}={}){O(Object.keys(t)[0]);try{let n=await fetch(`/api/milestones/${e._id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await n.json().catch(()=>({}));if(!n.ok)return d.default.error(i.error||"Failed to update milestone"),null;return c?.({milestones:[i.milestone]}),r||d.default.success("Saved"),i.milestone}catch{return d.default.error("Failed to update milestone"),null}finally{O(null)}}async function el(t){let r=(t?.title||"").trim();if(r)try{let n=t.dueDate||P||W(e.endDate||e.startDate),i={...t,title:r,milestone:e._id,...a?.type==="deal"?{parentDeal:t.parentDeal||a.id}:{linkedCampaign:t.linkedCampaign||o||a?.id||e.campaign},...g?{board:g}:{}};n&&(i.dueDate=n,i.startDate=t.startDate||n);let s=await fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),l=await s.json().catch(()=>({}));if(!s.ok)return void d.default.error(l.error||"Failed to create task");d.default.success("Task added"),N(""),C(""),A(!1),c?.(l.milestoneSync),p?.()}catch{d.default.error("Failed to create task")}}async function eu(){z(!0),Q(!0);try{let t=a?.type==="deal"?`parentDeal=${a.id}`:`campaign=${o||a?.id||e.campaign}`,r=await fetch(`/api/tasks?${t}&hasMilestone=false`),n=await r.json().catch(()=>({}));r.ok?J(n.tasks||[]):d.default.error(n.error||"Failed to load tasks")}catch{d.default.error("Failed to load tasks")}finally{Q(!1)}}async function ef(){if(0!==G.length)try{let t=await fetch(`/api/milestones/${e._id}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskIds:G})}),r=await t.json().catch(()=>({}));if(!t.ok)return void d.default.error(r.error||"Failed to attach tasks");d.default.success(`Attached ${G.length} task${1===G.length?"":"s"}`),Y([]),z(!1),c?.(r.milestoneSync),p?.()}catch{d.default.error("Failed to attach tasks")}}async function ed(t){try{let r=await fetch(`/api/milestones/${e._id}/tasks`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskIds:[t]})}),n=await r.json().catch(()=>({}));if(!r.ok)return void d.default.error(n.error||"Failed to detach task");d.default.success("Task detached"),c?.(n.milestoneSync),p?.()}catch{d.default.error("Failed to detach task")}}async function eh(t){er(!0);try{let r=await fetch(`/api/milestones/${e._id}?deleteTasks=${t?"true":"false"}`,{method:"DELETE"}),n=await r.json().catch(()=>({}));if(!r.ok)return void d.default.error(n.error||"Failed to delete milestone");d.default.success("Milestone deleted"),s?.(),p?.()}catch{d.default.error("Failed to delete milestone")}finally{er(!1)}}return(0,T.createPortal)((0,t.jsxs)(n.motion.div,{className:"fixed inset-0 z-[100]",initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm",onClick:s}),(0,t.jsxs)(n.motion.div,{initial:{x:"100%",scale:.98,opacity:0},animate:{x:0,scale:1,opacity:1},exit:{x:"100%",scale:.98,opacity:0},transition:{duration:.5,ease:[.25,.46,.45,.94]},className:"absolute right-0 top-0 h-full w-full sm:max-w-[480px] overflow-hidden flex flex-col",style:{background:"var(--surface-panel)",backdropFilter:"blur(40px)",boxShadow:"-20px 0 60px var(--shadow-ambient-md), -4px 0 20px var(--shadow-ambient-sm)"},children:[(0,t.jsx)("div",{className:"h-[3px] w-full bg-gradient-to-r from-pink-500/60 via-orange-400/60 to-violet-500/60 z-20"}),(0,t.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-[1.5px] animate-gradient-shift z-20 pointer-events-none",style:{background:"linear-gradient(180deg, #ec4899, #f97316, #8b5cf6)",opacity:.65}}),(0,t.jsx)("div",{className:"absolute -top-16 -right-16 w-64 h-64 rounded-full blur-3xl pointer-events-none animate-orb-drift-a",style:{background:"radial-gradient(circle, rgba(249,115,22,0.2), transparent 70%)"}}),(0,t.jsx)("div",{className:"absolute -bottom-20 -left-20 w-64 h-64 rounded-full blur-3xl pointer-events-none animate-orb-drift-b",style:{background:"radial-gradient(circle, rgba(139,92,246,0.18), transparent 70%)"}}),(0,t.jsxs)("div",{className:"relative z-10 flex-shrink-0 px-5 py-4 border-b",style:{background:"var(--panel-85)",backdropFilter:"blur(20px)",borderColor:"var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-3",children:[(0,t.jsx)("input",{value:w,onChange:e=>_(e.target.value),onBlur:()=>{w.trim()&&w.trim()!==e.title?ec({title:w.trim()},{silent:!0}):_(e.title)},className:"flex-1 min-w-0 text-lg font-black tracking-tight text-gray-900 dark:text-zinc-100 bg-transparent focus:outline-none focus:ring-2 focus:ring-orange-300/40 rounded-lg px-1 -mx-1"}),(0,t.jsx)("button",{onClick:s,className:"w-8 h-8 flex-shrink-0 rounded-xl flex items-center justify-center",style:{background:"var(--surface-soft)"},children:(0,t.jsx)(u.XMarkIcon,{className:"w-4 h-4 text-gray-500 dark:text-zinc-400"})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[V.map(r=>{let n=e.status===r.key;return(0,t.jsx)("button",{onClick:()=>ec({status:r.key}),disabled:"status"===k,className:"text-[11px] font-semibold px-2.5 py-1 rounded-full transition-all",style:{background:n?`${r.color}18`:"var(--surface-soft)",color:n?r.color:"var(--text-tertiary)",border:`1px solid ${n?`${r.color}40`:"var(--border-subtle)"}`},children:r.label},r.key)}),es>0&&(0,t.jsxs)("span",{className:"text-[10px] font-black px-2 py-1 rounded-full",style:{background:"#EF444414",color:"#EF4444",border:"1px solid #EF444425"},children:["+",es,"d slip"]})]})]}),(0,t.jsxs)("div",{className:"relative z-10 flex-1 min-h-0 overflow-y-auto px-5 py-5 space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Description"}),(0,t.jsx)("textarea",{value:S,onChange:e=>j(e.target.value),onBlur:()=>{S!==(e.description||"")&&ec({description:S},{silent:!0})},rows:2,placeholder:"What does this milestone cover?",className:"w-full text-sm px-3 py-2 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/40 resize-none",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 block",children:"Color"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:U.map(r=>(0,t.jsx)("button",{onClick:()=>ec({color:r},{silent:!0}),className:"w-6 h-6 rounded-full flex-shrink-0 transition-transform hover:scale-110",style:{background:r,boxShadow:e.color===r?`0 0 0 2px var(--surface-panel), 0 0 0 4px ${r}`:"none"},"aria-label":r},r))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Dates"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500",children:"Start"}),(0,t.jsx)("input",{type:"date",defaultValue:W(e.startDate),disabled:ea,onBlur:e=>{e.target.value&&ec({startDate:e.target.value},{silent:!0})},className:"w-full text-sm px-2.5 py-1.5 rounded-lg focus:outline-none disabled:opacity-50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500",children:"End"}),(0,t.jsx)("input",{type:"date",defaultValue:W(e.endDate),disabled:ea,onBlur:e=>{e.target.value&&ec({endDate:e.target.value},{silent:!0})},className:"w-full text-sm px-2.5 py-1.5 rounded-lg focus:outline-none disabled:opacity-50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}})]})]}),ea?(0,t.jsxs)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mt-1.5",children:["Dates are derived from the ",e.taskCount," attached task",1===e.taskCount?"":"s"," â detach them to edit manually."]}):(0,t.jsx)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mt-1.5",children:"Manual dates â will switch to task-derived once a task is attached."}),e.baselineStartDate&&(0,t.jsxs)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mt-1",children:["Baseline: ",H(e.baselineStartDate)," â ",H(e.baselineEndDate)]})]}),i.filter(t=>String(t._id)!==String(e._id)).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 block",children:"Depends on"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.filter(t=>String(t._id)!==String(e._id)).map(r=>{let n=eo.has(String(r._id));return(0,t.jsxs)("button",{onClick:()=>(function(t){let r,n=String(t);if(eo.has(n))r=[...eo].filter(e=>e!==n);else{if(function(e,t,r){let n=String(e),i=String(t);if(n===i)return!0;let o=new Map((r||[]).map(e=>[B(e),e])),a=new Set,s=[n];for(;s.length>0;){let e=s.shift();if(a.has(e))continue;if(a.add(e),e===i)return!0;
2let t=o.get(e);t&&s.push(...R(t))}return!1}(n,String(e._id),ei))return void d.default.error("That dependency would create a cycle");r=[...eo,n]}ec({dependsOn:r},{silent:!0})})(r._id),className:"text-[11px] font-semibold px-2.5 py-1 rounded-full transition-all flex items-center gap-1",style:{background:n?`${r.color||"#F97316"}20`:"var(--surface-soft)",color:n?r.color||"#F97316":"var(--text-tertiary)",border:`1px solid ${n?`${r.color||"#F97316"}45`:"var(--border-subtle)"}`},children:[n&&(0,t.jsx)(I.CheckIcon,{className:"w-3 h-3"}),r.title]},r._id)})})]}),(v=i.filter(t=>String(t._id)!==String(e._id)).flatMap(e=>(e.tasks||[]).map(t=>({task:t,owner:e}))),x=new Set((e.dependsOnTasks||[]).map(String)),0===v.length&&0===x.size?null:(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1 block",children:"Waits on tasks"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mb-2",children:"Tether this milestone to specific tasks elsewhere â it can't start until they're due."}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5 max-h-40 overflow-y-auto pr-1",children:v.map(({task:e,owner:r})=>{let n=x.has(String(e._id)),i=r.color||"#F97316";return(0,t.jsxs)("button",{onClick:()=>{let t;return t=String(e._id),void ec({dependsOnTasks:x.has(t)?[...x].filter(e=>e!==t):[...x,t]},{silent:!0})},className:"text-[11px] font-semibold px-2.5 py-1 rounded-full transition-all flex items-center gap-1 max-w-full",title:`${e.title} \xb7 ${r.title}`,style:{background:n?`${i}20`:"var(--surface-soft)",color:n?i:"var(--text-tertiary)",border:`1px solid ${n?`${i}45`:"var(--border-subtle)"}`},children:[n&&(0,t.jsx)(I.CheckIcon,{className:"w-3 h-3 flex-shrink-0"}),(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:i}}),(0,t.jsx)("span",{className:"truncate",children:e.title})]},e._id)})})]})),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em]",children:["Tasks (",e.doneTaskCount||0,"/",e.taskCount||0,")"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("button",{onClick:eu,className:"text-[10px] font-semibold px-2 py-1 rounded-full flex items-center gap-1 hover:bg-gray-100 dark:hover:bg-zinc-900",style:{color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsx)(f.LinkIcon,{className:"w-3 h-3"})," Attach"]}),(0,t.jsxs)("button",{onClick:()=>A(e=>!e),className:"text-[10px] font-semibold px-2 py-1 rounded-full flex items-center gap-1",style:{background:"rgba(249,115,22,0.1)",color:"#F97316",border:"1px solid rgba(249,115,22,0.2)"},children:[(0,t.jsx)(l.PlusIcon,{className:"w-3 h-3"})," Add task"]})]})]}),$&&(0,t.jsxs)("div",{className:"mb-2 rounded-xl overflow-visible [&>div]:border-b-0 [&>div]:rounded-xl",style:{border:"1px solid var(--border-default)"},children:[(0,t.jsx)(y.default,{teamMembers:m,groupColor:e.color||"#F97316",portalPopovers:!0,clearOnSubmit:!0,placeholder:"Task title â @ to assign, type a date",onSubmit:el,onCancel:()=>A(!1)}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pb-2 text-[10px] text-gray-400 dark:text-zinc-500",children:[(0,t.jsx)("span",{children:"Due"}),(0,t.jsx)("input",{type:"date",value:P,onChange:e=>C(e.target.value),className:"text-[11px] px-1.5 py-0.5 rounded-md focus:outline-none text-gray-700 dark:text-zinc-300",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"},title:"Due date (defaults to the milestone end)"}),(0,t.jsx)("span",{children:"· defaults to the milestone end if blank"})]})]}),L&&(0,t.jsx)("div",{className:"mb-2 rounded-xl p-2 max-h-48 overflow-y-auto",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"},children:X?(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 text-center py-2",children:"Loadingâ¦"}):0===F.length?(0,t.jsxs)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 text-center py-2",children:["No unassigned tasks on this ",a?.type||"campaign"]}):(0,t.jsxs)(t.Fragment,{children:[F.map(e=>{let r=G.includes(e._id);return(0,t.jsxs)("button",{onClick:()=>Y(t=>r?t.filter(t=>t!==e._id):[...t,e._id]),className:"w-full text-left flex items-center gap-2 px-2 py-1.5 rounded-lg hover:bg-white/60 dark:hover:bg-zinc-900/60",children:[(0,t.jsx)("span",{className:"w-4 h-4 rounded flex-shrink-0 flex items-center justify-center",style:r?{background:"#10B981"}:{border:"1.5px dashed var(--border-default)"},children:r&&(0,t.jsx)(I.CheckIcon,{className:"w-3 h-3 text-white"})}),(0,t.jsx)("span",{className:"text-[12px] text-gray-700 dark:text-zinc-300 truncate",children:e.title})]},e._id)}),(0,t.jsx)("div",{className:"flex justify-end pt-1",children:(0,t.jsxs)("button",{onClick:ef,disabled:0===G.length,className:"text-[11px] font-bold px-2.5 py-1.5 rounded-lg text-white disabled:opacity-40",style:{background:"linear-gradient(135deg, #F97316, #EC4899)"},children:["Attach ",G.length||""]})})]})}),(0,t.jsx)("div",{className:"space-y-1",children:0===(e.tasks||[]).length?(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 py-2",children:"No tasks attached yet."}):(e.tasks||[]).map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-2 rounded-lg group",style:{background:"var(--surface-soft)"},children:[(0,t.jsxs)("button",{onClick:()=>b?.(e),className:"flex-1 min-w-0 text-left",children:[(0,t.jsx)("div",{className:"text-[12px] font-semibold text-gray-800 dark:text-zinc-200 truncate",children:e.title}),(0,t.jsxs)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500",children:[e.status||"To Do",e.dueDate?` \xb7 due ${H(e.dueDate)}`:""]})]}),(0,t.jsx)("button",{onClick:()=>ed(e._id),className:"w-6 h-6 flex-shrink-0 rounded-md flex items-center justify-center opacity-100 md:opacity-0 md:group-hover:opacity-100 hover:bg-red-50 dark:hover:bg-red-950/30 transition-opacity",title:"Detach",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-400 dark:text-zinc-500"})})]},e._id))})]}),(e.shiftLog||[]).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(D.ClockIcon,{className:"w-3 h-3"})," Shift history"]}),(0,t.jsx)("div",{className:"space-y-1.5",children:[...e.shiftLog||[]].reverse().map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11px] px-2.5 py-1.5 rounded-lg",style:{background:"var(--surface-soft)"},children:[(0,t.jsx)("span",{className:"text-gray-600 dark:text-zinc-400",children:K[e.reason]||e.reason}),(0,t.jsxs)("span",{className:"text-gray-400 dark:text-zinc-500 flex-shrink-0 ml-2",children:["+",e.deltaDays,"d · ",H(e.at)]})]},e._id))})]}),(0,t.jsx)("div",{className:"pt-2 border-t",style:{borderColor:"var(--border-subtle)"},children:Z?(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("p",{className:"text-[11px] text-gray-500 dark:text-zinc-400",children:["This milestone has ",e.taskCount||0," attached task",1===e.taskCount?"":"s",". Keep them (moved to Unassigned) or delete them too?"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)("button",{disabled:et,onClick:()=>eh(!1),className:"text-[11px] font-semibold px-3 py-1.5 rounded-xl disabled:opacity-40",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",color:"var(--text-secondary)"},children:"Delete, keep tasks"}),(0,t.jsx)("button",{disabled:et,onClick:()=>eh(!0),className:"text-[11px] font-bold px-3 py-1.5 rounded-xl text-white disabled:opacity-40",style:{background:"#EF4444"},children:"Delete milestone + tasks"}),(0,t.jsx)("button",{onClick:()=>ee(!1),className:"text-[11px] font-semibold px-3 py-1.5 rounded-xl text-gray-500 dark:text-zinc-400",children:"Cancel"})]})]}):(0,t.jsxs)("button",{onClick:()=>ee(!0),className:"text-[11px] font-semibold px-3 py-2 rounded-xl flex items-center gap-1.5 text-red-500 hover:bg-red-50 dark:hover:bg-red-950/30 transition-colors",children:[(0,t.jsx)(M.Tras
2hIcon,{className:"w-3.5 h-3.5"})," Delete milestone"]})})]})]})]}),document.body)}],343609);var J=e.i(758253),G=e.i(263150);e.s(["default",0,function({campaignId:e=null,owner:i=null,campaign:o,onClose:a,onDeployed:s}){let c=i?.type==="deal"?{dealId:i.id}:e||i?.id?{campaignId:e||i.id}:null,[l,f]=(0,r.useState)([]),[y,b]=(0,r.useState)(!0),[m,g]=(0,r.useState)(null),[v,x]=(0,r.useState)(o?.startDate?new Date(o.startDate).toISOString().slice(0,10):new Date().toISOString().slice(0,10)),[w,_]=(0,r.useState)("append"),[S,j]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/milestone-templates"),t=await e.json().catch(()=>({}));e.ok?(f(t.templates||[]),(t.templates||[]).length>0&&g(t.templates[0]._id)):d.default.error(t.error||"Failed to load templates")}catch{d.default.error("Failed to load templates")}finally{b(!1)}})()},[]);let k=l.find(e=>e._id===m)||null,O=(0,r.useMemo)(()=>{if(!k||!v)return null;try{return{schedule:function(e,t){let r=e?.milestones||[],n=(0,h.toBusinessDay)(t??new Date),i=L(r.map(e=>({key:e.key,dependsOn:e.dependsOn||[]}))),o=new Map(r.map(e=>[String(e.key),e])),a=new Map;for(let e of i){let t,r=String(e.key),i=o.get(r);if(!i)continue;let s=Number.isFinite(i.startOffsetDays)?i.startOffsetDays:0,c=(i.dependsOn||[]).map(e=>String(e));if(0===c.length)t=(0,p.addBusinessDays)(n,s);else{let e=null;for(let t of c){let r=a.get(t);r&&(null===e||r.end.getTime()>e.getTime())&&(e=r.end)}let r=e??n;t=(0,p.addBusinessDays)(r,1+s)}let l=(i.tasks||[]).map(e=>{let r=Number.isFinite(e.startOffsetDays)?e.startOffsetDays:0,n=Number.isFinite(e.durationDays)&&e.durationDays>=1?e.durationDays:1,i=(0,p.addBusinessDays)(t,r),o=(0,p.addBusinessDays)(i,n-1);return{...e,start:i,due:o}}),u=l.length>0?l.reduce((e,t)=>t.due.getTime()>e.getTime()?t.due:e,l[0].due):t;a.set(r,{key:r,title:i.title,start:t,end:u,tasks:l})}return{anchor:n,milestones:r.map(e=>a.get(String(e.key))).filter(Boolean)}}(k,new Date(v)),error:null}}catch(e){return{schedule:null,error:e}}},[k,v]),$=O?.error?.code==="CYCLE";async function A(){if(k&&c&&!$){j(!0);try{let e=await fetch(`/api/milestone-templates/${k._id}/deploy`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...c,anchorDate:v,mode:w})}),t=await e.json().catch(()=>({}));if(!e.ok)return void(t.errors?d.default.error(t.error||"Template failed validation"):d.default.error(t.error||"Failed to deploy template"));d.default.success(`Deployed "${k.name}"`),s?.(t),a()}catch{d.default.error("Failed to deploy template")}finally{j(!1)}}}return(0,T.createPortal)((0,t.jsx)(n.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[110] flex items-center justify-center p-4 bg-black/30 backdrop-blur-sm",onClick:a,children:(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.96},transition:{duration:.25,ease:[.25,.46,.45,.94]},className:"relative w-full max-w-xl rounded-2xl overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 20px 60px var(--shadow-ambient-2xl)",border:"1px solid var(--border-subtle)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"h-[3px] w-full bg-gradient-to-r from-pink-500 via-orange-400 to-violet-500"}),(0,t.jsxs)("div",{className:"px-6 pt-5 pb-3 flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(139,92,246,0.15), rgba(236,72,153,0.15))",border:"1px solid rgba(139,92,246,0.2)"},children:(0,t.jsx)(J.RocketLaunchIcon,{className:"w-4 h-4 text-violet-500"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:"Templates"}),(0,t.jsx)("h3",{className:"text-base font-black text-gray-900 dark:text-zinc-100 tracking-tight",children:"Deploy a template"})]})]}),(0,t.jsx)("button",{onClick:a,className:"w-7 h-7 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-zinc-900",children:(0,t.jsx)(u.XMarkIcon,{className:"w-4 h-4 text-gray-400 dark:text-zinc-500"})})]}),(0,t.jsxs)("div",{className:"px-6 pb-5 space-y-5 max-h-[calc(85vh-120px)] overflow-y-auto",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Template"}),y?(0,t.jsx)("div",{className:"h-10 rounded-xl animate-pulse",style:{background:"var(--surface-soft)"}}):0===l.length?(0,t.jsx)("p",{className:"text-[12px] text-gray-500 dark:text-zinc-400 py-2",children:"No templates yet â save a campaign's milestones as a template first."}):(0,t.jsx)("select",{value:m||"",onChange:e=>g(e.target.value),className:"w-full text-sm px-3.5 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-violet-300/50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",color:"var(--text-primary)"},children:l.map(e=>(0,t.jsxs)("option",{value:e._id,children:[e.isDefault?"â
":"",e.name," (",e.milestones?.length||0," milestones",e.usageCount?`, used ${e.usageCount}\xd7`:"",e.isDefault?", default":"",")"]},e._id))})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Anchor date"}),(0,t.jsx)("input",{type:"date",value:v,onChange:e=>x(e.target.value),className:"w-full text-sm px-3 py-2 rounded-xl focus:outline-none focus:ring-2 focus:ring-violet-300/50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Mode"}),(0,t.jsx)("div",{className:"flex rounded-xl overflow-hidden",style:{border:"1px solid var(--border-default)"},children:["append","replace"].map(e=>(0,t.jsx)("button",{onClick:()=>_(e),className:"flex-1 text-[12px] font-semibold py-2 capitalize transition-colors",style:{background:w===e?"replace"===e?"#EF444414":"rgba(249,115,22,0.1)":"var(--surface-soft)",color:w===e?"replace"===e?"#EF4444":"#F97316":"var(--text-tertiary)"},children:e},e))})]})]}),"replace"===w&&(0,t.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-xl",style:{background:"#EF444410",border:"1px solid #EF444425"},children:[(0,t.jsx)(G.ExclamationTriangleIcon,{className:"w-4 h-4 text-red-500 flex-shrink-0 mt-0.5"}),(0,t.jsx)("p",{className:"text-[11px] text-red-600 dark:text-red-400",children:"Existing milestones will be removed; their attached tasks move to Unassigned tasks."})]}),$&&(0,t.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded-xl",style:{background:"#EF444410",border:"1px solid #EF444425"},children:[(0,t.jsx)(G.ExclamationTriangleIcon,{className:"w-4 h-4 text-red-500 flex-shrink-0 mt-0.5"}),(0,t.jsx)("p",{className:"text-[11px] text-red-600 dark:text-red-400",children:"This template's depen
2dency graph contains a cycle and can't be deployed. Fix it in Templates first."})]}),O?.schedule&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 block",children:"Preview"}),(0,t.jsx)("div",{className:"space-y-1.5 max-h-56 overflow-y-auto pr-1",children:O.schedule.milestones.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between text-[11.5px] px-2.5 py-1.5 rounded-lg",style:{background:"var(--surface-soft)"},children:[(0,t.jsx)("span",{className:"font-semibold text-gray-700 dark:text-zinc-300 truncate",children:e.title}),(0,t.jsxs)("span",{className:"text-gray-400 dark:text-zinc-500 flex-shrink-0 ml-2",children:[e.start.toLocaleDateString(void 0,{month:"short",day:"numeric"})," â"," ",e.end.toLocaleDateString(void 0,{month:"short",day:"numeric"}),e.tasks?.length?` \xb7 ${e.tasks.length} task${1===e.tasks.length?"":"s"}`:""]})]},e.key))})]})]}),(0,t.jsxs)("div",{className:"px-6 py-3.5 flex items-center justify-end gap-2 border-t",style:{borderColor:"var(--border-subtle)",background:"var(--shadow-ambient-xs)"},children:[(0,t.jsx)("button",{onClick:a,className:"text-xs font-semibold px-3 py-2 rounded-xl text-gray-600 dark:text-zinc-400 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:"Cancel"}),(0,t.jsx)("button",{onClick:A,disabled:!k||S||$,className:"text-xs font-bold px-4 py-2 text-white rounded-xl disabled:opacity-40 transition-all duration-300 hover:shadow-md hover:-translate-y-0.5",style:{background:"linear-gradient(135deg, #8B5CF6, #EC4899)",boxShadow:"0 4px 12px rgba(139,92,246,0.25)"},children:S?"Deployingâ¦":"Deploy"})]})]})}),document.body)}],386403);var Y=e.i(730049),X=e.i(578517),Q=e.i(307163);function Z(e){return String(e||"").toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"milestone"}function ee({templates:e,loading:r,showArchived:n,setShowArchived:i,newName:o,setNewName:a,creating:s,onCreate:c,onEdit:u,onArchive:f,onSetDefault:d}){return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{value:o,onChange:e=>a(e.target.value),onKeyDown:e=>"Enter"===e.key&&c(),placeholder:"New template nameâ¦",className:"flex-1 min-w-0 text-sm px-3.5 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}}),(0,t.jsxs)("button",{onClick:c,disabled:!o.trim()||s,className:"flex items-center gap-1.5 text-xs font-bold px-3.5 py-2.5 text-white rounded-xl disabled:opacity-40",style:{background:"linear-gradient(135deg, #F97316, #EC4899)"},children:[(0,t.jsx)(l.PlusIcon,{className:"w-3.5 h-3.5"})," Create"]})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:[e.length," template",1===e.length?"":"s"]}),(0,t.jsx)("button",{onClick:()=>i(e=>!e),className:"text-[11px] font-semibold px-2.5 py-1 rounded-full transition-colors",style:{background:n?"var(--surface-softer)":"var(--surface-soft)",color:n?"var(--text-secondary)":"var(--text-tertiary)",border:`1px solid ${n?"var(--border-default)":"var(--border-subtle)"}`},children:n?"Showing archived":"Show archived"})]}),r?(0,t.jsx)("div",{className:"space-y-2",children:[0,1,2].map(e=>(0,t.jsx)("div",{className:"h-14 rounded-xl animate-pulse",style:{background:"var(--surface-soft)"}},e))}):0===e.length?(0,t.jsx)("p",{className:"text-sm text-gray-400 dark:text-zinc-500 text-center py-8",children:n?"No archived templates.":"No templates yet â create one above."}):(0,t.jsx)("div",{className:"space-y-1.5",children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-xl",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-[13px] font-bold text-gray-800 dark:text-zinc-100 truncate",children:e.name}),e.isDefault&&(0,t.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",color:"#F97316"},title:"Auto-deployed when a deal converts to a campaign",children:"Default"})]}),(0,t.jsxs)("div",{className:"text-[10.5px] text-gray-400 dark:text-zinc-500",children:[e.milestones?.length||0," milestones · used ",e.usageCount||0,"Ã"]})]}),!e.archived&&(0,t.jsx)("button",{onClick:()=>d(e._id,!e.isDefault),className:"text-[11px] font-semibold px-2.5 py-1.5 rounded-lg hover:bg-white/60 dark:hover:bg-zinc-900/60",style:{color:e.isDefault?"#F97316":"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},title:e.isDefault?"Stop auto-deploying this template on deal conversion":"Auto-deploy this template when a deal converts to a campaign",children:e.isDefault?"Unset default":"Set default"}),(0,t.jsx)("button",{onClick:()=>u(e._id),className:"text-[11px] font-semibold px-2.5 py-1.5 rounded-lg hover:bg-white/60 dark:hover:bg-zinc-900/60",style:{color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:"Edit"}),!e.archived&&(0,t.jsx)("button",{onClick:()=>f(e._id),className:"w-8 h-8 flex-shrink-0 rounded-lg flex items-center justify-center hover:bg-red-50 dark:hover:bg-red-950/30",title:"Archive",children:(0,t.jsx)(X.ArchiveBoxIcon,{className:"w-4 h-4 text-gray-400 dark:text-zinc-500"})})]},e._id))})]})}function et({template:e,onSaved:n}){let[i,o]=(0,r.useState)(e?.name||""),[a,s]=(0,r.useState)(e?.description||""),[c,f]=(0,r.useState)(()=>(e?.milestones||[]).map(e=>({...e}))),[h,p]=(0,r.useState)(!1),[y,b]=(0,r.useState)([]),m=(0,r.useMemo)(()=>(function(e){let t=[],r=e?.milestones||[],n=new Set,i=new Set;for(let e of r){if(e?.key==null){t.push({code:"MISSING_KEY",message:"A milestone is missing a `key`."});continue}let r=String(e.key);n.has(r)&&i.add(r),n.add(r)}for(let e of i)t.push({code:"DUPLICATE_KEY",message:`Duplicate milestone key "${e}".`,milestoneKey:e});let o=new Set(r.filter(e=>e?.key!=null).map(e=>String(e.key)));for(let e of r){if(e?.key==null)continue;let r=String(e.key);for(let n of e.dependsOn||[]){let e=String(n);o.has(e)||t.push({code:"MISSING_DEPENDENCY",message:`Milestone "${r}" depends on unknown key "${e}".`,milestoneKey:r})}}try{L(r.filter(e=>e?.key!=null).map(e=>({key:e.key,dependsOn:e.dependsOn||[]})))}catch(e){if(e instanceof C||e?.code==="CYCLE")t.push({code:"CYCLE",message:"Milestone dependencies contain a cycle."});else throw e}for(let e of r){let r=e?.key!=null?String(e.key):void 0;for(let n of e?.tasks||[]){let e=n?.durationDays;("number"!=typeof e||!Number.isFinite(e)||e<1)&&t.push({code:"INVALID_DURATION",message:`Task "${n?.title??"(untitled)"}" on milestone "${r??"(unknown)"}" must have durationDays >= 1.`,milestoneKey:r})}}return{valid:0===t.length,errors:t}})({milestones:c}),[c]),g=(0,r.useMemo)(()=>new Set(c.map(e=>e.key)),[c]);function v(e,t){f(r=>r.map((r,n)=>n===e?{...r,...t}:r))}function x(e,t,r){f(n=>n.map((n,i)=>i===e?{...n,tasks:n.tasks.map((e,n)=>n===t?{...e,...r}:e)}:n))}async function w(){if(!m.valid)return void d.default.error("Fix validation errors before saving");p(!0),b([]);try{let t=await fetch(`/api/milestone-templates/${e._id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,description:a,milestones:c})}),r=await t.json().catch(()=>({}));if(!t.ok){r.errors&&b(r.errors),d.default.error(r.error||"Failed to save template");return}d.default.success("Template saved"),n?.(r.template)}catch{d.default.error("Failed to save template")}finally{p(!1)}}if(!e)return null;let _=[...m.errors,...y];return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:"Name"}),(0,t.jsx)("input",{value:i,onChange:e=>o(e.target.value),className:"w-full text-sm px-3 py-2 rounded-xl focus:outline-none",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 block",children:["Description ",(0,t.jsx)("span",{className:"normal-case tracking-normal font-normal text-gray-300 dark:text-zinc-700",children:"optional"})]}),(0,t.jsx)("input",{value:a,onChange:e=>s(e.target.value),className:"w-full text-sm px-3 py-2 rounded-xl focus:outline-none",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})]})]}),_.length>0&&(0,t.jsx)("div",{className:"space-y-1 px-3 py-2 rounded-xl",style:{background:"#EF444410",border:"1px solid #EF444425"},children:_.map((e,r)=>(0,t.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] text-red-600 dark:text-red-400",children:[(0,t.jsx)(G.ExclamationTriangleIcon,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5"}),e.message]},r))}),(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em]",children:["Milestones (",c.length,")"]}),(0,t.jsxs)("button",{onClick:function(){f(e=>[...e,function(e){let t="milestone",r=2;for(;e.has(t);)t=`milestone-${r}`,r+=1;return{key:t,title:"New milestone",description:"",color:U[0],position:0,dependsOn:[],startOffsetDays:0,tasks:[]}}(new Set(e.map(e=>e.key)))])},className:"text-[11px] font-semibold px-2.5 py-1 rounded-full flex items-center gap-1",style:{background:"rgba(249,115,22,0.1)",color:"#F97316",border:"1px solid rgba(249,115,22,0.2)"},children:[(0,t.jsx)(l.PlusIcon,{className:"w-3 h-3"})," Add milestone"]})]}),(0,t.jsx)("div",{className:"space-y-3",children:c.map((e,r)=>(0,t.jsxs)("div",{className:"rounded-xl p-3",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex items-start gap-2 mb-2",children:[(0,t.jsx)("span",{className:"w-6 h-6 rounded-full flex-shrink-0 mt-0.5",style:{background:e.color||"#F97316"}}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 grid grid-cols-1 sm:grid-cols-2 gap-2",children:[(0,t.jsx)("input",{value:e.title,onChange:e=>v(r,{title:e.target.value}),onBlur:()=>
2{if(!e.key||"milestone"===e.key){let t=Z(e.title),n=2;for(;[...g].filter(e=>e===t).length>1||g.has(t)&&t!==e.key;)t=`${Z(e.title)}-${n}`,n+=1;v(r,{key:t})}},placeholder:"Milestone title",className:"text-[13px] font-semibold px-2.5 py-1.5 rounded-lg focus:outline-none",style:{background:"var(--surface-panel)",border:"1px solid var(--border-default)"}}),(0,t.jsx)("input",{value:e.key,onChange:e=>v(r,{key:Z(e.target.value)}),placeholder:"key",className:"text-[12px] font-mono px-2.5 py-1.5 rounded-lg focus:outline-none",style:{background:"var(--surface-panel)",border:"1px solid var(--border-default)"}})]}),(0,t.jsx)("button",{onClick:()=>{let e;return e=c[r]?.key,void f(t=>t.filter((e,t)=>t!==r).map(t=>({...t,dependsOn:(t.dependsOn||[]).filter(t=>t!==e)})))},className:"w-7 h-7 flex-shrink-0 rounded-lg flex items-center justify-center hover:bg-red-50 dark:hover:bg-red-950/30",children:(0,t.jsx)(M.TrashIcon,{className:"w-3.5 h-3.5 text-gray-400 dark:text-zinc-500"})})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2 pl-8",children:[(0,t.jsx)("div",{className:"flex gap-1",children:U.slice(0,6).map(n=>(0,t.jsx)("button",{onClick:()=>v(r,{color:n}),className:"w-4 h-4 rounded-full",style:{background:n,boxShadow:e.color===n?`0 0 0 2px var(--surface-soft), 0 0 0 3px ${n}`:"none"}},n))}),(0,t.jsxs)("label",{className:"text-[10px] text-gray-400 dark:text-zinc-500 flex items-center gap-1",children:["Start offset (business days)",(0,t.jsx)("input",{type:"number",value:e.startOffsetDays??0,onChange:e=>v(r,{startOffsetDays:Number(e.target.value)||0}),className:"w-14 text-[11px] px-1.5 py-0.5 rounded-md focus:outline-none",style:{background:"var(--surface-panel)",border:"1px solid var(--border-default)"}})]})]}),c.length>1&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mb-2 pl-8",children:c.filter((e,t)=>t!==r).map(n=>{let i=(e.dependsOn||[]).includes(n.key);return(0,t.jsxs)("button",{onClick:()=>{var e;return e=n.key,void f(t=>t.map((t,n)=>{if(n!==r)return t;let i=(t.dependsOn||[]).includes(e);return{...t,dependsOn:i?t.dependsOn.filter(t=>t!==e):[...t.dependsOn||[],e]}}))},className:"text-[10px] font-semibold px-2 py-0.5 rounded-full",style:{background:i?`${n.color||"#F97316"}20`:"var(--surface-panel)",color:i?n.color||"#F97316":"var(--text-tertiary)",border:`1px solid ${i?`${n.color||"#F97316"}45`:"var(--border-subtle)"}`},children:["after ",n.title||n.key]},n.key)})}),(0,t.jsxs)("div",{className:"pl-8",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsxs)("span",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-gray-400 dark:text-zinc-500",children:["Tasks (",(e.tasks||[]).length,")"]}),(0,t.jsxs)("button",{onClick:()=>{f(e=>e.map((e,t)=>t===r?{...e,tasks:[...e.tasks||[],{title:"New task",startOffsetDays:0,durationDays:1,priority:"medium",tags:[],position:(e.tasks||[]).length}]}:e))},className:"text-[10px] font-semibold text-orange-500 flex items-center gap-0.5",children:[(0,t.jsx)(l.PlusIcon,{className:"w-3 h-3"})," Task"]})]}),(0,t.jsx)("div",{className:"space-y-1",children:(e.tasks||[]).map((e,n)=>(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("input",{value:e.title,onChange:e=>x(r,n,{title:e.target.value}),className:"flex-1 min-w-0 text-[11.5px] px-2 py-1 rounded-md focus:outline-none",style:{background:"var(--surface-panel)",border:"1px solid var(--border-default)"}}),(0,t.jsx)("input",{type:"number",title:"Offset (days)",value:e.startOffsetDays??0,onChange:e=>x(r,n,{startOffsetDays:Number(e.target.value)||0}),className:"w-12 text-[11px] px-1.5 py-1 rounded-md focus:outline-none",style:{background:"var(--surface-panel)",border:"1px solid var(--border-default)"}}),(0,t.jsx)("input",{type:"number",min:1,title:"Duration (days)",value:e.durationDays??1,onChange:e=>x(r,n,{durationDays:Number(e.target.value)||1}),className:"w-12 text-[11px] px-1.5 py-1 rounded-md focus:outline-none",style:{background:"var(--surface-panel)",border:"1px solid var(--border-default)"}}),(0,t.jsx)("button",{onClick:()=>{f(e=>e.map((e,t)=>t===r?{...e,tasks:e.tasks.filter((e,t)=>
2t!==n)}:e))},className:"w-6 h-6 flex-shrink-0 rounded-md flex items-center justify-center hover:bg-red-50 dark:hover:bg-red-950/30",children:(0,t.jsx)(u.XMarkIcon,{className:"w-3.5 h-3.5 text-gray-400 dark:text-zinc-500"})})]},n))})]})]},r))}),(0,t.jsx)("div",{className:"flex justify-end pt-2",children:(0,t.jsx)("button",{onClick:w,disabled:h||!m.valid,className:"text-xs font-bold px-4 py-2 text-white rounded-xl disabled:opacity-40 transition-all duration-300 hover:shadow-md hover:-translate-y-0.5",style:{background:"linear-gradient(135deg, #F97316, #EC4899)",boxShadow:"0 4px 12px rgba(236,72,153,0.25)"},children:h?"Savingâ¦":"Save template"})})]})}e.s(["default",0,function({onClose:e}){let[i,o]=(0,r.useState)([]),[a,s]=(0,r.useState)(!0),[c,l]=(0,r.useState)(!1),[f,h]=(0,r.useState)("list"),[p,y]=(0,r.useState)(null),[b,m]=(0,r.useState)(""),[g,v]=(0,r.useState)(!1);async function x(e){s(!0);try{let t=await fetch(`/api/milestone-templates${e?"?archived=true":""}`),r=await t.json().catch(()=>({}));t.ok?o(r.templates||[]):d.default.error(r.error||"Failed to load templates")}catch{d.default.error("Failed to load templates")}finally{s(!1)}}async function w(){if(b.trim()){v(!0);try{let e=await fetch("/api/milestone-templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b.trim(),description:"",milestones:[]})}),t=await e.json().catch(()=>({}));if(!e.ok)return void d.default.error(t.error||"Failed to create template");d.default.success("Template created"),o(e=>[t.template,...e]),m(""),y(t.template._id),h("edit")}catch{d.default.error("Failed to create template")}finally{v(!1)}}}async function _(e){try{let t=await fetch(`/api/milestone-templates/${e}`,{method:"DELETE"}),r=await t.json().catch(()=>({}));if(!t.ok)return void d.default.error(r.error||"Failed to archive template");d.default.success("Template archived"),o(t=>c?t:t.filter(t=>t._id!==e))}catch{d.default.error("Failed to archive template")}}async function S(e,t){try{let r=await fetch(`/api/milestone-templates/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({isDefault:t})}),n=await r.json().catch(()=>({}));if(!r.ok)return void d.default.error(n.error||"Failed to update default");d.default.success(t?"Set as default â new campaigns from deals will use it":"Default cleared"),o(r=>r.map(r=>({...r,isDefault:r._id===e?t:!t&&r.isDefault})))}catch{d.default.error("Failed to update default")}}(0,r.useEffect)(()=>{x(c)},[c]);let j=i.find(e=>e._id===p)||null;return(0,T.createPortal)((0,t.jsx)(n.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[110] flex items-center justify-center p-4 bg-black/30 backdrop-blur-sm",onClick:e,children:(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.96},transition:{duration:.25,ease:[.25,.46,.45,.94]},className:"relative w-full max-w-2xl rounded-2xl overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 20px 60px var(--shadow-ambient-2xl)",border:"1px solid var(--border-subtle)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"h-[3px] w-full bg-gradient-to-r from-pink-500 via-orange-400 to-violet-500"}),(0,t.jsxs)("div",{className:"px-6 pt-5 pb-3 flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:["edit"===f&&(0,t.jsx)("button",{onClick:()=>{h("list"),y(null)},className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-gray-100 dark:hover:bg-zinc-900",children:(0,t.jsx)(Q.ChevronLeftIcon,{className:"w-4 h-4 text-gray-500 dark:text-zinc-400"})}),(0,t.jsx)("div",{className:"w-9 h-9 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.15))",border:"1px solid rgba(99,102,241,0.2)"},children:(0,t.jsx)(Y.Squares2X2Icon,{className:"w-4 h-4 text-indigo-500"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:"Milestone templates"}),(0,t.jsx)("h3",{className:"text-base font-black text-gray-900 dark:text-zinc-100 tracking-tight",children:"list"===f?"Templates":j?.name||"Edit template"})]})]}),(0,t.jsx)("button",{onClick:e,className:"w-7 h-7 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-zinc-900",children:(0,t.jsx)(u.XMarkIcon,{className:"w-4 h-4 text-gray-400 dark:text-zinc-500"})})]}),(0,t.jsx)("div",{className:"px-6 pb-5 max-h-[calc(85vh-120px)] overflow-y-auto",children:"list"===f?(0,t.jsx)(ee,{templates:i,loading:a,showArchived:c,setShowArchived:l,newName:b,setNewName:m,creating:g,onCreate:w,onEdit:e=>{y(e),h("edit")},onArchive:_,onSetDefault:S}):(0,t.jsx)(et,{template:j,onSaved:e=>{o(t=>t.map(t=>t._id===e._id?e:t))}})})]})}),document.body)}],270723)},343210,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(217255),i=e.i(174080),o=e.i(88653),a=e.i(846932),s=e.i(482395),c=e.i(913107),l=e.i(758253),u=e.i(730049),f=e.i(967969),d=e.i(171387),h=e.i(858690),p=e.i(705766),y=e.i(259706),b=e.i(546481),m=e.i(343609),g=e.i(448459),v=e.i(386403),x=e.i(270723),w=e.i(231822),_=e.i(63495);let S=[{label:"To Do",color:"#c4c4c4"},{label:"In Progress",color:"#fdab3d"},{label:"Review",color:"#e2445c"},{label:"Done",color:"#00c875"},{label:"Stuck",color:"#df2f4a"}];function j(e){return e?new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"}):"â"}function k({owner:e,ownerHint:i,embedded:O,onChange:A}){let E="campaign"===e.type,N=E?e.id:null,{campaign:P,ownerDoc:M,milestones:D,unassignedTasks:I,loading:T,error:C,refetch:B,applyMilestoneSync:R,applyShiftResult:L,patchTaskLocal:z,shiftMilestoneLocal:F}=(0,y.default)(e),{data:U}=(0,n.useSession)(),q=(0,r.useMemo)(()=>{let e=U?.user?._id?.toString?.()||U?.user?._id;if(!e)return null;try{return localStorage.getItem(`task-board:lastActive:${e}`)||null}catch{return null}},[U?.user?._id]),[V,K]=(0,r.useState)(null),[H,W]=(0,r.useState)(null),[J,G]=(0,r.useState)([]),[Y,X]=(0,r.useState)(null),[Q,Z]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(!1),[er,en]=(0,r.useState)(!1),[ei,eo]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(!1),[ec,el]=(0,r.useState)(!1),[eu,ef]=(0,r.useState)(""),[ed,eh]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/agency-team");if(e.ok){let t=await e.json();G(t.users||t.team||[])}}catch{}})()},[]),(0,r.useEffect)(()=>{if(!N)return;let e=!1;return(async()=>{try{let t=await fetch(`/api/campaigns/${N}/source-deal`);if(t.ok){let r=await t.json();e||X(r.sourceDeal||null)}}catch{}})(),()=>{e=!0}},[N]);let ep=(0,r.useMemo)(()=>D.find(e=>String(e._id)===String(V))||null,[D,V]),ey=D.filter(e=>"completed"===e.status).length,eb=(0,r.useMemo)(()=>D.filter(e=>"completed"!==e.status&&e.endDate).sort((e,t)=>
2new Date(e.endDate)-new Date(t.endDate))[0]||null,[D]);function em(){A?.()}async function eg(e,t){if(t)try{let r=await fetch(`/api/milestones/${t}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskIds:[e]})}),n=await r.json().catch(()=>({}));if(!r.ok)return void p.default.error(n.error||"Failed to add task to milestone");p.default.success("Task added to milestone"),R?.(n.milestoneSync),await B(),em()}catch{p.default.error("Failed to add task to milestone")}}async function ev(){if(eu.trim()){eh(!0);try{let t=await fetch("/api/milestone-templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...E?{fromCampaignId:e.id}:{fromDealId:e.id},name:eu.trim()})}),r=await t.json().catch(()=>({}));if(!t.ok)return void p.default.error(r.error||"Failed to save template");p.default.success(`Saved as "${eu.trim()}"`),el(!1),eo(!1),ef("")}catch{p.default.error("Failed to save template")}finally{eh(!1)}}}return(0,t.jsxs)("div",{className:O?"space-y-5":"p-4 sm:p-6 md:p-8 max-w-7xl mx-auto space-y-6",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,t.jsx)("div",{className:`${O?"h-5":"h-6"} w-1 rounded-full bg-gradient-to-b from-pink-500 to-orange-400`}),(0,t.jsx)("h2",{className:`${O?"text-base":"text-lg sm:text-2xl"} font-bold text-gray-900 dark:text-zinc-100 tracking-tight`,children:"Milestones"}),!E&&(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.12em] px-2 py-0.5 rounded-full",style:{background:"#8B5CF614",color:"#8B5CF6",border:"1px solid #8B5CF625"},title:"Planned on the deal â carried over to the campaign when this deal converts",children:"Deal plan"})]}),(0,t.jsxs)("p",{className:"text-sm text-gray-400 dark:text-zinc-500 flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,t.jsxs)("span",{children:[ey,"/",D.length," complete"]}),eb&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700",children:"·"}),(0,t.jsxs)("span",{children:["Next: ",eb.title," (",j(eb.endDate),")"]})]}),Y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700",children:"·"}),(0,t.jsxs)("a",{href:`/dashboard/user/sales/deal/${Y._id}`,className:"inline-flex items-center gap-1 font-semibold text-violet-500 hover:text-violet-600",children:["From deal: ",Y.name,(0,t.jsx)(d.ArrowTopRightOnSquareIcon,{className:"w-3 h-3"})]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,t.jsxs)("button",{onClick:()=>es(e=>!e),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full text-xs font-semibold text-gray-700 dark:text-zinc-300 bg-[rgba(0,0,0,0.04)] dark:bg-white/5 border border-[rgba(0,0,0,0.06)] dark:border-white/10 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",title:"Create a task without attaching it to a milestone",children:[(0,t.jsx)(c.PlusIcon,{className:"w-3.5 h-3.5"})," New task"]}),(0,t.jsxs)("button",{onClick:()=>et(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full text-xs font-semibold text-gray-700 dark:text-zinc-300 bg-[rgba(0,0,0,0.04)] dark:bg-white/5 border border-[rgba(0,0,0,0.06)] dark:border-white/10 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:[(0,t.jsx)(l.RocketLaunchIcon,{className:"w-3.5 h-3.5"})," Deploy template"]}),(0,t.jsxs)("button",{onClick:()=>Z(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full text-xs font-semibold text-white hover:scale-105 transition-transform",style:{background:"linear-gradient(135deg, #F97316, #EC4899)"},children:[(0,t.jsx)(c.PlusIcon,{className:"w-3.5 h-3.5"})," New milestone"]}),(0,t.jsxs)("button",{onClick:()=>en(!0),className:"flex items-center gap-1.5 px-3.5 py-2 rounded-full text-xs font-semibold text-gray-700 dark:text-zinc-300 bg-[rgba(0,0,0,0.04)] dark:bg-white/5 border border-[rgba(0,0,0,0.06)] dark:border-white/10 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:[(0,t.jsx)(u.Squares2X2Icon,{className:"w-3.5 h-3.5"})," Templates"]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("button",{onClick:()=>eo(e=>!e),className:"w-9 h-9 rounded-full flex items-center justify-center hover:bg-gray-100 dark:hover:bg-zinc-900",style:{border:"1px solid var(--border-subtle)"},children:(0,t.jsx)(f.EllipsisHorizontalIcon,{className:"w-4 h-4 text-gray-500 dark:text-zinc-400"})}),(0,t.jsx)(o.AnimatePresence,{children:ei&&(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:-4,scale:.97}
2,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.97},transition:{duration:.15},className:"absolute right-0 mt-2 w-64 rounded-xl p-2 z-30",style:{background:"var(--surface-panel)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(16px)",boxShadow:"0 12px 32px var(--shadow-ambient-lg)"},children:ec?(0,t.jsxs)("div",{className:"p-1 space-y-2",children:[(0,t.jsx)("input",{autoFocus:!0,value:eu,onChange:e=>ef(e.target.value),onKeyDown:e=>"Enter"===e.key&&ev(),placeholder:"Template name",className:"w-full text-[12px] px-2.5 py-1.5 rounded-lg focus:outline-none",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}}),(0,t.jsxs)("div",{className:"flex justify-end gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>{el(!1),ef("")},className:"text-[11px] font-semibold px-2 py-1 rounded-lg text-gray-500 dark:text-zinc-400",children:"Cancel"}),(0,t.jsx)("button",{onClick:ev,disabled:!eu.trim()||ed,className:"text-[11px] font-bold px-2.5 py-1 rounded-lg text-white disabled:opacity-40",style:{background:"linear-gradient(135deg, #F97316, #EC4899)"},children:ed?"Savingâ¦":"Save"})]})]}):(0,t.jsxs)("button",{onClick:()=>el(!0),className:"w-full flex items-center gap-2 px-2.5 py-2 rounded-lg text-[12.5px] font-semibold text-gray-700 dark:text-zinc-300 hover:bg-gray-100 dark:hover:bg-zinc-900",children:[(0,t.jsx)(h.BookmarkIcon,{className:"w-3.5 h-3.5"})," Save as template"]})})})]})]})]}),(0,t.jsx)(o.AnimatePresence,{children:ea&&(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:-6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18},className:"rounded-2xl overflow-visible [&>div]:border-b-0 [&>div]:rounded-2xl",style:{border:"1px solid var(--border-default)",background:"var(--surface-frosted)",backdropFilter:"blur(12px)"},children:(0,t.jsx)(_.default,{teamMembers:J,portalPopovers:!0,clearOnSubmit:!0,groupColor:"#6366F1",placeholder:`New ${e.type} task â @ to assign, type a date. Not tied to a milestone.`,onSubmit:async t=>{let r=(t?.title||"").trim();if(!r)return void es(!1);try{let n=await fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,title:r,...E?{linkedCampaign:t.linkedCampaign||e.id}:{parentDeal:t.parentDeal||e.id},...q?{board:q}:{}})}),i=await n.json().catch(()=>({}));if(!n.ok)return p.default.error(i.error||"Failed to create task"),!1;return p.default.success("Task created â see Unassigned tasks"),await B(),em(),!0}catch{return p.default.error("Failed to create task"),!1}},onCancel:()=>es(!1)})})}),T?(0,t.jsx)("div",{className:"h-64 rounded-2xl animate-pulse",style:{background:"var(--surface-soft)"}}):C?(0,t.jsx)("div",{className:"border border-dashed rounded-3xl py-16 px-6 text-center",style:{borderColor:"var(--border-default)",background:"var(--surface-soft)"},children:(0,t.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400",children:C})}):0===D.length?(0,t.jsxs)("div",{className:"border border-dashed rounded-3xl py-16 px-6 text-center",style:{borderColor:"var(--border-default)",background:"var(--surface-soft)"},children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-2xl mx-auto mb-4 flex items-center justify-center bg-gradient-to-br from-orange-100 to-pink-50 dark:from-orange-950/40 dark:to-pink-950/20",children:(0,t.jsx)(s.FlagIcon,{className:"w-7 h-7 text-orange-400"})}),(0,t.jsx)("h3",{className:"text-lg font-bold text-gray-800 dark:text-zinc-200 mb-1",children:"No milestones yet"}),(0,t.jsxs)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 max-w-md mx-auto mb-5",children:["Deploy a reusable template or create your first milestone to start scheduling this ",e.type,"."]}),(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,t.jsxs)("button",{onClick:()=>et(!0),className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-semibold text-gray-700 dark:text-zinc-300 bg-[rgba(0,0,0,0.04)] dark:bg-white/5 border border-[rgba(0,0,0,0.06)] dark:border-white/10 hover:bg-gray-100 dark:hover:bg-zinc-900",children:[(0,t.jsx)(l.RocketLaunchIcon,{className:"w-3.5 h-3.5"})," Deploy template"]}),(0,t.jsxs)("button",{onClick:()=>Z(!0),className:"flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-semibold text-white hover:scale-105 transition-transform",style:{background:"linear-gradient(135deg, #F97316, #EC4899)"},children:[(0,t.jsx)(c.PlusIcon,{className:"w-3.5 h-3.5"})," New milestone"]})]})]}):(0,t.jsx)(b.default,{milestones:D,campaignId:N,owner:e,patchTaskLocal:z,shiftMilestoneLocal:F,teamMembers:J,defaultBoardId:q,onTaskDrop:(e,t)=>eg(e,t),refetch:async()=>{await B(),em()},onMilestoneClick:e=>
2K(e._id),onTaskClick:e=>W(e),applyMilestoneSync:e=>{R(e),em()},applyShiftResult:e=>{L(e),em()}}),(0,t.jsx)($,{tasks:I,milestones:D,onTaskClick:e=>W(e),onAddToMilestone:eg}),(0,t.jsx)(o.AnimatePresence,{children:ep&&(0,t.jsx)(m.default,{milestone:ep,siblingMilestones:D,campaignId:N,owner:e,teamMembers:J,defaultBoardId:q,onClose:()=>K(null),applyMilestoneSync:e=>{R(e),em()},refetch:async()=>{await B(),em()},onTaskClick:e=>W(e)})}),(0,t.jsx)(o.AnimatePresence,{children:H&&(0,t.jsx)(w.default,{task:H,onClose:()=>W(null),onUpdate:async e=>{W(t=>t?{...t,...e}:t),z?.(H._id,e);try{let t=await fetch(`/api/tasks/${H._id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),r=await t.json().catch(()=>({}));if(!t.ok)return void p.default.error(r.error||"Failed to update task");R?.(r.milestoneSync)}catch{p.default.error("Failed to update task")}await B(),em()},onDelete:async()=>{try{await fetch(`/api/tasks/${H._id}`,{method:"DELETE"}),p.default.success("Task deleted")}catch{p.default.error("Failed to delete task")}W(null),await B(),em()},onRefresh:B,teamMembers:J,statusOptions:S})}),(0,t.jsx)(o.AnimatePresence,{children:Q&&(0,t.jsx)(g.default,{owner:e,milestones:D,onClose:()=>Z(!1),onCreated:async()=>{await B(),em()}})}),(0,t.jsx)(o.AnimatePresence,{children:ee&&(0,t.jsx)(v.default,{owner:e,campaign:P||M||i,onClose:()=>et(!1),onDeployed:async()=>{await B(),em()}})}),(0,t.jsx)(o.AnimatePresence,{children:er&&(0,t.jsx)(x.default,{onClose:()=>en(!1)})})]})}let O={"To Do":"#9CA3AF","In Progress":"#6366F1",Review:"#F59E0B",Done:"#10B981",Complete:"#10B981",Stuck:"#EF4444"};function $({tasks:e,milestones:n,onTaskClick:o,onAddToMilestone:s}){let[c,l]=(0,r.useState)(null),[u,f]=(0,r.useState)(null);if(!e||0===e.length)return null;let d=(()=>{if(!c?.rect)return null;let e=c.rect,t=Math.max(8,Math.min(e.right-208,window.innerWidth-208-8));return e.bottom+224+12>window.innerHeight?{left:t,bottom:window.innerHeight-e.top+6}:{left:t,top:e.bottom+6}})();return(0,t.jsxs)("div",{className:"rounded-2xl overflow-hidden",style:{background:"var(--surface-frosted)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(12px)"},children:[(0,t.jsxs)("div",{className:"px-4 py-3 border-b flex items-center gap-2",style:{borderColor:"var(--border-subtle)"},children:[(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-[0.14em] text-gray-500 dark:text-zinc-400",children:"Unassigned tasks"}),(0,t.jsx)("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-full",style:{background:"var(--surface-soft)",color:"var(--text-tertiary)"},children:e.length}),(0,t.jsx)("span",{className:"hidden sm:inline text-[10px] text-gray-400 dark:text-zinc-500",children:'â drag a task onto a milestone above, or use "Add to milestone"'})]}),(0,t.jsx)("div",{children:e.map(e=>(0,t.jsxs)("div",{draggable:!0,onDragStart:t=>{t.dataTransfer.setData("application/x-scout-task-id",String(e._id)),t.dataTransfer.effectAllowed="move",f(e._id)},onDragEnd:()=>f(null),className:"flex items-center gap-2 px-4 py-2.5 border-b last:border-b-0 flex-wrap sm:flex-nowrap cursor-grab active:cursor-grabbing",style:{borderColor:"var(--surface-softer)",opacity:u===e._id?.4:1},title:"Drag onto a milestone in the Gantt to file this task under it",children:[(0,t.jsxs)("button",{onClick:()=>o?.(e),className:"min-w-0 flex-1 text-left",children:[(0,t.jsx)("div",{className:"text-[13px] font-semibold text-gray-800 dark:text-zinc-200 truncate",children:e.title}),(0,t.jsxs)("div",{className:"text-[10.5px] text-gray-400 dark:text-zinc-500 flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:O[e.status]||"#9CA3AF"}}),(0,t.jsx)("span",{style:{color:O[e.status]||void 0},className:"font-semibold",children:e.status||"To Do"}),e.dueDate&&(0,t.jsxs)("span",{children:["· due ",j(e.dueDate)]})]})]}),(()=>{let r=Array.isArray(e.assignees)?e.assignees.find(e=>e&&"object"==typeof e&&(e.name||e.image)):null;if(!r)return null;let n=(r.name||"").split(" ").filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join("");return r.image?(0,t.jsx)("img",{src:r.image,alt:r.name||"Assignee",title:r.name,className:"w-6 h-6 rounded-full object-cover flex-shrink-0",style:{border:"1.5px solid var(--border-subtle)"}}):(0,t.jsx)("span",{title:r.name,className:"w-6 h-6 rounded-full flex items-center justify-center text-[9px] font-bold text-white flex-shrink-0",style:{background:"linear-gradient(135deg, #6366F1, #8B5CF6)"},children:n})})(),e.parentDeal&&(0,t.jsx)("a",{href:`/dashboard/user/sales/deal/${e.parentDeal}`,onClick:e=>e.stopPropagation(),className:"text-[10px] font-semibold px-2 py-1 rounded-full flex-shrink-0",style:{background:"#8B5CF614",color:"#8B5CF6",border:"1px solid #8B5CF625"},children:"Deal"}),(0,t.jsxs)("div",{className:"flex-shrink-0",children:[(0,t.jsx)("button",{onClick:t=>{let r=t.currentTarget.getBoundingClientRect();l(t=>
2t?.id===e._id?null:{id:e._id,rect:r})},className:"text-[10.5px] font-semibold px-2.5 py-1 rounded-full",style:{background:"rgba(249,115,22,0.1)",color:"#F97316",border:"1px solid rgba(249,115,22,0.2)"},children:"Add to milestone"}),c?.id===e._id&&d&&"u">typeof document&&(0,i.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0",style:{zIndex:9999},onClick:()=>l(null)}),(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},transition:{duration:.15},className:"fixed w-52 max-h-56 overflow-y-auto rounded-xl p-1.5",style:{...d,zIndex:1e4,background:"var(--surface-panel)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(16px)",boxShadow:"0 12px 32px var(--shadow-ambient-lg)"},children:0===n.length?(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 px-2 py-1.5",children:"No milestones yet"}):n.map(r=>(0,t.jsxs)("button",{onClick:()=>{s(e._id,r._id),l(null)},className:"w-full flex items-center gap-2 text-left px-2 py-1.5 rounded-lg hover:bg-gray-100 dark:hover:bg-zinc-900",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:r.color||"#F97316"}}),(0,t.jsx)("span",{className:"text-[11.5px] text-gray-700 dark:text-zinc-300 truncate",children:r.title})]},r._id))})]}),document.body)]})]},e._id))})]})}e.s(["default",0,function({campaign:e=null,campaignId:r=null,deal:n=null,dealId:i=null,embedded:o=!1,onChange:a}){let c=r||e?._id||null,l=i||n?._id||null,u=c?{type:"campaign",id:String(c)}:l?{type:"deal",id:String(l)}:null;return u?(0,t.jsx)(k,{owner:u,ownerHint:e||n,embedded:o,onChange:a}):(0,t.jsx)("div",{className:"p-6 max-w-7xl mx-auto",children:(0,t.jsxs)("div",{className:"border border-dashed rounded-3xl py-16 px-6 text-center",style:{borderColor:"var(--border-default)",background:"var(--surface-soft)"},children:[(0,t.jsx)("div",{className:"w-16 h-16 rounded-2xl mx-auto mb-4 flex items-center justify-center bg-gradient-to-br from-orange-100 to-pink-50 dark:from-orange-950/40 dark:to-pink-950/20",children:(0,t.jsx)(s.FlagIcon,{className:"w-7 h-7 text-orange-400"})}),(0,t.jsx)("h3",{className:"text-lg font-bold text-gray-800 dark:text-zinc-200 mb-1",children:"No campaign selected"}),(0,t.jsx)("p",{className:"text-sm text-gray-500 dark:text-zinc-400 max-w-md mx-auto",children:"Milestones need a campaign or a deal to attach to â open this from inside one."})]})})}])},259706,750320,e=>{"use strict";var t=e.i(271645),r=e.i(705766),n=e.i(168716);function i(e){return"campaign"===e.type?`/api/campaigns/${e.id}/milestones`:`/api/deals/${e.id}/milestones`}e.s(["ownerListPath",0,i],750320),e.s(["default",0,function(e){let o=e&&"object"==typeof e?e.type:"campaign",a=e&&"object"==typeof e?e.id:e,[s,c]=(0,t.useState)(null),[l,u]=(0,t.useState)(null),[f,d]=(0,t.useState)([]),[h,p]=(0,t.useState)([]),[y,b]=(0,t.useState)(!0),[m,g]=(0,t.useState)(null),v=(0,t.useRef)(!0),x=(0,t.useRef)(!1);(0,t.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]);let w=(0,t.useCallback)(async()=>{if(!a)return void b(!1);x.current||b(!0),g(null);try{let e=await fetch(i({type:o,id:a}));if(!e.ok){let t=(await e.json().catch(()=>({}))).error||"Failed to load milestones";v.current&&g(t),(401===e.status||403===e.status||404===e.status||e.status>=500)&&r.default.error(t);return}let t=await e.json();if(!v.current)return;c(t.campaign||null),u(t.campaign||t.deal||null),d(t.milestones||[]),p(t.unassignedTasks||[]),x.current=!0}catch(e){v.current&&g(e?.message||"Failed to load milestones"),r.default.error("Failed to load milestones")}finally{v.current&&b(!1)}},[o,a]);(0,t.useEffect)(()=>{w()},[w]);let _=(0,t.useCallback)(e=>{if(!e)return;let t=Array.isArray(e.milestones)?e.milestones:[],r=Array.isArray(e.shiftedTaskIds)?e.shiftedTaskIds:[];t.length>0&&d(e=>{let r=new Map(e.map(e=>[String(e._id),e]));for(let e of t){let t=String(e._id),n=r.get(t);r.set(t,{...n,...e,tasks:e.tasks||n?.tasks||[]})}return Array.from(r.values()).sort((e,t)=>(e.position??0)!==(t.position??0)?(e.position??0)-(t.position??0):new Date(e.createdAt||0)-new Date(t.createdAt||0))}),(r.length>0||e.error)&&w()},[w]),S=(0,t.useCallback)(e=>{e&&_({milestones:(Array.isArray(e.shifted)?e.shifted:[]).map(e=>
2e.milestone).filter(Boolean),shiftedTaskIds:Array.isArray(e.taskIds)?e.taskIds:[]})},[_]);return{campaign:s,ownerDoc:l,milestones:f,unassignedTasks:h,loading:y,error:m,refetch:w,applyMilestoneSync:_,applyShiftResult:S,patchTaskLocal:(0,t.useCallback)((e,t)=>{if(!e||!t)return;let r=String(e);d(e=>e.map(e=>{if(!Array.isArray(e.tasks)||!e.tasks.some(e=>String(e._id)===r))return e;let n=e.tasks.map(e=>String(e._id)===r?{...e,...t}:e),i=null,o=null;for(let e of n){let t=e.startDate||e.dueDate;if(t){let e=new Date(t);isNaN(e)||i&&!(e<i)||(i=e)}if(e.dueDate){let t=new Date(e.dueDate);isNaN(t)||o&&!(t>o)||(o=t)}if(("Done"===e.status||"Complete"===e.status)&&e.completedAt){let t=new Date(e.completedAt);isNaN(t)||o&&!(t>o)||(o=t)}}return{...e,tasks:n,startDate:i?i.toISOString():e.startDate,endDate:o?o.toISOString():e.endDate}})),p(e=>e.some(e=>String(e._id)===r)?e.map(e=>String(e._id)===r?{...e,...t}:e):e)},[]),shiftMilestoneLocal:(0,t.useCallback)((e,t)=>{if(!e||!Number.isFinite(t)||0===t)return;let r=String(e),i=e=>e?(0,n.addBusinessDays)(new Date(e),t).toISOString():e;d(e=>e.map(e=>{if(String(e._id)!==r)return e;let t=new Set(["In Progress","Stuck","Review"]);return{...e,startDate:i(e.startDate),endDate:i(e.endDate),tasks:(e.tasks||[]).map(e=>{let r=t.has(e.status),n=i(e.dueDate);return r&&e.startDate&&n&&new Date(n)<new Date(e.startDate)&&(n=e.startDate),{...e,startDate:r?e.startDate:i(e.startDate),dueDate:n}})}}))},[]),setMilestones:d,setUnassignedTasks:p}}],259706)},68608,954882,746122,431702,757588,466073,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(846932),i=e.i(88653),o=e.i(984174),a=e.i(779529),s=e.i(263150),c=e.i(163858);e.s(["default",0,function({task:e}){let[l,u]=(0,r.useState)(null),[f,d]=(0,r.useState)(!1),[h,p]=(0,r.useState)(null),y=(e.comments?.length||0)+(e.subItems?.length||0)+(e.statusHistory?.length||0);if(y<5&&!l)return null;async function b(){d(!0),p(null);try{let t=await fetch("/api/tasks/ai/summary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e._id})});if(t.ok){let e=await t.json();u(e)}else{let e=await t.json();p(e.error||"Failed to summarize")}}catch{p("Failed to summarize")}finally{d(!1)}}return(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},transition:{duration:.3},className:"relative overflow-hidden rounded-2xl mb-5",style:{background:"linear-gradient(135deg, rgba(99,102,241,0.04), rgba(168,85,247,0.04), rgba(236,72,153,0.04))",border:"1px solid rgba(99,102,241,0.12)"},children:[(0,t.jsx)("div",{className:"absolute -top-8 -right-8 w-28 h-28 rounded-full opacity-20 blur-3xl pointer-events-none",style:{background:"linear-gradient(135deg, #6366F1, #A855F7)"}}),(0,t.jsxs)("div",{className:"relative z-10 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"linear-gradient(135deg, #6366F1, #A855F7)",boxShadow:"0 2px 8px rgba(168,85,247,0.25)"},children:(0,t.jsx)(o.SparklesIcon,{className:"w-3.5 h-3.5 text-white"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-500 dark:text-zinc-400",children:"AI Summary"})]}),(0,t.jsxs)("button",{onClick:b,disabled:f,className:"text-[11px] font-semibold px-2.5 py-1 rounded-lg flex items-center gap-1 transition-all duration-200 disabled:opacity-50",style:{background:"rgba(99,102,241,0.08)",color:"#6366F1"},children:[(0,t.jsx)(a.ArrowPathIcon,{className:`w-3 h-3 ${f?"animate-spin":""}`}),l?"Regenerate":"Generate"]})]}),(0,t.jsxs)(i.AnimatePresence,{mode:"wait",children:[!l&&!f&&!h&&(0,t.jsx)(n.motion.p,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"text-xs text-gray-400 dark:text-zinc-500 italic",children:y>=5?"This task has accumulated activity â generate a TL;DR to catch up fast.":"Generate a quick recap of what's happening on this task."},"empty"),f&&(0,t.jsxs)(n.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"space-y-2",children:[(0,t.jsx)("div",{className:"h-2.5 bg-gray-200/70 dark:bg-zinc-800/70 rounded animate-pulse w-full"}),(0,t.jsx)("div",{className:"h-2.5 bg-gray-200/70 dark:bg-zinc-800/70 rounded animate-pulse w-4/5"}),(0,t.jsx)("div",{className:"h-2.5 bg-gray-200/70 dark:bg-zinc-800/70 rounded animate-pulse w-2/3"})]},"loading"),h&&(0,t.jsx)(n.motion.p,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"text-xs text-red-500 italic",children:h},"error"),l&&!f&&(0,t.jsxs)(n.motion.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0},className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-[13px] text-gray-700 dark:text-zinc-300 leading-relaxed",children:l.summary}),l.openItems?.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[9px] font-bold uppercase tracking-[0.14em] text-emerald-600 mb-1 flex items-center gap-1",children:[(0,t.jsx)(c.CheckCircleIcon,{className:"w-3 h-3"}),"Open items"]}),(0,t.jsx)("ul",{className:"space-y-1",children:l.openItems.map((e,r)=>(0,t.jsxs)("li",{className:"text-[11px] text-gray-600 dark:text-zinc-400 flex items-start gap-1.5",children:[(0,t.jsx)("span",{className:"text-emerald-500 mt-0.5",children:"â¢"}),e]},r))})]}),l.blockers?.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[9px] font-bold uppercase tracking-[0.14em] text-red-500 mb-1 flex items-center gap-1",children:[(0,t.jsx)(s.ExclamationTriangleIcon,{className:"w-3 h-3"}),"Blockers"]}),(0,t.jsx)("ul",{className:"space-y-1",children:l.blockers.map((e,r)=>(0,t.jsxs)("li",{className:"text-[11px] text-gray-600 dark:text-zinc-400 flex items-start gap-1.5",children:[(0,t.jsx)("span",{className:"text-red-500 mt-0.5",children:"â¢"}),e]},r))})]})]},"data")]})]})]})}],68608);var l=e.i(913107),u=e.i(787906),f=e.i(427217),d=e.i(705766);e.s(["default",0,function({task:e,onSubItemsAdded:a}){let[s,c]=(0,r.useState)(!1),[h,p]=(0,r.useState)(!1),[y,b]=(0,r.useState)([]),[m,g]=(0,r.useState)(new Set);async function v(){p(!0),c(!0),b([]),g(new Set);try{let t=await fetch("/api/tasks/ai/break-down",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e._id})});if(t.ok){let e=await t.json();b(e.subTasks||[])}else d.default.error("Couldn't break down this task"),c(!1)}catch{d.default.error("Couldn't break down this task"),c(!1)}finally{p(!1)}}async function x(){for(let e of y.map((e,t)=>t).filter(e=>!m.has(e)))await w(e,!1);a?.(),d.default.success("Sub-tasks added"),c(!1)}async function w(t,r=!0){if(m.has(t))return;let n=y[t];try{(await fetch(`/api/tasks/${e._id}/subitems`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n.title})})).ok&&(g(e=>new Set(e).add(t)),r&&a?.())}catch{d.default.error("Failed to add sub-task")}}return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:v,disabled:h,className:"text-[11px] font-semibold px-2.5 py-1 rounded-lg flex items-center gap-1 transition-all duration-200 disabled:opacity-50",style:{background:"linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.1))",color:"#7C3AED",border:"1px solid rgba(99,102,241,0.2)"},children:[(0,t.jsx)(o.SparklesIcon,{className:`w-3 h-3 ${h?"animate-pulse":""}`}),"Break this down"]}),(0,t.jsx)(i.AnimatePresence,{children:s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[110] bg-black/30 backdrop-blur-sm",onClick:()=>c(!1)}),(0,t.jsx)(n.motion.div,{initial:{opacity:0,y:16,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.96},transition:{duration:.25,ease:[.25,.46,.45,.94]},className:"fixed inset-0 z-[111] flex items-center justify-center p-4",onClick:()=>c(!1),children:(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-2xl overflow-hidden",style:{background:"var(--panel-95)",backdropFilter:"blur(20px)",boxShadow:"0 24px 60px var(--shadow-ambient-xl)",border:"1px solid var(--border-subtle)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"h-[3px] w-full bg-gradient-to-r from-violet-500 via-purple-500 to-fuchsia-500"}),(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center",style:{background:"linear-gradient(135deg, #6366F1, #A855F7)",boxShadow:"0 4px 12px rgba(168,85,247,0.3)"},children:(0,t.jsx)(o.SparklesIcon,{className:"w-4 h-4 text-white"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-black text-gray-900 dark:text-zinc-100",children:"AI sub-task suggestions"}),(0,t.jsx)("p",{className:"text-[10px] text-gray-400 dark:text-zinc-500 mt-0.5",children:"Pick the ones you want, or accept all"})]})]}),(0,t.jsx)("button",{onClick:()=>c(!1),className:"w-7 h-7 flex items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-zinc-900",children:(0,t.jsx)(f.XMarkIcon,{className:"w-4 h-4 text-gray-400 dark:text-zinc-500"})})]}),h&&(0,t.jsx)("div",{className:"space-y-2 py-2",children:[1,2,3,4].map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded bg-gray-200/70 dark:bg-zinc-800/70 animate-pulse flex-shrink-0"}),(0,t.jsx)("div",{className:"h-3 bg-gray-200/70 dark:bg-zinc-800/70 rounded animate-pulse",style:{width:`${60+30*Math.random()}%`}})]},e))}),!h&&y.length>0&&(0,t.jsx)("div",{className:"space-y-1 mb-3",children:y.map((e,r)=>{let n=m.has(r);return(0,t.jsxs)("button",{onClick:()=>!n&&w(r),disabled:n,className:"w-full flex items-center gap-2.5 py-2 px-3 rounded-xl text-left transition-all duration-150 group",style:{background:n?"rgba(16,185,129,0.06)":"var(--surface-soft)",border:n?"1px solid rgba(16,185,129,0.2)":"1px solid var(--surface-softer)"},children:[(0,t.jsx)("div",{className:"w-5 h-5 rounded-md flex items-center justify-center flex-shrink-0",style:n?{background:"#10B981",boxShadow:"0 0 8px rgba(16,185,129,0.3)"}:{border:"1.5px dashed var(--shadow-ambient-xl)"},children:n?(0,t.jsx)(u.CheckIcon,{className:"w-3 h-3 text-white",strokeWidth:3}):(0,t.jsx)(l.PlusIcon,{className:"w-3 h-3 text-gray-400 dark:text-zinc-500 group-hover:text-violet-500"})}),(0,t.jsx)("span",{className:`text-[13px] flex-1 ${n?"text-emerald-700 line-through":"text-gray-700 dark:text-zinc-300"}`,children:e.title})]},r)})}),!h&&y.length>0&&(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("button",{onClick:x,disabled:m.size===y.length,className:"flex-1 text-xs px-4 py-2 text-white rounded-xl font-semibold disabled:opacity-50 transition-all duration-200 hover:shadow-md",style:{background:"linear-gradient(135deg, #6366F1, #A855F7)",boxShadow:"0 2px 8px rgba(168,85,247,0.25)"},children:["Add all (",y.length-m.size,")"]}),(0,t.jsx)("button",{onClick:v,className:"text-xs px-4 py-2 rounded-xl font-semibold text-gray-600 dark:text-zinc-400 hover:bg-gray-100 dark:hover:bg-zinc-900 transition-colors",children:"Regenerate"})]}),!h&&0===y.length&&(0,t.jsx)("p",{className:"text-xs text-gray-400 dark:text-zinc-500 text-center py-6",children:"No suggestions returned. Try regenerating or adding more detail to the description."})]})]})})]})})]})}],954882);var h=e.i(259030);e.s(["default",0,function({task:e}){let i=(0,r.useMemo)(()=>{var t;let r;return t=e,(r=[]).push({id:`created-${t._id}`,timestamp:t.createdAt,actor:t.createdBy?.name||"Someone",action:"created the task",color:"#6366F1",icon:l.PlusIcon}
2),(t.statusHistory||[]).forEach((e,t)=>{0!==t&&r.push({id:`status-${t}-${e.changedAt}`,timestamp:e.changedAt,actor:e.changedBy?.name||"Someone",action:"Done"===e.status||"Complete"===e.status?"completed it":"moved status to",target:"Done"===e.status||"Complete"===e.status?null:e.status,color:"Done"===e.status||"Complete"===e.status?"#10B981":e.color||"#6366F1",icon:"Done"===e.status||"Complete"===e.status?c.CheckCircleIcon:a.ArrowPathIcon})}),(t.comments||[]).forEach((e,t)=>{let n=e.media&&e.media.length>0;r.push({id:`comment-${e._id||t}`,timestamp:e.createdAt,actor:e.user?.name||"Someone",action:n&&!e.text?"sent a GIF":"commented",detail:e.text&&e.text.length>120?e.text.slice(0,120)+"â¦":e.text||"",media:e.media||[],color:"#EC4899",icon:h.ChatBubbleLeftIcon}),(e.replies||[]).forEach((t,n)=>{let i=t.media&&t.media.length>0;r.push({id:`reply-${e._id}-${n}`,timestamp:t.createdAt,actor:t.user?.name||"Someone",action:i&&!t.text?"replied with a GIF":"replied",detail:t.text&&t.text.length>120?t.text.slice(0,120)+"â¦":t.text||"",media:t.media||[],color:"#F472B6",icon:h.ChatBubbleLeftIcon})})}),r.sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime())},[e]);return 0===i.length?(0,t.jsxs)("div",{className:"text-center py-10",children:[(0,t.jsx)(a.ArrowPathIcon,{className:"w-10 h-10 text-gray-200 mx-auto mb-2 dark:text-zinc-200"}),(0,t.jsx)("p",{className:"text-sm text-gray-400 dark:text-zinc-500 font-medium",children:"No activity yet"}),(0,t.jsx)("p",{className:"text-xs text-gray-300 dark:text-zinc-700 mt-0.5",children:"Status changes, comments, and updates will appear here"})]}):(0,t.jsxs)("div",{className:"relative pl-3",children:[(0,t.jsx)("div",{className:"absolute left-[14px] top-2 bottom-2 w-px",style:{background:"linear-gradient(180deg, rgba(99,102,241,0.2), rgba(236,72,153,0.1) 60%, transparent)"}}),(0,t.jsx)("div",{className:"space-y-3",children:i.map((e,r)=>(0,t.jsxs)(n.motion.div,{initial:{opacity:0,x:-4},animate:{opacity:1,x:0},transition:{delay:.04*r,duration:.25},className:"relative pl-7",children:[(0,t.jsx)("div",{className:"absolute left-0 top-0.5 w-6 h-6 rounded-full flex items-center justify-center ring-2",style:{background:e.color,boxShadow:`0 0 0 3px ${e.color}25`},children:(0,t.jsx)(e.icon,{className:"w-3 h-3 text-white"})}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"text-[12px] text-gray-700 dark:text-zinc-300 leading-snug",children:[e.actor&&(0,t.jsx)("span",{className:"font-bold text-gray-900 dark:text-zinc-100",children:e.actor})," ",e.action,e.target&&(0,t.jsx)("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[10px] font-bold",style:{background:`${e.color}15`,color:e.color},children:e.target})]}),e.detail&&(0,t.jsx)("p",{className:"text-[11px] text-gray-500 dark:text-zinc-400 mt-1 leading-relaxed",children:e.detail}),e.media?.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1.5",children:[e.media.slice(0,3).map((e,r)=>(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"rounded-md overflow-hidden flex-shrink-0 hover:opacity-90 transition-opacity",style:{width:80,height:56,border:"1px solid var(--border-subtle)"},children:(0,t.jsx)("img",{src:e.previewUrl||e.url,alt:"",className:"w-full h-full object-cover",loading:"lazy"})},r)),e.media.length>3&&(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500 font-semibold",children:["+",e.media.length-3]})]})]}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500 font-medium whitespace-nowrap flex-shrink-0",title:new Date(e.timestamp).toLocaleString(),children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return i<7?`${i}d ago`:new Date(e).toLocaleDateString()}(e.timestamp)})]})]},e.id))})]})}],746122);var p=e.i(833786);e.s(["default",0,function({collaborators:e=[],assigner:r=null,onAdd:n,onRemoveCollaborator:i,chipSize:o=28,emptyLabel:a="+ Add collaborators"}){let s=new Set,c=[];
2for(let t of[...e,r].filter(Boolean)){let e=t._id?.toString()||t.toString();s.has(e)||(s.add(e),c.push(t))}let l=r?._id?.toString?.()||null;return 0===c.length?(0,t.jsxs)("button",{onClick:n,className:"text-xs text-gray-400 dark:text-zinc-500 hover:text-gray-600 dark:hover:text-zinc-300 transition-colors duration-150 flex items-center gap-1",type:"button",children:[(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),a]}):(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[c.map(e=>{let r=e._id?.toString()||e.toString(),n=l&&r===l;return(0,t.jsxs)("div",{className:"relative group/chip",children:[(0,t.jsx)(p.default,{user:e,size:o,assignerBadge:n}),i&&(0,t.jsx)("button",{onClick:()=>i(r),className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-red-500 text-white flex items-center justify-center opacity-0 group-hover/chip:opacity-100 md:opacity-0 md:group-hover/chip:opacity-100 transition-opacity duration-150 pointer-events-auto z-20 shadow-sm",type:"button","aria-label":`Remove ${e.name||"person"}`,title:`Remove ${e.name||"person"}`,children:(0,t.jsx)("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M6 18L18 6M6 6l12 12"})})})]},r)}),(0,t.jsx)("button",{onClick:n,type:"button",className:"flex items-center justify-center rounded-full transition-all duration-200 hover:scale-110 text-gray-400 dark:text-zinc-500 hover:text-gray-600 dark:hover:text-zinc-300",style:{width:o,height:o,background:"var(--surface-soft)",border:"1.5px dashed var(--border-default)"},"aria-label":"Add collaborator",title:"Add collaborator",children:(0,t.jsx)("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",style:{width:.43*o,height:.43*o},children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]})}],431702);var y=e.i(591160),b=e.i(313004),m=e.i(272857),g=e.i(976519);e.s(["default",0,function({taskId:e,task:n,session:i,teamMembers:o,highlightedMessageId:a,onVideoActivate:s,onVideoDeactivate:c,onMessagesChanged:l,pendingSubItemQuote:u,onClearSubItemQuote:f,onJumpToSubItem:h}){let[p,v]=(0,r.useState)([]),[x,w]=(0,r.useState)(!1),_=["admin","super_admin"].includes(i?.user?.role),S=(0,m.default)({enabled:!o||0===o.length}),j=o&&o.length>0?o:S,k=(0,r.useMemo)(()=>({type:"task",id:e}),[e]),{typers:O,notifyTyping:$,clearTyping:A}=(0,b.default)({parent:k,selfUserId:i?.user?._id}),E=(0,r.useRef)(l);(0,r.useEffect)(()=>{E.current=l},[l]);let N=(0,r.useCallback)(async()=>{try{let t=await fetch(`/api/messages?parent=task:${encodeURIComponent(e)}`);
2if(!t.ok)return;let r=(await t.json()).messages||[],n=function(e){let t=new Map,r=new Map,n=[];for(let i of e)if(t.set(i._id?.toString?.(),i),i.parentMessage){let e=i.parentMessage.toString(),t=r.get(e)||[];t.push(i),r.set(e,t)}else n.push(i);for(let e of(n.sort((e,t)=>new Date(e.createdAt)-new Date(t.createdAt)),r.values()))e.sort((e,t)=>new Date(e.createdAt)-new Date(t.createdAt));return n.map(e=>({...e,replies:r.get(e._id?.toString?.())||[]}))}(r);v(n),E.current?.(n,r)}catch(e){console.error("TaskMessageThread fetch failed:",e)}finally{w(!0)}},[e]);async function P({text:t,mentions:r,creatorMentions:n,campaignMentions:i,organizationMentions:o,dealMentions:a,media:s,quotedSubItem:c}){try{if(!(await fetch("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:{type:"task",id:e},text:t,mentions:r,creatorMentions:n,campaignMentions:i,organizationMentions:o,dealMentions:a,media:s,quotedSubItem:c||null})})).ok)throw Error("send_failed");A(),f?.(),N()}catch{d.default.error("Failed to send")}}async function M(t,r,n){try{if(!(await fetch("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:{type:"task",id:e},text:r,parentMessage:t,replyTo:n||null})})).ok)throw Error("send_failed");N()}catch{d.default.error("Failed to reply")}}async function D(e,t,r){try{let n=await fetch(`/api/messages/${t||e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error||"Edit failed")}N()}catch(e){throw d.default.error(e.message||"Couldn't save edit"),e}}async function I(e,t){try{if(!(await fetch(`/api/messages/${t||e}`,{method:"DELETE"})).ok)throw Error("delete_failed");N()}catch{d.default.error("Couldn't delete")}}async function T(e,t,r){try{if(!(await fetch(`/api/messages/${r||e}/reactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({emoji:t})})).ok)throw Error("react_failed");N()}catch{d.default.error("Failed to react")}}return((0,r.useEffect)(()=>{N()},[N]),(0,r.useEffect)(()=>{function t(t){let r=t.detail||{};if("message_updated"===r.kind){let{messageId:e,spawnedTask:t}=r;if(!e||!t)return;v(r=>{var n,i,o;let a,s,c;return n=r,i=e,o=t,a=i?.toString?.()||i,s=!1,c=n.map(e=>{let t=e._id?.toString?.()||e._id,r=(e.replies||[]).map(e=>(e._id?.toString?.()||e._id)!==a?e:(s=!0,{...e,spawnedTask:o}));return t===a?(s=!0,{...e,spawnedTask:o,replies:r}):r!==e.replies?{...e,replies:r}:e}),s?c:n});return}r.parent?.type!=="task"||r.parent.id?.toString?.()===e?.toString?.()&&N()}return window.addEventListener("ss-task-event",t),()=>window.removeEventListener("ss-task-event",t)},[e,N]),x)?(0,t.jsx)(y.default,{messages:p,currentUserId:i?.user?._id,isAdmin:_,teamMembers:j,composerPlaceholder:"Message your teamâ¦",composerCta:"Send",highlightedMessageId:a,readBy:[],showReadReceipts:!0,onSubmit:P,onEditMessage:D,onDeleteMessage:I,onToggleReaction:T,onAddReply:M,onVideoActivate:s,onVideoDeactivate:c,pendingQuote:u,onClearQuote:f,onJumpToSubItem:h,senderName:i?.user?.name,senderImage:i?.user?.image,onComposerActivity:$,typers:O,buildCopyLinkHandler:t=>{try{let r=(0,g.buildTaskLink)(n||{_id:e},{commentId:t}),i=window.location.origin,o=`${i}${r}`;"u">typeof navigator&&navigator.clipboard?(navigator.clipboard.writeText(o),d.default.success("Comment link copied")):d.default.success(o)}catch{d.default.error("Couldn't copy link")}}}):(0,t.jsx)("div",{className:"flex-1 min-h-0"})}],757588);let v=r.forwardRef(function({title:e,titleId:t,...n},i){return r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":t},n),e?r.createElement("title",{id:t},e):null,r.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z"}))});e.s(["RectangleGroupIcon",0,v],466073)},231822,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(174080),i=e.i(518763),o=e.i(217255),a=e.i(846932),s=e.i(88653),c=e.i(427217),l=e.i(460759),u=e.i(803884),f=e.i(259030),d=e.i(871822),h=e.i(389472),p=e.i(398393),y=e.i(782611),b=e.i(562718),m=e.i(979259),g=e.i(474121),v=e.i(844735),x=e.i(247103),w=e.i(264556),_=e.i(477183),S=e.i(76590),j=e.i(807311),k=e.i(976519);e.i(253017);var O=e.i(799539),$=e.i(825367),A=e.i(735490),E=e.i(789321),N=e.i(115200),P=e.i(68608),M=e.i(954882),D=e.i(746122),I=e.i(833786),T=e.i(431702),C=e.i(757588),B=e.i(136604),R=e.i(370221),L=e.i(927591),z=e.i(683512),F=e.i(107657),U=e.i(667912),q=e.i(787906),V=e.i(779529),K=e.i(507153),H=e.i(466073),W=e.i(83663),J=e.i(913107),G=e.i(705766);let Y={_id:null,title:"",status:"To Do",statusColor:"#c4c4c4",assignees:[],collaborators:[],assigner:null,dueDate:null,description:"",links:[],media:[],blockedBy:[],blocks:[]};
2function X({value:e,onChange:n}){let[i,o]=(0,r.useState)(!1),a=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){a.current&&!a.current.contains(e.target)&&o(!1)}},[i]);let s=e&&new Date(e)<new Date&&new Date(e).toDateString()!==new Date().toDateString(),c=e&&new Date(e).toDateString()===new Date().toDateString(),l=e?new Date(e).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):null;return(0,t.jsxs)("div",{className:"relative",ref:a,children:[(0,t.jsxs)("button",{type:"button",onClick:function(){o(e=>!e)},className:l?"relative flex items-center gap-1 px-2 py-0.5 rounded-md text-[11px] font-semibold transition-all duration-200 hover:shadow-sm hover:scale-[1.02] active:scale-[0.98] whitespace-nowrap":"relative flex items-center gap-1 text-xs text-gray-400 dark:text-zinc-500 hover:text-gray-600 dark:hover:text-zinc-300 transition-colors duration-150",style:(s?{background:"rgba(239,68,68,0.08)",color:"#DC2626",border:"1px solid rgba(239,68,68,0.15)"}:c?{background:"rgba(245,158,11,0.08)",color:"#D97706",border:"1px solid rgba(245,158,11,0.15)"}:l?{background:"var(--surface-soft)",color:"var(--text-tertiary)",border:"1px solid transparent"}:null)||void 0,title:l?`Due ${l} â click to change`:"Set due date",children:[s&&(0,t.jsxs)("span",{className:"flex h-1.5 w-1.5 flex-shrink-0",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-1.5 w-1.5 rounded-full bg-red-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-red-500"})]}),!l&&(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),(0,t.jsx)("span",{children:l||"Add due date"})]}),i&&(0,t.jsxs)("div",{className:"absolute left-0 top-full mt-1.5 z-50 flex items-center gap-2 rounded-xl p-2 shadow-lg",style:{background:"var(--surface-panel)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(16px)"},children:[(0,t.jsx)("input",{type:"date",autoFocus:!0,value:(0,W.toInputDate)(e),onChange:e=>{n((0,W.fromInputDate)(e.target.value)),o(!1)},className:"text-[12px] px-2 py-1 rounded-md focus:outline-none text-gray-800 dark:text-zinc-200",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}}),e&&(0,t.jsx)("button",{type:"button",onClick:()=>{n(null),o(!1)},className:"text-[11px] font-semibold text-red-500 hover:text-red-600 whitespace-nowrap",children:"Clear"})]})]})}function Q({teamMembers:e=[],currentOwner:n,onSelect:i,onClose:o}){let[a,s]=(0,r.useState)(""),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&o()}function t(e){"Escape"===e.key&&(e.stopImmediatePropagation(),o())}return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let l=(e||[]).filter(e=>(e.name||"").toLowerCase().includes(a.toLowerCase()));return(0,t.jsxs)("div",{ref:c,className:"absolute z-50 mt-1.5 left-0 rounded-xl py-2 w-64 overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 32px -8px rgba(0,0,0,0.14)"},children:[(0,t.jsx)("div",{className:"px-2.5 pb-1.5",children:(0,t.jsx)("input",{autoFocus:!0,t
2ype:"text",value:a,onChange:e=>s(e.target.value),placeholder:"Search peopleâ¦",className:"w-full px-2.5 py-1.5 rounded-lg text-[12px] bg-transparent border focus:outline-none focus:ring-2 focus:ring-orange-300/40",style:{border:"1px solid var(--border-subtle)"}})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto",children:[0===l.length&&(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 text-center py-3",children:"No matches"}),l.map(e=>{let r=(n?._id||n)?.toString()===(e._id||e).toString();return(0,t.jsxs)("button",{type:"button",onClick:()=>i(e),className:`w-full flex items-center gap-2.5 px-3 py-2 text-left text-[12px] font-medium transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] ${r?"text-orange-500":"text-gray-700 dark:text-zinc-300"}`,children:[(0,t.jsx)(I.default,{user:e,size:22}),(0,t.jsx)("span",{className:"truncate",children:e.name}),r&&(0,t.jsx)(q.CheckIcon,{className:"w-3.5 h-3.5 ml-auto flex-shrink-0 text-orange-500"})]},e._id||e.name)})]})]})}function Z({teamMembers:e=[],selected:n=[],onToggle:i,onClose:o}){let[a,s]=(0,r.useState)(""),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&o()}function t(e){"Escape"===e.key&&(e.stopImmediatePropagation(),o())}return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let l=new Set(n.map(e=>(e._id||e).toString())),u=(e||[]).filter(e=>(e.name||"").toLowerCase().includes(a.toLowerCase()));return(0,t.jsxs)("div",{ref:c,className:"absolute z-50 mt-1.5 left-0 rounded-xl py-2 w-64 overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 32px -8px rgba(0,0,0,0.14)"},children:[(0,t.jsx)("div",{className:"px-2.5 pb-1.5",children:(0,t.jsx)("input",{autoFocus:!0,t
2ype:"text",value:a,onChange:e=>s(e.target.value),placeholder:"Search peopleâ¦",className:"w-full px-2.5 py-1.5 rounded-lg text-[12px] bg-transparent border focus:outline-none focus:ring-2 focus:ring-orange-300/40",style:{border:"1px solid var(--border-subtle)"}})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto",children:u.map(e=>{let r=l.has((e._id||e).toString());return(0,t.jsxs)("button",{type:"button",onClick:()=>i(e),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left text-[12px] font-medium transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] text-gray-700 dark:text-zinc-300",children:[(0,t.jsx)(I.default,{user:e,size:22}),(0,t.jsx)("span",{className:"truncate flex-1",children:e.name}),r&&(0,t.jsx)(q.CheckIcon,{className:"w-3.5 h-3.5 flex-shrink-0 text-orange-500"})]},e._id||e.name)})})]})}function ee({siblings:e,onAdd:n,onClose:i}){let[o,a]=(0,r.useState)(""),s=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){s.current&&!s.current.contains(e.target)&&i()}function t(e){"Escape"===e.key&&(e.stopImmediatePropagation(),i())}return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[i]);let c=e.filter(e=>(e.title||"").toLowerCase().includes(o.toLowerCase()));return(0,t.jsxs)("div",{ref:s,className:"absolute z-50 mt-1.5 left-0 rounded-xl py-2 w-72 overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 32px -8px rgba(0,0,0,0.14)"},children:[(0,t.jsx)("p",{className:"px-3 pt-0.5 pb-1.5 text-[10px] font-bold uppercase tracking-[0.12em] text-gray-400 dark:text-zinc-500",children:"Blocked by (sibling subtask)"}),(0,t.jsx)("div",{className:"px-2.5 pb-1.5",children:(0,t.jsx)("input",{autoFocus:!0,t
2ype:"text",value:o,onChange:e=>a(e.target.value),placeholder:"Search subtasksâ¦",className:"w-full px-2.5 py-1.5 rounded-lg text-[12px] bg-transparent border focus:outline-none focus:ring-2 focus:ring-orange-300/40",style:{border:"1px solid var(--border-subtle)"}})}),(0,t.jsxs)("div",{className:"max-h-52 overflow-y-auto",children:[0===c.length&&(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500 text-center py-3",children:"No eligible siblings"}),c.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{n(e._id),i()},className:"w-full flex items-center gap-2 px-3 py-2 text-left text-[12px] font-medium text-gray-700 dark:text-zinc-300 hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:e.statusColor||"#c4c4c4"}}),(0,t.jsx)("span",{className:"truncate",children:e.title})]},e._id))]})]})}function et({taskId:e,subItemId:n,subItemTitle:i,teamMembers:c=[],onAfterRead:l}){let{data:u}=(0,o.useSession)(),[f,d]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),y=(0,r.useRef)(null),b=u?.user?._id?.toString?.(),m=(0,r.useCallback)(async()=>{try{let t=await fetch(`/api/tasks/${e}/subitems/${n}/comments`);if(!t.ok)return;let r=await t.json();d(r.messages||[])}catch{}finally{p(!0)}},[e,n]);async function g({text:t,mentions:r,creatorMentions:i,campaignMentions:o,organizationMentions:a,dealMentions:s,media:c}){if(t?.trim()||c?.length)try{if(!(await fetch(`/api/tasks/${e}/subitems/${n}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:t,mentions:r,creatorMentions:i,campaignMentions:o,organizationMentions:a,dealMentions:s,media:c})})).ok)throw Error("send_failed");await m(),l?.()}catch{G.default.error("Failed to send")}}return(0,r.useEffect)(()=>{let t=!1;return async function(){try{await fetch(`/api/tasks/${e}/subitems/${n}/read`,{method:"POST"})}catch{}t||(await m(),l?.())}(),()=>{t=!0}},[e,n,m,l]),(0,r.useEffect)(()=>{y.current&&f.length>0&&(y.current.scrollTop=y.current.scrollHeight)},[f]),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{ref:y,className:"flex flex-col gap-1.5 max-h-[320px] overflow-y-auto overscroll-contain pr-1",style:{scrollbarWidth:"thin"},children:[!h&&(0,t.jsx)("div",{className:"flex justify-center py-4",children:(0,t.jsx)("span",{className:"w-4 h-4 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"rgba(236,72,153,0.4)",borderTopColor:"transparent"}})}),h&&0===f.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center py-6 gap-2",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center",style:{background:"rgba(236,72,153,0.08)"},children:(0,t.jsx)("svg",{className:"w-5 h-5",style:{color:"#EC4899"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.
2123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})})}),(0,t.jsx)("p",{className:"text-[12px] font-medium text-gray-500 dark:text-zinc-400",children:"No messages yet â start the conversation"})]}),(0,t.jsx)(s.AnimatePresence,{initial:!1,children:h&&f.map((e,r)=>{let n=f[r-1],i=e.user?._id?.toString?.()===b||e.user?.toString?.()===b,o=n&&(n.user?._id?.toString?.()||n.user?.toString?.())===(e.user?._id?.toString?.()||e.user?.toString?.()),s=n?new Date(e.createdAt).getTime()-new Date(n.createdAt).getTime():1/0,c=o&&s<3e5,l=e.user?.name||"Unknown",u=l[0]?.toUpperCase()||"?",d=(0,B.getAvatarGradient)(l);return(0,t.jsxs)(a.motion.div,{initial:{opacity:0,y:8,scale:.97},animate:{opacity:1,y:0,scale:1},transition:{duration:.3,ease:[.25,.46,.45,.94]},className:`flex gap-2 ${i?"flex-row-reverse":""} ${c?"mt-1":"mt-3"}`,children:[(0,t.jsx)("div",{className:"w-7 flex-shrink-0",children:!c&&(0,t.jsx)("div",{className:`w-7 h-7 rounded-full bg-gradient-to-br ${d} flex items-center justify-center text-white text-[10px] font-bold shadow-sm`,children:u})}),(0,t.jsxs)("div",{className:`flex flex-col min-w-0 max-w-[78%] ${i?"items-end":"items-start"}`,children:[!c&&(0,t.jsxs)("div",{className:`flex items-baseline gap-1.5 mb-0.5 ${i?"flex-row-reverse":""}`,children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold text-gray-700 dark:text-zinc-300",children:i?"You":l}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return i<7?`${i}d ago`:new Date(e).toLocaleDateString()}(e.createdAt)})]}),(0,t.jsx)("div",{className:"px-3 py-1.5 rounded-2xl text-[13px] leading-[1.45] whitespace-pre-wrap break-words",style:i?{background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.12)",color:"var(--text-primary)",borderTopRightRadius:6}:{background:"var(--surface-softer)",border:"1px solid var(--surface-softer)",color:"var(--text-primary)",borderTopLeftRadius:6},children:e.text||""})]})]},e._id||r)})})]}),(0,t.jsxs)("div",{className:"group/composer relative mt-1",children:[(0,t.jsx)("div",{className:"absolute -inset-1 rounded-2xl opacity-0 blur-xl pointer-events-none transition-opacity duration-500 group-focus-within/composer:opacity-40",style:{background:"linear-gradient(135deg, rgba(236,72,153,0.4), rgba(249,115,22,0.4))"}}),(0,t.jsx)(A.default,{teamMembers:c,placeholder:`Reply on "${i}"â¦`,onSubmit:g})]})]})}function er({link:e}){let r="";try{r=new URL(e.url).hostname.replace("www.","")}catch{r=e.url}return(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg text-[11px] font-semibold text-blue-600 dark:text-blue-400 transition-colors hover:bg-blue-50 dark:hover:bg-blue-500/10 truncate max-w-full",style:{border:"1px solid rgba(59,130,246,0.18)",background:"rgba(59,130,246,0.05)"},children:[(0,t.jsx)(u.LinkIcon,{className:"w-3 h-3 flex-shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.label||r})]})}function en({subItem:e,parentTask:i,statusOptions:o=[],teamMembers:l=[],onClose:u,onParentTaskUpdate:f,onSubItemsUpdate:d,onUnreadRefresh:p,draft:y=!1,onCreate:b}){let m,g,[v,x]=(0,r.useState)(e||(y?Y:null)),[w,_]=(0,r.useState)(e?.title||""),[S,j]=(0,r.useState)(!!y),k=(0,r.useRef)({}),O=(0,r.useRef)(!1),[$,A]=(0,r.useState)(e?.description||""),[E,N]=(0,r.useState)(!1),[P,M]=(0,r.useState)(!1),[D,C]=(0,r.useState)(!1),B=(0,r.useRef)(null),[R,F]=(0,r.useState)(!1),[U,q]=(0,r.useState)(!1),V=i?._id,K=v?._id,H=!K;async function W(e){if(H){k.current={...k.current,...e};return}try{let t=await fetch(`/api/tasks/${V}/subitems`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemId:K,...e})});if(!t.ok)throw Error("patch_failed");let r=await t.json();if(Array.isArray(r.subItems)){let e=r.subItems.find(e=>(e._id?.toString?.()||e._id)===(K?.toString?.()||K));e&&x(e),d?.(r.subItems)}}catch{G.default.error("Failed to save")}}async function ea(e){if(!O.current&&b){O.current=!0;try{let t=await b({title:e,...k.current});t&&(k.current={},x(t),_(t.title||e),j(!1))}finally{O.current=!1}}}function es(){let e=w.replace(/\s*\n+\s*/g," ").trim();if(H){e&&ea(e);return}if(!e){_(v?.title||""),j(!1);return}e!==v?.title&&(x(t=>({...t,title:e})),W({title:e})),j(!1)}async function ec(e){q(!0);try{let t=await fetch(`/api/tasks/${V}/subitems/${K}/dependencies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blockerSubItemId:e})});if(!t.ok){let e=await t.json().catch(()=>({}));
2G.default.error(e.error||"Failed to add dependency");return}let r=await t.json();if(r.task){f?.(r.task);let e=(r.task.subItems||[]).find(e=>(e._id?.toString?.()||e._id)===(K?.toString?.()||K));e&&x(e)}}catch{G.default.error("Failed to add dependency")}finally{q(!1)}}async function el(e){q(!0);try{let t=await fetch(`/api/tasks/${V}/subitems/${K}/dependencies/${e}`,{method:"DELETE"});if(!t.ok){let e=await t.json().catch(()=>({}));G.default.error(e.error||"Failed to remove dependency");return}let r=await t.json();if(r.task){f?.(r.task);let e=(r.task.subItems||[]).find(e=>(e._id?.toString?.()||e._id)===(K?.toString?.()||K));e&&x(e)}}catch{G.default.error("Failed to remove dependency")}finally{q(!1)}}(0,r.useEffect)(()=>{e&&(x(e),_(e?.title||""),A(e?.description||""))},[e]),(0,r.useEffect)(()=>{function e(e){"Escape"===e.key&&(P||D||R||u())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,P,D,R]),(0,r.useEffect)(()=>{function e(e){B.current&&!B.current.contains(e.target)&&C(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let eu=new Set((v?.blockedBy||[]).map(e=>e?.toString?.()||e)),ef=new Set((v?.blocks||[]).map(e=>e?.toString?.()||e)),ed=(i?.subItems||[]).filter(e=>{let t=e._id?.toString?.()||e._id;return!(t===(K?.toString?.()||K)||eu.has(t)||ef.has(t))&&!e.completed});function eh(e){let t=e?.toString?.()||e,r=(i?.subItems||[]).find(e=>(e._id?.toString?.()||e._id)===t);return r?.title||`Subtask ${t.slice(-4)}`}if(!v)return null;let ep=(m=(v.assigner?._id||v.assigner)?.toString?.(),g=((v.assignees||[])[0]?._id||(v.assignees||[])[0])?.toString?.(),m&&g&&m===g)?null:v.assigner||null,ey=(0,t.jsx)(s.AnimatePresence,{children:(0,t.jsxs)(a.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.18},className:"fixed inset-0 z-[200] flex justify-end pointer-events-none",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm pointer-events-auto",onClick:u}),(0,t.jsxs)(a.motion.div,{initial:{x:"100%",scale:.98,opacity:0},animate:{x:0,scale:1,opacity:1},exit:{x:"100%",scale:.98,opacity:0},transition:{duration:.22,ease:[.25,.46,.45,.94]},className:"relative w-full sm:max-w-[520px] flex flex-col overflow-hidden pointer-events-auto",style:{height:"100dvh",background:"var(--surface-panel)",backdropFilter:"blur(28px)",boxShadow:"-20px 0 60px var(--border-default), -4px 0 20px var(--surface-softer)"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-pink-500/60 via-orange-400/60 to-violet-500/60 z-20"}),(0,t.jsx)("div",{className:"absolute top-0 left-0 bottom-0 w-[1.5px] opacity-65 pointer-events-none animate-gradient-shift z-20",style:{background:"linear-gradient(180deg, rgba(236,72,153,0.6), rgba(249,115,22,0.5), rgba(139,92,246,0.55), rgba(236,72,153,0.6))"}}),(0,t.jsx)("div",{className:"absolute -top-24 -right-24 w-64 h-64 rounded-full blur-3xl pointer-events-none animate-orb-drift-a",style:{background:"radial-gradient(circle, rgba(249,115,22,0.22), rgba(236,72,153,0.16) 55%, transparent 75%)",opacity:.75}}),(0,t.jsx)("div",{className:"absolute -bottom-32 -left-20 w-72 h-72 rounded-full blur-3xl pointer-events-none animate-orb-drift-b",style:{background:"radial-gradient(circle, rgba(139,92,246,0.18), rgba(59,130,246,0.12) 55%, transparent 75%)",opacity:.65}}),(0,t.jsxs)("div",{className:"flex-shrink-0 z-10 safe-area-pt",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",borderBottom:"1px solid var(--border-subtle)"},children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 pt-3 pb-3 sm:px-6 sm:pt-4",children:[(0,t.jsx)("button",{type:"button",onClick:u,"aria-label":"Close subtask detail",className:"flex-shrink-0 w-8 h-8 rounded-xl flex items-center justify-center transition-all duration-200 hover:scale-105 mt-0.5",style:{background:"var(--surface-soft)"},children:(0,t.jsx)(c.XMarkIcon,{className:"w-4 h-4 text-gray-500 dark:text-zinc-400"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[S||H?(0,t.jsx)("textarea",{autoFocus:!0,rows:1,cols:1,value:w,placeholder:H?"Name this sub-taskâ¦":void 0,onChange:e=>{_(e.target.value);let t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`},onKeyDown:e=>{if("Enter"!==e.key||e.shiftKey){if("Escape"===e.key){if(H)return;_(v?.title||""),j(!1)}}else e.preventDefault(),es()},onBlur:es,className:"w-full resize-none bg-transparent border-none focus:outline-none text-lg font-bold text-gray-900 dark:text-zinc-100 tracking-tight leading-tight placeholder-gray-300 dark:placeholder-zinc-600",style:{minHeight:28}}):(0,t.jsx)("h2",{role:"button",tabIndex:0,onClick:()=>j(!0),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),j(!0))},className:"text-lg font-bold text-gray-900 dark:text-zinc-100 tracking-tight leading-tight cursor-text hover:opacity-80 transition-opacity",children:v?.title||"Untitled subtask"}),H&&(0,t.jsx)("p",{className:"mt-1 text-[11px] text-gray-400 dark:text-zinc-500",children:"Not saved yet â naming it creates the sub-task. Close to discard."})]})]}),(0,t.jsx)("div",{className:"px-4 sm:px-6 pb-3",children:(0,t.jsxs)("button",{type:"button",onClick:u,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold transition-all duration-200 hover:scale-[1.02] hover:opacity-80",style:{background:"rgba(249,115,22,0.06)",border:"1px solid rgba(249,115,22,0.15)",color:"#EA580C"},title:"Go back to parent task",children:[(0,t.jsx)("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),(0,t.jsxs)("span",{className:"truncate max-w-[280px]",children:["Parent: ",i?.title||"Parent task"]})]})})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto","data-subitem-drawer-body":"true",children:(0,t.jsxs)("div",{className:"px-4 sm:px-6 py-4 flex flex-col gap-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] mb-2 block",children:"Status"}),(0,t.jsx)(ei,{status:v?.status,statusColor:v?.statusColor,statusOptions:o,onChange:function(e,t){x(r=>({...r,status:e,statusColor:t})),W({status:e,statusColor:t})}})]}),(0,t.jsx)("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-zinc-800 to-transparent"}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] flex items-center gap-1",children:[(0,t.jsx)(L.UserIcon,{className:"w-3 h-3",style:{color:"#F97316"}}),"Owner"]}
2),(0,t.jsxs)("div",{className:"relative flex items-center gap-2",children:[(v?.assignees||[]).length>0?(0,t.jsx)(I.default,{user:(v.assignees||[])[0],size:28,onClick:()=>M(e=>!e)}):(0,t.jsx)("button",{type:"button",onClick:()=>M(e=>!e),className:"w-7 h-7 rounded-full flex items-center justify-center transition-all duration-200 hover:scale-110 text-gray-400 dark:text-zinc-500",style:{background:"var(--surface-soft)",border:"1.5px dashed var(--border-default)"},title:"Assign an owner",children:(0,t.jsx)(L.UserIcon,{className:"w-3.5 h-3.5"})}),P&&(0,t.jsx)(Q,{teamMembers:l,currentOwner:(v?.assignees||[])[0],onSelect:function(e){x(t=>({...t,assignees:[e]})),W({assignees:[e._id||e]}),M(!1)},onClose:()=>M(!1)})]})]}),(0,t.jsx)("span",{className:"h-4 w-px bg-gray-200 dark:bg-zinc-800 self-end mb-1"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 relative",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] flex items-center gap-1",children:[(0,t.jsx)(h.CalendarDaysIcon,{className:"w-3 h-3"}),"Due"]}),(0,t.jsx)(X,{value:v?.dueDate,onChange:function(e){x(t=>({...t,dueDate:e})),W({dueDate:e})}})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(z.EyeIcon,{className:"w-3 h-3",style:{color:"#0EA5E9"}}),"People"]}),(0,t.jsxs)("div",{ref:B,className:"relative",children:[(0,t.jsx)(T.default,{collaborators:v?.collaborators||[],assigner:ep,onAdd:()=>C(e=>!e),onRemoveCollaborator:e=>{let t=(v?.collaborators||[]).filter(t=>(t._id||t).toString()!==e);x(e=>({...e,collaborators:t})),W({collaborators:t.map(e=>e._id||e)})},chipSize:28}),D&&(0,t.jsx)(Z,{teamMembers:l,selected:v?.collaborators||[],onToggle:function(e){let t=v?.collaborators||[],r=new Set(t.map(e=>(e._id||e).toString())),n=e._id.toString(),i=r.has(n)?t.filter(e=>(e._id||e).toString()!==n):[...t,e];x(e=>({...e,collaborators:i})),W({collaborators:i.map(e=>e._id||e)})},onClose:()=>C(!1)})]})]})]}),(0,t.jsx)("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-zinc-800 to-transparent"}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] mb-2 flex items-center gap-1.5",children:[(0,t.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),"Dependencies",U&&(0,t.jsx)("span",{className:"w-3 h-3 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"rgba(249,115,22,0.4)",borderTopColor:"transparent"}})]}),(v?.blockedBy||[]).length>0&&(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold text-gray-400 dark:text-zinc-500 mb-1.5",children:"Blocked by"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(v.blockedBy||[]).map(e=>{let r=e?.toString?.()||e;return(0,t.jsxs)("button",{type:"button",onClick:()=>el(r),disabled:U,title:"Click to remove this blocker",className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold transition-all duration-200 hover:scale-[0.97] group/dep disabled:opacity-50",style:{background:"rgba(239,68,68,0.08)",border:"1px solid rgba(239,68,68,0.2)",color:"#DC2626"},children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 flex-shrink-0"}),(0,t.jsx)("span",{className:"truncate max-w-[160px]",children:eh(r)}),(0,t.jsx)(c.XMarkIcon,{className:"w-3 h-3 flex-shrink-0 opacity-0 group-hover/dep:opacity-100 transition-opacity"})]},r)})})]}),(v?.blocks||[]).length>0&&(0,t.jsxs)("div",{className:"mb-2",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold text-gray-400 dark:text-zinc-500 mb-1.5",children:"Blocks"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(v.blocks||[]).map(e=>{let r=e?.toString?.()||e;return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[11px] font-semibold",style:{background:"rgba(245,158,11,0.08)",border:"1px solid rgba(245,158,11,0.2)",color:"#D97706"},children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 flex-shrink-0"}),(0,t.jsx)("span",{className:"truncate max-w-[160px]",children:eh(r)})]},r)})})]}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>F(e=>!e),disabled:H||U||0===ed.length,className:"flex items-center gap-1.5 text-[11px] font-semibold text-gray-400 dark:text-zinc-500 hover:text-orange-500 transition-colors duration-150 disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,t.jsx)(J.PlusIcon,{className:"w-3 h-3"}
2),H?"Name the sub-task to add dependencies":0===ed.length?"No siblings available":"Add dependency"]}),R&&(0,t.jsx)(ee,{siblings:ed,onAdd:ec,onClose:()=>F(!1)})]})]}),(0,t.jsx)("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-zinc-800 to-transparent"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] mb-2 block",children:"Description"}),E?(0,t.jsx)("textarea",{autoFocus:!0,value:$,onChange:e=>A(e.target.value),onBlur:function(){(v?.description||"")!==$&&W({description:$}),N(!1)},onKeyDown:e=>{"Escape"===e.key&&(A(v?.description||""),N(!1))},placeholder:"Add a descriptionâ¦",rows:4,className:"w-full resize-none rounded-xl px-3 py-2.5 text-sm text-gray-800 dark:text-zinc-200 bg-transparent focus:outline-none focus:ring-2 focus:ring-orange-300/40 placeholder-gray-300 dark:placeholder-zinc-600",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"}}):(0,t.jsx)("div",{role:"button",tabIndex:0,onClick:()=>N(!0),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),N(!0))},className:"rounded-xl px-3 py-2.5 text-sm cursor-text transition-colors min-h-[40px]",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)",color:$?"var(--text-primary)":"var(--text-label)"},children:$||"Add a descriptionâ¦"})]}),((v?.links||[]).length>0||(v?.media||[]).length>0)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-zinc-800 to-transparent"}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(v?.links||[]).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] mb-2 block",children:"Links"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(v.links||[]).map((e,r)=>(0,t.jsx)(er,{link:e},r))})]}),(v?.media||[]).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] mb-2 block",children:"Attachments"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:(v.media||[]).map((e,r)=>(0,t.jsx)(eo,{media:e},r))})]})]})]}),(0,t.jsx)("div",{className:"h-px bg-gradient-to-r from-transparent via-gray-200 dark:via-zinc-800 to-transparent"}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] mb-3 flex items-center gap-1.5",children:[(0,t.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Comments"]}),H?(0,t.jsx)("p",{className:"text-[12px] text-gray-400 dark:text-zinc-500",children:"Comments open once the sub-task has a name."}):(0,t.jsx)(et,{taskId:V,subItemId:K,subItemTitle:v?.title||"Subtask",teamMembers:l,onAfterRead:p})]}),(0,t.jsx)("div",{className:"safe-area-pb h-4"})]})})]})]},"subitem-drawer")});return(0,n.createPortal)(ey,document.body)}function ei({status:e,statusColor:n,statusOptions:i=[],onChange:o}){let[c,l]=(0,r.useState)(!1),u=(0,r.useRef)(null),f=(0,r.useRef)(!1);(0,r.useEffect)(()=>{f.current=c},[c]),(0,r.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&l(!1)}function t(e){"Escape"===e.key&&f.current&&(e.stopImmediatePropagation(),l(!1))}return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[]);let d=n||"#c4c4c4";return(0,t.jsxs)("div",{ref:u,className:"relative inline-block",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>l(e=>!e),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold tracking-wide transition-all duration-200 hover:scale-[1.02] hover:shadow-sm",style:{background:`${d}14`,border:`1px solid ${d}33`,color:d},children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:d}}),e||"No status",(0,t.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 opacity-60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,t.jsx)(s.AnimatePresence,{children:c&&(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:-4,scale:.97}
2,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.97},transition:{duration:.14,ease:[.25,.46,.45,.94]},className:"absolute z-50 mt-1.5 left-0 rounded-xl py-1.5 min-w-[180px] overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 32px -8px rgba(0,0,0,0.14)"},children:i.map(r=>{let n=r.color||"#c4c4c4",i=r.label===e;return(0,t.jsxs)("button",{type:"button",onClick:()=>{o(r.label,r.color),l(!1)},className:"w-full flex items-center gap-2.5 px-3 py-2 text-left text-[12px] font-medium transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04]",style:{color:i?n:"var(--text-secondary)"},children:[(0,t.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:n}}),r.label,i&&(0,t.jsx)(q.CheckIcon,{className:"w-3.5 h-3.5 ml-auto flex-shrink-0",style:{color:n}})]},r.label)})})})]})}function eo({media:e}){let r="image"===e.type||"gif"===e.type||e.mimeType?.startsWith("image/"),n="video"===e.type||e.mimeType?.startsWith("video/"),i=r?(0,t.jsx)("img",{src:e.url,alt:e.name||"Screenshot",className:"w-16 h-16 object-cover",loading:"lazy"}):n?(0,t.jsx)("video",{src:e.url,className:"w-16 h-16 object-cover",muted:!0,playsInline:!0,preload:"metadata"}):(0,t.jsxs)("div",{className:"w-16 h-16 flex flex-col items-center justify-center px-1 text-center",style:{background:"rgba(139,92,246,0.06)"},children:[(0,t.jsx)(b.PhotoIcon,{className:"w-5 h-5 text-violet-500"}),(0,t.jsx)("span",{className:"text-[8px] font-bold text-violet-700 dark:text-violet-300 truncate w-full mt-0.5",children:e.name||"File"})]});return(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"relative rounded-lg overflow-hidden block",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-panel)"},onClick:e=>e.stopPropagation(),children:i})}let ea=["social-scout"];function es(e){return Array.from(e||[]).filter(e=>e.type?.startsWith("image/")||e.type?.startsWith("video/")||"application/pdf"===e.type)}async function ec(e){let t=await Promise.all(e.map(async e=>{try{let t=new FormData;t.append("file",e);let r=await fetch("/api/tasks/upload-attachment",{method:"POST",body:t});if(!r.ok){let t=await r.json().catch(()=>null);return{error:t?.error||`HTTP ${r.status}`,file:e}}return await r.json()}catch(t){return{error:t?.message||"Network error",file:e}}})),r=t.filter(e=>e&&!e.error),n=t.filter(e=>e?.error);if(0===r.length){let e=n[0]?.error||"Unknown error",t=n[0]?.file?.name?` (${n[0].file.name})`:"";G.default.error(`Upload failed${t}: ${e}`)}else n.length>0&&G.default.error(`${n.length} file(s) failed: ${n[0].error}`);return r}function el(e){return["users","creators","campaigns","organizations","deals"].map(t=>(e?.[t]||[]).map(e=>String(e?._id||e)).sort().join(",")).join("|")}let eu=["details","comments","activity","links"],ef="taskTab";function ed(e){let t=new URL(window.location.href);(e||null)!==t.searchParams.get(ef)&&(e?t.searchParams.set(ef,e):t.searchParams.delete(ef),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}function eh({task:e,onUpdate:n}){let[i,o]=(0,r.useState)(!1),[l,f]=(0,r.useState)(""),[d,h]=(0,r.useState)(""),p=e.links||[];function y(){let e=d.trim();if(!e)return;let t=/^https?:\/\//i.test(e)?e:`https://${e}`;n([...p,{label:l.trim()||t,url:t}]),f(""),h(""),o(!1)}return(0,t.jsxs)(a.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3},className:"space-y-3",children:[(0,t.jsx)("div",{className:"space-y-2",children:p.map((e,r)=>(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl transition-all duration-200 hover:shadow-sm group",style:{background:"rgba(99,102,241,0.04)",border:"1px solid rgba(99,102,241,0.08)"},children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 flex items-center gap-3 min-w-0",children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(99,102,241,0.1)"},children:(0,t.jsx)(u.LinkIcon,{className:"w-4 h-4 text-violet-500"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm text-violet-600 font-medium truncate group-hover:underline",children:e.label||e.url}),e.label&&e.label!==e.url&&(0,t.jsx)("div",{className:"text-[11px] text-gray-400 dark:text-zinc-500 truncate",children:e.url})]})]}),(0,t.jsx)("button",{onClick:()=>{n(p.filter((e,t)=>
2t!==r))},className:"opacity-100 sm:opacity-0 sm:group-hover:opacity-100 text-gray-300 dark:text-zinc-700 hover:text-red-400 transition-all flex-shrink-0 p-1 -m-1",title:"Remove link","aria-label":"Remove link",children:(0,t.jsx)(c.XMarkIcon,{className:"w-4 h-4"})})]},r))}),(0,t.jsx)(s.AnimatePresence,{mode:"wait",children:i?(0,t.jsxs)(a.motion.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:{duration:.18},className:"rounded-xl p-3.5 space-y-2",style:{background:"linear-gradient(135deg, rgba(99,102,241,0.04), rgba(168,85,247,0.04))",border:"1px solid rgba(99,102,241,0.18)"},children:[(0,t.jsx)("input",{autoFocus:!0,value:l,onChange:e=>f(e.target.value),placeholder:"Label (optional) â e.g. Brief doc",className:"w-full text-sm px-3 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-violet-300/50 transition-all",style:{background:"var(--surface-frosted)",border:"1px solid var(--border-subtle)"}}),(0,t.jsx)("input",{value:d,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&y(),"Escape"===e.key&&(o(!1),f(""),h(""))},placeholder:"https://...",className:"w-full text-sm px-3 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-violet-300/50 transition-all",style:{background:"var(--surface-frosted)",border:"1px solid var(--border-subtle)"}}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-1",children:[(0,t.jsx)("button",{onClick:()=>{o(!1),f(""),h("")},className:"text-xs font-semibold px-3 py-1.5 rounded-lg text-gray-500 dark:text-zinc-400 hover:bg-gray-100/60 dark:hover:bg-zinc-900/60 transition-colors",children:"Cancel"}),(0,t.jsx)("button",{onClick:y,disabled:!d.trim(),className:"text-xs font-bold px-4 py-1.5 text-white rounded-lg disabled:opacity-40 transition-all duration-200 hover:shadow-md",style:{background:"linear-gradient(135deg, #6366F1, #A855F7)",boxShadow:"0 2px 8px rgba(168,85,247,0.25)"},children:"Add link"})]})]},"form"):(0,t.jsxs)(a.motion.button,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},onClick:()=>o(!0),className:"w-full px-4 py-3 rounded-xl flex items-center gap-2.5 text-xs font-semibold transition-all duration-200 hover:shadow-sm group",style:{background:"rgba(99,102,241,0.04)",border:"1.5px dashed rgba(99,102,241,0.25)",color:"#6366F1"},children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all duration-200 group-hover:rotate-90",style:{background:"rgba(99,102,241,0.12)"},children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5 text-violet-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M12 4v16m8-8H4"})})}),"Add a link",(0,t.jsx)("span",{className:"ml-auto text-[10px] text-gray-400 dark:text-zinc-500 font-medium",children:"Brief, asset, doc, anything"})]},"cta")}),0===p.length&&!i&&(0,t.jsx)("p",{className:"text-[11px] text-gray-300 dark:text-zinc-700 text-center pt-1 italic",children:"No links yet"})]})}function ep({subItems:e,onReorder:r,children:n}){let i=(0,_.useSensors)((0,_.useSensor)(_.PointerSensor,{activationConstraint:{distance:5}})),o=(e||[]).map(e=>e._id);return(0,t.jsx)(_.DndContext,{sensors:i,collisionDetection:_.closestCenter,onDragEnd:e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;let i=o.indexOf(t.id),a=o.indexOf(n.id);if(-1===i||-1===a)return;let s=(0,S.arrayMove)(o,i,a);r?.(s)},children:(0,t.jsx)(S.SortableContext,{items:o,strategy:S.verticalListSortingStrategy,children:(0,t.jsx)("div",{className:"space-y-1",children:n})})})}function ey({sub:e,task:n,highlighted:i,teamMembers:o=[],onToggle:l,onDelete:d,onJumpHere:h,onComment:p,onAttach:b,onRemoveMedia:w,onEdit:_,onOpenDetail:O}){let A=(0,r.useRef)(null),E=(0,r.useRef)(null),[N,P]=(0,r.useState)(!1),[M,D]=(0,r.useState)(e.title||""),[I,T]=(0,r.useState)(!1),[C,B]=(0,r.useState)(e.description||""),{attributes:R,listeners:L,setNodeRef:z,transform:F,transition:U,isDragging:q}=(0,S.useSortable)({id:e._id}),V={transform:j.CSS.Transform.toString(F),transition:U,opacity:q?.55:1,zIndex:q?5:"auto"};function K(){let t=M.replace(/\s*\n+\s*/g," ").trim();if(!t){D(e.title||""),P(!1);return}t!==e.title&&_?.({title:t}),P(!1)}function H(){(e.description||"")!==C&&_?.({description:C})}return(0,r.useEffect)(()=>{N||D(e.title||"")},[e.title,N]),(0,r.useEffect)(()=>{B(e.description||"")},[e.description]),(0,t.jsxs)("div",{ref:z,style:{...V,background:"var(--surface-soft)"},"data-subitem-id":e._id,...R,onPaste:function(e){let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of t)if("file"===e.kind){let t=e.getAsFile();t&&t.type?.startsWith("image/")&&r.push(t)}0!==r.length&&(e.preventDefault(),b?.(r))},className:`flex flex-col gap-2 group py-2 px-3 rounded-xl transition-all duration-300 hover:shadow-sm ${i?"ring-2 ring-orange-400/60 ring-offset-2 ring-offset-transparent shadow-lg shadow-orange-400/20":""}`,children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("button",{type:"button",...L,className:"text-gray-300 dark:text-zinc-700 hover:text-gray-500 dark:hover:text-zinc-400 cursor-grab active:cursor-grabbing flex-shrink-0 transition-colors",title:"Drag to reorder","aria-label":"Drag to reorder",children:(0,t.jsx)(g.Bars3Icon,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:l,className:"w-[18px] h-[18px] rounded-md border-2 flex-shrink-0 flex items-center justify-center transition-all duration-300",style:e.completed?{borderColor:"#10B981",background:"#10B981",boxShadow:"0 0 8px rgba(16,185,129,0.3)"}:{borderColor:"var(--border-default)"},"aria-label":e.completed?"Mark incomplete":"Mark complete",children:e.completed&&(0,t.jsx)("svg",{className:"w-2.5 h-2.5 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})}),N?(0,t.jsx)("textarea",{ref:E,autoFocus:!0,rows:1,cols:1,value:M,onChange:e=>{D(e.target.value);let t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`},onKeyDown:t=>{"Enter"!==t.key||t.shiftKey?"Escape"===t.key&&(D(e.title||""),P(!1)):(t.preventDefault(),K())},onBlur:K,onFocus:e=>{let t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`,t.setSelectionRange(t.value.length,t.value.length)},className:"text-sm flex-1 min-w-0 bg-transparent border-b border-orange-300/50 focus:border-orange-400 focus:outline-none text-gray-800 dark:text-zinc-100 pb-0.5 resize-none leading-snug overflow-hidden whitespace-pre-wrap break-all"}):(0,t.jsx)("button",{type:"button",onClick:()=>{O?O():h?.()},onDoubleClick:e=>{e.preventDefault(),P(!0)},className:`text-sm flex-1 min-w-0 text-left transition-all duration-200 whitespace-normal break-all leading-snug ${e.completed?"text-gray-400 dark:text-zinc-500 line-through":"text-gray-700 dark:text-zinc-300 hover:text-gray-900 dark:hover:text-zinc-100"}`,title:O?"Click to open subtask detail":"Click to jump · double-click to edit",children:e.title}),(0,t.jsx)("input",{ref:A,type:"file",accept:"image/*,video/*,application/pdf",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&(b?.(e.target.files),e.target.value="")}}),(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)($.default,{value:e.assignees||[],teamMembers:o,compact:!0,onChange:e=>_?.({assignees:(e||[]).map(e=>e?._id||e)})})}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 opacity-100 transition-opacity duration-200",children:[(0,t.jsx)("button",{type:"button",onClick:()=>T(e=>!e),className:`p-1 rounded-md transition-colors ${e.description?"text-orange-500 hover:bg-orange-50 dark:hover:bg-orange-500/10":"text-gray-400 dark:text-zinc-500 hover:text-orange-500 hover:bg-orange-50 dark:hover:bg-orange-500/10"}`,title:I?"Hide details":"Show details","aria-label":"Toggle description","aria-expanded":I,children:I?(0,t.jsx)(v.ChevronDownIcon,{className:"w-3.5 h-3.5"}):(0,t.jsx)(x.ChevronRightIcon,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>P(!0),className:"text-gray-400 dark:text-zinc-500 hover:text-emerald-500 transition-colors p-1 rounded-md hover:bg-emerald-50 dark:hover:bg-emerald-500/10",title:"Edit title","aria-label":"Edit title",children:(0,t.jsx)(m.PencilIcon,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>A.current?.click(),className:"text-gray-400 dark:text-zinc-500 hover:text-violet-500 transition-colors p-1 rounded-md hover:bg-violet-50 dark:hover:bg-violet-500/10",title:"Attach a screenshot or file","aria-label":"Attach screenshot",children:(0,t.jsx)(y.PaperClipIcon,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:function(){try{let t=(0,k.buildTaskLink)(n,{subItemId:e._id}),r=window.location.origin,i=`${r}${t}`;"u">typeof navigator&&navigator.clipboard?(navigator.clipboard.writeText(i),G.default.success("Subtask link copied")):G.default.success(i)}catch{G.default.error("Couldn't copy link")}},className:"text-gray-400 dark:text-zinc-500 hover:text-indigo-500 transition-colors p-1 rounded-md hover:bg-indigo-50 dark:hover:bg-indigo-500/10",title:"Copy share link","aria-label":"Copy link to this subtask",children:(0,t.jsx)(u.LinkIcon,{className:"w-3.5 h-3.5"})}),p&&(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),p()},className:"text-gray-400 dark:text-zinc-500 hover:text-pink-500 transition-colors p-1 rounded-md hover:bg-pink-50 dark:hover:bg-pink-500/10",title:"Comment on this subtask","aria-label":"Comment on this subtask",children:(0,t.jsx)(f.ChatBubbleLeftIcon,{className:"w-3.5 h-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),d?.()},className:"text-gray-400 dark:text-zinc-500 hover:text-red-500 transition-all duration-200 p-1 rounded-md hover:bg-red-50 dark:hover:bg-red-500/10",title:"Delete subtask","aria-label":"Delete subtask",children:(0,t.jsx)(c.XMarkIcon,{className:"w-4 h-4"})})]})]}),(0,t.jsx)(s.AnimatePresence,{initial:!1,mode:"wait",children:I?(0,t.jsx)(a.motion.div,{initial:{opacity:0,height:0}
2,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:[.25,.46,.45,.94]},className:"ml-7 overflow-hidden",children:(0,t.jsx)("textarea",{autoFocus:!0,value:C,onChange:e=>B(e.target.value),onBlur:H,onKeyDown:t=>{"Enter"!==t.key||t.shiftKey||t.metaKey||t.ctrlKey?"Escape"===t.key&&(t.preventDefault(),B(e.description||""),T(!1)):(t.preventDefault(),H(),T(!1))},placeholder:"Add details, context, or notes⦠(Enter to save, Shift+Enter for new line)",rows:Math.max(2,Math.min(6,C.split("\n").length)),className:"w-full text-[13px] leading-relaxed text-gray-700 dark:text-zinc-300 placeholder-gray-300 dark:placeholder-zinc-500 bg-transparent rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-orange-300/40 transition-all",style:{background:"var(--surface-frosted)",border:"1px solid var(--border-subtle)",resize:"vertical",minHeight:56}})},"editor"):e.description?(0,t.jsx)(a.motion.button,{type:"button",initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:[.25,.46,.45,.94]},onClick:()=>T(!0),className:"ml-7 text-left text-[12.5px] leading-relaxed text-gray-600 dark:text-zinc-400 whitespace-pre-wrap rounded-md px-2 py-1.5 hover:bg-orange-50/40 dark:hover:bg-orange-500/5 transition-colors",title:"Click to edit",children:e.description},"preview"):null}),e.media?.length>0&&(0,t.jsx)("div",{className:"ml-7 flex flex-wrap gap-2",children:e.media.map((e,r)=>(0,t.jsx)(em,{media:e,onRemove:()=>w?.(r)},`${e.url}-${r}`))}),e.links?.length>0&&(0,t.jsx)("div",{className:"ml-7 flex flex-wrap gap-1.5",children:e.links.filter(e=>e?.url).map((e,r)=>(0,t.jsx)(eb,{link:e},`${e.url}-${r}`))})]})}function eb({link:e}){let r=e.label?.trim();if(!r)try{r=new URL(e.url).hostname.replace(/^www\./,"")}catch{r=e.url}return(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"inline-flex items-center gap-1 pl-1.5 pr-2 py-0.5 rounded-full text-[11px] font-semibold transition-all hover:shadow-sm hover:-translate-y-0.5",style:{background:"rgba(99,102,241,0.08)",border:"1px solid rgba(99,102,241,0.22)",color:"#4F46E5"},title:e.url,children:[(0,t.jsx)(u.LinkIcon,{className:"w-3 h-3"}),(0,t.jsx)("span",{className:"truncate max-w-[200px]",children:r})]})}function em({media:e,onRemove:n}){let i="image"===e.type||"gif"===e.type||e.mimeType?.startsWith("image/"),o="video"===e.type||e.mimeType?.startsWith("video/"),[a,s]=(0,r.useState)(!1),l=i||o,u=(0,t.jsx)(t.Fragment,{children:i?(0,t.jsx)("img",{src:e.url,alt:e.name||"Screenshot",className:"w-20 h-20 object-cover",loading:"lazy"}):o?(0,t.jsx)("video",{src:e.url,className:"w-20 h-20 object-cover",muted:!0,playsInline:!0,preload:"metadata"}):(0,t.jsxs)("div",{className:"w-20 h-20 flex flex-col items-center justify-center px-1 text-center",style:{background:"rgba(139,92,246,0.06)"},children:[(0,t.jsx)(b.PhotoIcon,{className:"w-5 h-5 text-violet-500"}),(0,t.jsx)("span",{className:"text-[8px] font-bold text-violet-700 dark:text-violet-300 truncate w-full mt-1",children:e.name||"File"})]})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative group/chip rounded-lg overflow-hidden",style:{border:"1px solid var(--border-subtle)",background:"var(--surface-panel)"},children:[l?(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s(!0)},className:"block cursor-zoom-in","aria-label":`Preview ${e.name||(o?"video":"image")}`,children:u}):(0,t.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"block",onClick:e=>e.stopPropagation(),children:u}),(0,t.jsx)("button",{type:"button",onClick:n,className:"absolute top-0.5 right-0.5 w-5 h-5 rounded-full flex items-center justify-center opacity-0 group-hover/chip:opacity-100 transition-opacity",style:{background:"var(--overlay-scrim-strong)",color:"white"},title:"Remove attachment","aria-label":"Remove attachment",children:(0,t.jsx)(c.XMarkIcon,{className:"w-3 h-3"})})]}),a&&(0,t.jsx)(eg,{media:e,isVideo:o,onClose:()=>s(!1)})]})}function eg({media:e,isVideo:i,onClose:o}){return((0,r.useEffect)(()=>{function e(e){"Escape"===e.key&&o()}document.addEventListener("keydown",e);let t=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=t}},[o]),"u"<typeof document)?null:(0,n.createPortal)((0,t.jsxs)(a.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.18,ease:[.25,.46,.45,.94]},className:"fixed inset-0 z-[10000] flex items-center justify-center p-6",style:{background:"var(--lightbox-scrim)",backdropFilter:"blur(6px)"},onClick:o,role:"dialog","aria-modal":"true",children:[(0,t.jsxs)("div",{className:"absolute top-3 right-3 flex items-center gap-1.5",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 rounded-lg text-[11px] font-semibold text-white/90 dark:text-white/90 hover:text-white hover:bg-white/10 transition-colors flex items-center gap-1.5",title:"Open in new tab",children:[(0,t.jsx)(u.LinkIcon,{className:"w-3.5 h-3.5"}),"Open in tab"]}),(0,t.jsx)("button",{type:"button",onClick:o,"aria-label":"Close preview",className:"w-9 h-9 rounded-lg flex items-center justify-center text-white/90 dark:text-white/90 hover:text-white hover:bg-white/10 transition-colors",children:(0,t.jsx)(c.XMarkIcon,{className:"w-5 h-5"})})]}),(0,t.jsx)(a.motion.div,{initial:{scale:.96,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.96,opacity:0},transition:{duration:.22,ease:[.25,.46,.45,.94]},className:"max-w-full max-h-full flex items-center justify-center",onClick:e=>e.stopPropagation(),children:i?(0,t.jsx)("video",{src:e.url,controls:!0,autoPlay:!0,className:"max-w-[92vw] max-h-[88vh] rounded-xl shadow-2xl"}):(0,t.jsx)("img",{src:e.url,alt:e.name||"Preview",className:"max-w-[92vw] max-h-[88vh] rounded-xl shadow-2xl object-contain"})}),e.name&&(0,t.jsx)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 px-3 py-1.5 rounded-full text-[11px] font-semibold text-white/85 dark:text-white/85",style:{background:"var(--lightbox-scrim-soft)"},children:e.name})]}),document.body)}function ev({value:e,onChange:n}){let[i,o]=(0,r.useState)(!1),a=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){a.current&&!a.current.contains(e.target)&&o(!1)}},[i]);let s=e&&new Date(e)<new Date&&new Date(e).toDateString()!==new Date().toDateString(),c=e&&new Date(e).toDateString()===new Date().toDateString(),l=e?new Date(e).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):null;return(0,t.jsxs)("div",{className:"relative",ref:a,children:[(0,t.jsxs)("button",{type:"button",onClick:function(){o(e=>!e)},className:l?"relative flex items-center gap-1 px-2 py-0.5 rounded-md text-[11px] font-semibold transition-all duration-200 hover:shadow-sm hover:scale-[1.02] active:scale-[0.98] whitespace-nowrap":"relative flex items-center gap-1 text-xs text-gray-400 dark:text-zinc-500 hover:text-gray-600 dark:hover:text-zinc-300 transition-colors duration-150",style:(s?{background:"rgba(239,68,68,0.08)",color:"#DC2626",border:"1px solid rgba(239,68,68,0.15)"}:c?{background:"rgba(245,158,11,0.08)",color:"#D97706",border:"1px solid rgba(245,158,11,0.15)"}:l?{background:"var(--surface-soft)",color:"var(--text-tertiary)",border:"1px solid transparent"}:null)||void 0,title:l?`Due ${l} â click to change`:"Set due date",children:[s&&(0,t.jsxs)("span",{className:"flex h-1.5 w-1.5 flex-shrink-0",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-1.5 w-1.5 rounded-full bg-red-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-red-500"})]}),!l&&(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),(0,t.jsx)("span",{children:l||"Add due date"})]}),i&&(0,t.jsxs)("div",{className:"absolute left-0 top-full mt-1.5 z-50 flex items-center gap-2 rounded-xl p-2 shadow-lg",style:{background:"var(--surface-panel)",border:"1px solid var(--border-subtle)",backdropFilter:"blur(16px)"},children:[(0,t.jsx)("input",{type:"date",autoFocus:!0,value:(0,W.toInputDate)(e),onChange:e=>{n((0,W.fromInputDate)(e.target.value)),o(!1)},className:"text-[12px] px-2 py-1 rounded-md focus:outline-none text-gray-800 dark:text-zinc-200",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)",colorScheme:"light dark"}}),e&&(0,t.jsx)("button",{type:"button",onClick:()=>{n(null),o(!1)},className:"text-[11px] font-semibold text-red-500 hover:text-red-600 whitespace-nowrap",children:"Clear"})]})]})}function ex({teamMembers:e=[],currentOwner:n,onSelect:i,onClose:o}){let[a,s]=(0,r.useState)(""),c=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){c.current&&!c.current.contains(e.target)&&o()}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]);let l=e.filter(e=>e.name?.toLowerCase().includes(a.toLowerCase())||e.email?.toLowerCase().includes(a.toLowerCase()));return(0,t.jsxs)("div",{ref:c,className:"absolute z-50 mt-1.5 left-0 rounded-xl py-2 w-72",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 12px 40px var(--shadow-ambient-lg), 0 2px 8px var(--border-subtle)",border:"1px solid var(--border-default)"},children:[(0,t.jsx)("div",{className:"px-3 pb-2",children:(0,t.jsx)("input",{autoFocus:!0,t
2ype:"text",placeholder:"Find a teammateâ¦",value:a,onChange:e=>s(e.target.value),className:"w-full text-xs px-3 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})}),(0,t.jsxs)("div",{className:"max-h-56 overflow-y-auto",children:[l.map(e=>{let r=n?._id?.toString()===e._id?.toString();return(0,t.jsxs)("button",{onClick:()=>i(e),className:"w-full px-3 py-2 flex items-center gap-2.5 hover:bg-gray-50/80 dark:hover:bg-zinc-900/80 text-xs transition-colors duration-150",children:[(0,t.jsx)(I.default,{user:e,size:28}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsx)("div",{className:"text-gray-700 dark:text-zinc-300 font-medium truncate",children:e.name}),e.email&&(0,t.jsx)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500 truncate",children:e.email})]}),r&&(0,t.jsx)("div",{className:"ml-auto flex-shrink-0 w-5 h-5 rounded-full bg-emerald-500 flex items-center justify-center shadow-sm",children:(0,t.jsx)("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},e._id)}),0===l.length&&(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 dark:text-zinc-500 text-center",children:a?"No teammates match":"No teammates"})]})]})}function ew({teamMembers:e=[],selected:n=[],onToggle:i,onClose:o,onTeamResolve:a}){let[s,c]=(0,r.useState)(""),l=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){l.current&&!l.current.contains(e.target)&&o()}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]);let u=new Set((n||[]).map(e=>(e._id||e).toString())),f=e.filter(e=>e.name?.toLowerCase().includes(s.toLowerCase())||e.email?.toLowerCase().includes(s.toLowerCase()));return(0,t.jsxs)("div",{ref:l,className:"absolute z-50 mt-1.5 left-0 rounded-xl py-2 w-72",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 12px 40px var(--shadow-ambient-lg), 0 2px 8px var(--border-subtle)",border:"1px solid var(--border-default)"},children:[(0,t.jsx)("div",{className:"px-3 pb-2",children:(0,t.jsx)("input",{autoFocus:!0,t
2ype:"text",placeholder:"Search teamâ¦",value:s,onChange:e=>c(e.target.value),className:"w-full text-xs px-3 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})}),(0,t.jsxs)("div",{className:"max-h-56 overflow-y-auto",children:[f.map(e=>{let r=u.has(e._id.toString());return(0,t.jsxs)("button",{onClick:()=>i(e),className:"w-full px-3 py-2 flex items-center gap-2.5 hover:bg-gray-50/80 dark:hover:bg-zinc-900/80 text-xs transition-colors duration-150",children:[(0,t.jsx)(I.default,{user:e,size:28}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsx)("div",{className:"text-gray-700 dark:text-zinc-300 font-medium truncate",children:e.name}),e.email&&(0,t.jsx)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500 truncate",children:e.email})]}),r&&(0,t.jsx)("div",{className:"ml-auto flex-shrink-0 w-5 h-5 rounded-full bg-emerald-500 flex items-center justify-center shadow-sm",children:(0,t.jsx)("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},e._id)}),0===f.length&&(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 dark:text-zinc-500 text-center",children:s?"No teammates match":"No teammates"})]}),a&&(0,t.jsxs)("div",{className:"border-t mt-1 px-3 pt-2 pb-2 flex items-center justify-between",style:{borderColor:"var(--border-subtle)"},children:[(0,t.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-[0.12em] text-gray-400 dark:text-zinc-500",children:"Or add by team"}),(0,t.jsx)(E.default,{accent:"#6366F1",buttonLabel:"Add a team",onResolve:a})]})]})}function e_({task:e,onUpdated:n}){let[i,o]=(0,r.useState)(!1),[a,s]=(0,r.useState)(""),[l,f]=(0,r.useState)([]),[d,h]=(0,r.useState)(!1),[p,y]=(0,r.useState)([]),[b,m]=(0,r.useState)(!1),[g,v]=(0,r.useState)(!1),x=e.blockedBy||[],w=e.blocks||[],_="object"==typeof e.board?e.board?._id?.toString():e.board?.toString();(0,r.useEffect)(()=>{if(!i){s(""),y([]);return}if(!_)return;let e=!1;return h(!0),fetch(`/api/tasks?limit=50&excludeStatuses=Done,Complete&board=${_}`).then(e=>e.ok?e.json():null).then(t=>{e||f(t?.tasks||[])}).finally(()=>{e||h(!1)}),()=>{e=!0}},[i,_]),(0,r.useEffect)(()=>{if(!i||!_)return;let e=a.trim();if(e.length<2)return void y([]);let t=!1;m(!0);let r=setTimeout(()=>{fetch(`/api/tasks?query=${encodeURIComponent(e)}&limit=20&excludeStatuses=Done,Complete&board=${_}`).then(e=>e.ok?e.json():null).then(e=>{t||y(e?.tasks||[])}).finally(()=>{t||m(!1)})},200);return()=>{t=!0,clearTimeout(r)}},[i,a,_]);let S=(()=>{let t=e._id?.toString(),r=new Set(x.map(e=>(e._id||e)?.toString())),n=a.trim().toLowerCase(),i=e=>{let n=e._id?.toString();if(!n||n===t||r.has(n))return!0;let i=(e.status||"").toLowerCase();return"done"===i||"complete"===i},o=e=>!n||(e.title||"").toLowerCase().includes(n),s=new Set,c=[];for(let e of l){if(i(e)||!o(e))continue;let t=e._id?.toString();s.has(t)||(s.add(t),c.push(e))}for(let e of p){if(i(e))continue;let t=e._id?.toString();s.has(t)||(s.add(t),c.push(e))}return c.slice(0,50)})();async function j(t){if(!g){v(!0);try{let r=await fetch(`/api/tasks/${e._id}/dependencies`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({relation:"blockedBy",taskId:t._id})});if(r.ok){let e=await r.json();n?.(e.task),s(""),y([]),G.default.success("Dependency added")}else{let e="Couldn't add dependency";try{let t=await r.json();t?.error&&(e=t.error)}catch{}G.default.error(e)}}catch{G.default.error("Couldn't add dependency")}finally{v(!1)}}}async function k(t){if(!g){v(!0);try{let r=await fetch(`/api/tasks/${e._id}/dependencies`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({relation:"blockedBy",taskId:t})});if(r.ok){let e=await r.json();n?.(e.task)}}finally{v(!1)}}}function O(r){let n="Done"===r.status||"Complete"===r.status,i="object"==typeof r.board?r.board?._id?.toString?.():r.board?.toString?.(),o="object"==typeof e.board?e.board?._id?.toString?.():e.board?.toString?.(),a="object"==typeof r.board?r.board?.name:null;return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-lg text-[11px] font-semibold",style:{background:n?"rgba(16,185,129,0.08)":"rgba(239,68,68,0.08)",color:n?"#10B981":"#DC2626",border:n?"1px solid rgba(16,185,129,0.2)":"1px solid rgba(239,68,68,0.2)"},children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:n?"#10B981":"#DC2626"}}),r.title,i&&o&&i!==o&&a&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-wider px-1 py-0.5 rounded",style:{background:"rgba(99,102,241,0.12)",color:"#4F46E5",border:"1px solid rgba(99,102,241,0.22)"},title:`Lives on board "${a}"`,children:a}),n&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-wider",children:"done"})]})}return(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(u.LinkIcon,{className:"w-3 h-3"}),"Dependencies"]}
2),(0,t.jsxs)("div",{className:"mb-2.5",children:[(0,t.jsxs)("div",{className:"text-[10px] font-bold text-gray-500 dark:text-zinc-400 uppercase tracking-wider mb-1.5",children:["Blocked by (",x.length,")"]}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[0===x.length&&(0,t.jsx)("span",{className:"text-[11px] text-gray-400 dark:text-zinc-500 italic",children:"Nothing blocking â this task can start any time."}),x.map(e=>{let r=e._id||e,n="object"==typeof e?e:{_id:r,title:"(task)"};return(0,t.jsxs)("span",{className:"group/dep relative",children:[O(n),(0,t.jsx)("button",{onClick:()=>k(r),className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-white dark:bg-zinc-900 border border-gray-200 dark:border-zinc-800 flex items-center justify-center opacity-0 group-hover/dep:opacity-100 transition-opacity",title:"Remove blocker",children:(0,t.jsx)(c.XMarkIcon,{className:"w-2.5 h-2.5 text-gray-500 dark:text-zinc-400"})})]},r?.toString?.()||r)})]}),i?(0,t.jsx)("div",{className:"mt-2 rounded-xl p-2",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"},children:_?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1",children:[(0,t.jsx)("input",{autoFocus:!0,value:a,onChange:e=>s(e.target.value),placeholder:"Filter tasksâ¦",className:"flex-1 text-xs px-2 py-1.5 rounded-md bg-transparent focus:outline-none text-gray-900 dark:text-zinc-100"}),b&&(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500 shrink-0",children:"searchingâ¦"})]}),(0,t.jsxs)("div",{className:"max-h-56 overflow-y-auto",children:[d&&0===l.length&&(0,t.jsx)("div",{className:"px-2 py-3 text-[11px] text-gray-400 dark:text-zinc-500 text-center",children:"Loading tasksâ¦"}),!d&&0===S.length&&(0,t.jsx)("div",{className:"px-2 py-3 text-[11px] text-gray-400 dark:text-zinc-500 text-center",children:a.trim()?"No tasks match that filter.":"No other tasks available to block this one."}),S.map(r=>{let n="Done"===r.status||"Complete"===r.status,i="object"==typeof r.board?r.board?._id?.toString?.():r.board?.toString?.(),o="object"==typeof e.board?e.board?._id?.toString?.():e.board?.toString?.(),a="object"==typeof r.board?r.board?.name:null,s=i&&o&&i!==o&&a;return(0,t.jsxs)("button",{onClick:()=>j(r),className:"w-full px-2 py-1.5 text-[12px] text-left rounded-md hover:bg-white/60 dark:hover:bg-zinc-900/60 text-gray-700 dark:text-zinc-300 flex items-center gap-2 group/row",children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{background:r.statusColor||(n?"#10B981":"var(--text-label)")}}),(0,t.jsx)("span",{className:"truncate flex-1",children:r.title}),s&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-wider px-1 py-0.5 rounded shrink-0",style:{background:"rgba(99,102,241,0.10)",color:"#4F46E5",border:"1px solid rgba(99,102,241,0.20)"},title:`On board "${a}"`,children:a}),r.status&&(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-gray-400 dark:text-zinc-500 shrink-0",children:r.status})]},r._id)})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-1.5 border-t border-gray-200/50 dark:border-zinc-800/50 mt-1",children:[(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500",children:[S.length," task",1===S.length?"":"s"]}),(0,t.jsx)("button",{onClick:()=>{o(!1),s("")},className:"text-[11px] font-semibold text-gray-400 dark:text-zinc-500 hover:text-gray-700 dark:hover:text-zinc-300",children:"Done"})]})]}):(0,t.jsx)("div",{className:"px-2 py-3 text-[11px] text-gray-400 dark:text-zinc-500 text-center",children:"This task isn't on a board. Add it to a board to create dependencies."})}):(0,t.jsx)("button",{onClick:()=>o(!0),className:"text-[11px] font-semibold text-violet-500 hover:text-violet-700 dark:text-violet-300 mt-1",children:"+ Add a blocker"})]}),w.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"text-[10px] font-bold text-gray-500 dark:text-zinc-400 uppercase tracking-wider mb-1.5",children:["Blocks (",w.length,")"]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:w.map(e=>{let r="object"==typeof e?e:{_id:e,title:"(task)"};return(0,t.jsx)("span",{children:O(r)},r._id?.toString?.()||r._id)})})]})]})}e.s(["default",0,function({task:e,onClose:b,onUpdate:m,onDelete:g,onRequestDelete:v,onRefresh:x,teamMembers:_=[],statusOptions:S=[],initialSubItemId:j=null,initialSubItemDraft:k=!1,initialQuoteSubItem:$=null,subItemUnread:E={},subItemTotal:J={},onUnreadRefresh:Y,onNavigateToSubitem:X}){let Q,Z,ee,et,er,ei,eo,eb,eg,eS,ej,ek,{data:eO}=(0,o.useSession)(),{setFilterPanelOpen:e$}=(0,i.useAI)();(0,r.useEffect)(()=>(e$(!0),()=>e$(!1)),[e$]);let[eA,eE]=(0,r.useState)(e),[eN,eP]=(0,r.useState)(()=>{let e;return e=new URLSearchParams(window.location.search).get(ef),eu.includes(e)?e:"details"}),[eM,eD]=(0,r.useState)(null),[eI,eT]=(0,r.useState)(null),[eC,eB]=(0,r.useState)(null),[eR,eL]=(0,r.useState)(null),[ez,eF]=(0,r.useState)(0),[eU,eq]=(0,r.useState)($),[eV,eK]=(0,r.useState)(!1),[eH,eW]=(0,r.useState)(null);function eJ(e){eB(e),eP("details")}let eG=(0,r.useRef)(null);async function eY(e,t){let r=Array.isArray(t)?t.length:0,n=eG.current;if(eG.current=r,null!==n&&n!==r)try{let e=await fetch(`/api/tasks/${eA._id}`);if(!e.ok)return;let t=await e.json();if(!t?.task)return;eE(e=>({...e,comments:t.task.comments||e.comments,links:t.task.links||e.links,collaborators:t.task.collaborators||e.collaborators}))}catch{}}(0,r.useEffect)(()=>
2{if($?.subItemId)return void eP("comments");if(k){eP("details"),tP.current=!0,tN(!0);return}if(j){eP("details"),eB(j),tA(j?.toString?.()||j);return}let e=new URL(window.location.href),t=e.searchParams.get("commentId"),r=e.searchParams.get("subItemId");t?(eP("comments"),eD(t)):r&&(eP("details"),eB(r),tA(r?.toString?.()||r)),(t||r)&&(e.searchParams.delete("commentId"),e.searchParams.delete("subItemId"),window.history.replaceState(null,"",e.pathname+(e.search?e.search:"")+e.hash))},[]),(0,r.useEffect)(()=>{ed(eN)},[eN]),(0,r.useEffect)(()=>()=>ed(null),[]),(0,r.useEffect)(()=>{if("comments"!==eN||!eM)return;let e=setTimeout(()=>{let e=document.querySelector(`[data-comment-id="${eM}"]`);if(e){let t=e.parentElement;for(;t&&t!==document.body;){let e=getComputedStyle(t).overflowY;if("auto"===e||"scroll"===e)break;t=t.parentElement}if(t&&t!==document.body){let r=t.getBoundingClientRect(),n=e.getBoundingClientRect().top-r.top+t.scrollTop-t.clientHeight/2+e.offsetHeight/2;t.scrollTop=Math.max(0,n)}eT(eM),setTimeout(()=>eT(e=>e===eM?null:e),1600)}eD(null)},60);return()=>clearTimeout(e)},[eN,eM]),(0,r.useEffect)(()=>{if("details"!==eN||!eC)return;let e=!1;function t(){if(e)return!1;let t=document.querySelector('[data-task-modal-body="true"]');if(!t)return!1;let r=t.querySelector(`[data-subitem-id="${eC}"]`);if(!r)return!1;let n=t.getBoundingClientRect(),i=r.getBoundingClientRect().top-n.top+t.scrollTop-t.clientHeight/2+r.offsetHeight/2,o=t.scrollHeight-t.clientHeight;return t.scrollTop=Math.max(0,Math.min(o,i)),!0}let r=setTimeout(t,80),n=setTimeout(t,280),i=setTimeout(t,520),o=setTimeout(t,800),a=setTimeout(()=>{t()&&(eL(eC),setTimeout(()=>eL(e=>e===eC?null:e),1600)),eB(null)},1100);return()=>{e=!0,clearTimeout(r),clearTimeout(n),clearTimeout(i),clearTimeout(o),clearTimeout(a)}},[eN,eC,eA.subItems]);let[eX,eQ]=(0,r.useState)(!1),[eZ,e0]=(0,r.useState)(eA.title),[e1,e2]=(0,r.useState)(!1),e5=(0,r.useRef)(null),[e4,e6]=(0,r.useState)(!1),[e3,e8]=(0,r.useState)(""),[e9,e7]=(0,r.useState)([]),[te,tt]=(0,r.useState)(!1),[tr,tn]=(0,r.useState)(!1),[ti,to]=(0,r.useState)(0),ta=(0,r.useRef)(null),ts=(0,r.useRef)(null),tc=(0,r.useRef)(Y);(0,r.useEffect)(()=>{tc.current=Y},[Y]);let tl=(0,r.useRef)(!1),[tu,tf]=(0,r.useState)(!1),td=(0,r.useRef)(null),[th,tp]=(0,r.useState)(!1),[ty,tb]=(0,r.useState)(!1),[tm,tg]=(0,r.useState)(""),[tv,tx]=(0,r.useState)([]),[tw,t_]=(0,r.useState)(!1),tS=(0,r.useRef)(null);(0,r.useEffect)(()=>{function e(e){tS.current&&!tS.current.contains(e.target)&&tb(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.useEffect)(()=>{if(!ty)return;t_(!0);let e=setTimeout(async()=>{try{let e=new URLSearchParams({limit:"10"});tm.trim()&&e.set("search",tm.trim());let t=await fetch(`/api/deals?${e.toString()}`);if(t.ok){let e=await t.json();tx(e.deals||[])}}catch{}finally{t_(!1)}},250);return()=>clearTimeout(e)},[tm,ty]);let tj=(Q=eA?.parentDeal)?"object"==typeof Q?{id:Q._id?.toString?.()||Q._id,name:Q.name||"View",stage:Q.stage}:{id:Q.toString?.()||Q,name:"Deal",stage:null}:null,tk=(Z=eA?.milestone)?"object"==typeof Z?{id:Z._id?.toString?.()||Z._id,title:Z.title||"Milestone",color:Z.color||"#EC4899"}:{id:Z.toString?.()||Z,title:"Milestone",color:"#EC4899"}:null,tO=eA.linkedCampaign?._id?.toString?.()||eA.linkedCampaign?._id||("string"==typeof eA.linkedCampaign?eA.linkedCampaign:null);(0,r.useEffect)(()=>{function e(e){td.current&&!td.current.contains(e.target)&&tf(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.useEffect)(()=>{if(tl.current)return;let e=eA.assignees||[];if(e.length<=1)return;tl.current=!0;let t=e[0],r=e.slice(1),n=eA.collaborators||[],i=new Set(n.map(e=>(e._id||e).toString())),o=[...n,...r.filter(e=>!i.has((e._id||e).toString()))];eE(e=>({...e,assignees:[t],collaborators:o})),fetch(`/api/tasks/${eA._id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({assignees:[t._id||t],collaborators:o.map(e=>e._id||e)})}).catch(()=>{})},[eA._id]);let[t$,tA]=(0,r.useState)(null),[tE,tN]=(0,r.useState)(!1),tP=(0,r.useRef)(!1);function tM(){eZ.trim()&&eZ.trim()!==eA.title&&(m({title:eZ.trim()}),eE(e=>({...e,title:eZ.trim()}))),eQ(!1)}async function tD({text:e,mentions:t,creatorMentions:r,campaignMentions:n,organizationMentions:i,dealMentions:o,media:a}){let s=e||"",c={users:t||[],creators:r||[],campaigns:n||[],organizations:i||[],deals:o||[]},l=a?.length?[...eA.media||[],...a]:null,u=el(eA.descriptionMentions),f=el(c);
2if(e2(!1),s!==(eA.description||"")||l||u!==f){eE(e=>({...e,description:s,...l?{media:l}:{}}));try{await m({description:s,descriptionMentions:c,...l?{media:l}:{}})}catch{G.default.error("Couldn't save the description");return}if("|||"!==f||"|||"!==u)try{let e=await fetch(`/api/tasks/${eA._id}`);if(e.ok){let t=await e.json();eE(e=>({...e,descriptionMentions:t.task?.descriptionMentions||e.descriptionMentions,collaborators:t.task?.collaborators||e.collaborators}))}}catch{}}}async function tI(e){let t=es(e);if(0===t.length)return void G.default.error("Pick an image, video, or PDF");e6(!0);try{let e=await ec(t);if(0===e.length)return;let r=[...eA.media||[],...e];eE(e=>({...e,media:r})),await m({media:r}),G.default.success(1===e.length?"Attachment added":`${e.length} files attached`)}catch{G.default.error("Couldn't save the attachment")}finally{e6(!1)}}async function tT(e){if(eH)return;let t=eA.parentDeal?._id?.toString()||eA.parentDeal?.toString(),r=eA.approval?._id?.toString()||eA.approval?.toString(),n=eA.approvalStepIndex;if(!t||!r||null==n)return void G.default.error("Missing approval context");let i=(eA.title||"").match(/^Approve\s+(.+?)\s+for\s+(.+)$/i),o=i?i[1]:null,a=i?i[2]:null;eW(e);try{let i=await fetch(`/api/deals/${t}/approvals/${r}/steps/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:e})}),s=await i.json();if(!i.ok)throw Error(s.error||"Action failed");if("approve"===e){let e=o&&a?`Approved ${o} for ${a}`:"Approved";G.default.success(e)}else{let e=o?`Requested changes on ${o}`:"Changes requested";(0,G.default)(e,{icon:"â»",style:{background:"rgba(245,158,11,0.12)",color:"#b45309",border:"1px solid rgba(245,158,11,0.30)"}})}await new Promise(e=>setTimeout(e,600)),b(),x?.()}catch(e){G.default.error(e.message||"Action failed")}finally{eW(null)}}function tC(e){m({tags:e}),eE(t=>({...t,tags:e}))}function tB(e){let t=(e||"").trim();if(!t)return;let r=eA.tags||[];r.some(e=>e.toLowerCase()===t.toLowerCase())||tC([...r,t])}(0,r.useEffect)(()=>{async function t(){try{let t=await fetch(`/api/tasks/${e._id}`);if(t.ok){let e=await t.json();eE(e.task),e0(e.task.title)}}catch{}}async function r(){try{(await fetch(`/api/tasks/${e._id}/read`,{method:"POST"})).ok&&(t(),window.dispatchEvent(new CustomEvent("ss-notifications-changed")))}catch{}}function n(n){let{taskId:i}=n.detail||{};i&&i===e._id&&(t(),r())}function i(){tc.current?.()}return t(),r(),window.addEventListener("ss-task-event",n),window.addEventListener("focus",i),()=>{window.removeEventListener("ss-task-event",n),window.removeEventListener("focus",i)}},[e._id]);let tR=(ee=new Set((eA.tags||[]).map(e=>(e||"").toLowerCase())),e9.filter(e=>e&&e.tag&&!ee.has(e.tag.toLowerCase())));async function tL(e){try{let t=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw Error("create_failed");let r=await t.json();eE(e=>({...e,subItems:r.subItems})),m?.({subItems:r.subItems});let n=r.subItems?.[r.subItems.length-1];if(!n?._id)throw Error("create_failed");return tP.current&&tA(n._id?.toString?.()||n._id),n}catch{return G.default.error("Failed to add sub-item"),null}}async function tz(e,t){let r=new Date().toISOString(),n=e=>{let n="Done"===e.status,i=!t,o=e.status,a=e.statusColor;return i?(o="Done",a="#00c875"):!i&&n&&(o="To Do",a="#c4c4c4"),{...e,completed:i,completedAt:i?r:null,status:o,statusColor:a}};eE(t=>({...t,subItems:(t.subItems||[]).map(t=>t._id===e?n(t):t)})),m?.({subItems:(eA.subItems||[]).map(t=>t._id===e?n(t):t)});try{let r=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemId:e,completed:!t})});if(r.ok){let e=await r.json();eE(t=>({...t,subItems:e.subItems})),m?.({subItems:e.subItems})}else eE(r=>({...r,subItems:(r.subItems||[]).map(r=>r._id===e?{...r,completed:t,completedAt:t?r.completedAt:null}:r)})),G.default.error("Failed to update sub-item")}catch{G.default.error("Failed to update sub-item")}}async function tF(e){let t=eA.subItems||[];try{let r=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemId:e})});if(!r.ok)return void G.default.error("Failed to delete sub-item");let n=await r.json().catch(()=>null),i=n?.subItems?n.subItems:t.filter(t=>t._id!==e);eE(e=>({...e,subItems:i})),m?.({subItems:i})}catch{G.default.error("Failed to delete sub-item")}}async function tU(e,t){let r=es(t);if(0===r.length)return void G.default.error("Pick an image, video, or PDF");let n=(eA.subItems||[]).find(t=>t._id?.toString()===e?.toString());if(!n)return;let i=await ec(r);if(0===i.length)return;let o=[...n.media||[],...i];try{let t=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemId:e,media:o})});if(t.ok){let e=await t.json();eE(t=>({...t,subItems:e.subItems})),m?.({subItems:e.subItems}),G.default.success(1===i.length?"Screenshot attached":`${i.length} files attached`)}else throw Error("save_failed")}catch{G.default.error("Couldn't save the attachment")}}async function tq(e,t){eE(r=>({...r,subItems:(r.subItems||[]).map(r=>r._id===e?{...r,...t}:r)}));try{let r=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemId:e,...t})});if(r.ok){let e=await r.json();eE(t=>({...t,subItems:e.subItems})),m?.({subItems:e.subItems})}else G.default.error("Couldn't save the change")}catch{G.default.error("Couldn't save the change")}}async function tV(){try{let e=function(){let e=[];
2if(e.push("You are working on the Social Scout Next.js app. Implement the feature described below. Use the existing code style and design system; keep edits minimal and focused.","",`# Feature: ${eA.title||"(untitled)"}`,""),eA.description){let t=eA.description.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();t&&e.push("## Context",t,"")}let t=[];eA.status&&t.push(`Status: ${eA.status}`),eA.priority&&t.push(`Priority: ${eA.priority}`),eA.dueDate&&t.push(`Due: ${new Date(eA.dueDate).toLocaleDateString()}`),eA.startDate&&t.push(`Start: ${new Date(eA.startDate).toLocaleDateString()}`),t.length&&e.push("## Metadata",t.join(" · "),"");let r=[];eA.linkedCampaign?.name&&r.push(`- Campaign: ${eA.linkedCampaign.name}`),eA.linkedCreator?.name&&r.push(`- Creator: ${eA.linkedCreator.name}`),eA.organization?.name&&r.push(`- Organization: ${eA.organization.name}`),eA.linkedPost?.link&&r.push(`- Post: ${eA.linkedPost.link}`),r.length&&e.push("## Linked entities",...r,"");let n=(eA.subItems||[]).filter(e=>!e.completed);if(n.length>0&&(e.push("## Sub-tasks to implement"),n.forEach((t,r)=>{if(e.push(`${r+1}. ${t.title||"(untitled)"}`),t.description){let r=t.description.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();r&&e.push(` > ${r}`)}let n=[];t.priority&&"medium"!==t.priority&&n.push(t.priority),t.dueDate&&n.push(`due ${new Date(t.dueDate).toLocaleDateString()}`),(t.media||[]).length>0&&n.push(`${t.media.length} attachment${1===t.media.length?"":"s"}`),n.length&&e.push(` _${n.join(" · ")}_`)}),e.push("")),(eA.comments||[]).length>0){let t=eA.comments.slice(-5);for(let r of(e.push("## Recent discussion (most recent last)"),t)){let t=r.user?.name||"Someone",n=r.createdAt?new Date(r.createdAt).toLocaleDateString():"",i=(r.text||"").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,320);i&&e.push(`- **${t}** (${n}): ${i}`)}e.push("")}return e.push("## Instructions","1. Read the relevant files and propose a minimal implementation plan before editing.","2. Reuse existing components, models, and conventions where possible â do not introduce new dependencies.","3. Implement each sub-task listed above. (Already-completed sub-tasks have been intentionally omitted; treat the list as the remaining work to ship.)","4. After implementation, run a syntax check on every changed file and outline any follow-up work the task implies but didn't enumerate."),e.join("\n")}();navigator?.clipboard&&await navigator.clipboard.writeText(e),G.default.success("Claude prompt copied")}catch{G.default.error("Couldn't copy prompt")}}async function tK(e){eE(t=>{let r=new Map((t.subItems||[]).map(e=>[e._id,e])),n=[],i=new Set;for(let t of e){let e=r.get(t);e&&!i.has(t)&&(n.push(e),i.add(t))}for(let[e,t]of r.entries())i.has(e)||n.push(t);return{...t,subItems:n}});try{let t=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemOrder:e})});if(t.ok){let e=await t.json();eE(t=>({...t,subItems:e.subItems})),m?.({subItems:e.subItems})}}catch{G.default.error("Couldn't save the new order")}}async function tH(e,t){let r=(eA.subItems||[]).find(t=>t._id?.toString()===e?.toString());if(!r)return;let n=(r.media||[]).filter((e,r)=>r!==t);try{let t=await fetch(`/api/tasks/${eA._id}/subitems`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({subItemId:e,media:n})});if(t.ok){let e=await t.json();eE(t=>({...t,subItems:e.subItems})),m?.({subItems:e.subItems})}}catch{G.default.error("Couldn't remove the attachment")}}(0,r.useEffect)(()=>{if(!tr)return;let e=e3.trim();tt(!0);let t=setTimeout(()=>{fetch(`/api/tasks/tags/autocomplete?q=${encodeURIComponent(e)}&limit=10`).then(e=>e.ok?e.json():{tags:[]}).then(e=>e7(Array.isArray(e?.tags)?e.tags:[])).catch(()=>e7([])).finally(()=>tt(!1))},200);return()=>clearTimeout(t)},[e3,tr]),(0,r.useEffect)(()=>{to(0)},[e3,tr,e9.length]),(0,r.useEffect)(()=>{if(tr)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){let t=ta.current&&ta.current.contains(e.target),r=ts.current&&ts.current.contains(e.target);t||r||tn(!1)}},[tr]);let tW=eA.subItems?.length>0?Math.round(eA.subItems.filter(e=>e.completed).length/eA.subItems.length*100):0,tJ=[{id:"details",label:"Details",icon:d.ListBulletIcon},{id:"comments",label:`Comments${eA.comments?.length?` (${eA.comments.length})`:""}`,icon:f.ChatBubbleLeftIcon},{id:"activity",label:"Activity",icon:R.ClockIcon},{id:"links",label:"Links",icon:u.LinkIcon}];return"u"<typeof document?null:(0,n.createPortal)((0,t.jsxs)(a.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[100] flex justify-end",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm",onClick:b}),(0,t.jsxs)(a.motion.div,{initial:{x:"100%",scale:.98,opacity:0},animate:{x:0,scale:1,opacity:1},exit:{x:"100%",scale:.98,opacity:0},transition:{duration:.5,ease:[.25,.46,.45,.94]},className:`relative w-full flex flex-col overflow-hidden h-dvh-safe transition-[max-width] duration-500 ease-out ${ez>0?"max-w-none sm:max-w-[680px] md:max-w-[820px] lg:max-w-[960px]":"max-w-none sm:max-w-[580px]"}`,style:{background:"var(--surface-panel)",backdropFilter:"blur(40px)",boxShadow:"-20px 0 60px var(--border-default), -4px 0 20px var(--surface-softer)"},children:[(0,t.jsx)("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-gradient-to-r from-pink-500/60 via-orange-400/60 to-violet-500/60 z-20"}),(0,t.jsx)("div",{className:"absolute top-0 left-0 bottom-0 w-[1.5px] opacity-65 pointer-events-none animate-gradient-shift z-20",style:{background:"linear-gradient(180deg, rgba(236,72,153,0.6), rgba(249,115,22,0.5), rgba(139,92,246,0.55), rgba(236,72,153,0.6))"}}),(0,t.jsx)("div",{className:"absolute -top-24 -right-24 w-72 h-72 rounded-full blur-3xl pointer-events-none animate-orb-drift-a",style:{background:"radial-gradient(circle, rgba(249,115,22,0.22), rgba(236,72,153,0.16) 55%, transparent 75%)",opacity:.85}}),(0,t.jsx)("div",{className:"absolute -bottom-32 -left-20 w-80 h-80 rounded-full blur-3xl pointer-events-none animate-orb-drift-b",style:{background:"radial-gradient(circle, rgba(139,92,246,0.18), rgba(59,130,246,0.12) 55%, transparent 75%)",opacity:.75}}),(0,t.jsxs)("div",{className:"flex-shrink-0 z-10 safe-area-pt",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)"},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2 px-4 py-3 sm:px-6 sm:py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[(0,t.jsx)(O.default,{status:eA.status,statusColor:eA.statusColor||"#c4c4c4",statusOptions:S,onChange:(e,t)=>
2{eE(r=>({...r,status:e,statusColor:t})),m({status:e,statusColor:t})}}),eA.priority&&(0,t.jsx)("span",{className:"text-[10px] font-black uppercase tracking-wider px-2.5 py-1 rounded-lg whitespace-nowrap",style:"critical"===eA.priority?{background:"rgba(239,68,68,0.1)",color:"#EF4444",border:"1px solid rgba(239,68,68,0.2)"}:"high"===eA.priority?{background:"rgba(245,158,11,0.1)",color:"#F59E0B",border:"1px solid rgba(245,158,11,0.2)"}:"medium"===eA.priority?{background:"rgba(99,102,241,0.1)",color:"#6366F1",border:"1px solid rgba(99,102,241,0.2)"}:{background:"rgba(156,163,175,0.1)",color:"var(--text-label)",border:"1px solid rgba(156,163,175,0.2)"},children:eA.priority}),(0,t.jsxs)("button",{type:"button",onClick:()=>{eE(e=>({...e,isPrivate:!e.isPrivate})),m({isPrivate:!eA.isPrivate})},title:eA.isPrivate?"Private â only you and explicit assignees / collaborators can see this task. Click to share with the team.":"Shared with the team. Click to make this task private.",className:"text-[10px] font-black uppercase tracking-wider px-2.5 py-1 rounded-lg whitespace-nowrap inline-flex items-center gap-1 transition-colors",style:eA.isPrivate?{background:"rgba(99,102,241,0.1)",color:"#6366F1",border:"1px solid rgba(99,102,241,0.25)"}:{background:"var(--surface-softer)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)"},children:[eA.isPrivate?(0,t.jsx)(F.LockClosedIcon,{className:"w-3 h-3"}):(0,t.jsx)(U.LockOpenIcon,{className:"w-3 h-3"}),eA.isPrivate?"Private":"Shared"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 sm:gap-1.5 flex-shrink-0",children:[(0,t.jsx)("button",{onClick:async()=>{try{let e=eN&&"details"!==eN?`?tab=${eN}`:"",t=`${window.location.origin}/dashboard/user/task/${eA._id}${e}`;await navigator.clipboard.writeText(t),G.default.success("Task link copied")}catch{G.default.error("Couldn't copy link")}},className:"w-11 h-11 sm:w-8 sm:h-8 flex items-center justify-center rounded-xl transition-all duration-200 hover:scale-105 active:scale-95",style:{background:"rgba(139,92,246,0.10)"},title:"Copy shareable link","aria-label":"Copy shareable link",children:(0,t.jsx)(u.LinkIcon,{className:"w-4 h-4",style:{color:"#8B5CF6"}})}),eO?.user?.role==="super_admin"&&(0,t.jsx)("button",{onClick:tV,className:"w-11 h-11 sm:w-8 sm:h-8 flex items-center justify-center rounded-xl transition-all duration-200 hover:scale-105 active:scale-95",style:{background:"rgba(16,185,129,0.10)"},title:"Copy a Claude Code prompt for this task + sub-tasks","aria-label":"Copy Claude prompt",children:(0,t.jsx)(w.CodeBracketIcon,{className:"w-4 h-4",style:{color:"#10B981"}})}),(0,t.jsx)("button",{onClick:()=>{v?v(eA):g?.()},className:"w-11 h-11 sm:w-8 sm:h-8 flex items-center justify-center rounded-xl transition-all duration-200 hover:scale-105 active:scale-95",style:{background:"rgba(239,68,68,0.10)"},title:"Delete task","aria-label":"Delete task",children:(0,t.jsx)(l.TrashIcon,{className:"w-4 h-4",style:{color:"#EF4444"}})}),(0,t.jsx)("button",{onClick:b,className:"w-11 h-11 sm:w-8 sm:h-8 flex items-center justify-center rounded-xl transition-all duration-200 hover:scale-105 active:scale-95",style:{background:"var(--border-subtle)"},title:"Close","aria-label":"Close task panel",children:(0,t.jsx)(c.XMarkIcon,{className:"w-5 h-5 text-gray-500 dark:text-zinc-400"})})]})]}),(0,t.jsx)("div",{className:"px-4 sm:px-6 pb-3",children:eX?(0,t.jsx)("input",{autoFocus:!0,value:eZ,onChange:e=>e0(e.target.value),onBlur:tM,onKeyDown:e=>{"Enter"===e.key&&tM(),"Escape"===e.key&&(e0(eA.title),eQ(!1))},className:"text-xl font-black text-gray-900 dark:text-zinc-100 w-full border-b-2 border-orange-400 focus:outline-none pb-1 bg-transparent tracking-tight"}):(0,t.jsx)("h2",{onClick:()=>eQ(!0),className:"text-xl font-black text-gray-900 dark:text-zinc-100 cursor-text hover:text-gray-700 dark:hover:text-zinc-300 transition-colors tracking-tight",children:eA.title})}),(0,t.jsxs)("div",{className:"px-4 sm:px-6 pb-3 flex flex-wrap gap-2",children:[eA.linkedCampaign&&(0,t.jsxs)("a",{href:`/dashboard/user/campaign/${eA.linkedCampaign._id||eA.linkedCampaign}`,className:"text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all duration-200 hover:shadow-sm",style:{background:"rgba(99,102,241,0.08)",color:"#6366F1",border:"1px solid rgba(99,102,241,0.15)"},children:["Campaign: ",eA.linkedCampaign.name||"View"]}
2),eA.linkedCreator&&(0,t.jsxs)("a",{href:`/dashboard/user/creator/${eA.linkedCreator._id||eA.linkedCreator}`,className:"text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all duration-200 hover:shadow-sm",style:{background:"rgba(168,85,247,0.08)",color:"#A855F7",border:"1px solid rgba(168,85,247,0.15)"},children:["Creator: ",eA.linkedCreator.name||"View"]}),eA.linkedPost&&(0,t.jsx)("a",{href:`/dashboard/user/post/${eA.linkedPost._id||eA.linkedPost}`,className:"text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all duration-200 hover:shadow-sm",style:{background:"rgba(16,185,129,0.08)",color:"#10B981",border:"1px solid rgba(16,185,129,0.15)"},children:"Post: View"}),tk&&tO&&(0,t.jsxs)("a",{href:`/dashboard/user/campaign/${tO}?tab=milestones`,className:"text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all duration-200 hover:shadow-sm",style:{background:`${tk.color}14`,color:tk.color,border:`1px solid ${tk.color}25`},children:["Milestone: ",tk.title]}),tj?(0,t.jsxs)("div",{className:"inline-flex items-center gap-1 rounded-lg pl-3 pr-1 py-1 transition-all duration-200",style:{background:"rgba(249,115,22,0.08)",color:"#F97316",border:"1px solid rgba(249,115,22,0.18)"},children:[(0,t.jsxs)("a",{href:`/dashboard/user/sales/deal/${tj.id}`,target:"_blank",rel:"noopener noreferrer",className:"text-[11px] font-semibold hover:underline",children:["Deal: ",tj.name]}),(0,t.jsx)("button",{type:"button",onClick:function(){eE(e=>({...e,parentDeal:null})),m({parentDeal:null})},className:"w-5 h-5 flex items-center justify-center rounded-md hover:bg-orange-500/15 transition-colors",title:"Unlink deal","aria-label":"Unlink deal",children:(0,t.jsx)(c.XMarkIcon,{className:"w-3 h-3"})})]}):(0,t.jsxs)("div",{ref:tS,className:"relative",children:[(0,t.jsx)("button",{type:"button",onClick:()=>tb(e=>!e),className:"text-[11px] font-semibold px-3 py-1.5 rounded-lg transition-all duration-200 hover:shadow-sm",style:{background:"var(--surface-soft)",color:"var(--text-tertiary)",border:"1px dashed var(--border-default)"},children:"+ Deal"}),ty&&(0,t.jsxs)("div",{className:"absolute z-20 mt-1.5 w-64 max-w-[80vw] rounded-xl py-1.5 max-h-72 overflow-y-auto",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 12px 40px var(--shadow-ambient-lg), 0 2px 8px var(--border-subtle)",border:"1px solid var(--border-default)"},children:[(0,t.jsx)("div",{className:"px-2 pt-1 pb-1.5",children:(0,t.jsx)("input",{autoFocus:!0,value:tm,onChange:e=>tg(e.target.value),placeholder:"Search dealsâ¦",className:"w-full text-xs px-2 py-1.5 rounded-lg focus:outline-none focus:ring-2 focus:ring-orange-300/50 text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"}})}),tw?(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 dark:text-zinc-500 text-center",children:"Searchingâ¦"}):0===tv.length?(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 dark:text-zinc-500 text-center",children:tm?"No deals match":"No deals found"}):tv.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{tb(!1),tg(""),eE(t=>({...t,parentDeal:{_id:e._id,name:e.name,stage:e.stage}})),m({parentDeal:e._id}),G.default.success(`Linked to deal "${e.name}"`)},className:"w-full px-3 py-2 flex items-center gap-2 text-left hover:bg-gray-50/80 dark:hover:bg-zinc-900/80 transition-colors",children:[(0,t.jsx)("span",{className:"flex-1 min-w-0 text-xs font-medium text-gray-700 dark:text-zinc-300 truncate",children:e.name}),e.stage&&(0,t.jsx)("span",{className:"text-[9px] font-bold uppercase tracking-wider text-gray-400 dark:text-zinc-500 flex-shrink-0",children:e.stage})]},e._id))]})]})]}),(0,t.jsx)("div",{className:"flex gap-0 px-4 sm:px-6 border-t overflow-x-auto scrollbar-hide",style:{borderColor:"var(--border-subtle)"},children:tJ.map(e=>{let r=eN===e.id;return(0,t.jsxs)("button",{onClick:()=>eP(e.id),className:"flex items-center gap-1.5 px-4 py-2.5 text-xs font-semibold transition-all duration-300 border-b-2 relative group flex-shrink-0 whitespace-nowrap",style:{borderColor:"transparent",color:r?"transparent":"var(--text-label)"},children:[(0,t.jsx)(e.icon,{className:"w-3.5 h-3.5 transition-colors duration-200",style:{color:r?"#F97316":void 0}}
2),r?(0,t.jsx)("span",{className:"bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(90deg, #EC4899, #F97316)"},children:e.label}):(0,t.jsx)("span",{className:"group-hover:text-gray-700 dark:group-hover:text-zinc-300 transition-colors duration-200",children:e.label}),r&&(0,t.jsx)(a.motion.div,{layoutId:"activeDetailTab",className:"absolute bottom-0 left-0 right-0 h-[2px]",style:{background:"linear-gradient(90deg, #F97316, #EC4899)"},transition:{type:"spring",stiffness:400,damping:30}})]},e.id)})})]}),(0,t.jsxs)("div",{"data-task-modal-body":"true",className:`flex-1 min-h-0 ${"comments"===eN?"flex flex-col":"overflow-y-auto p-4 sm:p-6"}`,children:["details"===eN&&(0,t.jsxs)(a.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3},className:"space-y-6",children:["approval"===eA.taskType&&(0,t.jsxs)("div",{className:"rounded-2xl p-4",style:{background:"rgba(99,102,241,0.06)",border:"1px solid rgba(99,102,241,0.18)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(K.CheckBadgeIcon,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-widest text-indigo-500 dark:text-indigo-400",children:"Approval"}),(0,t.jsx)("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full",style:{background:"rgba(99,102,241,0.14)",color:"#6366f1",border:"1px solid rgba(99,102,241,0.25)"},children:null!=eA.approvalStepIndex?`Step ${eA.approvalStepIndex+1} of â`:"â"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsxs)("button",{onClick:()=>tT("approve"),disabled:!!eH,className:"flex items-center gap-1.5 px-4 py-2 rounded-xl text-xs font-semibold transition-all duration-200 disabled:opacity-50 hover:scale-[1.02] active:scale-[0.98]",style:{background:"rgba(16,185,129,0.12)",color:"#10b981",border:"1px solid rgba(16,185,129,0.28)"},children:["approve"===eH?(0,t.jsx)(V.ArrowPathIcon,{className:"w-3.5 h-3.5 animate-spin"}):(0,t.jsx)(q.CheckIcon,{className:"w-3.5 h-3.5"}),"Approve"]}),(0,t.jsxs)("button",{onClick:()=>tT("changes_requested"),disabled:!!eH,className:"flex items-center gap-1.5 px-4 py-2 rounded-xl text-xs font-semibold transition-all duration-200 disabled:opacity-50 hover:scale-[1.02] active:scale-[0.98]",style:{background:"rgba(239,68,68,0.08)",color:"#ef4444",border:"1px solid rgba(239,68,68,0.22)"},children:["changes_requested"===eH?(0,t.jsx)(V.ArrowPathIcon,{className:"w-3.5 h-3.5 animate-spin"}):(0,t.jsx)(V.ArrowPathIcon,{className:"w-3.5 h-3.5"}),"Request changes"]})]}),(eA.parentDeal||eA.parentSubstage)&&(0,t.jsxs)("a",{href:`/dashboard/user/sales/deal/${eA.parentDeal?._id?.toString()||eA.parentDeal?.toString()}${eA.parentSubstage?`#substage-${eA.parentSubstage?.toString()}`:""}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[11px] font-semibold text-indigo-500 hover:text-indigo-600 dark:text-indigo-400 dark:hover:text-indigo-300 transition-colors",children:[(0,t.jsx)(u.LinkIcon,{className:"w-3 h-3"}),"Open deal workspace"]})]}),"substage"===eA.taskType&&(0,t.jsxs)("div",{className:"rounded-2xl p-4",style:{background:"rgba(20,184,166,0.06)",border:"1px solid rgba(20,184,166,0.18)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,t.jsx)(H.RectangleGroupIcon,{className:"w-4 h-4 flex-shrink-0",style:{color:"#14b8a6"}}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-widest",style:{color:"#14b8a6"},children:"Workflow Substage"})]}),(eA.parentDeal||eA.parentSubstage)&&(0,t.jsxs)("a",{href:`/dashboard/user/sales/deal/${eA.parentDeal?._id?.toString()||eA.parentDeal?.toString()}${eA.parentSubstage?`#substage-${eA.parentSubstage?.toString()}`:""}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[11px] font-semibold transition-colors",style:{color:"#14b8a6"},children:[(0,t.jsx)(u.LinkIcon,{className:"w-3 h-3"}),"Open deal workspace"]})]}),(0,t.jsx)(P.default,{task:eA}),(0,t.jsxs)("div",{onPaste:function(e){if(e1)return;let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of t)if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}0!==r.length&&(e.preventDefault(),tI(r))},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsx)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] block",children:"Description"}),!e1&&(0,t.jsxs)("button",{type:"button",onClick:()=>e5.current?.click(),disabled:e4,className:"inline-flex items-center gap-1 text-[10px] font-semibold px-1.5 py-0.5 rounded-md text-gray-400 dark:text-zinc-500 hover:text-violet-500 hover:bg-violet-50 dark:hover:bg-violet-500/10 transition-colors disabled:opacity-50",title:"Attach a screenshot, video, or PDF to this task",children:[(0,t.jsx)(y.PaperClipIcon,{className:"w-3 h-3"}),e4?"Uploadingâ¦":"Attach"]}),(0,t.jsx)("input",{ref:e5,type:"file",multiple:!0,accept:"image/*,video/*,application/pdf",className:"hidden",onChange:e=>{e.target.files?.length&&tI(e.target.files),e.target.value=""}})]}),e1?(0,t.jsx)(A.default,{teamMembers:_,placeholder:"Describe the task⦠@ to tag someone, paste a screenshot to attach it",ctaLabel:"Save",rows:4,autoF
2ocus:!0,submitOnEnter:!1,showGif:!1,initialText:eA.description||"",initialMentions:eA.descriptionMentions,onCancel:()=>e2(!1),onSubmit:tD}):(0,t.jsx)("div",{role:"button",tabIndex:0,onClick:()=>e2(!0),onKeyDown:e=>{"Enter"===e.key&&e2(!0)},className:"text-sm text-gray-600 dark:text-zinc-400 cursor-text min-h-[60px] rounded-xl p-4 transition-all duration-200 hover:shadow-sm focus:outline-none focus:ring-2 focus:ring-orange-300/50",style:{background:"var(--surface-soft)",border:"1px solid var(--surface-softer)"},children:eA.description?(0,t.jsx)(N.default,{text:eA.description,mentions:eA.descriptionMentions?.users,creatorMentions:eA.descriptionMentions?.creators,campaignMentions:eA.descriptionMentions?.campaigns,organizationMentions:eA.descriptionMentions?.organizations,dealMentions:eA.descriptionMentions?.deals}):(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700 italic",children:"Click to add a description â @ to tag someone, paste a screenshot to attach it"})})]}),eA.media?.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(y.PaperClipIcon,{className:"w-3 h-3"}),"Attachments"]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:eA.media.map((e,r)=>(0,t.jsx)(em,{media:e,onRemove:async()=>{let e=eA.media.filter((e,t)=>t!==r);eE(t=>({...t,media:e})),m({media:e})}},`${e.url}-${r}`))})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(p.TagIcon,{className:"w-3 h-3"}),"Tags"]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(eA.tags||[]).map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[11px] font-semibold pl-2.5 pr-1.5 py-1 rounded-lg",style:{background:"rgba(99,102,241,0.08)",color:"#6366F1",border:"1px solid rgba(99,102,241,0.12)"},children:[e,(0,t.jsx)("button",{type:"button",onClick:()=>{tC((eA.tags||[]).filter(t=>t!==e))},"aria-label":`Remove tag ${e}`,className:"p-0.5 rounded-full transition-colors hover:bg-indigo-100 dark:hover:bg-indigo-500/20",children:(0,t.jsx)(c.XMarkIcon,{className:"w-2.5 h-2.5",style:{color:"#6366F1"}})})]},e)),ea.filter(e=>!(eA.tags||[]).some(t=>t.toLowerCase()===e.toLowerCase())).map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>tB(e),title:"Add suggested tag",className:"inline-flex items-center gap-1 text-[11px] font-semibold px-2.5 py-1 rounded-lg transition-all text-gray-500 dark:text-zinc-400 hover:text-gray-700 dark:hover:text-zinc-200 hover:bg-gray-50 dark:hover:bg-zinc-900/60",style:{background:"var(--surface-soft)",border:"1px dashed var(--border-default)"},children:[(0,t.jsx)("span",{"aria-hidden":!0,className:"font-bold leading-none",children:"+"}),(0,t.jsx)("span",{children:e})]},e)),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{ref:ta,type:"text",value:e3,onChange:e=>e8(e.target.value),onFocus:()=>tn(!0),onKeyDown:function(e){if(tr&&tR.length>0){if("ArrowDown"===e.key){e.preventDefault(),to(e=>(e+1)%tR.length);return}if("ArrowUp"===e.key){e.preventDefault(),to(e=>(e-1+tR.length)%tR.length);return}if("Enter"===e.key){e.preventDefault();let t=tR[ti];t?.tag&&(tB(t.tag),e8(""),tn(!1));return}}if("Escape"===e.key)return void tn(!1);if("Enter"!==e.key&&","!==e.key)return;e.preventDefault();let t=e3.split(","),r=eA.tags||[],n=new Set(r.map(e=>e.toLowerCase())),i=[];for(let e of t){let t=e.trim();!t||n.has(t.toLowerCase())||(n.add(t.toLowerCase()),i.push(t))}i.length>0&&tC([...r,...i]),e8(""),tn(!1)},placeholder:"Add tagâ¦","aria-label":"Add tag",autoComplete:"off",className:"text-[11px] font-semibold px-2.5 py-1 rounded-lg outline-none focus:ring-2 focus:ring-orange-300/50 w-28 text-gray-700 dark:text-zinc-300 placeholder:text-gray-400 dark:placeholder:text-zinc-500",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"}}),(0,t.jsx)(s.AnimatePresence,{children:tr&&(0,t.jsxs)(a.motion.div,{ref:ts,initial:{opacity:0,y:4,scale:.98}
2,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:4,scale:.98},transition:{duration:.12},className:"absolute z-50 left-0 mb-1.5 rounded-xl py-1.5 overflow-hidden",style:{bottom:"100%",minWidth:220,maxWidth:"min(280px, calc(100vw - 32px))",background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 -8px 40px var(--shadow-ambient-lg), 0 -2px 8px var(--border-subtle)",border:"1px solid var(--border-default)"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-b mb-1",style:{borderColor:"var(--surface-softer)"},children:[(0,t.jsx)(p.TagIcon,{className:"w-3 h-3",style:{color:"#6366F1"}}),(0,t.jsx)("span",{className:"text-[10px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:e3.trim()?"Matching tags":"Top tags"}),te&&(0,t.jsx)("span",{className:"ml-auto text-[10px] text-gray-300 dark:text-zinc-700",children:"searchingâ¦"})]}),(0,t.jsxs)("div",{className:"max-h-56 overflow-y-auto",children:[tR.map((e,r)=>{let n=r===ti;return(0,t.jsxs)("button",{type:"button",onMouseDown:t=>{t.preventDefault(),tB(e.tag),e8(""),tn(!1)},onMouseEnter:()=>to(r),className:"w-full px-3 py-2 flex items-center gap-2.5 text-xs transition-colors duration-100",style:{background:n?"rgba(249,115,22,0.06)":"transparent"},children:[(0,t.jsx)("div",{className:"w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(99,102,241,0.10)"},children:(0,t.jsx)(p.TagIcon,{className:"w-3 h-3",style:{color:"#6366F1"}})}),(0,t.jsx)("div",{className:"flex-1 min-w-0 text-left",children:(0,t.jsx)("div",{className:"text-gray-700 dark:text-zinc-300 font-semibold truncate",children:e.tag})}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500 flex-shrink-0 tabular-nums",children:e.count})]},e.tag.toLowerCase())}),!te&&0===tR.length&&e3.trim()&&(0,t.jsx)("div",{className:"px-3 py-3 text-center",children:(0,t.jsxs)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500",children:["Press Enter to create â",(0,t.jsx)("span",{className:"font-semibold text-gray-600 dark:text-zinc-400",children:e3.trim()}),"â"]})}),!te&&0===tR.length&&!e3.trim()&&(0,t.jsx)("div",{className:"px-3 py-3 text-center",children:(0,t.jsx)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500",children:"Type to create a tag"})})]}),tR.length>0&&(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 text-[10px] font-medium border-t",style:{borderColor:"var(--surface-softer)",color:"var(--text-label)",background:"var(--surface-soft)"},children:[(0,t.jsx)("span",{children:"ââ navigate · âµ select"}),(0,t.jsx)("span",{className:"text-gray-300 dark:text-zinc-700",children:"esc to dismiss"})]})]})})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] flex items-center gap-1",children:[(0,t.jsx)(L.UserIcon,{className:"w-3 h-3",style:{color:"#F97316"}}),"Owner"]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:(eA.assignees||[]).length>0?(0,t.jsx)(I.default,{user:(eA.assignees||[])[0],size:28,onClick:()=>tp(e=>!e)}):(0,t.jsx)("button",{type:"button",onClick:()=>tp(e=>!e),className:"w-7 h-7 rounded-full flex items-center justify-center transition-all duration-200 hover:scale-110 text-gray-400 dark:text-zinc-500",style:{background:"var(--surface-soft)",border:"1.5px dashed var(--border-default)"},title:"Assign an owner",children:(0,t.jsx)(L.UserIcon,{className:"w-3.5 h-3.5"})})})]}),(0,t.jsx)("span",{className:"h-4 w-px bg-gray-200 dark:bg-zinc-800 self-end mb-1"}),(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 relative",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.12em] flex items-center gap-1",children:[(0,t.jsx)(h.CalendarDaysIcon,{className:"w-3 h-3"}),"Due"]}),(0,t.jsx)(ev,{value:eA.dueDate,onChange:e=>{eE(t=>({...t,dueDate:e})),m({dueDate:e})}})]})]}),th&&(0,t.jsx)(ex,{teamMembers:_,currentOwner:(eA.assignees||[])[0],onSelect:e=>{eE(t=>({...t,assignees:[e]})),m({assignees:[e._id||e]}),tp(!1)},onClose:()=>tp(!1)})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(z.EyeIcon,{className:"w-3 h-3",style:{color:"#0EA5E9"}}),"People"]}),(0,t.jsxs)("div",{ref:td,className:"relative",children:[(et=(eA.createdBy?._id||eA.createdBy)?.toString?.(),er=((eA.assignees||[])[0]?._id||(eA.assignees||[])[0])?.toString?.(),ei=eA.collaborators||[],eo=et&&er&&et===er?null:eA.createdBy||null,(0,t.jsx)(T.default,{collaborators:ei,assigner:eo,onAdd:()=>tf(e=>!e),onRemoveCollaborator:e=>{let t=ei.filter(t=>(t._id||t).toString()!==e);eE(e=>({...e,collaborators:t})),m({collaborators:t.map(e=>e._id||e)})},chipSize:28})),tu&&(0,t.jsx)(ew,{teamMembers:_,selected:eA.collaborators||[],onToggle:e=>{let t=eA.collaborators||[],r=new Set(t.map(e=>(e._id||e).toString())),n=e._id.toString(),i=r.has(n)?t.filter(e=>(e._id||e).toString()!==n):[...t,e];eE(e=>({...e,collaborators:i})),m({collaborators:i.map(e=>e._id||e)})},onClose:()=>tf(!1),onTeamResolve:e=>{let t=eA.collaborators||[],r=new Set(t.map(e=>(e._id||e).toString())),n=[...t,...e.filter(e=>e._id&&!r.has(e._id.toString()))];eE(e=>({...e,collaborators:n}
2)),m({collaborators:n.map(e=>e._id||e)}),tf(!1)}})]})]}),(0,t.jsx)(e_,{task:eA,onUpdated:e=>{eE(e),m?.({status:e.status,statusColor:e.statusColor,group:e.group,preStuckStatus:e.preStuckStatus,preStuckColor:e.preStuckColor,preStuckGroup:e.preStuckGroup,blockedBy:e.blockedBy,blocks:e.blocks})}}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 flex items-center gap-1.5 ",children:[(0,t.jsx)(h.CalendarDaysIcon,{className:"w-3 h-3"}),"Start Date"]}),(0,t.jsx)("input",{type:"date",value:(0,W.toInputDate)(eA.startDate),onChange:e=>{let t=(0,W.fromInputDate)(e.target.value);eE(e=>({...e,startDate:t})),m({startDate:t})},className:"w-full text-sm px-3.5 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"}})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(h.CalendarDaysIcon,{className:"w-3 h-3"}),"Due Date"]}),(0,t.jsx)("input",{type:"date",value:(0,W.toInputDate)(eA.dueDate),onChange:e=>{let t=(0,W.fromInputDate)(e.target.value);eE(e=>({...e,dueDate:t})),m({dueDate:t})},className:"w-full text-sm px-3.5 py-2.5 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all",style:{background:"var(--surface-soft)",border:"1px solid var(--border-subtle)"}})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] flex items-center gap-2",children:["Sub-items",eA.subItems?.length>0&&(0,t.jsxs)("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full",style:{background:100===tW?"rgba(16,185,129,0.1)":"rgba(245,158,11,0.1)",color:100===tW?"#10B981":"#F59E0B"},children:[eA.subItems.filter(e=>e.completed).length,"/",eA.subItems.length]})]}),(0,t.jsx)(M.default,{task:eA,onSubItemsAdded:async()=>{try{let e=await fetch(`/api/tasks/${eA._id}`);if(e.ok){let t=await e.json();eE(t.task)}}catch{}}})]}),eA.subItems?.length>0&&(0,t.jsx)("div",{className:"w-full h-2 rounded-full mb-3.5 overflow-hidden",style:{background:"var(--surface-softer)"},children:(0,t.jsx)(a.motion.div,{className:"h-full rounded-full",initial:{width:0},animate:{width:`${tW}%`},transition:{duration:.6,ease:[.25,.46,.45,.94]},style:{background:100===tW?"linear-gradient(90deg, #10B981, #059669)":"linear-gradient(90deg, #F59E0B, #F97316)",boxShadow:100===tW?"0 0 12px rgba(16,185,129,0.3)":"0 0 12px rgba(245,158,11,0.3)"}})}),(eg=[...(eb=eA.subItems||[]).filter(e=>!e.completed),...eb.filter(e=>e.completed).sort((e,t)=>{let r=e.completedAt?new Date(e.completedAt).getTime():0;return(t.completedAt?new Date(t.completedAt).getTime():0)-r})],(0,t.jsx)(ep,{subItems:eg,onReorder:e=>tK(e),children:eg.map(e=>(0,t.jsx)(a.motion.div,{layout:!0,transition:{layout:{type:"spring",stiffness:380,damping:32,mass:.9}},children:(0,t.jsx)(ey,{sub:e,task:eA,highlighted:eR&&e._id?.toString()===eR.toString(),teamMembers:_,onToggle:()=>tz(e._id,e.completed),onDelete:()=>tF(e._id),onJumpHere:()=>eJ(e._id),onComment:()=>
2{eq({subItemId:e._id,title:(e.title||"").slice(0,200)}),eP("comments")},onAttach:t=>tU(e._id,t),onRemoveMedia:t=>tH(e._id,t),onEdit:t=>tq(e._id,t),onOpenDetail:()=>tA(e._id?.toString?.()||e._id)})},e._id))})),(0,t.jsx)("div",{className:"py-2 px-3",children:(0,t.jsxs)("button",{type:"button",onClick:function(){tP.current=!0,tN(!0)},className:"flex items-center gap-2.5 text-sm text-gray-400 dark:text-zinc-500 hover:text-violet-500 transition-colors duration-150",children:[(0,t.jsx)("span",{className:"w-[18px] h-[18px] rounded-md flex items-center justify-center flex-shrink-0",style:{border:"1.5px dashed var(--shadow-ambient-lg)"},children:(0,t.jsx)("svg",{className:"w-2.5 h-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),"Add a sub-item"]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,t.jsxs)("label",{className:"text-[10px] font-bold text-gray-400 dark:text-zinc-500 uppercase tracking-[0.14em] flex items-center gap-1.5",children:[(0,t.jsx)(f.ChatBubbleLeftIcon,{className:"w-3 h-3",style:{color:"#EC4899"}}),"Recent activity",eA.comments?.length>0&&(0,t.jsx)("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-md",style:{background:"rgba(236,72,153,0.1)",color:"#EC4899"},children:eA.comments.length})]}),eA.comments?.length>2&&(0,t.jsx)("button",{onClick:()=>eP("comments"),className:"text-[11px] font-semibold text-orange-500 hover:text-orange-600",children:"View all â"})]}),(eA.comments||[]).slice(-2).reverse().map((e,r)=>(0,t.jsxs)("button",{type:"button",onClick:()=>e._id&&void(eD(e._id),eP("comments")),title:"Open in comments",className:"w-full text-left flex gap-2.5 mb-2.5 last:mb-0 rounded-lg p-1.5 -mx-1.5 hover:bg-gray-50 dark:hover:bg-zinc-900/60 transition-colors",children:[(0,t.jsx)("div",{className:`w-7 h-7 rounded-xl bg-gradient-to-br ${(0,B.getAvatarGradient)(e.user?.name)} flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0 shadow-sm`,children:(e.user?.name||"?")[0].toUpperCase()}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-[12px] font-bold text-gray-700 dark:text-zinc-300",children:e.user?.name||"Unknown"}),(0,t.jsx)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500",children:(()=>{let t=Math.floor((Date.now()-new Date(e.createdAt).getTime())/1e3);if(t<60)return"just now";let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let n=Math.floor(r/60);if(n<24)return`${n}h ago`;let i=Math.floor(n/24);return i<7?`${i}d ago`:new Date(e.createdAt).toLocaleDateString()})()}),e.replies?.length>0&&(0,t.jsxs)("span",{className:"text-[9px] font-bold px-1.5 py-0.5 rounded",style:{background:"rgba(236,72,153,0.08)",color:"#EC4899"},children:[e.replies.length," repl",1===e.replies.length?"y":"ies"]})]}),e.text&&(0,t.jsx)("div",{className:"text-[12px] text-gray-600 dark:text-zinc-400 mt-0.5 leading-relaxed line-clamp-2",children:(0,t.jsx)(N.default,{text:e.text,mentions:e.mentions,creatorMentions:e.creatorMentions,campaignMentions:e.campaignMentions,organizationMentions:e.organizationMentions,dealMentions:e.dealMentions,compact:!0})}),e.media?.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[e.media.slice(0,3).map((e,r)=>(0,t.jsx)("div",{className:"rounded-md overflow-hidden flex-shrink-0",style:{width:56,height:40,border:"1px solid var(--border-subtle)"},children:(0,t.jsx)("img",{src:e.previewUrl||e.url,alt:"",className:"w-full h-full object-cover",loading:"lazy"})},r)),!e.text&&(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500 italic ml-0.5",children:["sent ",e.media[0]?.type==="gif"?"a GIF":"an attachment"]}),e.media.length>3&&(0,t.jsxs)("span",{className:"text-[10px] text-gray-400 dark:text-zinc-500 font-semibold",children:["+",e.media.length-3]})]})]})]},e._id||r)),(!eA.comments||0===eA.comments.length)&&(0,t.jsx)("p",{className:"text-[11px] text-gray-300 dark:text-zinc-700 italic mb-2.5",children:"No comments yet â start the conversation"}),(0,t.jsxs)("div",{className:"flex gap-2.5 mt-3",children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-xl bg-gradient-to-br from-orange-500 to-pink-500 flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0 shadow-sm",children:(eO?.user?.name||"?")[0].toUpperCase()}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(A.default,{teamMembers:_,placeholder:"Quick comment⦠@ to tag",ctaLabel:"Send",rows:1,onSubmit:async({text:e,mentions:t,creatorMentions:r,campaignMentions:n,organizationMentions:i,dealMentions:o,media:a})=>{try{let s=await fetch("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:{type:"task",id:eA._id},text:e,mentions:t,creatorMentions:r,campaignMentions:n,organizationMentions:i,dealMentions:o,media:a})});if(s.ok){let e=await fetch(`/api/tasks/${eA._id}`);if(e.ok){let t=await e.json();eE(e=>({...e,comments:t.task?.comments||e.comments,links:t.task?.links||e.links,collaborators:t.task?.collaborators||e.collaborators}))}G.default.success("Comment added")}else{let e=await s.json().catch(()=>null);G.default.error(e?.error||"Couldn't post the comment")}}catch{G.default.error("Failed to add comment")}}})})]})]}),(0,t.jsxs)("div",{className:"pt-4 space-y-1.5",style:{borderTop:"1px solid var(--surface-softer)"},children:[(0,t.jsxs)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500",children:["Assigned by ",(0,t.jsx)("span",{className:"font-semibold text-gray-500 dark:text-zinc-400",children:eA.createdBy?.name||"Unknown"})," on"," ",new Date(eA.createdAt).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]}),eA.updatedAt&&(0,t.jsxs)("p",{className:"text-[11px] text-gray-400 dark:text-zinc-500",children:["Last updated"," ",new Date(eA.updatedAt).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})]}),"comments"===eN&&(0,t.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[Object.keys(E).length>0&&(eS=Object.values(E).reduce((e,t)=>
2e+t,0),(0,t.jsxs)("div",{className:"flex-shrink-0 mx-3 mt-2 mb-1 rounded-xl overflow-hidden",style:{background:"rgba(236,72,153,0.06)",border:"1px solid rgba(236,72,153,0.16)"},children:[(0,t.jsxs)("button",{type:"button",onClick:()=>eK(e=>!e),className:"w-full flex items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-pink-50/40 dark:hover:bg-pink-500/10","aria-expanded":eV,children:[(0,t.jsx)("span",{className:"flex-shrink-0 w-4 h-4 rounded-md flex items-center justify-center",style:{background:"rgba(236,72,153,0.15)"},children:(0,t.jsxs)("svg",{className:"w-2.5 h-2.5",style:{color:"#EC4899"},fill:"currentColor",viewBox:"0 0 20 20",children:[(0,t.jsx)("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),(0,t.jsx)("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z"})]})}),(0,t.jsxs)("span",{className:"flex-1 text-[11px] font-semibold",style:{color:"#EC4899"},children:[eS," new message",1!==eS?"s":""," in subtasks"]}),(0,t.jsx)("svg",{className:`w-3.5 h-3.5 flex-shrink-0 transition-transform duration-200 ${eV?"rotate-180":""}`,style:{color:"#EC4899"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),eV&&(0,t.jsx)("div",{className:"border-t",style:{borderColor:"rgba(236,72,153,0.12)"},children:Object.entries(E).map(([e,r])=>{let n,i=(n=(eA.subItems||[]).find(t=>t._id?.toString?.()===e?.toString?.()),n?.title||`Subtask ${e}`);return(0,t.jsxs)("button",{type:"button",onClick:()=>{Y?.(),X?.(e)},className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-pink-50/40 dark:hover:bg-pink-500/10 transition-colors",children:[(0,t.jsx)("span",{className:"flex-1 text-[11px] text-gray-600 dark:text-zinc-400 truncate",children:i}),(0,t.jsxs)("span",{className:"flex-shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded-full",style:{background:"rgba(236,72,153,0.12)",color:"#EC4899",border:"1px solid rgba(236,72,153,0.25)"},children:[r," new"]})]},e)})})]})),(0,t.jsx)(C.default,{taskId:eA._id,task:eA,session:eO,teamMembers:_,highlightedMessageId:eI,onVideoActivate:()=>eF(e=>e+1),onVideoDeactivate:()=>eF(e=>Math.max(0,e-1)),pendingSubItemQuote:eU,onClearSubItemQuote:()=>eq(null),onJumpToSubItem:eJ,onMessagesChanged:eY})]}),"activity"===eN&&(0,t.jsx)(a.motion.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.3},children:(0,t.jsx)(D.default,{task:eA})}),"links"===eN&&(0,t.jsx)(eh,{task:eA,onUpdate:e=>{m({links:e}),eE(t=>({...t,links:e}))}})]})]}),(null!=t$||tE)&&(ej=(eA.subItems||[]).find(e=>(e._id?.toString?.()||e._id)===t$),ek=tE&&null==t$,ej||ek?(0,t.jsx)(en,{subItem:ej||null,draft:ek,onCreate:tL,parentTask:eA,statusOptions:S,teamMembers:_,onClose:()=>{tP.current=!1,tA(null),tN(!1)},onParentTaskUpdate:e=>{eE(e),m?.({subItems:e.subItems})},onSubItemsUpdate:e=>{eE(t=>({...t,subItems:e})),m?.({subItems:e})},onUnreadRefresh:Y},tE?"draft":t$):null)]}),document.body)}],231822)},825367,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(846932),i=e.i(88653),o=e.i(766972),a=e.i(833786);let s=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;e.s(["default",0,function({value:e=[],externalValue:c=[],onChange:l,onAddExternal:u,onRemoveExternal:f,teamMembers:d=[],compact:h=!1}){let[p,y]=(0,r.useState)(!1),[b,m]=(0,r.useState)(""),g=(0,r.useRef)(null),v=(0,r.useRef)(null),x=(0,r.useRef)(null),w=function(e,t,n,i=8){let[o,a]=(0,r.useState)({});return(0,r.useLayoutEffect)(()=>{if(!n)return void a({});let r=e.current?.getBoundingClientRect(),o=t.current?.getBoundingClientRect();if(!r||!o)return;let s={},c=window.innerWidth,l=window.innerHeight;c<320?(s.left=`${i}px`,s.right=`${i}px`,s.width="auto"):r.left<i?s.left=`${i-r.left}px`:r.left+o.width>c-i&&(s.right="0",s.left="auto"),r.bottom+o.height>l-i&&(s.bottom="100%",s.top="auto",s.marginBottom="6px",s.marginTop="0"),a(s)},[n]),o}(v,x,p);(0,r.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&y(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let _=new Set((e||[]).map(e=>e._id||e)),S=new Set((c||[]).map(e=>e.email)),j=d.filter(e=>e.name?.toLowerCase().includes(b.toLowerCase())||e.email?.toLowerCase().includes(b.toLowerCase())),k=b.trim(),O=s.test(k)&&!j.some(e=>e.email?.toLowerCase()===k.toLowerCase())&&!S.has(k.toLowerCase());function $(){O&&(u?.(k.toLowerCase()),m(""))}let A=(e||[]).slice(0,2),E=(c||[]).slice(0,1),N=(e||[]).length+(c||[]).length-A.length-E.length;return(0,t.jsxs)("div",{ref:g,className:"relative",children:[(0,t.jsx)("button",{ref:v,onClick:()=>y(!p),className:`w-full ${h?"h-7":"h-9"} flex items-center justify-center gap-0.5 group/person`,children:0===A.length&&0===E.length?(0,t.jsx)("div",{className:`${h?"w-5 h-5":"w-7 h-7"} rounded-full flex items-center justify-center transition-all duration-300 group-hover/person:shadow-sm group-hover/person:scale-110`,style:{background:"var(--surface-soft)",border:"1.5px dashed var(--border-default)"},children:(0,t.jsx)("svg",{className:`${h?"w-2.5 h-2.5":"w-3 h-3"} text-gray-300 dark:text-zinc-700`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}):(0,t.jsxs)(t.Fragment,{children:[A.map(e=>{let r="guest"===e.source||"guest_agency"===e.source;return(0,t.jsxs)("span",{className:"relative -ml-1 first:ml-0 transition-transform duration-200 hover:scale-110 hover:z-10",children:[(0,t.jsx)(a.default,{user:e,size:h?20:24}),r&&(0,t.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 ${h?"w-2 h-2":"w-2.5 h-2.5"} rounded-full ring-2 ring-white dark:ring-zinc-950`,style:{background:"linear-gradient(135deg, #F59E0B, #EC4899)"},title:"guest_agency"===e.source?"Guest agency":"Guest"})]},e._id||e)}),E.map(e=>(0,t.jsxs)("div",{className:`${h?"w-5 h-5":"w-7 h-7 text-[9px]"} rounded-full flex items-center justify-center font-bold -ml-1 first:ml-0 ring-2 ring-white dark:ring-zinc-950 shadow-sm relative`,style:{background:"linear-gradient(135deg, var(--text-label), var(--text-disabled))",color:"white"},title:`External: ${e.email}`,children:[(0,t.jsx)(o.EnvelopeIcon,{className:h?"w-2.5 h-2.5":"w-3 h-3"}),(0,t.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 ${h?"w-2 h-2":"w-2.5 h-2.5"} rounded-full bg-amber-400 ring-2 ring-white dark:ring-zinc-950`})]},e.email)),N>0&&(0,t.jsxs)("div",{className:"-ml-1 rounded-full bg-gray-100 dark:bg-zinc-900 flex items-center justify-center text-gray-500 dark:text-zinc-400 font-bold ring-2 ring-white dark:ring-zinc-950",style:{width:h?20:24,height:h?20:24,fontSize:h?7:8},children:["+",N]})]})}),(0,t.jsx)(i.AnimatePresence,{children:p&&(0,t.jsxs)(n.motion.div,{ref:x,initial:{opacity:0,y:-4,scale:.96}
2,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.96},transition:{duration:.15,ease:[.25,.46,.45,.94]},className:"absolute z-50 mt-1.5 left-0 rounded-xl py-2 w-72",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",boxShadow:"0 12px 40px var(--shadow-ambient-lg), 0 2px 8px var(--border-subtle)",border:"1px solid var(--border-default)",...w},children:[(0,t.jsx)("div",{className:"px-3 pb-2",children:(0,t.jsx)("input",{type:"text",placeholder:"Search team or paste emailâ¦",value:b,onChange:e=>m(e.target.value),onKeyDown:e=>{"Enter"===e.key&&O&&(e.preventDefault(),$())},className:"w-full text-xs px-3 py-2 rounded-lg focus:outline-none focus:ring-2 focus:ring-orange-300/50 transition-all text-gray-900 dark:text-zinc-100 placeholder-gray-400 dark:placeholder-zinc-500",style:{background:"var(--surface-soft)",border:"1px solid var(--border-default)"},autoFocus:!0})}),(0,t.jsxs)("div",{className:"max-h-56 overflow-y-auto",children:[j.map(r=>{let n=r.source;return(0,t.jsxs)("button",{onClick:()=>{let t;return t=r._id,void(_.has(t)?l(e.filter(e=>(e._id||e)!==t)):l([...e,r]))},className:"w-full px-3 py-2 flex items-center gap-2.5 hover:bg-gray-50/80 dark:hover:bg-zinc-900/80 text-xs transition-colors duration-150",children:[(0,t.jsx)(a.default,{user:r,size:28}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-gray-700 dark:text-zinc-300 font-medium truncate",children:r.name}),("guest"===n||"guest_agency"===n)&&(0,t.jsx)("span",{className:"text-[8.5px] uppercase font-bold px-1.5 py-0.5 rounded shrink-0 tracking-wider",style:{background:"rgba(245,158,11,0.1)",color:"#B45309",border:"1px solid rgba(245,158,11,0.2)"},title:"guest_agency"===n?"Member of an agency invited to this board":"Individually invited to this board",children:"guest_agency"===n?"Guest agency":"Guest"})]}),r.email&&(0,t.jsx)("div",{className:"text-[10px] text-gray-400 dark:text-zinc-500 truncate",children:r.email})]}),_.has(r._id)&&(0,t.jsx)("div",{className:"ml-auto flex-shrink-0 w-5 h-5 rounded-full bg-emerald-500 flex items-center justify-center shadow-sm",children:(0,t.jsx)("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},r._id)}),0===j.length&&!O&&(0,t.jsx)("p",{className:"px-3 py-3 text-xs text-gray-400 dark:text-zinc-500 text-center",children:b?"No team members match":"No members"})]}),O&&(0,t.jsx)("div",{className:"border-t mt-1 pt-1.5",style:{borderColor:"var(--border-subtle)"},children:(0,t.jsxs)("button",{onClick:$,className:"w-full px-3 py-2.5 flex items-center gap-2.5 text-xs transition-colors duration-150 group",style:{background:"linear-gradient(90deg, rgba(245,158,11,0.06), rgba(236,72,153,0.04))"},children:[(0,t.jsx)("div",{className:"w-7 h-7 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, #F59E0B, #EC4899)",boxShadow:"0 2px 6px rgba(245,158,11,0.25)"},children:(0,t.jsx)(o.EnvelopeIcon,{className:"w-3.5 h-3.5 text-white"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,t.jsxs)("div",{className:"text-gray-800 dark:text-zinc-100 font-bold",children:["Invite external: ",k]}),(0,t.jsx)("div",{className:"text-[10px] text-gray-500 dark:text-zinc-400",children:"They'll get an email and can opt out anytime"})]}),(0,t.jsx)("span",{className:"text-[9px] font-bold px-2 py-0.5 rounded-full flex-shrink-0",style:{background:"rgba(245,158,11,0.12)",color:"#D97706",border:"1px solid rgba(245,158,11,0.2)"},children:"EXT"})]})}),(c||[]).length>0&&(0,t.jsxs)("div",{className:"border-t mt-1 pt-1.5",style:{borderColor:"var(--border-subtle)"},children:[(0,t.jsx)("div",{className:"px-3 pb-1 text-[9px] font-bold uppercase tracking-[0.14em] text-gray-400 dark:text-zinc-500",children:"External"}),c.map(e=>(0,t.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-2 hover:bg-gray-50/80 dark:hover:bg-zinc-900/80 group",children:[(0,t.jsx)("div",{className:"w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, var(--text-label), var(--text-disabled))"},children:(0,t.jsx)(o.EnvelopeIcon,{className:"w-3 h-3 text-white"})}),(0,t.jsx)("span",{className:"text-xs text-gray-600 dark:text-zinc-400 font-medium truncate flex-1",children:e.email}),(0,t.jsx)("button",{onClick:()=>f?.(e.email),className:"text-gray-300 dark:text-zinc-700 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},e.email))]})]})})]})}],825367)},83663,e=>{"use strict";e.s(["fromInputDate",0,function(e){if(!e)return null;let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let r=new Date(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10),12,0,0,0);return isNaN(r.getTime())?null:r.toISOString()},"toInputDate",0,function(e){if(!e)return"";let t=new Date(e);if(isNaN(t.getTime()))return"";let r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${r}-${n}-${i}`}])},822617,168716,e=>{"use strict";function t(e){let t=e instanceof Date?e:new Date(e),r=t.getUTCFullYear(),n=String(t.getUTCMonth()+1).padStart(2,"0"),i=String(t.getUTCDate()).padStart(2,"0");return`${r}-${n}-${i}`}function r(e){let t=e instanceof Date?e:new Date(e);
2if(isNaN(t.getTime()))throw Error(`utcDay: invalid date input: ${e}`);return new Date(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()))}e.s(["addBusinessDays",0,function(e,r,n=[]){if(0===r)return new Date(e);let i=new Set(n.map(e=>t(e))),o=r>0?1:-1,a=Math.abs(r),s=new Date(e);for(;a>0;){let e=(s=new Date(s.getTime()+864e5*o)).getUTCDay();0!==e&&6!==e&&!i.has(t(s))&&a--}return s}],168716),e.s(["businessDaysBetween",0,function(e,t){let n=r(e),i=r(t);if(n.getTime()===i.getTime())return 0;let o=i.getTime()>n.getTime()?1:-1,a=new Date(n),s=0;for(;a.getTime()!==i.getTime();){let e=(a=new Date(a.getTime()+864e5*o)).getUTCDay();0!==e&&6!==e&&(s+=o)}return s},"toBusinessDay",0,function(e){let t=r(e),n=t.getUTCDay();return 6===n?new Date(t.getTime()+1728e5):0===n?new Date(t.getTime()+864e5):t}],822617)},264556,976519,799539,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function({title:e,titleId:r,...n},i){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"}))});e.s(["CodeBracketIcon",0,r],264556);var n=e.i(239351);let i=new n.default.Schema({recipient:{type:n.default.Schema.Types.ObjectId,ref:"User",index:!0},externalEmail:{type:String,lowercase:!0,trim:!0,index:!0,sparse:!0},sender:{type:n.default.Schema.Types.ObjectId,ref:"User"},type:{type:String,enum:["task_assigned","task_collaborator_added","task_status_changed","task_updated","task_comment","task_comment_reply","subtask_comment","task_mention","task_due_soon","task_overdue","task_completed","task_subitem_completed","task_assigned_from_message","direct_message","direct_message_mention","group_message","group_message_mention","message_comment","message_mention","board_invited","form_viewer_added","org_claim_requested","org_claim_approved","org_claim_rejected","org_merge_requested","org_merge_approved","org_merge_executed","org_merge_failed","deal_stage_changed","deal_owner_assigned","pod_assigned","approval_requested","approval_reminder","approval_completed","workflow_stage_completed","final_approval_completed","ready_for_client_delivery","meeting_notes_ready"],required:!0},task:{type:n.default.Schema.Types.ObjectId,ref:"Task",default:null},conversation:{type:n.default.Schema.Types.ObjectId,ref:"Conversation",default:null},message:{type:n.default.Schema.Types.ObjectId,ref:"Message",default:null},dedupeKey:{type:String,default:null,index:!0},title:{type:String,required:!0},body:{type:String,default:""},link:{type:String,default:""},read:{type:Boolean,default:!1,index:!0},readAt:Date,metadata:{type:Map,of:n.default.Schema.Types.Mixed,default:{}}},{timestamps:!0});function o(e){return e?"string"==typeof e?e:"object"==typeof e?e._id||e.id||null:e.toString():null}i.index({recipient:1,read:1,createdAt:-1}),i.index({externalEmail:1,createdAt:-1}),i.index({recipient:1,dedupeKey:1,read:1},{sparse:!0}),i.index({recipient:1,conversation:1,read:1},{sparse:!0}),i.index({recipient:1,task:1,read:1},{sparse:!0}),i.pre("validate",function(e){return this.recipient||this.externalEmail?this.recipient&&this.externalEmail?e(Error("Notification cannot have both recipient and externalEmail")):void e():e(Error("Notification requires either recipient or externalEmail"))}),i.index({createdAt:1},{expireAfterSeconds:7776e3}),n.default.models?.Notification||n.default.model("Notification",i),e.s(["buildTaskLink",0,function(e,t={}){let r=o(e._id)||e._id,n=o(e.linkedCampaign),i=o(e.linkedCreator),a=o(e.linkedPost),s=o(e.organization),c=[];t.commentId&&c.push(`commentId=${t.commentId}`),t.subItemId&&c.push(`subItemId=${t.subItemId}`);let l=e=>c.length?`${e}&${c.join("&")}`:e;return l(n?`/dashboard/user/campaign/${n}?tab=tasks&taskId=${r}`:i?`/dashboard/user/creator/${i}?tab=tasks&taskId=${r}`:s?`/dashboard/user/organization/${s}?tab=tasks&taskId=${r}`:a?`/dashboard/user/post/${a}?taskId=${r}`:`/dashboard/user/tasks?taskId=${r}`)}],976519);var a=e.i(843476),s=e.i(846932),c=e.i(88653),l=e.i(787906);e.s(["default",0,function({status:e,statusColor:r,statusOptions:n=[],onChange:i}){let[o,u]=(0,t.useState)(!1),f=(0,t.useRef)(null),d=(0,t.useRef)(!1);(0,t.useEffect)(()=>{d.current=o},[o]),(0,t.useEffect)(()=>{function e(e){f.current&&!f.current.contains(e.target)&&u(!1)}function t(e){"Escape"===e.key&&d.current&&(e.stopImmediatePropagation(),u(!1))}return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[]);let h=r||"#c4c4c4";return(0,a.jsxs)("div",{ref:f,className:"relative inline-block",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold tracking-wide transition-all duration-200 hover:scale-[1.02] hover:shadow-sm",style:{background:`${h}14`,border:`1px solid ${h}33`,color:h},children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:h}}),e||"No status",(0,a.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 opacity-60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),(0,a.jsx)(c.AnimatePresence,{children:o&&(0,a.jsx)(s.motion.div,{initial:{opacity:0,y:-4,scale:.97}
2,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.97},transition:{duration:.14,ease:[.25,.46,.45,.94]},className:"absolute z-50 mt-1.5 left-0 rounded-xl py-1.5 min-w-[180px] overflow-hidden",style:{background:"var(--surface-panel)",backdropFilter:"blur(20px)",border:"1px solid var(--border-subtle)",boxShadow:"0 12px 32px -8px rgba(0,0,0,0.14)"},children:n.map(t=>{let r=t.color||"#c4c4c4",n=t.label===e;return(0,a.jsxs)("button",{type:"button",onClick:()=>{i(t.label,t.color),u(!1)},className:"w-full flex items-center gap-2.5 px-3 py-2 text-left text-[12px] font-medium transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04]",style:{color:n?r:"var(--text-secondary)"},children:[(0,a.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:r}}),t.label,n&&(0,a.jsx)(l.CheckIcon,{className:"w-3.5 h-3.5 ml-auto flex-shrink-0",style:{color:r}})]},t.label)})})})]})}],799539)},131011,992580,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function({title:e,titleId:r,...n},i){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"}))});e.s(["MagnifyingGlassPlusIcon",0,r],131011);let n=t.forwardRef(function({title:e,titleId:r,...n},i){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM13.5 10.5h-6"}))});e.s(["MagnifyingGlassMinusIcon",0,n],992580)},302292,e=>{"use strict";var t=e.i(271645);let r=t.forwardRef(function({title:e,titleId:r,...n},i){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:i,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m0 0h7.5"}))});e.s(["TableCellsIcon",0,r],302292)},239351,(e,t,r)=>{"u">typeof self?self:e.e,t.exports=(()=>{var e={5507:(e,t,r)=>{"use strict";e.exports=r(1735)},1735:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}
2function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}r(9906).set(r(6333));var c=r(4304);c.setBrowser(!0),t.Error=r(4888),t.Schema=r(5506),t.Types=r(8941),t.VirtualType=r(459),t.SchemaType=r(4289),t.utils=r(6872),t.Document=c(),t.model=function(e,r){var n=function(e){function t(e,n){var s,c;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),s=t,c=[e,r,n],s=a(s),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,o()?Reflect.construct(s,c||[],a(this).constructor):s.apply(this,c))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t.Document);return n.modelName=e,n},"u">typeof window&&(window.mongoose=e.exports,window.Buffer=n)},3434:(e,t,r)=>{"use strict";var n=r(8727),i=r(9620).EventEmitter,o=r(4888),a=r(5506),s=r(6079),c=o.ValidationError,l=r(8859),u=r(5721);function f(e,t,r,i,c){if(!(this instanceof f))return new f(e,t,r,i,c);if(u(t)&&!t.instanceOfSchema&&(t=new a(t)),t=this.schema||t,!this.schema&&t.options._id&&void 0===(e=e||{})._id&&(e._id=new s),!t)throw new o.MissingSchemaError;for(var d in this.$__setSchema(t),n.call(this,e,r,i,c),l(this,t,{decorateDoc:!0}),t.methods)this[d]=t.methods[d];for(var h in t.statics)this[h]=t.statics[h]}f.prototype=Object.create(n.prototype),f.prototype.constructor=f,f.events=new i,f.$emitter=new i,["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"].forEach(function(e){f[e]=function(){return f.$emitter[e].apply(f.$emitter,arguments)}}),f.ValidationError=c,e.exports=f},6787:(e,t,r)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(1795),a=r(3328),s=r(5251),c=r(9739),l=r(2417),u=r(6495),f=r(9981),d=r(2392),h=r(7906),p=r(8751),y=r(5721),b=r(6584),m=r(6872),g=["Polygon","MultiPolygon"];e.exports=function e(t,r,v,x){if(Array.isArray(r))throw Error("Query filter must be an object, got an array ",p.inspect(r));if(null==r)return r;null!=t&&null!=t.discriminators&&null!=r[t.options.discriminatorKey]&&(t=d(t,r[t.options.discriminatorKey])||t);var w,_,S,j,k,O,$=Object.keys(r),A=$.length;for(v=v||{};A--;)if(O=r[j=$[A]],"$or"===j||"$nor"===j||"$and"===j){if(!Array.isArray(O))throw new o("Array",O,j);for(var E=O.length-1;E>=0;E--){if(null==O[E]||"object"!==i(O[E]))throw new o("Object",O[E],j+"."+E);var N=Object.keys(O[E]).length,P=O[E][t.options.discriminatorKey];if(null==P)O[E]=e(t,O[E],v,x);else{var M=d(x.schema,P);O[E]=e(M||t,O[E],v,x)}0===Object.keys(O[E]).length&&0!==N&&O.splice(E,1)}0===O.length&&delete r[j]}else{if("$where"===j){if("string"!==(k=i(O))&&"function"!==k)throw Error("Must have a string or function for $where");"function"===k&&(r[j]=O.toString());continue}if("$expr"===j){O=c(O,t);continue}if("$elemMatch"===j)O=e(t,O,v,x);else if("$text"===j)O=u(O,j);else if("$comment"!==j||t.paths.hasOwnProperty("$comment")){if(!t)continue;if(!(_=t.path(j)))for(var D=j.split("."),I=D.length;I--;){var T=D.slice(0,I).join("."),C=D.slice(I).join("."),B=t.path(T),R=B&&B.schema&&B.schema.options&&B.schema.options.discriminatorKey;if(null!=B&&null!=(B.schema&&B.schema.discriminators)&&null!=R&&C!==R){var L=f(r,T+"."+R),z=B.schema.discriminators;"string"==typeof L&&null!=z[L]?_=z[L].path(C):null!=L&&1===Object.keys(L).length&&Array.isArray(L.$in)&&1===L.$in.length&&"string"==typeof L.$in[0]&&null!=z[L.$in[0]]&&(_=z[L.$in[0]].path(C))}}if(_){if(null==O)continue;if(m.isPOJO(O))if(Object.keys(O).some(h))for(var F=Object.keys(O),U=void 0,q=F.length;q--;)if(S=O[U=F[q]],"$elemMatch"===U)S&&null!=_&&null!=_.schema?e(_.schema,S,v,x):S&&null!=_&&_.$
2isMongooseArray&&(m.isPOJO(S)&&null!=S.$not?e(t,S,v,x):O[U]=_.castForQuery(U,S,x));else if("$not"===U){if(S&&_){if((w=Object.keys(S)).length&&h(w[0]))for(var V in S)S[V]=_.castForQuery(V,S[V],x);else O[U]=_.castForQuery(U,S,x);continue}}else O[U]=_.castForQuery(U,S,x);else r[j]=_.castForQuery(null,O,x);else if(Array.isArray(O)&&-1===["Buffer","Array"].indexOf(_.instance)){var K,H=[],W=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(O);try{for(W.s();!(K=W.n()).done;){var J=K.value;H.push(_.castForQuery(null,J,x))}}catch(e){W.e(e)}finally{W.f()}r[j]={$in:H}}else r[j]=_.castForQuery(null,O,x)}else{for(var G=j.split("."),Y=G.length,X=void 0,Q=void 0,Z=void 0;Y--&&(X=G.slice(0,Y).join("."),!(_=t.path(X))););if(_){if(_.caster&&_.caster.schema){(Z={})[Q=G.slice(Y).join(".")]=O;var ee=e(_.caster.schema,Z,v,x)[Q];void 0===ee?delete r[j]:r[j]=ee}else r[j]=O;continue}if(y(O)){var et="";if(O.$near?et="$near":O.$nearSphere?et="$nearSphere":O.$within?et="$within":O.$geoIntersects?et="$geoIntersects":O.$geoWithin&&(et="$geoWithin"),et){var er=new s.Number("__QueryCasting__"),en=O[et];if(null!=O.$maxDistance&&(O.$maxDistance=er.castForQuery(null,O.$maxDistance,x)),null!=O.$minDistance&&(O.$minDistance=er.castForQuery(null,O.$minDistance,x)),"$within"===et){var ei=en.$center||en.$centerSphere||en.$box||en.$polygon;if(!ei)throw Error("Bad $within parameter: "+JSON.stringify(O));en=ei}else if("$near"===et&&"string"==typeof en.type&&Array.isArray(en.coordinates))en=en.coordinates;else if(("$near"===et||"$nearSphere"===et||"$geoIntersects"===et)&&en.$geometry&&"string"==typeof en.$geometry.type&&Array.isArray(en.$geometry.coordinates))null!=en.$maxDistance&&(en.$maxDistance=er.castForQuery(null,en.$maxDistance,x)),null!=en.$minDistance&&(en.$minDistance=er.castForQuery(null,en.$minDistance,x)),b(en.$geometry)&&(en.$geometry=en.$geometry.toObject({transform:!1,virtuals:!1})),en=en.$geometry.coordinates;else if("$geoWithin"===et)if(en.$geometry){b(en.$geometry)&&(en.$geometry=en.$geometry.toObject({virtuals:!1}));var eo=en.$geometry.type;if(-1===g.indexOf(eo))throw Error('Invalid geoJSON type for $geoWithin "'+eo+'", must be "Polygon" or "MultiPolygon"');en=en.$geometry.coordinates}else b(en=en.$box||en.$polygon||en.$center||en.$centerSphere)&&(en=en.toObject({virtuals:!1}));!function e(t,r,n){if(Array.isArray(t))t.forEach(function(i,o){if(Array.isArray(i)||y(i))return e(i,r,n);t[o]=r.castForQuery(null,i,n)});else for(var i=Object.keys(t),o=i.length;o--;){var a=i[o],s=t[a];Array.isArray(s)||y(s)?(e(s,r,n),t[a]=s):t[a]=r.castForQuery({val:s,context:n})}}(en,er,x);continue}}if(t.nested[j])continue;var ea="strict"in v?v.strict:t.options.strict,es=function(e,t,r,n){if("strictQuery"in e)return e.strictQuery;if("strictQuery"in t)return t.strictQuery;var i=n&&n.mongooseCollection&&n.mongooseCollection.conn&&n.mongooseCollection.conn.base&&n.mongooseCollection.conn.base.options;return i&&"strictQuery"in i?i.strictQuery:r.strictQuery}(v,t._userProvidedOptions,t.options,x);if(v.upsert&&ea){if("throw"===ea)throw new a(j);throw new a(j,'Path "'+j+'" is not in schema, strict mode is `true`, and upsert is `true`.')}if("throw"===es)throw new a(j,'Path "'+j+"\" is not in schema and strictQuery is 'throw'.");es&&delete r[j]}}else O=l(O,j),r[j]=O}return r}},3087:(e,t,r)=>{"use strict";var n=r(9373),i=r(4029).Long;e.exports=function(e){return null==e?e:""===e?null:"bigint"==typeof e?e:e instanceof i?e.toBigInt():"string"==typeof e||"number"==typeof e?BigInt(e):void n.ok(!1)}},6670:(e,t,r)=>{"use strict";var n=r(1795);e.exports=function(t,r){if(e.exports.convertToTrue.has(t))return!0;
2if(e.exports.convertToFalse.has(t))return!1;if(null==t)return t;throw new n("boolean",t,r)},e.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]),e.exports.convertToFalse=new Set([!1,"false",0,"0","no"])},195:(e,t,r)=>{"use strict";var n=r(9373);e.exports=function(e){var t;return null==e||""===e?null:e instanceof Date?(n.ok(!isNaN(e.valueOf())),e):(n.ok("boolean"!=typeof e),isNaN((t=new Date(e instanceof Number||"number"==typeof e?e:"string"==typeof e&&!isNaN(Number(e))&&(Number(e)>=275761||-271820>Number(e))?Number(e):"function"==typeof e.valueOf?e.valueOf():e)).valueOf())?void n.ok(!1):t)}},6209:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(5003),a=r(9373);e.exports=function(e){return null==e?e:"object"===i(e)&&"string"==typeof e.$numberDecimal?o.fromString(e.$numberDecimal):e instanceof o?e:"string"==typeof e?o.fromString(e):"function"==typeof n&&n.isBuffer(e)||"function"==typeof Uint8Array&&e instanceof Uint8Array?new o(e):"number"==typeof e?o.fromString(String(e)):"function"==typeof e.valueOf&&"string"==typeof e.valueOf()?o.fromString(e.valueOf()):void a.ok(!1)}},3065:(e,t,r)=>{"use strict";var n=r(9373);e.exports=function(e){return null==e?e:""===e?null:("string"!=typeof e&&"boolean"!=typeof e||(e=Number(e)),n.ok(!isNaN(e)),e instanceof Number?e.valueOf():"number"==typeof e?e:Array.isArray(e)||"function"!=typeof e.valueOf?e.toString&&!Array.isArray(e)&&e.toString()==Number(e)?Number(e):void n.ok(!1):Number(e.valueOf()))}},4731:(e,t,r)=>{"use strict";var n=r(1563),i=r(6079);e.exports=function(e){if(null==e||n(e,"ObjectId"))return e;if(e._id){if(n(e._id,"ObjectId"))return e._id;if(e._id.toString instanceof Function)return new i(e._id.toString())}return new i(e.toString instanceof Function?e.toString():e)}},2417:(e,t,r)=>{"use strict";var n=r(1795);e.exports=function(e,t){if(null==e)return e;if(e._id&&"string"==typeof e._id)return e._id;if(e.toString&&e.toString!==Object.prototype.toString&&!Array.isArray(e))return e.toString();
2throw new n("string",e,t)}},8727:(e,t,r)=>{"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=Object.create((n&&n.prototype instanceof l?n:l).prototype);return i(s,"_invoke",function(r,n,i){var o,a,s,l=0,u=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,a=0,s=e,d.n=r,c}};function h(r,n){for(a=r,s=n,t=0;!f&&l&&!i&&t<u.length;t++){var i,o=u[t],h=d.p,p=o[2];r>3?(i=p===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,d.v=n,d.n=o[1]):h<p&&(i=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,d.n=p,a=0))}if(i||r>1)return c;throw f=!0,n}return function(i,u,p){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),a=u,s=p;(t=a<2?e:s)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.v=s);try{if(l=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?s:r.call(n,d))!==c)break}catch(t){o=e,a=1,s=t}finally{l=1}}return{value:t,done:f}}}(r,o,a),!0),s}var c={};function l(){}function u(){}function f(){}t=Object.getPrototypeOf;var d=f.prototype=l.prototype=Object.create([][o]?t(t([][o]())):(i(t={},o,function(){return this}),t));function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=f,i(d,"constructor",f),i(f,"constructor",u),u.displayName="GeneratorFunction",i(f,a,"GeneratorFunction"),i(d),i(d,a,"Generator"),i(d,o,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(n=function(){return{w:s,m:h}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function(e,t,r,n){function a(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,r,n)}function o(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,c,"next",e)}function c(e){o(a,n,i,s,c,"throw",e)}s(void 0)})}}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(e,t,r){var n;return(n=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=d(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==d(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return f(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var h,p,y,b,m,g=r(9620).EventEmitter,v=r(6379),x=r(4888),w=r(3861),_=r(4107),S=r(900),j=r(7962),k=r(5506),O=r(3328),$=r(122),A=r(2037),E=r(7427),N=r(2874),P=r(4134),M=r(1973),D=r(8724).M,I=r(8724).c,T=r(2829).x,C=r(9981),B=r(111),R=r(37),L=r(9728),z=r(719),F=r(1490),U=r(2183),q=r(9098),V=r(8751).inspect,K=r(4962).h,H=r(5837),W=r(3564),J=r(2888),G=r(6872),Y=r(5543),X=G.deepEqual,Q=G.isMongooseObject,Z=r(8770).arrayAtomicsBackupSymbol,ee=r(8770).arrayAtomicsSymbol,et=r(8770).documentArrayParent,er=r(8770).documentIsModified,en=r(8770).documentModifiedPaths,ei=r(8770).documentSchemaSymbol,eo=r(8770).getSymbol,ea=r(8770).populateModelSymbol,es=r(8770).scopeSymbol,ec=r(8107).schemaMixedSymbol,el=r(251),eu=r(9585),ef=r(8770).sessionNewDocuments,ed=G.specialProperties,eh=G.object.hasOwnProperty;function ep(e,t,r,n){if("object"===d(r)&&null!=r&&(r=(n=r).skipId),n=Object.assign({},n),null==this.$__schema){var i=G.isObject(t)&&!t.instanceOfSchema?new k(t):t;this.$__setSchema(i),t=r,r=n,n=arguments[4]||{}}if(this.$__=new v,null!=n.isNew&&!0!==n.isNew&&(this.$isNew=n.isNew),null!=n.priorDoc&&(this.$__.priorDoc=n.priorDoc),r&&(this.$__.skipId=r),null!=e&&"object"!==d(e))throw new S(e,"obj","Document");var o=!0;void 0!==n.defaults&&(this.$__.defaults=n.defaults,o=n.defaults);var a=this.$__schema;"boolean"==typeof t||"throw"===t?(!0!==t&&(this.$__.strictMode=t),t=void 0):!0!==a.options.strict&&(this.$__.strictMode=a.options.strict);var s,c=u(a.requiredPaths(!0));try{for(c.s();!(s=c.n()).done;){var l=s.value;this.$__.activePaths.require(l)}}catch(e){c.e(e)}finally{c.f()}var f=null;G.isPOJO(t)&&Object.keys(t).length>0&&(f=q(t),this.$__.selected=t,this.$__.exclude=f);var h=!1===f&&t?E(t):null;if(null==this._doc&&(this.$__buildDoc(e,t,r,f,h,!1),o&&N(this,t,f,h,!0,null)),e&&(this.$__original_set?this.$__original_set(e,void 0,!0,n):this.$set(e,void 0,!0,n),e instanceof ep&&(this.$isNew=e.$isNew)),n.willInit&&o?n.skipDefaults&&(this.$__.skipDefaults=n.skipDefaults):o&&N(this,t,f,h,!1,n.skipDefaults),!this.$__.strictMode&&e){var p=this;
2Object.keys(this._doc).forEach(function(e){e in a.tree||e in a.methods||e in a.virtuals||e.startsWith("$")||I({prop:e,subprops:null,prototype:p})})}!function(e){var t=e.$__schema&&e.$__schema.callQueue;if(t.length){var r,n=u(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;"pre"!==i[0]&&"post"!==i[0]&&"on"!==i[0]&&e[i[0]].apply(e,i[1])}}catch(e){n.e(e)}finally{n.f()}}}(this)}for(var ey in ep.prototype.$isMongooseDocumentPrototype=!0,Object.defineProperty(ep.prototype,"isNew",{get:function(){return this.$isNew},set:function(e){this.$isNew=e}}),Object.defineProperty(ep.prototype,"errors",{get:function(){return this.$errors},set:function(e){this.$errors=e}}),ep.prototype.$isNew=!0,G.each(["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"],function(e){ep.prototype[e]=function(){if(!this.$__.emitter){if("emit"===e)return;this.$__.emitter=new g,this.$__.emitter.setMaxListeners(0)}return this.$__.emitter[e].apply(this.$__.emitter,arguments)},ep.prototype["$".concat(e)]=ep.prototype[e]}),ep.prototype.constructor=ep,g.prototype)ep[ey]=g.prototype[ey];function eb(e,t,r){var n={};!function(e){var t=Object.keys(e.$__.activePaths.getStatePaths("require")),r=0,n=t.length;for(r=0;r<n;++r){var i=t[r],o=e.$__schema.path(i);if(null!=o&&"function"==typeof o.originalRequiredValue){e.$__.cachedRequired=e.$__.cachedRequired||{};try{e.$__.cachedRequired[i]=o.originalRequiredValue.call(e,e)}catch(t){e.invalidate(i,t)}}}}(e);var i=new Set(Object.keys(e.$__.activePaths.getStatePaths("require")).filter(function(t){return!(!e.$__isSelected(t)&&!e.$isModified(t))&&(null==e.$__.cachedRequired||!(t in e.$__.cachedRequired)||e.$__.cachedRequired[t])}));function o(e){i.add(e)}Object.keys(e.$__.activePaths.getStatePaths("init")).forEach(o),Object.keys(e.$__.activePaths.getStatePaths("modify")).forEach(o),Object.keys(e.$__.activePaths.getStatePaths("default")).forEach(o);var a,s=e.$getAllSubdocs(),c=e.modifiedPaths(),l=u(s);try{for(l.s();!(a=l.n()).done;){var f=a.value;if(f.$basePath){var d,h=f.$isSingleNested?f.$__pathRelativeToParent():f.$__fullPathWithIndexes(),p=u(f.modifiedPaths());try{for(p.s();!(d=p.n()).done;){var y=d.value;i.delete(h+"."+y)}}catch(e){p.e(e)}finally{p.f()}!e.$isModified(h,null,c)||e.isDirectModified(h)||e.$isDefault(h)||(i.add(h),null==e.$__.pathsToScopes&&(e.$__.pathsToScopes={}),e.$__.pathsToScopes[h]=f.$isDocumentArrayElement?f.__parentArray:f.$parent(),n[h]={skipSchemaValidators:!0},f.$isDocumentArrayElement&&null!=f.__index&&(n[h].index=f.__index))}}}catch(e){l.e(e)}finally{l.f()}var b,m=u(i);try{for(m.s();!(b=m.n()).done;){var g=b.value,v=e.$__schema.path(g);if(v){if(v.$isMongooseDocumentArray){var x,w=u(i);try{for(w.s();!(x=w.n()).done;){var _=x.value;(null==_||_.startsWith(v.path+"."))&&i.delete(_)}}catch(e){w.e(e)}finally{w.f()}}(v.caster||0!==v.validators.length||v.$parentSchemaDocArray)&&(!v.$isMongooseArray||v.$isMongooseDocumentArray||v.$embeddedSchemaType.$isMongooseArray||0!==v.validators.length||0!==v.$embeddedSchemaType.validators.length)||i.delete(g)}}}catch(e){m.e(e)}finally{m.f()}var S,j=u(i);try{for(j.s();!(S=j.n()).done;){var k=S.value;e.$__schema.singleNestedPaths.hasOwnProperty(k)&&i.delete(k)}}catch(e){j.e(e)}finally{j.f()}Array.isArray(t)?i=function(e,t){var r,n=new Set(t),i=new Map([]),o=u(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(-1!==a.indexOf("."))for(var s=a.split("."),c=s[0],l=1;l<s.length;++l)i.set(c,a),c=c+"."+s[l]}}catch(e){o.e(e)}finally{o.f()}var f,d=new Set,h=u(e);try{for(h.s();!(f=h.n()).done;){var p=f.value;n.has(p)?d.add(p):i.has(p)&&d.add(i.get(p))}}catch(e){h.e(e)}finally{h.f()}return d}(i,t):Array.isArray(r)&&(O=i,$=new Set($=r),i=new Set(O=Array.from(O).filter(function(e){return!$.has(e)})));var O,$,A,E=u(i);try{for(E.s();!(A=E.n()).done;){var N=A.value,P=e.$__schema.path(N);P&&P.$isMongooseArray&&(Array.isArray(P)||!P.$isMongooseDocumentArray||P&&P.schemaOptions&&P.schemaOptions.required)&&(!P.$isMongooseArray||P.$isMongooseDocumentArray||P.$embeddedSchemaType.$isMongooseArray||0!==P.$embeddedSchemaType.validators.length)&&function e(t,r,n){if(null!=t)for(var i=t.length,o=0;o<i;++o)Array.isArray(t[o])?e(t[o],r,n+"."+o):r.add(n+"."+o)}(e.$__getValue(N),i,N)}}catch(e){E.e(e)}finally{E.f()}var M,D={skipArrays:!0},I=u(i);try{for(I.s();!(M=I.n()).done;){var C=M.value;if(e.$__schema.nested[C]){var B=e.$__getValue(C);Q(B)&&(B=B.toObject({transform:!1}));var R=T(B,C,D,e.$__schema);
2Object.keys(R).forEach(o)}}}catch(e){I.e(e)}finally{I.f()}var L,z=u(i);try{for(z.s();!(L=z.n()).done;){var F=L.value,U=e.$__schema.path(F);if(U&&(U.$parentSchemaDocArray&&"string"==typeof U.$parentSchemaDocArray.path&&i.add(U.$parentSchemaDocArray.path),U.$isSchemaMap)){var q=e.$__getValue(F);if(null!=q){var V,K=u(q.keys());try{for(K.s();!(V=K.n()).done;){var H=V.value;i.add(F+"."+H)}}catch(e){K.e(e)}finally{K.f()}}}}}catch(e){z.e(e)}finally{z.f()}return[i=Array.from(i),n]}function em(e,t,r,n){var i,o,a,s=e.$__schema,c=Object.keys(s.virtuals),l=c.length,u=l,f=e._doc,d="boolean"!=typeof(n&&n.aliases)||n.aliases,h=null;if(Array.isArray((r=r||{}).virtuals))h=new Set(r.virtuals);else if(r.virtuals&&r.virtuals.pathsToSkip){h=new Set(c);for(var p=0;p<r.virtuals.pathsToSkip.length;p++)h.has(r.virtuals.pathsToSkip[p])&&h.delete(r.virtuals.pathsToSkip[p])}if(!f)return t;for(l=0;l<u;++l)if(i=c[l],(null==h||h.has(i))&&(d||!s.aliases.hasOwnProperty(i))){if(o=i,null!=r.path){if(!i.startsWith(r.path+"."))continue;o=i.substring(r.path.length+1)}var y=o.split(".");if(void 0!==(a=M(e.get(i),r))){var b=y.length;f=t;for(var m=0;m<b-1;++m)f[y[m]]=f[y[m]]||{},f=f[y[m]];f[y[b-1]]=a}}return t}function eg(e,t){if(Y(t))throw Error("`transform` function must be synchronous, but the transform on path `"+e+"` returned a promise.")}ep.prototype.$__schema,ep.prototype.schema,Object.defineProperty(ep.prototype,"$locals",{configurable:!1,enumerable:!1,get:function(){return null==this.$__.locals&&(this.$__.locals={}),this.$__.locals},set:function(e){this.$__.locals=e}}),ep.prototype.isNew,Object.defineProperty(ep.prototype,"$where",{configurable:!1,enumerable:!1,writable:!0}),ep.prototype.id,ep.prototype.$errors,Object.defineProperty(ep.prototype,"$op",{get:function(){return this.$__.op||null},set:function(e){this.$__.op=e}}),ep.prototype.$__buildDoc=function(e,t,r,n,i){for(var o={},a=Object.keys(this.$__schema.paths).filter(function(e){return!e.includes("$*")}),s=a.length,c=0;c<s;++c){var l=a[c];if("_id"!==l||!r&&(!e||!("_id"in e)))for(var u=this.$__schema.paths[l].splitPath(),f=u.length,d=f-1,h="",p=o,y=!1,b=0;b<f;++b){var m=u[b];if(h.length?h+="."+m:h=m,!0===n){if(h in t)break}else if(!1===n&&t&&!y){if(h in t)y=!0;else if(!i[h])break}b<d&&(p=p[m]||(p[m]={}))}}this._doc=o},ep.prototype.toBSON=function(){return this.toObject(K)},ep.prototype.init=function(e,t,r){return"function"==typeof t&&(r=t,t=null),this.$__init(e,t),r&&r(null,this),this},ep.prototype.$init=function(){return this.constructor.prototype.init.apply(this,arguments)},ep.prototype.$__init=function(e,t){if(this.$isNew=!1,t=t||{},null!=e._id&&t.populated&&t.populated.length){var r,n=String(e._id),i=u(t.populated);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.isVirtual?this.$populated(o.path,G.getValue(o.path,e),o):this.$populated(o.path,o._docs[n],o),null!=o._childDocs){var a,s=u(o._childDocs);try{for(s.s();!(a=s.n()).done;){var c=a.value;null!=c&&null!=c.$__&&(c.$__.parent=this)}}catch(e){s.e(e)}finally{s.f()}o._childDocs=[]}}}catch(e){i.e(e)}finally{i.f()}}(function e(t,r,n,i,o){o=o||"",null!=r.$__&&(r=r._doc);for(var a,s,c,l=Object.keys(r),u=l.length,f=0,d=t.$__.strictMode,h=t.$__schema;f<u;)!function(u){if("__proto__"!==(c=l[u])&&"constructor"!==c&&(s=o?o+c:c,a=h.path(s),!h.$isRootDiscriminator||t.$__isSelected(s))){var f=r[c];if(!a&&G.isPOJO(f))n[c]||(n[c]={},d||c in h.tree||c in h.methods||c in h.virtuals||(t[c]=n[c])),e(t,f,n[c],i,s+".");else if(a){if(n.hasOwnProperty(c)&&void 0!==f&&delete n[c],null===f)n[c]=a._castNullish(null);else if(void 0!==f){var p=null==f.$__?null:f.$__.wasPopulated;if(a&&!p)try{i&&i.setters?n[c]=a.applySetters(f,t,!1):n[c]=a.cast(f,t,!0)}catch(e){t.invalidate(e.path,new A({path:e.path,message:e.message,type:"cast",value:e.value,reason:e}))}else n[c]=f}t.$isModified(s)||t.$__.activePaths.init(s)}else n[c]=f,d||o||(t[c]=f)}}(f++)})(this,e,this._doc,t),H(this,t.populated),this.$emit("init",this),this.constructor.emit("init",this);var l=!1===this.$__.exclude&&this.$__.selected?E(this.$__.selected):null;return N(this,this.$__.selected,this.$__.exclude,l,!1,this.$__.skipDefaults),this},ep.prototype.updateOne=function(e,t,r){var n=this.constructor.updateOne({_id:this._id},e,t),i=this;return n.pre(function(e){i.constructor._middleware.execPre("updateOne",i,[i],e)}),n.post(function(e){i.constructor._middleware.execPost("updateOne",i,[i],{},e)}),null!=this.$session()&&("session"in n.options||(n.options.session=this.$session())),null!=r?n.exec(r):n},ep.prototype.replaceOne=function(){var e=Array.prototype.slice.call(arguments);return e.unshift({_id:this._id}),this.constructor.replaceOne.apply(this.constructor,e)},ep.prototype.$session=function(e){if(0==arguments.length)return null!=this.$__.session&&this.$__.session.hasEnded?(this.$__.session=null,null):this.$__.session;if(null!=e&&e.hasEnded)throw new x("Cannot set a document's session to a session that has ended. Make sure you haven't called `endSession()` on the session you are passing to `$session()`.");if(null!=e||null!=this.$__.session){if(this.$__.session=e,!this.$isSubdocument){var t,r=u(this.$getAllSubdocs());try{for(r.s();!(t=r.n()).done;)t.value.$session(e)}catch(e){r.e(e)}finally{r.f()}}return e}},ep.prototype.$timestamps=function(e){return 0==arguments.length?null!=this.$__.timestamps?this.$__.timestamps:this.$__schema?this.$__schema.options.timestamps:void 0:(e!==this.$timestamps()&&(this.$__.timestamps=e),this)},ep.prototype.overwrite=function(e){for(var t=0,r=Array.from(new Set(Object.keys(this._doc).concat(Object.keys(e))));t<r.length;t++){var n=r[t];"_id"!==n&&(this.$__schema.options.versionKey&&n===this.$__schema.options.versionKey||this.$__schema.options.discriminatorKey&&n===this.$__schema.options.discriminatorKey||this.$set(n,e[n]))}return this},ep.prototype.$set=function(e,t,r,n){var i=this;G.isPOJO(r)&&(n=r,r=void 0);var o,a,s,f,h=n&&n.merge,p=r&&!0!==r,y=!0===r,b=0,m=n&&"strict"in n,g=m?n.strict:this.$__.strictMode;if(p&&((this.$__.adhocPaths||(this.$__.adhocPaths={}))[e]=this.$__schema.interpretAsType(e,r,this.$__schema.options)),null==e){var v=[t,e];e=v[0],t=v[1]}else if("string"!=typeof e){if(e instanceof ep&&(e=e.$__isNested?e.toObject():e.$__schema===this.$__schema?em(e,c({},e._doc)):e._doc),null==e){var S=[t,e];e=S[0],t=S[1]}f=t?t+".":"";var j=(o=R(this.$__schema,e)).length,k=n&&n._skipMinimizeTopLevel||!1;if(0===j&&k)return delete n._skipMinimizeTopLevel,t&&this.$set(t,{}),this;n=Object.assign({},n,{_skipMinimizeTopLevel:!1});for(var $=0;$<j;++$){s=o[$];var A=f?f+s:s;a=this.$__schema.pathType(A);var E=e[s];if(!0!==r||f||null==E||"nested"!==a||null==this._doc[s]||delete this._doc[s],G.isNonBuiltinObject(E)&&"nested"===a)this.$set(A,E,y,Object.assign({},n,{_skipMarkModified:!0})),function(e,t,r){if(null!=e)for(var n=Object.keys(r.$__schema.paths),i=n.length,o=-1===t.indexOf(".")?[t]:t.split("."),a=0;a<i;++a){var s="",c=n[a];if(c.startsWith(t+".")){var l=r.$__schema.paths[c],u=l.splitPath().slice(o.length),f=u.length;if(void 0!==l.defaultValue)for(var d=e,h=0;h<f&&null!=d;++h){var p=u[h];if(h===f-1){if(void 0!==d[p])break;try{var y=l.getDefault(r,!1);void 0!==y&&(d[p]=y)}catch(e){r.invalidate(t+"."+s,e)}break}s+=(s.length?".":"")+p,d[p]=d[p]||{},d=d[p]}}}}(this.$get(A),A,this);else if(g){if(y&&void 0===E&&void 0!==this.$get(A))continue;if("adhocOrUndefined"===a&&(a=B(this,A,{typeOnly:!0})),"real"===a||"virtual"===a)this.$set(A,E,y,n);else if("nested"===a&&E instanceof ep)this.$set(A,E.toObject({transform:!1}),y,n);else{if("throw"===g)throw"nested"===a?new _(s,E):new O(s);"nested"===a&&null==E&&this.$set(A,E,y,n)}}else void 0!==E&&this.$set(A,E,y,n)}for(var N={},M=Object.keys(this.$__schema.tree),D=0,I=M.length;D<I;++D)(s=M[D])&&this._doc.hasOwnProperty(s)&&(N[s]=void 0);return this._doc=Object.assign(N,this._doc),this}var T=this.$__schema.pathType(e),C=null;if("adhocOrUndefined"===T&&(T=B(this,C=-1===e.indexOf(".")?[e]:e.split("."),{typeOnly:!0})),"adhocOrUndefined"===T&&!m){null==C&&(C=-1===e.indexOf(".")?[e]:e.split("."));var F=L(this.$__schema,C);void 0!==F&&(g=F)}t=z(t);var U,q=null!=i.$__.priorDoc?i.$__.priorDoc.$__getValue(e):y?void 0:i.$__getValue(e);if("nested"===T&&t){if("object"===d(t)&&null!=t){if(null!=t.$__&&(t=t.toObject(K)),null==t)return this.invalidate(e,new x.CastError("Object",t,e)),this;var V=this.$isModified(e),H=null!=this.$__.savedState&&this.$__.savedState.hasOwnProperty(e);if(null!=this.$__.savedState&&!this.$isNew&&!this.$__.savedState.hasOwnProperty(e)){var J=this.$__getValue(e);this.$__.savedState[e]=J;for(var Y=0,X=Object.keys(J||{});Y<X.length;Y++){var Q=X[Y];this.$__.savedState[e+"."+Q]=J[Q]}}if(h)return this.$set(t,e,y,n);this.$__setValue(e,null),P(this,e);var Z=R(this.$__schema,t,e);this.$__setValue(e,{});var ee,et=u(Z);try{for(et.s();!(ee=et.n()).done;){var er=ee.value;this.$set(e+"."+er,t[er],y,c(c({},n),{},{_skipMarkModified:!0}))}}catch(e){et.e(e)}finally{et.f()}return null!=q&&(!V||H)&&G.deepEqual(H?this.$__.savedState[e]:q,t)?this.unmarkModified(e):this.markModified(e),this}return this.invalidate(e,new x.CastError("Object",t,e)),this}if(null==C&&(C=-1===e.indexOf(".")?[e]:e.split(".")),"string"==typeof this.$__schema.aliases[C[0]]&&(C[0]=this.$__schema.aliases[C[0]]),"adhocOrUndefined"===T&&g){for(b=0;b<C.length;++b){var en=C.slice(0,b+1).join(".");if(b+1<C.length&&"virtual"===this.$__schema.pathType(en))return W.set(e,t,this),this;if(null!=(U=this.$__schema.path(en))){if(U instanceof w){ei=!0;break}if(U.$isSchemaMap&&U.$__schemaType instanceof w&&b<C.length-1){ei=!0,U=U.$__schemaType;break}}}if(null==U&&(U=B(this,e)),!ei&&!U){if("throw"===g)throw new O(e);return this}}else{if("virtual"===T)return(U=this.$__schema.virtualpath(e)).applySetters(t,this),this;U=this.$__path(e)}var ei,eo,es=this._doc,ec="";for(b=0;b<C.length-1;++b)es=es[C[b]],ec+=(0!==ec.length?".":"")+C[b],es||(this.$set(ec,{}),this.$__isSelected(ec)||this.unmarkModified(ec),es=this.$__getValue(ec));if(C.length<=1)eo=e;else{var el=C.length;for(b=0;b<el;++b){var ed=C.slice(0,b+1).join(".");if(null===this.$get(ed,null,{getters:!1})){eo=ed;break}}eo||(eo=e)}if(!U)return this.$__set(eo,e,n,y,C,U,t,q),"nested"===T&&null==t&&P(this,e),this;if((U.$isSingleNested||U.$isMongooseArray)&&function(e,t){if(e.$__.validationError){for(var r=0,n=Object.keys(e.$__.validationError.errors);r<n.length;r++){var i=n[r];i.startsWith(t+".")&&delete e.$__.validationError.errors[i]}0===Object.keys(e.$__.validationError.errors).length&&(e.$__.validationError=null)}}(this,e),null!=t&&h&&U.$isSingleNested){t instanceof ep&&(t=t.toObject({virtuals:!1,transform:!1}));for(var eh=0,ey=Object.keys(t);eh<ey.length;eh++){var eb=ey[eh];this.$set(e+"."+eb,t[eb],y,n)}return this}var eg=!0;try{var ev,ex=function(){if(null==U.options||!(t instanceof ep))return!1;var e=t.constructor,r=U.options.ref;if(null!=r&&(r===e.modelName||r===e.baseModelName))return!0;var n=U.options.refPath;if(null==n)return!1;var i=t.get(n);return i===e.modelName||i===e.baseModelName}(),ew=!1;if(ex&&t instanceof ep&&(!t.$__.wasPopulated||G.deepEqual(t.$__.wasPopulated.value,t._id
2))){var e_=U&&U.$isSingleNested?U.cast(t,this):t._id;this.$populated(e,e_,l({},ea,t.constructor)),t.$__.wasPopulated={value:e_},ew=!0}var eS=this.$__schema.options.typeKey;if(U.options&&Array.isArray(U.options[eS])&&U.options[eS].length&&U.options[eS][0].ref&&function(e,t){if(!Array.isArray(e)||0===e.length)return!1;var r,n=u(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(!(i instanceof ep)||null==i.constructor.modelName||i.constructor.modelName!=t&&i.constructor.baseModelName!=t)return!1}}catch(e){n.e(e)}finally{n.f()}return!0}(t,U.options[eS][0].ref)){ev=l({},ea,t[0].constructor),this.$populated(e,t.map(function(e){return e._id}),ev);var ej,ek=u(t);try{for(ek.s();!(ej=ek.n()).done;){var eO=ej.value;eO.$__.wasPopulated={value:eO._id}}}catch(e){ek.e(e)}finally{ek.f()}ew=!0}if(!ex||!U.$isSingleNested||!t.$__){var e$=this;null!=this.$__schema.singleNestedPaths[e]&&C.length>1&&(e$=eu(this,C,this.schema)),t=null!=n&&n.overwriteImmutable?U.applySetters(t,e$,!1,q,{overwriteImmutable:!0}):U.applySetters(t,e$,!1,q)}if(Array.isArray(t)&&!Array.isArray(U)&&U.$isMongooseDocumentArray&&0!==t.length&&null!=t[0]&&null!=t[0].$__&&null!=t[0].$__.populated){for(var eA=Object.keys(t[0].$__.populated),eE=0;eE<eA.length;eE++)!function(){var r=eA[eE];i.$populated(e+"."+r,t.map(function(e){return e.$populated(r)}),t[0].$__.populated[r].options)}();ew=!0}if(!ew&&this.$__.populated){if(Array.isArray(t)&&this.$__.populated[e])for(var eN=0;eN<t.length;++eN)t[eN]instanceof ep&&t.set(eN,t[eN]._id,!0);delete this.$__.populated[e]}null!=t&&U.$isSingleNested&&function(e,t,r){var n=t.schema;if(null!=n)for(var i=0,o=Object.keys(n.paths);i<o.length;i++){var a=o[i],s=n.paths[a];if(null!=s.$immutableSetter){var c=null==r?void 0:r.$__getValue(a);s.$immutableSetter.call(e,c)}}}(t,U,q),this.$markValid(e)}catch(r){r instanceof x.StrictModeError&&r.isImmutableError?this.invalidate(e,r):r instanceof x.CastError?(this.invalidate(r.path,r),r.$originalErrorPath&&this.invalidate(e,new x.CastError(U.instance,t,e,r.$originalErrorPath))):this.invalidate(e,new x.CastError(U.instance,t,e,r)),eg=!1}if(eg){var eP,eM=null,eD=null;if(!y){var eI=this.$isSubdocument?this.ownerDocument():this;eM=eI.$__.savedState,eD=this.$isSubdocument?this.$__.fullPath+"."+e:e,eI.$__saveInitialState(eD)}this.$__set(eo,e,n,y,C,U,t,q);var eT=!(null==(eP=this.$__.session)||!eP.transaction),eC=this.$__.session&&this.$__.session[ef]&&this.$__.session[ef].has(this)&&this.$__.session[ef].get(this).modifiedPaths&&!this.$__.session[ef].get(this).modifiedPaths.has(eD);null!=eM&&eM.hasOwnProperty(eD)&&(!eT||eC)&&G.deepEqual(t,eM[eD])&&this.unmarkModified(e)}return U.$isSingleNested&&(this.isDirectModified(e)||null==t)&&P(this,e),this},ep.prototype.set=ep.prototype.$set,ep.prototype.$__shouldModify=function(e,t,r,n,i,o,a,s){return!(r&&r._skipMarkModified||!this.$isNew&&!(t in this.$__.activePaths.getStatePaths("modify"))&&(void 0!==a||this.$__isSelected(t))&&(void 0===a&&t in this.$__.activePaths.getStatePaths("default")||this.$populated(t)&&a instanceof ep&&X(a._id,s)||X(a,void 0!==s?s:G.getValue(t,this))&&(n||null==a||!(t in this.$__.activePaths.getStatePaths("default"))||!X(a,o.getDefault(this,n)))))},ep.prototype.$__set=function(e,t,n,i,o,a,s,c){m=m||r(1568),this.$__shouldModify(e,t,n,i,o,a,s,c)?(this.$__.primitiveAtomics&&this.$__.primitiveAtomics[t]&&(delete this.$__.primitiveAtomics[t],0===Object.keys(this.$__.primitiveAtomics).length&&delete this.$__.primitiveAtomics),this.markModified(e),b||(b=r(1362)),s&&G.isMongooseArray(s)&&(s._registerAtomic("$set",s),G.isMongooseDocumentArray(s)&&s.forEach(function(e){e&&e.__parentArray&&(e.__parentArray=s)}))):Array.isArray(s)&&Array.isArray(c)&&G.isMongooseArray(s)&&G.isMongooseArray(c)&&(s[ee]=c[ee],s[Z]=c[Z],G.isMongooseDocumentArray(s)&&s.forEach(function(e){null!=e&&(e.$isNew=!1)}));for(var l=this._doc,u=0,f=o.length,d="";u<f;u++){var h=u+1===f;if(d+=d?"."+o[u]:o[u],ed.has(o[u]))return;if(h)l instanceof Map?l.set(o[u],s):l.$isSingleNested?(o[u]in l||(l[o[u]]=s),l._doc[o[u]]=s):l[o[u]]=s;else{var p=l instanceof Map,y=p?l.get(o[u]):l[o[u]];
2G.isPOJO(y)||y&&y instanceof m||y&&!Array.isArray(y)&&y.$isSingleNested||y&&Array.isArray(y)||null==y&&(y={},p?l.set(o[u],y):l[o[u]]=y),l=y}}},ep.prototype.$__getValue=function(e){return G.getValue(e,this._doc)},ep.prototype.$inc=function(e,t){var r=this;if(null==t&&(t=1),Array.isArray(e))return e.forEach(function(e){return r.$inc(e,t)}),this;var n=this.$__path(e);if(null==n){if("throw"===this.$__.strictMode)throw new O(e);if(!0===this.$__.strictMode)return this}else if("Number"!==n.instance)return this.invalidate(e,new x.CastError(n.instance,t,e)),this;var i=this.$__getValue(e)||0,o=!1,a=null,s=t;try{t=n.cast(t),s=(a=n.applySetters(i+t,this))-i,o=!0}catch(r){this.invalidate(e,new x.CastError("number",t,e,r))}return o&&(this.$__.primitiveAtomics=this.$__.primitiveAtomics||{},null==this.$__.primitiveAtomics[e]?this.$__.primitiveAtomics[e]={$inc:s}:this.$__.primitiveAtomics[e].$inc+=s,this.markModified(e),this.$__setValue(e,a)),this},ep.prototype.$__setValue=function(e,t){return G.setValue(e,t,this._doc),this},ep.prototype.get=function(e,t,r){null==r&&(r={}),t&&(n=this.$__schema.interpretAsType(e,t,this.$__schema.options));var n,i=r.noDottedPath,o=i?eh(this.$__schema.paths,e)?this.$__schema.paths[e]:void 0:this.$__path(e);if(null==o&&null!=(o=this.$__schema.virtualpath(e)))return o.applyGetters(void 0,this);if(i){var a=eh(this._doc,e)?this._doc[e]:void 0;return n&&(a=n.cast(a)),null!=o&&!1!==r.getters?o.applyGetters(a,this):a}if(null!=o&&"Mixed"===o.instance){var s=this.$__schema.virtualpath(e);
2null!=s&&(o=s)}var c=-1!==e.indexOf("."),l=this._doc,u=c?e.split("."):[e];"string"==typeof this.$__schema.aliases[u[0]]&&(u[0]=this.$__schema.aliases[u[0]]);for(var f=0,d=u.length;f<d;f++){if(ed.has(u[f]))return;l&&l._doc&&(l=l._doc),l=null==l?void 0:l instanceof Map?l.get(u[f],{getters:!1}):f===d-1?G.getValue(u[f],l):l[u[f]]}if(n&&(l=n.cast(l)),null!=o&&!1!==r.getters)l=o.applyGetters(l,this);else if(eh(this.$__schema.nested,e)&&r.virtuals)return em(this,M(l)||{},{path:e});return l},ep.prototype[eo]=ep.prototype.get,ep.prototype.$get=ep.prototype.get,ep.prototype.$__path=function(e){var t=this.$__.adhocPaths;return(t&&t.hasOwnProperty(e)?t[e]:null)||this.$__schema.path(e)},ep.prototype.markModified=function(e,t){this.$__saveInitialState(e),this.$__.activePaths.modify(e),null==t||this.$isSubdocument||(this.$__.pathsToScopes=this.$__pathsToScopes||{},this.$__.pathsToScopes[e]=t)},ep.prototype.$__saveInitialState=function(e){var t=this.$__.savedState;if(null!=t){var r=e.indexOf("."),n=-1===r?e:e.slice(0,r);t.hasOwnProperty(n)||(t[n]=M(this.$__getValue(n)))}},ep.prototype.unmarkModified=function(e){this.$__.activePaths.init(e),null!=this.$__.pathsToScopes&&delete this.$__.pathsToScopes[e]},ep.prototype.$ignore=function(e){this.$__.activePaths.ignore(e)},ep.prototype.directModifiedPaths=function(){return Object.keys(this.$__.activePaths.getStatePaths("modify"))},ep.prototype.$isEmpty=function(e){var t={minimize:!0,virtuals:!1,getters:!1,transform:!1};if(0!=arguments.length){var r=this.$get(e);return null==r||"object"===d(r)&&(G.isPOJO(r)?function e(t){if(null==t)return!0;if("object"!==d(t)||Array.isArray(t))return!1;for(var r=0,n=Object.keys(t);r<n.length;r++)if(!e(t[n[r]]))return!1;return!0}(r):0===Object.keys(r.toObject(t)).length)}return 0===Object.keys(this.toObject(t)).length},ep.prototype.modifiedPaths=function(e){e=e||{};var t=Object.keys(this.$__.activePaths.getStatePaths("modify")),r=new Set,n=0,i=0,o=t.length;for(n=0;n<o;++n){var a=t[n],s=el(a),c=s.length;for(i=0;i<c;++i)r.add(s[i]);if(e.includeChildren){var l=0,u=this.$get(a);if("object"===d(u)&&null!==u){u._doc&&(u=u._doc);var f=u.length;if(Array.isArray(u))for(l=0;l<f;++l){var h=a+"."+l;if(!r.has(h)&&(r.add(h),null!=u[l]&&u[l].$__)){var p=u[l].modifiedPaths(),y=0,b=p.length;for(y=0;y<b;++y)r.add(h+"."+p[y])}}else{var m=Object.keys(u),g=0,v=m.length;for(g=0;g<v;++g)r.add(a+"."+m[g])}}}}return Array.from(r)},ep.prototype[en]=ep.prototype.modifiedPaths,ep.prototype.isModified=function(e,t,r){var n=this;if(e){var i=t&&t.ignoreAtomics,o=this.$__.activePaths.states.modify;if(null==o)return!1;"string"==typeof e&&(e=-1===e.indexOf(" ")?[e]:e.split(" "));var a,s=u(e);try{for(s.s();!(a=s.n()).done;)if(null!=o[a.value])return!0}catch(e){s.e(e)}finally{s.f()}var c=r||this[en](),l=e.some(function(e){return!!~c.indexOf(e)}),f=Object.keys(o);return i&&(f=f.filter(function(e){var t=n.$__getValue(e);return null==t||null==t[ee]||void 0!==t[ee].$set})),l||e.some(function(e){return f.some(function(t){return t===e||e.startsWith(t+".")})})}return this.$__.activePaths.some("modify")},ep.prototype.$isModified=ep.prototype.isModified,ep.prototype[er]=ep.prototype.isModified,ep.prototype.$isDefault=function(e){var t=this;if(null==e)return this.$__.activePaths.some("default");if("string"==typeof e&&-1===e.indexOf(" "))return this.$__.activePaths.getStatePaths("default").hasOwnProperty(e);var r=e;return Array.isArray(r)||(r=r.split(" ")),r.some(function(e){return t.$__.activePaths.getStatePaths("default").hasOwnProperty(e)})},ep.prototype.$isDeleted=function(e){return 0==arguments.length?!!this.$__.isDeleted:(this.$__.isDeleted=!!e,this)},ep.prototype.isDirectModified=function(e){var t=this;if(null==e)return this.$__.activePaths.some("modify");if("string"==typeof e&&-1===e.indexOf(" ")){var r=this.$__.activePaths.getStatePaths("modify").hasOwnProperty(e);if(r||-1===e.indexOf("."))return r;for(var n=e.split("."),i=0;i<n.length-1;++i){var o=n.slice(0,i+1).join("."),a=this.$get(o);if(null!=a&&null!=a.$__&&a.isDirectModified(n.slice(i+1).join(".")))return!0}return!1}var s=e;return"string"==typeof s&&(s=s.split(" ")),s.some(function(e){return t.isDirectModified(e)})},ep.prototype.isInit=function(e){var t=this;if(null==e)return this.$__.activePaths.some("init");if("string"==typeof e&&-1===e.indexOf(" "))return this.$__.activePaths.getStatePaths("init").hasOwnProperty(e);var r=e;return Array.isArray(r)||(r=r.split(" ")),r.some(function(e){return t.$__.activePaths.getStatePaths("init").hasOwnProperty(e)})},ep.prototype.isSelected=function(e){var t=this;if(null==this.$__.selected)return!0;
2if(!e)return!1;if("_id"===e)return 0!==this.$__.selected._id;if(-1!==e.indexOf(" ")&&(e=e.split(" ")),Array.isArray(e))return e.some(function(e){return t.$__isSelected(e)});var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var i=0;i<r.length;i++){var o=r[i];if("_id"!==o&&U(this.$__.selected[o])){n=!!this.$__.selected[o];break}}if(null===n)return!0;if(e in this.$__.selected)return n;for(var a=e+".",s=0;s<r.length;s++){var c=r[s];if("_id"!==c){if(c.startsWith(a))return n||c!==a;if(a.startsWith(c+"."))return n}}return!n},ep.prototype.$__isSelected=ep.prototype.isSelected,ep.prototype.isDirectSelected=function(e){var t=this;if(null==this.$__.selected)return!0;if("_id"===e)return 0!==this.$__.selected._id;if(-1!==e.indexOf(" ")&&(e=e.split(" ")),Array.isArray(e))return e.some(function(e){return t.isDirectSelected(e)});var r=Object.keys(this.$__.selected),n=null;if(1===r.length&&"_id"===r[0])return 0===this.$__.selected._id;for(var i=0;i<r.length;i++){var o=r[i];if("_id"!==o&&U(this.$__.selected[o])){n=!!this.$__.selected[o];break}}return null===n||(this.$__.selected.hasOwnProperty(e)?n:!n)},ep.prototype.validate=(h=a(n().m(function e(t,r){var i,o,a=this,s=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:if("function"!=typeof t&&"function"!=typeof r&&"function"!=typeof s[2]){e.n=1;break}throw new x("Document.prototype.validate() no longer accepts a callback");case 1:if(this.$op="validate",null!=this.$isSubdocument||(this.$__.validating?i=new j(this,{parentStack:r&&r.parentStack,conflictStack:this.$__.validating.stack}):this.$__.validating=new j(this,{parentStack:r&&r.parentStack})),1===s.length&&("object"!==d(s[0])||Array.isArray(s[0])||(r=s[0],t=null)),r&&"string"==typeof r.pathsToSkip&&(o=-1===r.pathsToSkip.indexOf(" "),r.pathsToSkip=o?[r.pathsToSkip]:r.pathsToSkip.split(" ")),null==i){e.n=2;break}throw i;case 2:return e.a(2,new Promise(function(e,n){a.$__validate(t,r,function(t){if(a.$op=null,a.$__.validating=null,null!=t)return n(t);e()})}))}},e,this)})),function(e,t){return h.apply(this,arguments)}),ep.prototype.$validate=ep.prototype.validate,ep.prototype.$__validate=function(e,t,r){var n=this;"function"==typeof e?(r=e,t=null,e=null):"function"==typeof t&&(r=t,t=null);var i,o=t&&"object"===d(t)&&"validateModifiedOnly"in t,a=t&&t.pathsToSkip||null;i=o?!!t.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var s=this,l=function(){var e=n.$__.validationError;if(n.$__.validationError=null,n.$__.validating=null,i&&null!=e){for(var t=0,r=Object.keys(e.errors);t<r.length;t++){var o=r[t];n.$isModified(o)||delete e.errors[o]}0===Object.keys(e.errors).length&&(e=void 0)}if(n.$__.cachedRequired={},n.$emit("validate",s),n.constructor.emit("validate",s),e){for(var a in e.errors)!n[et]&&e.errors[a]instanceof x.CastError&&n.invalidate(a,e.errors[a]);return e}},f=eb(this,e,a),h=i?f[0].filter(function(e){return n.$isModified(e)}):f[0],p=f[1];if("string"==typeof e&&(e=e.split(" ")),0===h.length)return F(function(){var e=l();if(e)return s.$__schema.s.hooks.execPost("validate:error",s,[s],{error:e},function(e){r(e)});r(null,s)});var y,b={},m=0,g=u(h);try{for(g.s();!(y=g.n()).done;)!function(e){null==e||b[e]||(b[e]=!0,m++,F(function(){var t=s.$__schema.path(e);if(!t)return--m||v();if(s.$isValid(e)){if(null!=t[ec]&&e!==t.path)return--m||v();var r,n=s.$__getValue(e);(r=s.$populated(e))?n=r:null!=n&&null!=n.$__&&n.$__.wasPopulated&&(n=n._id);var o=null!=s.$__.pathsToScopes&&e in s.$__.pathsToScopes?s.$__.pathsToScopes[e]:s,a=c(c({},p[e]),{},{path:e,validateModifiedOnly:i});t.doValidate(n,function(r){if(r){if((t.$isSingleNested||t.$isArraySubdocument||t.$isMongooseDocumentArray)&&r instanceof $)return--m||v();s.invalidate(e,r,void 0,!0)}--m||v()},o,a)}else--m||v()}))}(y.value)}catch(e){g.e(e)}finally{g.f()}function v(){var e=l();if(e)return s.$__schema.s.hooks.execPost("validate:error",s,[s],{error:e},function(e){r(e)});r(null,s)}},ep.prototype.validateSync=function(e,t){var r,n=this;1!=arguments.length||"object"!==d(arguments[0])||Array.isArray(arguments[0])||
2(t=arguments[0],e=null),r=t&&"object"===d(t)&&"validateModifiedOnly"in t?!!t.validateModifiedOnly:this.$__schema.options.validateModifiedOnly;var i=t&&t.pathsToSkip;"string"==typeof e?e=-1===e.indexOf(" ")?[e]:e.split(" "):"string"==typeof i&&-1!==i.indexOf(" ")&&(i=i.split(" "));for(var o=eb(this,e,i),a=r?o[0].filter(function(e){return n.$isModified(e)}):o[0],s=o[1],c={},l=0,u=a.length;l<u;++l){var f=a[l];if(!c[f]){c[f]=!0;var h=this.$__schema.path(f);if(h&&this.$isValid(f)){var p=this.$__getValue(f),y=h.doValidateSync(p,this,{skipSchemaValidators:s[f],path:f,validateModifiedOnly:r});if(y){if((h.$isSingleNested||h.$isArraySubdocument||h.$isMongooseDocumentArray)&&y instanceof $)continue;this.invalidate(f,y,void 0,!0)}}}}var b=this.$__.validationError;if(this.$__.validationError=void 0,this.$emit("validate",this),this.constructor.emit("validate",this),b)for(var m in b.errors)b.errors[m]instanceof x.CastError&&this.invalidate(m,b.errors[m]);return b},ep.prototype.invalidate=function(e,t,r,n){if(this.$__.validationError||(this.$__.validationError=new $(this)),!this.$__.validationError.errors[e])return t&&"string"!=typeof t||(t=new A({path:e,message:t,type:n||"user defined",value:r})),this.$__.validationError===t||this.$__.validationError.addError(e,t),this.$__.validationError},ep.prototype.$markValid=function(e){this.$__.validationError&&this.$__.validationError.errors[e]&&(delete this.$__.validationError.errors[e],0===Object.keys(this.$__.validationError.errors).length&&(this.$__.validationError=null))},ep.prototype.$isValid=function(e){var t=this;return null==this.$__.validationError||0===Object.keys(this.$__.validationError.errors).length||null!=e&&(-1!==e.indexOf(" ")&&(e=e.split(" ")),Array.isArray(e)?e.some(function(e){return null==t.$__.validationError.errors[e]}):null==this.$__.validationError.errors[e])},ep.prototype.$__reset=function(){var e,t=this,r=this.$parent()===this?this.$getAllSubdocs():[],n=new Set,i=u(r);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=o.$__fullPathWithIndexes();if(o.$__reset(),this.isModified(a)||function(e){e=-1===e.indexOf(".")?[e]:e.split(".");for(var r="",n=0;n<e.length;++n)if(r+=(r.length?".":"")+e[n],"init"===t.$__.activePaths[r])return!0;return!1}(a))if(o.$isDocumentArrayElement)n.add(o.parentArray());else{var s=o.$parent();s===this?this.$__.activePaths.clearPath(o.$basePath):null!=s&&s.$isSubdocument&&s.$__reset()}}}catch(e){i.e(e)}finally{i.f()}var c,l=u(n);try{for(l.s();!(c=l.n()).done;){var f=c.value;this.$__.activePaths.clearPath(f.$path()),f[Z]=f[ee],f[ee]={}}}catch(e){l.e(e)}finally{l.f()}return this.$__dirty().forEach(function(e){var t=e.value;t&&t[ee]&&(t[Z]=t[ee],t[ee]={})}),this.$__.backup={},this.$__.backup.activePaths={modify:Object.assign({},this.$__.activePaths.getStatePaths("modify")),default:Object.assign({},this.$__.activePaths.getStatePaths("default"))},this.$__.backup.validationError=this.$__.validationError,this.$__.backup.errors=this.$errors,this.$__.activePaths.clear("modify"),this.$__.activePaths.clear("default"),this.$__.validationError=void 0,this.$errors=void 0,t=this,this.$__schema.requiredPaths().forEach(function(e){t.$__.activePaths.require(e)}),this},ep.prototype.$__undoReset=function(){if(null!=this.$__.backup&&null!=this.$__.backup.activePaths){this.$__.activePaths.states.modify=this.$__.backup.activePaths.modify,this.$__.activePaths.states.default=this.$__.backup.activePaths.default,this.$__.validationError=this.$__.backup.validationError,this.$errors=this.$__.backup.errors;var e,t=u(this.$__dirty());try{for(t.s();!(e=t.n()).done;){var r=e.value.value;r&&r[ee]&&r[Z]&&(r[ee]=r[Z])}}catch(e){t.e(e)}finally{t.f()}var n,i=u(this.$getAllSubdocs());try{for(i.s();!(n=i.n()).done;)n.value.$__undoReset()}catch(e){i.e(e)}finally{i.f()}}},ep.prototype.$__dirty=function(){var e=this,t=this.$__.activePaths.map("modify",function(t){return{path:t,value:e.$__getValue(t),schema:e.$__path(t)}}),r=new Map((t=t.concat(this.$__.activePaths.map("default",function(t){if("_id"!==t&&null!=e.$__getValue(t))return{path:t,value:e.$__getValue(t),schema:e.$__path(t)}}))).filter(function(e){return null!=e}).map(function(e){return[e.path,e.value]})),n=[];return t.forEach(function(e){if(e){for(var t=null,i=el(e.path),o=0;o<i.length-1;o++)if(r.has(i[o])){t=r.get(i[o]);break}null==t?n.push(e):null!=t&&null!=t[ee]&&t.hasAtomics()&&(t[ee]={},t[ee].$set=t)}}),n}
2,ep.prototype.$__setSchema=function(e){D(e.tree,this,void 0,e.options);for(var t=0,r=Object.keys(e.virtuals);t<r.length;t++){var n=r[t];e.virtuals[n]._applyDefaultGetters()}null==e.path("schema")&&(this.schema=e),this.$__schema=e,this[ei]=e},ep.prototype.$__getArrayPathsToValidate=function(){return y||(y=r(6077)),this.$__.activePaths.map("init","modify",(function(e){return this.$__getValue(e)}).bind(this)).filter(function(e){return e&&Array.isArray(e)&&G.isMongooseDocumentArray(e)&&e.length}).reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return e})},ep.prototype.$getAllSubdocs=function(){y||(y=r(6077)),m=m||r(1568);for(var e=[],t=0,n=Object.keys(this._doc);t<n.length;t++)!function e(t,r,n){var i=t,o=!1;if(n&&(t instanceof ep&&t[ei].paths[n]?i=t._doc[n]:t instanceof ep&&t[ei].nested[n]?(i=t._doc[n],o=!0):i=t[n]),i instanceof m)r.push(i);else if(i instanceof Map)r=Array.from(i.keys()).reduce(function(t,r){return e(i.get(r),t,null)},r);else if(i&&!Array.isArray(i)&&i.$isSingleNested)(r=Object.keys(i._doc).reduce(function(t,r){return e(i,t,r)},r)).push(i);else if(i&&G.isMongooseDocumentArray(i))i.forEach(function(t){t&&t._doc&&(r=Object.keys(t._doc).reduce(function(r,n){return e(t._doc,r,n)},r),t instanceof m&&r.push(t))});else if(o&&null!=i)for(var a=0,s=Object.keys(i);a<s.length;a++){var c=s[a];e(i,r,c)}return r}(this,e,n[t]);return e},ep.prototype.$__handleReject=function(e){this.$listeners("error").length?this.$emit("error",e):this.constructor.listeners&&this.constructor.listeners("error").length&&this.constructor.emit("error",e)},ep.prototype.$toObject=function(e,t){var r,n,i,o={transform:!0,flattenDecimals:!0},a=t?"toJSON":"toObject",s=this.constructor&&this.constructor.base&&this.constructor.base.options&&C(this.constructor.base.options,a)||{},l=this.$__schema&&this.$__schema.options||{};o=c(c(c({},o),s),l[a]),(e=G.isPOJO(e)?c({},e):{})._calledWithOptions=e._calledWithOptions||c({},e),r=null!=e._calledWithOptions.minimize?e.minimize:null!=o.minimize?o.minimize:l.minimize,n=null!=e._calledWithOptions.flattenMaps?e.flattenMaps:null!=o.flattenMaps?o.flattenMaps:l.flattenMaps,i=null!=e._calledWithOptions.flattenObjectIds?e.flattenObjectIds:null!=o.flattenObjectIds?o.flattenObjectIds:l.flattenObjectIds;var u=Object.assign({},e,{_isNested:!0,json:t,minimize:r,flattenMaps:n,flattenObjectIds:i,_seen:e&&e._seen||new Map});if(G.hasUserDefinedProperty(e,"getters")&&(u.getters=e.getters),G.hasUserDefinedProperty(e,"virtuals")&&(u.virtuals=e.virtuals),(e.depopulate||e._parentOptions&&e._parentOptions.depopulate)&&e._isNested&&this.$__.wasPopulated)return M(this.$__.wasPopulated.value||this._id,u);(e=c(c({},o),e))._isNested=!0,e.json=t,e.minimize=r,u._parentOptions=e,u._skipSingleNestedGetters=!1;var f=Object.assign({},u);f._skipSingleNestedGetters=!0;var h=e.transform,p=M(this._doc,u)||{};e.getters&&(function(e,t,r){var n,i,o=e.$__schema,a=Object.keys(o.paths),s=a.length,c=e._doc;if(c)for(;s--;){var l=(n=a[s]).split("."),u=l.length,f=u-1,h=t,p=void 0;if(c=e._doc,e.$__isSelected(n))for(var y=0;y<u&&(i=c[p=l[y]],null==h||"object"===d(h));++y){if(y===f){var b=e.$get(n);if(h[p]=M(b,r),Array.isArray(h[p])&&o.paths[n].$embeddedSchemaType)for(var m=0;m<h[p].length;++m)h[p][m]=o.paths[n].$embeddedSchemaType.applyGetters(h[p][m],e)}else{if(null==i){p in c&&(h[p]=i);break}h=h[p]||(h[p]={})}c=i}}}(this,p,f),e.minimize&&(p=function e(t){for(var r,n,i,o=Object.keys(t),a=o.length;a--;)i=t[n=o[a]],G.isPOJO(i)&&(t[n]=e(i)),void 0!==t[n]?r=!0:delete t[n];return r?t:void 0}(p)||{})),(e.virtuals||e.getters&&!1!==e.virtuals)&&em(this,p,f,e),!1===e.versionKey&&this.$__schema.options.versionKey&&delete p[this.$__schema.options.versionKey];var y=e.transform;if(y&&function(e,t){var r=e.$__schema,n=Object.keys(r.paths||{});if(e._doc)for(var i=0;i<n.length;i++){var o=n[i],a=r.paths[o];if("function"==typeof a.options.transform){var s=e.$get(o);if(void 0===s)continue;var c=a.options.transform.call(e,s);eg(o,c),G.setValue(o,c,t)}else if(null!=a.$embeddedSchemaType&&"function"==typeof a.$embeddedSchemaType.options.transform){var l=e.$get(o);if(void 0===l)continue;for(var u=[].concat(l),f=a.$embeddedSchemaType.options.transform,d=0;d<u.length;++d){var h=f.call(e,u[d]);u[d]=h,eg(o,h)}t[o]=u}}}(this,p),e.useProjection&&function(e,t){var r=e.$__schema,n=Object.keys(r.paths||{});if(e._doc){var i=e.$__.selected;if(void 0===i&&(i={},J.applyPaths(i,r)),null!=i&&0!==Object.keys(i).length)for(var o=0;o<n.length;o++){var a=n[o];null==i[a]||i[a]||delete t[a]}}}(this,p),!0===y||l.toObject&&y){var b=e.json?l.toJSON:l.toObject;b&&(y="function"==typeof e.transform?e.transform:b.transform)}else e.transform=h;if("function"==typeof y){var m=y(this,p,e);void 0!==m&&(p=m)}return p},ep.prototype.toObject=function(e){return this.$toObject(e)},ep.prototype.toJSON=function(e){return this.$toObject(e,!0)},ep.prototype.ownerDocument=function(){return this},ep.prototype.parent=function(){return this.$isSubdocument||this.$__.wasPopulated?this.$__.parent:this},ep.prototype.$parent=ep.prototype.parent,ep.prototype.inspect=function(e){G.isPOJO(e)&&((t=e).minimize=!1);var t,r=this.toObject(t);return r??"MongooseDocument { "+r+" }"},V.custom&&(ep.prototype[V.custom]=ep.prototype.inspect),ep.prototype.toString=function(){var e=this.inspect();return"string"==typeof e?e:V(e)},ep.prototype.equals=function(e){if(!e)return!1;var t=this.$__getValue("_id"),r=null!=e.$__?e.$__getValue("_id"):e;return t||r?t&&t.equals?t.equals(r):t===r:X(this,e)},ep.prototype.populate=(p=a(n().m(function e(){var t,r,i,o,a,s,c,l,f,d=arguments;return n().w(function(e){for(;;)switch(e.n){case 0:if(t={},"function"!=typeof(r=Array.prototype.slice.call(d))[r.length-1]){e.n=1;break}throw new x("Document.prototype.populate() no longer accepts a callback");case 1:if(0!==r.length){i=u(G.populate.apply(null,r));try{for(i.s();!(o=i.n()).done;)t[(a=o.value).path]=a}catch(e){i.e(e)}finally{i.f()}}return s=G.object.vals(t),c=this.constructor,this.$__isNested&&(c=this.$__[es].constructor,l=this.$__.nestedPath,s.forEac
2h(function(e){e.path=l+"."+e.path})),null!=this.$session()&&(f=this.$session(),s.forEach(function(e){null!=e.options?"session"in e.options||(e.options.session=f):e.options={session:f}})),s.forEach(function(e){e._localModel=c}),e.a(2,c.populate(this,s))}},e,this)})),function(){return p.apply(this,arguments)}),ep.prototype.$getPopulatedDocs=function(){var e=[];null!=this.$__.populated&&(e=e.concat(Object.keys(this.$__.populated)));var t,r=[],n=u(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=this.$get(i);Array.isArray(o)?r=r.concat(o):o instanceof ep&&r.push(o)}}catch(e){n.e(e)}finally{n.f()}return r},ep.prototype.populated=function(e,t,r){if(null==t||!0===t){if(!this.$__.populated||"string"!=typeof e)return;var n=e.endsWith(".$*")?e.replace(/\.\$\*$/,""):e,i=this.$__.populated[n];return i?!0===t?i:i.value:void 0}this.$__.populated||(this.$__.populated={}),this.$__.populated[e]={value:t,options:r};for(var o=e.split("."),a=0;a<o.length-1;++a){var s=o.slice(0,a+1).join("."),c=this.$get(s);if(null!=c&&null!=c.$__&&this.$populated(s)){var l=o.slice(a+1).join(".");c.$populated(l,t,r);break}}return t},ep.prototype.$populated=ep.prototype.populated,ep.prototype.$assertPopulated=function(e,t){var r=this;if(Array.isArray(e))return e.forEach(function(e){return r.$assertPopulated(e,t)}),this;if(arguments.length>1&&this.$set(t),!this.$populated(e))throw new x('Expected path "'.concat(e,'" to be populated'));return this},ep.prototype.depopulate=function(e){"string"==typeof e&&(e=-1===e.indexOf(" ")?[e]:e.split(" "));var t=this.$$populatedVirtuals?Object.keys(this.$$populatedVirtuals):[],r=this.$__&&this.$__.populated||{};if(0==arguments.length){var n,i,o=u(t);try{for(o.s();!(i=o.n()).done;){var a=i.value;delete this.$$populatedVirtuals[a],delete this._doc[a],delete r[a]}}catch(e){o.e(e)}finally{o.f()}for(var s=0,c=Object.keys(r);s<c.length;s++){var l=c[s];(n=this.$populated(l))&&(delete r[l],G.setValue(l,n,this._doc))}return this}var f,d=u(e);try{for(d.s();!(f=d.n()).done;){var h=f.value;n=this.$populated(h),delete r[h],-1!==t.indexOf(h)?(delete this.$$populatedVirtuals[h],delete this._doc[h]):n&&G.setValue(h,n,this._doc)}}catch(e){d.e(e)}finally{d.f()}return this},ep.prototype.$__fullPath=function(e){return e||""},ep.prototype.getChanges=function(){var e=this.$__delta();return e?e[1]:{}},ep.prototype.$clone=function(){var e=new(0,this.constructor);if(e.$isNew=this.$isNew,this._doc&&(e._doc=M(this._doc)),this.$__){var t,r=new(0,this.$__.constructor),n=u(Object.getOwnPropertyNames(this.$__));try{for(n.s();!(t=n.n()).done;){var i=t.value;"activePaths"!==i&&(r[i]=M(this.$__[i]))}}catch(e){n.e(e)}finally{n.f()}Object.assign(r.activePaths,M(c({},this.$__.activePaths))),e.$__=r}return e},ep.prototype._applyVersionIncrement=function(){if(this.$__.version){var e=!(2&~this.$__.version);if(this.$__.version=void 0,e){var t=this.$__schema.options.versionKey,r=this.$__getValue(t)||0;this.$__setValue(t,r+1)}}},ep.ValidationError=$,e.exports=ep},4304:(e,t,r)=>{"use strict";var n=r(8727),i=r(3434),o=!1;e.exports=function(){return o?i:n},e.exports.setBrowser=function(e){o=e}},9906:e=>{"use strict";var t=null;e.exports.get=function(){return t},e.exports.set=function(e){t=e}},6333:(e,t)=>{"use strict";t.Collection=function(){throw Error("Cannot create a collection from browser library")},t.Connection=function(){throw Error("Cannot create a connection from browser library")}},1795:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r){return t=s(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return o(e)}(e,a()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function o(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}
2function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var l=r(5202),u=r(8751),f=function(e){var t;function r(e,t,n,a,s){var c;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),arguments.length>0){var l=h(t);(c=i(this,r,[y(null,e,t,n,p(s),l,a)])).init(e,t,n,a,s)}else c=i(this,r,[y()]);return o(c)}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(r,e),t=[{key:"toJSON",value:function(){return{stringValue:this.stringValue,valueType:this.valueType,kind:this.kind,value:this.value,path:this.path,reason:this.reason,name:this.name,message:this.message}}},{key:"init",value:function(e,t,r,n,i){this.stringValue=d(t),this.messageFormat=p(i),this.kind=e,this.value=t,this.path=r,this.reason=n,this.valueType=h(t)}},{key:"copy",value:function(e){this.messageFormat=e.messageFormat,this.stringValue=e.stringValue,this.kind=e.kind,this.value=e.value,this.path=e.path,this.reason=e.reason,this.message=e.message,this.valueType=e.valueType}},{key:"setModel",value:function(e){this.model=e,this.message=y(e,this.kind,this.value,this.path,this.messageFormat,this.valueType)}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(i.key),i)}}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}(l);function d(e){var t=u.inspect(e);return(t=t.replace(/^'|'$/g,'"')).startsWith('"')||(t='"'+t+'"'),t}function h(e){if(null==e)return""+e;var t=n(e);return"object"!==t||"function"!=typeof e.constructor?t:e.constructor.name}function p(e){var t=e&&e._castErrorMessage||null;if("string"==typeof t||"function"==typeof t)return t}function y(e,t,r,n,i,o,a){if("string"==typeof i){var s=d(r),c=i.replace("{KIND}",t).replace("{VALUE}",s).replace("{PATH}",n);return null!=e&&(c=c.replace("{MODEL}",e.modelName)),c}if("function"==typeof i)return i(r,n,e,t);var l="Cast to "+t+" failed for value "+d(r)+(o?" (type "+o+")":"")+' at path "'+n+'"';return null!=e&&(l+=' for model "'+e.modelName+'"'),null!=a&&"function"==typeof a.constructor&&"AssertionError"!==a.constructor.name&&"Error"!==a.constructor.name&&(l+=' because of "'+a.constructor.name+'"'),l}Object.defineProperty(f.prototype,"name",{value:"CastError"}),e.exports=f},6067:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e){var r,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),r=t,a=["For your own good, using `document.save()` to update an array which was selected using an $elemMatch projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+e.join("\n ")+"\nUse Model.updateOne() to update these arrays instead."],r=o(r),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(r,a||[],o(this).constructor):r.apply(this,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"DivergentArrayError"}),e.exports=s},4888:(e,t,r)=>{"use strict";var n=r(5202);e.exports=n,n.messages=r(983),n.Messages=n.messages,n.DocumentNotFoundError=r(3640),n.CastError=r(1795),n.ValidationError=r(122),n.ValidatorError=r(2037),n.VersionError=r(8809),n.ParallelSaveError=r(5007),n.OverwriteModelError=r(5676),n.MissingSchemaError=r(1511),n.MongooseServerSelectionError=r(1870),n.DivergentArrayError=r(6067),n.StrictModeError=r(3328),n.StrictPopulateError=r(8967)},3346:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e,r){var a,s;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),a=t,s=['Cannot create use schema for property "'.concat(e,'" because the schema has the ').concat(r," option enabled.")],a=o(a),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(a,s||[],o(this).constructor):a.apply(this,s))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"InvalidSchemaOptionError"}),e.exports=s},983:(e,t)=>{"use strict";var r=e.exports={};r.DocumentNotFoundError=null,r.general={},r.general.default="Validator failed for path `{PATH}` with value `{VALUE}`",r.general.required="Path `{PATH}` is required.",r.Number={},r.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).",r.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).",r.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",r.Date={},r.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).",r.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).",r.String={},r.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",r.String.match="Path `{PATH}` is invalid ({VALUE}).",r.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).",r.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."},1511:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e){var r,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),r=t,a=["Schema hasn't been registered for model \""+e+'".\nUse mongoose.model(name, schema)'],r=o(r),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(r,a||[],o(this).constructor):r.apply(this,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"MissingSchemaError"}),e.exports=s},5202:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){var t="function"==typeof Map?new Map:void 0;return(r=function(e){if(null===e||!function(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(n())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var a=new(e.bind.apply(e,o));return r&&i(a,r.prototype),a}(e,arguments,o(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(r,e)})(e)}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(n=function(){return!!e})()}
2function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a=function(e){function r(){var e,i;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),e=r,i=arguments,e=o(e),function(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,n()?Reflect.construct(e,i||[],o(this).constructor):e.apply(this,i))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}(r(Error));Object.defineProperty(a.prototype,"name",{value:"MongooseError"}),e.exports=a},3640:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=r(4888),c=r(8751),l=function(e){function t(e,r,a,l){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var u,f,d,h=s.messages;return(u=t,f=[null!=h.DocumentNotFoundError?"function"==typeof h.DocumentNotFoundError?h.DocumentNotFoundError(e,r):h.DocumentNotFoundError:'No document found for query "'+c.inspect(e)+'" on model "'+r+'"'],u=o(u),d=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(u,f||[],o(this).constructor):u.apply(this,f))).result=l,d.numAffected=a,d.filter=e,d.query=e,d}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(s);Object.defineProperty(l.prototype,"name",{value:"DocumentNotFoundError"}),e.exports=l},4107:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e,r){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var a,s,c,l=Array.isArray(r)?"array":"primitive value";return(a=t,s=["Tried to set nested object field `"+e+"` to ".concat(l," `")+r+"`"],a=o(a),c=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(a,s||[],o(this).constructor):a.apply(this,s))).path=e,c}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"ObjectExpectedError"}),e.exports=s},900:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e,r,a){var s,c;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),s=t,c=['Parameter "'+r+'" to '+a+'() must be an object, got "'+e.toString()+'" (type '+n(e)+")"],s=o(s),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(s,c||[],o(this).constructor):s.apply(this,c))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"ObjectParameterError"}),e.exports=s},5676:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e){var r,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),r=t,a=["Cannot overwrite `"+e+"` model once compiled."],r=o(r),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(r,a||[],o(this).constructor):r.apply(this,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"OverwriteModelError"}),e.exports=s},5007:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e){var r,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),r=t,a=["Can't save() the same doc multiple times in parallel. Document: "+e._id],r=o(r),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(r,a||[],o(this).constructor):r.apply(this,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"ParallelSaveError"}),e.exports=s},7962:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e){var r,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),r=t,a=["Can't validate() the same doc multiple times in parallel. Document: "+e._id],r=o(r),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(r,a||[],o(this).constructor):r.apply(this,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(5202));Object.defineProperty(s.prototype,"name",{value:"ParallelValidateError"}),e.exports=s},1870:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=r(5202),c=r(5285),l=r(2082),u=r(3871),f=function(e){var t;function r(){var e,t;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),e=r,t=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,t||[],o(this).constructor):e.apply(this,t))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(r,e),t=[{key:"assimilateError",value:function(e){var t=e.reason,r=l(t)&&c(t)&&-1===e.message.indexOf("bad auth")&&-1===e.message.indexOf("Authentication failed");for(var n in r?this.message="Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/":u(t)?this.message="Mongoose is connecting with SSL enabled, but the server is not accepting SSL connections. Please ensure that the MongoDB server you are connecting to is configured to accept SSL connections. Learn more: https://mongoosejs.com/docs/tutorials/ssl.html":this.message=e.message,e)"name"!==n&&(this[n]=e[n]);return this}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(i.key),i)}}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}(s);Object.defineProperty(f.prototype,"name",{value:"MongooseServerSelectionError"}),e.exports=f},3328:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e,r,a){var s,c,l;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),(c=t,l=[r=r||"Field `"+e+"` is not in schema and strict mode is set to throw."],c=o(c),s=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(c,l||[],o(this).constructor):c.apply(this,l))).isImmutableError=!!a,s.path=e,s}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"StrictModeError"}),e.exports=s},8967:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e,r){var a,s,c;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),(s=t,c=[r=r||"Cannot populate path `"+e+"` because it is not in your schema. Set the `strictPopulate` option to false to override."],s=o(s),a=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(s,c||[],o(this).constructor):s.apply(this,c))).path=e,a}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"StrictPopulateError"}),e.exports=s},122:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=r(5202),c=r(1981),l=r(8751),u=r(198),f=function(e){var t;function r(e){var t,a,s,l;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),(s=r,l=[a="model"===c(e)?e.constructor.modelName+" validation failed":"Validation failed"],s=o(s),t=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(s,l||[],o(this).constructor):s.apply(this,l))).errors={},t._message=a,e&&(e.$errors=t.errors),t}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(r,e),t=[{key:"toString",value:function(){return this.name+": "+u(this)}},{key:"inspect",value:function(){return Object.assign(Error(this.message),this)}},{key:"addError",value:function(e,t){if(t instanceof r)for(var n=t.errors,i=0,o=Object.keys(n);i<o.length;i++){var a=o[i];this.addError("".concat(e,".").concat(a),n[a])}else this.errors[e]=t,this.message=this._message+": "+u(this)}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];
2i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(i.key),i)}}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}(s);l.inspect.custom&&(f.prototype[l.inspect.custom]=f.prototype.inspect),Object.defineProperty(f.prototype,"toJSON",{enumerable:!1,writable:!1,configurable:!0,value:function(){return Object.assign({},this,{name:this.name,message:this.message})}}),Object.defineProperty(f.prototype,"name",{value:"ValidationError"}),e.exports=f},2037:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=r(4888),c=function(e){var t;function r(e,t){if(!(this instanceof r))throw TypeError("Cannot call a class as a function");var a,c,u,f=e.message;f||(f=s.messages.general.default);var d=l(f,e,t);return a=r,c=[d],a=o(a),(u=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(a,c||[],o(this).constructor):a.apply(this,c))).properties=e=Object.assign({},e,{message:d}),u.kind=e.type,u.path=e.path,u.value=e.value,u.reason=e.reason,u}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(r,e),t=[{key:"toString",value:function(){return this.message}},{key:"toJSON",value:function(){return Object.assign({name:this.name,message:this.message},this)}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(i.key),i)}}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}(s);function l(e,t,r){if("function"==typeof e)return e(t,r);for(var n=0,i=Object.keys(t);n<i.length;n++){var o=i[n];"message"!==o&&(e=e.replace("{"+o.toUpperCase()+"}",t[o]))}return e}Object.defineProperty(c.prototype,"name",{value:"ValidatorError"}),Object.defineProperty(c.prototype,"properties",{enumerable:!1,writable:!0,value:null}),c.prototype.formatMessage=l,e.exports=c},8809:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(e,r,a){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");var s,c,l,u=a.join(", ");return(s=t,c=['No matching document found for id "'+e._id+'" version '+r+' modifiedPaths "'+u+'"'],s=o(s),l=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(s,c||[],o(this).constructor):s.apply(this,c))).version=r,l.modifiedPaths=a,l}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(4888));Object.defineProperty(s.prototype,"name",{value:"VersionError"}),e.exports=s},6069:e=>{"use strict";e.exports=function e(t){if(!Array.isArray(t))return{min:0,max:0,containsNonArrayItem:!0};if(0===t.length||1===t.length&&!Array.isArray(t[0]))return{min:1,max:1,containsNonArrayItem:!1};for(var r=e(t[0]),n=1;n<t.length;++n){var i=e(t[n]);i.min<r.min&&(r.min=i.min),i.max>r.max&&(r.max=i.max),r.containsNonArrayItem=r.containsNonArrayItem||i.containsNonArrayItem}return r.min=r.min+1,r.max=r.max+1,r}},1973:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(5003),o=r(6079),a=r(2862),s=r(6584),c=r(6749),l=r(1563),u=r(7339).isMongooseArray,f=r(5721),d=r(4673),h=r(8770),p=r(3636).trustedSymbol;function y(e,t,r){if(null==e)return e;if(Array.isArray(e))return function(e,t){var r=0,n=e.length,i=Array(n);for(r=0;r<n;++r)i[r]=y(e[r],t,!0);return i}(u(e)?e.__array:e,t);if(s(e)){t&&t._skipSingleNestedGetters&&e.$isSingleNested&&(t=Object.assign({},t,{getters:!1}));var a,p,m=e.$isSingleNested;if(d(e)&&null!=e.$__&&null!=e._doc)return e._doc;if(p=t&&t.json&&"function"==typeof e.toJSON?e.toJSON(t):e.toObject(t),t&&t.minimize&&!e.constructor.$__required&&m&&0===Object.keys(p).length)return;return p}var g=e.constructor;if(g)switch(c(g)){case"Object":return b(e,t,r);case"Date":return new g(+e);case"RegExp":return(a=new RegExp(e.source,e.flags)).lastIndex!==e.lastIndex&&(a.lastIndex=e.lastIndex),a}return l(e,"ObjectId")?t&&t.flattenObjectIds?e.toJSON():new o(e.id):l(e,"Decimal128")?t&&t.flatten
2Decimals?e.toJSON():i.fromString(e.toString()):!g&&f(e)?b(e,t,r):"object"===n(e)&&e[h.schemaTypeSymbol]?e.clone():t&&t.bson&&"function"==typeof e.toBSON?e:"function"==typeof e.valueOf?e.valueOf():b(e,t,r)}function b(e,t,r){var n,i=t&&t.minimize,o=t&&t.omitUndefined,s=t&&t._seen,c={};if(s&&s.has(e))return s.get(e);s&&s.set(e,c),p in e&&(c[p]=e[p]);var l=0,u="",f=Object.keys(e),d=f.length;for(l=0;l<d;++l)if(!a.has(u=f[l])){var h=y(e[u],t,!1);(!1===i||o)&&void 0===h?delete c[u]:!0===i&&void 0===h||(n||(n=!0),c[u]=h)}return i&&!r?n&&c:c}e.exports=y},2829:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(4029).Binary,a=r(1563),s=r(6584);r(4888),r(8751),t.x=function e(t,r,c,l){var u,f=(u=t&&s(t)&&!n.isBuffer(t)?Object.keys(t.toObject({transform:!1,virtuals:!1})||{}):Object.keys(t||{})).length,d={};r=r?r+".":"";for(var h=0;h<f;++h){var p=u[h],y=t[p];d[r+p]=y;var b=l&&l.path&&l.path(r+p),m=l&&l.nested&&l.nested[r+p];if(!b||"Mixed"!==b.instance){if(y&&"object"===i(y)&&!(y instanceof Date)&&!a(y,"ObjectId")&&(!Array.isArray(y)||0!==y.length)&&!(y instanceof n)&&!a(y,"Decimal128")&&!(y instanceof o)){if(c&&c.skipArrays&&Array.isArray(y))continue;var g=e(y,r+p,c,l);for(var v in g)d[v]=g[v];Array.isArray(y)&&(d[r+p]=y)}if(m)for(var x=0,w=Object.keys(l.paths);x<w.length;x++){var _=w[x];_.startsWith(r+p+".")&&!d.hasOwnProperty(_)&&(d[_]=void 0)}}}return d}},2794:(e,t,r)=>{"use strict";var n=r(1563);e.exports=function(e,t){return"string"==typeof e&&"string"==typeof t||"number"==typeof e&&"number"==typeof t?e===t:!(!n(e,"ObjectId")||!n(t,"ObjectId"))&&e.toString()===t.toString()}},4531:e=>{"use strict";e.exports=function(e,t,r,n,i){var o=Object.keys(e).reduce(function(e,r){return e||r.startsWith(t+".")},!1),a=t+"."+r.options.discriminatorKey;o||1!==i.length||i[0]!==a||n.splice(n.indexOf(a),1)}},8413:(e,t,r)=>{"use strict";var n=r(7291);e.exports=function(e,t,r){var i=e.schema.options.discriminatorKey,o=null!=t&&t[i];if(null==o&&(o=r),e.discriminators&&null!=o)if(e.discriminators[o])e=e.discriminators[o];else{var a=n(e.discriminators,o);a&&(e=a)}return e}},7291:(e,t,r)=>{"use strict";var n=r(2794);e.exports=function(e,t){if(null==e)return null;for(var r=0,i=Object.keys(e);r<i.length;r++){var o=e[i[r]];if(o.schema&&o.schema.discriminatorMapping&&n(o.schema.discriminatorMapping.value,t))return o}return null}},2392:(e,t,r)=>{"use strict";var n=r(2794);e.exports=function(e,t){if(null==e||null==e.discriminators)return null;for(var r=0,i=Object.keys(e.discriminators);r<i.length;r++){var o=i[r],a=e.discriminators[o];if(null!=a.discriminatorMapping&&n(a.discriminatorMapping.value,t))return a}return null}},2462:(e,t,r)=>{"use strict";var n=r(4913),i=r(2862),o=r(1563),a=r(6079),s=r(5721);e.exports=function e(t,r,c,l){var u,f=Object.keys(r),d=0,h=f.length;if(c=c||"",!(l=l||new WeakSet).has(r)){for(l.add(r);d<h;)if(u=f[d++],(c||"discriminators"!==u&&"base"!==u&&"_applyDiscriminators"!==u&&"_userProvidedOptions"!==u&&"options"!==u)&&!("tree"===c&&null!=r&&r.instanceOfSchema||i.has(u))){if(null==t[u])t[u]=r[u];else if(s(r[u])){if(s(t[u])||(t[u]={}),null!=r[u]){if(r[u].$isSingleNested&&t[u].$isMongooseDocumentArray||r[u].$isMongooseDocumentArray&&t[u].$isSingleNested||r[u].$isMongooseDocumentArrayElement&&t[u].$isMongooseDocumentArrayElement)continue;if(r[u].instanceOfSchema){t[u].instanceOfSchema?n(t[u],r[u].clone(),!0):t[u]=r[u].clone();continue}if(o(r[u],"ObjectId")){t[u]=new a(r[u]);continue}}e(t[u],r[u],c?c+"."+u:u,l)}}}}},2874:(e,t,r)=>{"use strict";var n=r(7368);function i(e,t){e.$__.activePaths.default(t),e.$isSubdocument&&e.$isSingleNested&&null!=e.$parent()&&e.$parent().$__.activePaths.default(e.$__pathRelativeToParent(t))}e.exports=function(e,t,r,o,a,s){for(var c=Object.keys(e.$__schema.paths),l=c.length,u=0;u<l;++u){var f=void 0,d="",h=c[u];if("_id"!==h||!e.$__.skipId)for(var p=e.$__schema.paths[h],y=p.splitPath(),b=y.length,m=!1,g=e._doc,v=0;v<b&&null!=g;++v){var x=y[v];if(d+=(d.length?".":"")+x,!0===r){if(d in t)break}else if(!1===r&&t&&!m){var w=p.$isSingleNested||p.$isMongooseDocumentArray;
2if(d in t&&!n(t[d])||v===b-1&&w&&null!=o&&o[d])m=!0;else if(null!=o&&!o[d])break}if(v===b-1){if(void 0!==g[x])break;if(null!=a){if("function"==typeof p.defaultValue){if(!p.defaultValue.$runBeforeSetters&&a||p.defaultValue.$runBeforeSetters&&!a)break}else if(!a)continue}if(s&&s[d])break;if(t&&null!==r){if(!0===r){if(h in t)continue;try{f=p.getDefault(e,!1)}catch(t){e.invalidate(h,t);break}void 0!==f&&(g[x]=f,i(e,h))}else if(m){try{f=p.getDefault(e,!1)}catch(t){e.invalidate(h,t);break}void 0!==f&&(g[x]=f,i(e,h))}}else{try{f=p.getDefault(e,!1)}catch(t){e.invalidate(h,t);break}void 0!==f&&(g[x]=f,i(e,h))}}else g=g[x]}}}},4134:e=>{"use strict";e.exports=function(e,t,r){var n=(r=r||{}).skipDocArrays,i=0;if(!e)return i;for(var o=0,a=Object.keys(e.$__.activePaths.getStatePaths("modify"));o<a.length;o++){var s=a[o];if(n){var c=e.$__schema.path(s);if(c&&c.$isMongooseDocumentArray)continue}if(s.startsWith(t+".")&&(e.$__.activePaths.clearPath(s),++i,e.$isSubdocument)){var l=e.ownerDocument(),u=e.$__fullPath(s);l.$__.activePaths.clearPath(u)}}return i}},8724:(e,t,r)=>{"use strict";var n,i=r(1973),o=r(8770).documentSchemaSymbol,a=r(4962).h,s=r(6872),c=r(8770).getSymbol,l=r(8770).scopeSymbol,u=s.isPOJO;t.M=h,t.c=p;var f=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1}),d=Object.freeze({noDottedPath:!0});function h(e,t,i,o){n=n||r(8727);for(var a=o.typeKey,s=0,c=Object.keys(e);s<c.length;s++){var l=c[s],f=e[l];p({prop:l,subprops:u(f)&&Object.keys(f).length>0&&(!f[a]||"type"===a&&u(f.type)&&f.type.type)?f:null,prototype:t,prefix:i,options:o})}}function p(e){var t=e.prop,s=e.subprops,u=e.prototype,p=e.prefix,y=e.options;n=n||r(8727);var b=(p?p+".":"")+t,m=(p=p||"")?Object.freeze({}):d;s?Object.defineProperty(u,t,{enumerable:!0,configurable:!0,get:function(){var e,t,r=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[b]){var a=Object.create(n.prototype,(e=this,t={},Object.getOwnPropertyNames(e).forEach(function(r){-1===["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)||(t[r]=Object.getOwnPropertyDescriptor(e,r),t[r].enumerable=!1)}),t));p||(a.$__[l]=this),a.$__.nestedPath=b,Object.defineProperty(a,"schema",{enumerable:!1,configurable:!0,writable:!1,value:u.schema}),Object.defineProperty(a,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:u.schema}),Object.defineProperty(a,o,{enumerable:!1,configurable:!0,writable:!1,value:u.schema}),Object.defineProperty(a,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return i(r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(a,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty(a,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(b,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty(a,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0}),Object.defineProperty(a,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(b,null,f)||{}).length}}),Object.defineProperty(a,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),h(s,a,b,y),this.$__.getters[b]=a}return this.$__.getters[b]},set:function(e){null!=e&&e.$__isNested?e=e.$__get():e instanceof n&&!e.$__isNested&&(e=e.$toObject(a)),(this.$__[l]||this).$set(b,e)}}):Object.defineProperty(u,t,{enumerable:!0,configurable:!0,get:function(){return this[c].call(this.$__[l]||this,b,null,m)},set:function(e){this.$set.call(this.$__[l]||this,b,e)}})}},9585:e=>{"use strict";e.exports=function(e,t,r){for(var n=t[0],i=r,o=e,a=0;a<t.length-1;++a){var s=i.path(n);if(s&&s.schema){var c=o.get(n);if(i=s.schema,n=t[a+1],Array.isArray(c)&&!isNaN(n)&&(c=c[n],n=""),null==c)break;o=c}else n+=n.length?"."+t[a+1]:t[a+1]}return o}},111:(e,t,r)=>{"use strict";var n=r(9981),i=r(2392);e.exports=function e(t,r,o){for(var a=(o=o||{}).typeOnly,s=Array.isArray(r)?r:-1===r.indexOf(".")?[r]:r.split("."),c=null,l="adhocOrUndefined",u=i(t.schema,t.get(t.
2schema.options.discriminatorKey))||t.schema,f=0;f<s.length;++f){var d=s.slice(0,f+1).join(".");if(null!=(c=u.path(d))){if("Mixed"===c.instance)return a?"real":c;if(l=u.pathType(d),(c.$isSingleNested||c.$isMongooseDocumentArrayElement)&&null!=c.schema.discriminators){var h=c.schema.discriminators,p=t.get(d+"."+n(c,"schema.options.discriminatorKey"));if(null==p||null==h[p])continue;var y=s.slice(f+1).join(".");return e(t.get(d),y,o)}}else l="adhocOrUndefined"}return a?l:c}},719:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(6872),s=new Set(["__index","__parentArray","_doc"]);e.exports=function(e,t){if(a.isPOJO(e)&&null!=e.$__&&null!=e._doc){if(t){for(var r={},n=0,c=Object.keys(e);n<c.length;n++){var l=c[n];"symbol"!==o(l)&&"$"!==l[0]&&(s.has(l)||(r[l]=e[l]))}return i(i({},e._doc),r)}return e._doc}return e}},9449:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}e.exports=function(e,r,n){if(0===e.length)return n();var i,o=e.length,a=null,s=function(e){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return t(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,void 0):void 0}}(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(e);try{for(s.s();!(i=s.n()).done;)r(i.value,function(e){if(null==a)return null!=e?n(a=e):--o<=0?n():void 0})}catch(e){s.e(e)}finally{s.f()}}},198:e=>{"use strict";e.exports=function(e){for(var t,r=Object.keys(e.errors||{}),n=r.length,i=[],o=0;o<n;++o)t=r[o],e!==e.errors[t]&&i.push(t+": "+e.errors[t].message);return i.join(", ")}},9981:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function r(e,t){return null==e?e:e instanceof Map?e.get(t):e[t]}e.exports=function(e,n,i){var o,a=!1;if("string"==typeof n){if(-1===n.indexOf("."))return r(e,n)??i;o=n.split(".")}else if(a=!0,1===(o=n).length)return r(e,o[0])??i;var s,c=n,l=e,u=function(e){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return t(e,void 0);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,void 0):void 0}}(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
2}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(o);try{for(u.s();!(s=u.n()).done;){var f=s.value;if(null==l)return i;if(!a&&null!=l[c])return l[c];l=r(l,f),a||(c=c.substr(f.length+1))}}catch(e){u.e(e)}finally{u.f()}return l??i}},1981:e=>{"use strict";e.exports=function(e){if(null!=e&&"function"==typeof e.constructor)return e.constructor.name}},6749:e=>{"use strict";var t=/^function\s*([^\s(]+)/;e.exports=function(e){return e.name||(e.toString().trim().match(t)||[])[1]}},1490:e=>{"use strict";e.exports=function(e){return setTimeout(e,0)}},1605:e=>{"use strict";e.exports=function(e,t){var r=e.discriminatorMapping&&e.discriminatorMapping.value;if(r&&!("sparse"in t)){var n=e.options.discriminatorKey;t.partialFilterExpression=t.partialFilterExpression||{},t.partialFilterExpression[n]=r}return t}},8857:e=>{"use strict";e.exports=function(e){return"function"==typeof e&&e.constructor&&"AsyncFunction"===e.constructor.name}},1563:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e,r){return"object"===t(e)&&null!==e&&e._bsontype===r}},6584:(e,t,r)=>{"use strict";var n=r(7339).isMongooseArray;e.exports=function(e){return null!=e&&(n(e)||null!=e.$__||e.isMongooseBuffer||e.$isMongooseMap)}},5721:(e,t,r)=>{"use strict";var n=r(365).Buffer;e.exports=function(e){return n.isBuffer(e)||"[object Object]"===Object.prototype.toString.call(e)}},4673:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){if(null==e||"object"!==t(e))return!1;var r=Object.getPrototypeOf(e);return!r||"Object"===r.constructor.name}},5543:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return!!e&&("object"===t(e)||"function"==typeof e)&&"function"==typeof e.then}},9130:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){for(var r=Object.keys(e),n=!0,i=0,o=r.length;i<o;++i)if("object"===t(e[r[i]])&&null!==e[r[i]]){n=!1;break}return n}},8859:(e,t,r)=>{"use strict";var n=r(8107),i=r(8486);e.exports=a,a.middlewareFunctions=["deleteOne","save","validate","remove","updateOne","init"];var o=new Set(a.middlewareFunctions.flatMap(function(e){return[e,"$__".concat(e)]}));function a(e,t,r){var s={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},c=(r=r||{}).decorateDoc?e:e.prototype;e.$appliedHooks=!0;for(var l=0,u=Object.keys(t.paths);l<u.length;l++){var f=u[l],d=t.paths[f],h=null;if(d.$isSingleNested)h=d.caster;else{if(!d.$isMongooseDocumentArray)continue;h=d.Constructor}if(!h.$appliedHooks&&(a(h,d.schema,r),null!=h.discriminators))for(var p=0,y=Object.keys(h.discriminators);p<y.length;p++){var b=y[p];a(h.discriminators[b],h.discriminators[b].schema,r)}}var m=t.s.hooks.filter(function(e){return"updateOne"===e.name||"deleteOne"===e.name?!!e.document:"remove"===e.name||"init"===e.name?null==e.document||!!e.document:null==e.query&&null==e.document||!1!==e.document}).filter(function(e){return!t.methods[e.name]||!e.fn[n.builtInMiddleware]});e._middleware=m,c.$__originalValidate=c.$__originalValidate||c.$__validate;for(var g=0,v=["save","validate","remove","deleteOne"];g<v.length;g++){var x=v[g],w="validate"===x?"$__originalValidate":"$__".concat(x),_=m.createWrapper(x,c[w],null,s);c["$__".concat(x)]=_}c.$__init=m.createWrapperSync("init",c.$__init,null,s);for(var S=Object.keys(t.methods),j=Object.assign({},s,{checkForPromise:!0}),k=0;k<S.length;k++)!function(){var t=S[k];if(!o.has(t)&&m.hasHooks(t)){var r=c[t];c[t]=function(){var r=this,n=Array.prototype.slice.call(arguments),o=n.slice(-1).pop(),a="function"==typeof o?n.slice(0,n.length-1):n;return i(o,function(e){return r["$__".concat(t)].apply(r,a.concat([e]))},e.events)},c["$__".concat(t)]=m.createWrapper(t,r,null,j)}}()}},9181:(e,t,r)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var i=r(3861),o=r(6956),a=r(1973),s=r(8724).c,c=r(9981),l=r(6872),u=r(2462),f={toJSON:!0,toObject:!0,_id:!0,id:!0,virtuals:!0,methods:!0};e.exports=function(e,t,r,d,h,p){if(!r||!r.instanceOfSchema)throw Error("You must pass a valid discriminator Schema");if(p=p??!0,e.schema.discriminatorMapping&&!e.schema.discriminatorMapping.isRoot)throw Error('Discriminator "'+t+'" can only be a discriminator of the root model');if(h){var y=c(e.base,"options.applyPluginsToDiscriminators",!1)||!p;e.base._applyPlugins(r,{skipTopLevel:!y})}else p||o(r);var b=e.schema.options.discriminatorKey,m=e.schema.path(b);if(null!=m)l.hasUserDefinedProperty(m.options,"select")||(m.options.select=!0),m.options.$skipDiscriminatorCheck=!0;else{var g={};g[b]={default:void 0,select:!0,$skipDiscriminatorCheck:!0},g[b][e.schema.options.typeKey]=String,e.schema.add(g),s({prop:b,prototype:e.prototype,options:e.schema.options})}if(r.path(b)&&!0!==r.path(b).options.$skipDiscriminatorCheck)throw Error('Discriminator "'+t+'" cannot have field with name "'+b+'"');var v=t;if(("string"==typeof d&&d.length||null!=d)&&(v=d),function(t,r){t._baseSchema=r,r.paths._id&&r.paths._id.options&&!r.paths._id.options.auto&&t.remove("_id");for(var o=[],s=0,c=Object.keys(r.paths);s<c.length;s++){var d=c[s];if(t.nested[d])o.push(d);else if(-1!==d.indexOf(".")){var y,g="",x=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}
2}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(d.split(".").slice(0,-1));try{for(x.s();!(y=x.n()).done;){var w=y.value;g+=(g.length?".":"")+w,(t.paths[g]instanceof i||t.singleNestedPaths[g]instanceof i)&&o.push(d)}}catch(e){x.e(e)}finally{x.f()}}}u(t,r);for(var _=0;_<o.length;_++){var S=o[_];delete t.paths[S]}t.childSchemas.forEach(function(e){e.model.prototype.$__setSchema(e.schema)});var j={};j[b]={default:v,select:!0,set:function(e){if(e===v||Array.isArray(v)&&l.deepEqual(e,v))return v;throw Error("Can't set discriminator key \""+b+'"')},$skipDiscriminatorCheck:!0},j[b][t.options.typeKey]=m?m.options[t.options.typeKey]:String,t.add(j),t.discriminatorMapping={key:b,value:v,isRoot:!1},r.options.collection&&(t.options.collection=r.options.collection);var k=t.options.toJSON,O=t.options.toObject,$=t.options._id,A=t.options.id,E=Object.keys(t.options);t.options.discriminatorKey=r.options.discriminatorKey;for(var N=t._userProvidedOptions,P=0;P<E.length;P++){var M=E[P];if(!f[M]&&M in N&&!l.deepEqual(t.options[M],r.options[M]))throw Error("Can't customize discriminator option "+M+" (can only modify "+Object.keys(f).join(", ")+")")}t.options=a(r.options);for(var D=0,I=Object.keys(N);D<I.length;D++){var T=I[D];t.options[T]=N[T]}k&&(t.options.toJSON=k),O&&(t.options.toObject=O),void 0!==$&&(t.options._id=$),t.options.id=A,p&&(t.s.hooks=e.schema.s.hooks.merge(t.s.hooks)),h&&(t.plugins=Array.prototype.slice.call(r.plugins)),t.callQueue=r.callQueue.concat(t.callQueue),delete t._requiredpaths}(r,e.schema),e.discriminators||(e.discriminators={}),e.schema.discriminatorMapping||(e.schema.discriminatorMapping={key:b,value:null,isRoot:!0}),e.schema.discriminators||(e.schema.discriminators={}),e.schema.discriminators[t]=r,e.discriminators[t]&&!r.options.overwriteModels)throw Error('Discriminator with name "'+t+'" already exists');return r}},251:e=>{"use strict";var t=/\./g;e.exports=function(e){if(-1===e.indexOf("."))return[e];for(var r=e.split(t),n=r.length,i=Array(n),o="",a=0;a<n;++a)o+=0!==o.length?"."+r[a]:r[a],i[a]=o;return i}},5837:(e,t,r)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var i=r(6872);e.exports=function(e,t){if(null!=e._id&&null!=t&&0!==t.length){var r,o=String(e._id),a=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(t);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!s.isVirtual)for(var c=s.path.split("."),l=0;l<c.length-1;++l){var u=c.slice(0,l+1).join("."),f=c.slice(l+1).join("."),d=e.get(u);if(null!=d&&i.isMongooseDocumentArray(d)){for(var h=0;h<d.length;++h)d[h]&&d[h].populated(f,null==s._docs[o]?void 0:s._docs[o][h],s);break}}}}catch(e){a.e(e)}finally{a.f()}}}},6870:(e,t,r)=>{"use strict";var n=r(5202),i=r(8751);e.exports=function(e,t){if("string"!=typeof e&&"function"!=typeof e)throw new n('Invalid ref at path "'+t+'". Got '+i.inspect(e,{depth:0}))}},7427:e=>{"use strict";e.exports=function(e){for(var t={},r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(-1!==i.indexOf("."))for(var o=i.split("."),a=o[0],s=0;s<o.length;++s)t[a]=1,s+1<o.length&&(a=a+"."+o[s+1]);else t[i]=1}return t}},2183:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return null==e||"object"!==t(e)||!("$meta"in e)&&!("$slice"in e)}},9098:(e,t,r)=>{"use strict";var n=r(2183),i=r(4673);e.exports=function e(t){if(null==t)return null;var r=Object.keys(t),o=null;if(1===r.length&&"_id"===r[0])o=!t._id;else for(var a=0;a<r.length;++a){var s,c=r[a];
2if("_id"!==c&&n(t[c])&&null!=(o=i(t[c])?null!=(s=e(t[c]))?s:o:!t[c]))break}return o}},7368:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return null!=e&&"object"===t(e)&&null==e.$slice&&null==e.$elemMatch&&null==e.$meta&&null==e.$}},23:e=>{"use strict";e.exports=function(e,t){for(var r,n,i,o=t.split("."),a="",s=0;s<o.length;++s)if(e[a+=a.length?".":""+o[s]]){for(i=(n=Object.keys(e)).length,r=0;r<i;++r)0!==n[s].indexOf(a+".")||n[s].indexOf(t);return!0}return!1}},8486:(e,t,r)=>{"use strict";var n=r(1490),i=Symbol("mongoose:emitted");e.exports=function(e,t,o,a){if("function"==typeof e)try{return t(function(t){if(null==t)e.apply(this,arguments);else{null!=o&&null!=o.listeners&&o.listeners("error").length>0&&!t[i]&&(t[i]=!0,o.emit("error",t));try{e(t)}catch(e){return n(function(){throw e})}}})}catch(t){return null!=o&&null!=o.listeners&&o.listeners("error").length>0&&!t[i]&&(t[i]=!0,o.emit("error",t)),e(t)}return new(a=a||r.g.Promise)(function(e,r){t(function(t,n){return null!=t?(null!=o&&null!=o.listeners&&o.listeners("error").length>0&&!t[i]&&(t[i]=!0,o.emit("error",t)),r(t)):arguments.length>2?e(Array.prototype.slice.call(arguments,1)):void e(n)})})}},5130:(e,t,r)=>{"use strict";function n(e,t){var r=t.schema.s.hooks.filter(function(e){var t,r=(t={},e.hasOwnProperty("query")&&(t.query=e.query),e.hasOwnProperty("document")&&(t.document=e.document),t);return"validate"===e.name?!!r.query:"deleteOne"===e.name||"updateOne"===e.name?!!r.query||0===Object.keys(r).length:null==e.query&&null==e.document||!!e.query});e.prototype._queryMiddleware=r}e.exports=n,n.middlewareFunctions=r(9853).concat(["validate"])},9739:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(1795),o=r(3328),a=r(3065),s=new Set(["$and","$or"]),c=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),l=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),u=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),f=new Set(["$arrayElemAt","$first","$last"]),d=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),h=new Set(["$not"]);function p(e){if(!b(e))return e;try{return a(e)}catch(t){throw new i("Number",e)}}function y(e){return"string"==typeof e&&"$"===e[0]}function b(e){return!("string"==typeof e&&"$"===e[0]||"object"===n(e)&&null!==e&&Object.keys(e).find(function(e){return"$"===e[0]})&&null==e.$literal)}e.exports=function(e,t,r){if("object"!==n(e)||null===e)throw Error("`$expr` must be an object");return function e(t,r,m){if(y(t)||null===t)return t;null!=t.$cond?Array.isArray(t.$cond)?t.$cond=t.$cond.map(function(t){return e(t,r,m)}):(t.$cond.if=e(t.$cond.if,r,m),t.$cond.then=e(t.$cond.then,r,m),t.$cond.else=e(t.$cond.else,r,m)):null!=t.$ifNull?t.$ifNull.map(function(t){return e(t,r,m)}):null!=t.$switch&&(Array.isArray(t.$switch.branches)&&(t.$switch.branches=t.$switch.branches.map(function(t){return e(t,r,m)})),"default"in t.$switch&&(t.$switch.default=e(t.$switch.default,r,m)));for(var g=0,v=Object.keys(t);g<v.length;g++){var x=v[g];s.has(x)?t[x]=t[x].map(function(t){return e(t,r,m)}):c.has(x)?t[x]=function(t,r,s){if(!Array.isArray(t)||2!==t.length)throw Error("Comparison operator must be an array of length 2");t[0]=e(t[0],r,s);var c=t[0];if(b(t[1])){var l=null,u=null,h=null;if(y(c))l=c.slice(1),u=r.path(l);else if("object"===n(c)&&null!=c)for(var p=0,m=Object.keys(c);p<m.length;p++){var g=m[p];d.has(g)&&y(c[g])?(l=c[g].slice(1)+"."+g,h=a):f.has(g)&&y(c[g])&&(l=c[g].slice(1)+"."+g,null!=(u=r.path(c[g].slice(1)))&&(u.$isMongooseDocumentArray?u=u.$embeddedSchemaType:u.$isMongooseArray&&(u=u.caster)))}var v="object"===n(t[1])&&null!=t[1]&&null!=t[1].$literal;if(null!=u)t[1]=v?{$literal:u.cast(t[1].$literal)}:u.cast(t[1]);else if(null!=h)if(v)try{t[1]={$literal:h(t[1].$literal)}}catch(e){throw new i(h.name.replace(/^cast/,""),t[1],l+".$literal")}else try{t[1]=h(t[1])}catch(e){throw new i(h.name.replace(/^cast/,""),t[1],l)}else{if(null!=l&&!0===s)return;if(null!=l&&"throw"===s)throw new o(l)}}else t[1]=e(t[1]);return t}(t[x],r,m):l.has(x)?t[x]=function(e){if(!Array.isArray(e)){if(!b(e))return e;try{return a(e)}catch(t){throw new i("Number",e)}}return e.map(function(e){if(!b(e))return e;try{return a(e)}catch(t){throw new i("Number",e)}})}(t[x]):u.has(x)?t[x]=p(t[x]):h.has(x)&&(t[x]=e(t[x],r,m))}if(t.$in&&(t.$in=function(e,t,r){var n=e[1];if(!y(n))return e;var i=e[0],a=t.path(n.slice(1));if(null!==a){if(!a.$isMongooseArray)throw Error("Path must be an array for $in");return[a.$isMongooseDocumentArray?a.$embeddedSchemaType.cast(i):a.caster.cast(i),n]}if(!1===r)return e;if("throw"===r)throw new o("$in")}(t.$in,r,m)),t.$size&&(t.$size=p(t.$size)),t.$round){var w=t.$round;if(!Array.isArray(w)||w.length<1||w.length>2)throw new i("Array",w,"$round");t.$round=w.map(function(e){return p(e)})}return function(e){for(var t=Object.keys(e),r=0,n=t.length;r<n;++r)void 0===e[t[r]]&&delete e[t[r]]}(t),t}(e,t,r)}},1428:e=>{"use strict";e.exports=function(e){switch(e){case"p":e="primary";break;case"pp":e="primaryPreferred";break;case"s":e="secondary";break;case"sp":e="secondaryPreferred";break;case"n":e="nearest"}return e}},7906:e=>{"use strict";var t=new Set(["$ref","$id","$db"]);e.exports=function(e){return"$"===e[0]&&!t.has(e)}},3636:(e,t)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n=Symbol("mongoose#trustedSymbol");
2t.trustedSymbol=n,t.trusted=function(e){return null==e||"object"!==r(e)&&"function"!=typeof e||(e[n]=!0),e}},9853:e=>{"use strict";e.exports=Object.freeze(["count","countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete","findOneAndRemove"])},4133:e=>{"use strict";e.exports=function(e){var t={_id:{auto:!0}};t._id[e.options.typeKey]="ObjectId",e.add(t)}},6956:(e,t,r)=>{"use strict";var n=r(4292);e.exports=function(e){for(var t=0,r=Object.values(n);t<r.length;t++)(0,r[t])(e,{deduplicate:!0});e.plugins=Object.values(n).map(function(e){return{fn:e,opts:{deduplicate:!0}}}).concat(e.plugins)}},7658:e=>{"use strict";e.exports=function(e){return e.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}},5379:(e,t,r)=>{"use strict";var n=r(9981),i=r(5721),o=r(1605);e.exports=function(e){var t=[],r=new WeakMap,a=e.constructor.indexTypes,s=new Map;return function e(c,l,u){if(!r.has(c)){r.set(c,!0),l=l||"";for(var f=0,d=Object.keys(c.paths);f<d.length;f++){var h=d[f],p=c.paths[h];if(null==u||!u.paths[h]){if(p.$isMongooseDocumentArray||p.$isSingleNested){if(!0!==n(p,"options.excludeIndexes")&&!0!==n(p,"schemaOptions.excludeIndexes")&&!0!==n(p,"schema.options.excludeIndexes")&&e(p.schema,l+h+"."),null!=p.schema.discriminators)for(var y=p.schema.discriminators,b=0,m=Object.keys(y);b<m.length;b++)e(y[m[b]],l+h+".",p.schema);if(p.$isMongooseDocumentArray)continue}var g=p._index||p.caster&&p.caster._index;if(!1!==g&&null!=g){var v,x={},w=i(g),_=w?g:{},S="string"==typeof g?g:!!w&&g.type;S&&-1!==a.indexOf(S)?x[l+h]=S:_.text?(x[l+h]="text",delete _.text):(v="descending"===g||"desc"===g||"ascending"!==g&&"asc"!==g&&-1===Number(g),x[l+h]=v?-1:1),delete _.type,"background"in _||(_.background=!0),null!=c.options.autoIndex&&(_._autoIndex=c.options.autoIndex);var j=_&&_.name;"string"==typeof j&&s.has(j)?Object.assign(s.get(j),x):(t.push([x,_]),s.set(j,x))}}}r.delete(c),l?function(e,r){for(var n=e._indexes,i=n.length,o=0;o<i;++o){for(var a=n[o][0],s=n[o][1],c=Object.keys(a),l=c.length,u={},f=0;f<l;++f){var d=c[f];u[r+d]=a[d]}var h=Object.assign({},s);if(null!=s&&null!=s.partialFilterExpression){h.partialFilterExpression={};for(var p=s.partialFilterExpression,y=0,b=Object.keys(p);y<b.length;y++){var m=b[y];h.partialFilterExpression[r+m]=p[m]}}t.push([u,h])}}(c,l):(c._indexes.forEach(function(e){var t=e[1];"background"in t||(t.background=!0),o(c,t)}),t=t.concat(c._indexes))}}(e),t}},37:(e,t,r)=>{"use strict";function n(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=r(9981);e.exports=function(e,t,r){var i,a=null!=r?Object.keys(o(e.tree,r,{})):Object.keys(e.tree),s=new Set(Object.keys(t));if(s.size>1){i=new Set;var c,l=n(a);try{for(l.s();!(c=l.n()).done;){var u=c.value;s.has(u)&&i.add(u)}}catch(e){l.e(e)}finally{l.f()}var f,d=n(s);try{for(d.s();!(f=d.n()).done;){var h=f.value;i.has(h)||i.add(h)}}catch(e){d.e(e)}finally{d.f()}i=Array.from(i)}else i=Array.from(s);return i}},9728:e=>{"use strict";e.exports=function(e,t){if(1!==t.length){for(var r=t[0],n=void 0,i=0;i<t.length-1;++i){var o=e.path(r);o&&o.schema?(n=o.schema.options.strict,e=o.schema,r=o.$isMongooseDocumentArray&&!isNaN(t[i+1])?"":t[i+1]):r+=r.length?"."+t[i+1]:t[i+1]}return n}}},9691:(e,t,r)=>{"use strict";var n=r(4133);e.exports=function(e,t){return null==t||null==t._id||(e=e.clone(),t._id?e.paths._id||(n(e),e.options._id=!0):(e.remove("_id"),e.options._id=!1)),e}},6370:e=>{"use strict";e.exports=function(e,t){return null==e?null:"boolean"==typeof e?t:"boolean"==typeof e[t]?e[t]?t:null:t in e?e[t]:t}},1879:e=>{"use strict";function t(){return null!=this._id?String(this._id):null}function r(e){return this._id=e,e}e.exports=function(e){return!e.paths.id&&e.paths._id&&e.options.id&&(e.aliases&&e.aliases.id||(e.virtual("id").get(t),e.virtual("id").set(r))),e}},4913:e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}
2e.exports=function(e,r,n){for(var i={},o=0,a=Object.keys(r.tree);o<a.length;o++){var s=a[o];n&&(e.paths[s]||e.nested[s]||e.singleNestedPaths[s])||(i[s]=r.tree[s])}e.options._isMerging=!0,e.add(i,null),delete e.options._isMerging,e.callQueue=e.callQueue.concat(r.callQueue),e.method(r.methods),e.static(r.statics);for(var c=0,l=Object.entries(r._userProvidedOptions);c<l.length;c++){var u,f=function(e){if(Array.isArray(e))return e}(u=l[c])||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,i,o,a=[],s=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(r=i.call(t)).done)&&(a.push(r.value),2!==a.length);s=!0);}catch(e){c=!0,n=e}finally{try{if(!s&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw n}}return a}}(u)||function(e){if(e){if("string"==typeof e)return t(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),d=f[0],h=f[1];d in e._userProvidedOptions||e.set(d,h)}for(var p in r.query)e.query[p]=r.query[p];for(var y in r.virtuals)e.virtuals[y]=r.virtuals[y].clone();e._indexes=e._indexes.concat(r._indexes||[]),e.s.hooks.merge(r.s.hooks,!1)}},8828:(e,t,r)=>{"use strict";var n=r(3328);e.exports=function(e){var t,r;e.$immutable?(t=e.path,r=e.options.immutable,e.$immutableSetter=function(e,i,o,a){if(null==this||null==this.$__||this.isNew||a&&a.overwriteImmutable||!("function"==typeof r?r.call(this,this):r))return e;var s=null!=this.$__.priorDoc?this.$__.priorDoc.$__getValue(t):this.$__getValue(t);if("throw"===this.$__.strictMode&&e!==s)throw new n(t,"Path `"+t+"` is immutable and strict mode is set to throw.",!0);return s},e.set(e.$immutableSetter)):e.$immutableSetter&&(e.setters=e.setters.filter(function(t){return t!==e.$immutableSetter}),delete e.$immutableSetter)}},2862:e=>{"use strict";e.exports=new Set(["__proto__","constructor","prototype"])},8770:(e,t)=>{"use strict";t.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup"),t.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics"),t.arrayParentSymbol=Symbol("mongoose#Array#_parent"),t.arrayPathSymbol=Symbol("mongoose#Array#_path"),t.arraySchemaSymbol=Symbol("mongoose#Array#_schema"),t.documentArrayParent=Symbol("mongoose:documentArrayParent"),t.documentIsSelected=Symbol("mongoose#Document#isSelected"),t.documentIsModified=Symbol("mongoose#Document#isModified"),t.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths"),t.documentSchemaSymbol=Symbol("mongoose#Document#schema"),t.getSymbol=Symbol("mongoose#Document#get"),t.modelSymbol=Symbol("mongoose#Model"),t.objectIdSymbol=Symbol("mongoose#ObjectId"),t.populateModelSymbol=Symbol("mongoose.PopulateOptions#Model"),t.schemaTypeSymbol=Symbol("mongoose#schemaType"),t.sessionNewDocuments=Symbol("mongoose:ClientSession#newDocuments"),t.scopeSymbol=Symbol("mongoose#Document#scope"),t.validatorErrorSymbol=Symbol("mongoose:validatorError")},4922:e=>{"use strict";e.exports=function(e,t,r,n,i){var o=null!=t&&!1===t.updatedAt,a=null!=t&&!1===t.createdAt,s=null!=r?r():e.ownerDocument().constructor.base.now();if(!a&&(e.isNew||e.$isSubdocument)&&n&&!e.$__getValue(n)&&e.$__isSelected(n)&&e.$set(n,s,void 0,{overwriteImmutable:!0}),!o&&i&&(e.isNew||e.$isModified())){var c=s;e.isNew&&null!=n&&(c=e.$__getValue(n)),e.$set(i,c)}}},3767:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t,r){var i;return(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r(4843),s=r(6434),c=r(9981),l=r(6370),u=r(4922),f=r(8107),d=new Set(["replaceOne","findOneAndReplace"]);e.exports=function(e,t){var r=e.childSchemas.find(function(e){return!!e.schema.options.timestamps});if(t||r){var n=l(t,"createdAt"),h=l(t,"updatedAt"),p=null!=t&&t.hasOwnProperty("currentTime")?t.currentTime:null,y={};if(e.$timestamps={createdAt:n,updatedAt:h}
2,n&&!e.paths[n]){var b=null!=e.base?e.base.get("timestamps.createdAt.immutable"):null;y[n]=o(o({},e.options.typeKey||"type",Date),"immutable",null==b||b)}h&&!e.paths[h]&&(y[h]=Date),e.add(y),e.pre("save",function(e){var t=c(this,"$__.saveOptions.timestamps");if(!1===t)return e();u(this,t,p,n,h),e()}),e.methods.initializeTimestamps=function(){var e=null!=p?p():this.constructor.base.now();if(n&&!this.get(n)&&this.$set(n,e),h&&!this.get(h)&&this.$set(h,e),this.$isSubdocument)return this;var t,r=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,void 0):void 0}}(e))){t&&(e=t);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(this.$getAllSubdocs());try{for(r.s();!(t=r.n()).done;){var o=t.value;o.initializeTimestamps&&o.initializeTimestamps()}}catch(e){r.e(e)}finally{r.f()}return this},g[f.builtInMiddleware]=!0;var m={query:!0,model:!1};e.pre("findOneAndReplace",m,g),e.pre("findOneAndUpdate",m,g),e.pre("replaceOne",m,g),e.pre("update",m,g),e.pre("updateOne",m,g),e.pre("updateMany",m,g)}function g(e){var t=null!=p?p():this.model.base.now();d.has(this.op)&&null==this.getUpdate()&&this.setUpdate({}),s(t,n,h,this.getUpdate(),this._mongooseOptions,this.schema),a(t,this.getUpdate(),this.model.schema),e()}}},5285:(e,t,r)=>{"use strict";var n=r(1981);e.exports=function(e){if("TopologyDescription"!==n(e))return!1;var t=Array.from(e.servers.values());return t.length>0&&t.every(function(e){return"Unknown"===e.type})}},2082:(e,t,r)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var i=r(1981);e.exports=function(e){if("TopologyDescription"!==i(e)||0===e.servers.size)return!1;var t,r=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(e.servers.values());try{for(r.s();!(t=r.n()).done;){var o=t.value;if(!1===o.host.endsWith(".mongodb.net")||27017!==o.port)return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},3871:(e,t,r)=>{"use strict";var n=r(1981);e.exports=function(e){if("TopologyDescription"!==n(e))return!1;var t=Array.from(e.servers.values());return t.length>0&&t.every(function(e){return e.error&&-1!==e.error.message.indexOf("Client network socket disconnected before secure TLS connection was established")})}},4843:(e,t,r)=>{"use strict";function n(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e}
2,f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=r(7658),a=r(6370);function s(e,t,r){if(null!=t){if(Object.keys(t).some(function(e){return"$"===e[0]})){if(t.$push&&p(t.$push),t.$addToSet&&p(t.$addToSet),null!=t.$set)for(var i=0,o=Object.keys(t.$set);i<o.length;i++)c(r,o[i],t.$set,e);if(null!=t.$setOnInsert)for(var l=0,u=Object.keys(t.$setOnInsert);l<u.length;l++)c(r,u[l],t.$setOnInsert,e)}var f,d=n(Object.keys(t).filter(function(e){return"$"!==e[0]}));try{for(d.s();!(f=d.n()).done;){var h=f.value;c(r,h,t,e)}}catch(e){d.e(e)}finally{d.f()}}function p(t){for(var n=0,i=Object.keys(t);n<i.length;n++)!function(){var o=i[n],c=r.path(o.replace(/\.\$\./i,".").replace(/.\$$/,""));if(t[o]&&c&&c.$isMongooseDocumentArray&&c.schema.options.timestamps){var l=c.schema.options.timestamps,u=a(l,"createdAt"),f=a(l,"updatedAt");t[o].$each?t[o].$each.forEach(function(t){null!=f&&(t[f]=e),null!=u&&(t[u]=e),s(e,t,c.schema)}):(null!=f&&(t[o][f]=e),null!=u&&(t[o][u]=e),s(e,t[o],c.schema))}}()}}function c(e,t,r,i){var c=o(t),l=e.path(c);if(l){for(var u=[],f=c.split("."),d=f.length-1;d>0;--d){var h=e.path(f.slice(0,d).join("."));null!=h&&(h.$isMongooseDocumentArray||h.$isSingleNested)&&u.push({parentPath:t.split(".").slice(0,d).join("."),parentSchemaType:h})}if(Array.isArray(r[t])&&l.$isMongooseDocumentArray)!function(e,t,r){var n=t.schema.options.timestamps,i=e.length;if(n)for(var o=a(n,"createdAt"),c=a(n,"updatedAt"),l=0;l<i;++l)null!=c&&(e[l][c]=r),null!=o&&(e[l][o]=r),s(r,e[l],t.schema);else for(var u=0;u<i;++u)s(r,e[u],t.schema)}(r[t],l,i);else if(r[t]&&l.$isSingleNested)!function(e,t,r){var n=t.schema.options.timestamps;if(n){var i=a(n,"createdAt"),o=a(n,"updatedAt");null!=o&&(e[o]=r),null!=i&&(e[i]=r),s(r,e,t.schema)}else s(r,e,t.schema)}(r[t],l,i);else if(u.length>0){var p,y=n(u);try{for(y.s();!(p=y.n()).done;){var b=p.value,m=b.parentPath,g=b.parentSchemaType,v=g.schema.options.timestamps,x=a(v,"updatedAt");if(v&&null!=x){if(g.$isSingleNested)r[m+"."+x]=i;else if(g.$isMongooseDocumentArray){var w=t.substring(m.length+1);if(/^\d+$/.test(w)){r[m+"."+w][x]=i;continue}var _=w.indexOf(".");r[m+"."+(w=-1!==_?w.substring(0,_):w)+"."+x]=i}}}}catch(e){y.e(e)}finally{y.f()}}else if(null!=l.schema&&l.schema!=e&&r[t]){var S=l.schema.options.timestamps,j=a(S,"createdAt"),k=a(S,"updatedAt");if(!S)return;null!=k&&(r[t][k]=i),null!=j&&(r[t][j]=i)}}}e.exports=s},6434:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(9981);e.exports=function(e,t,r,o,a){var s=o,c=s,l=i(a,"overwrite",!1),u=i(a,"timestamps",!0);if(!u||null==s)return o;var f,d,h=null!=u&&!1===u.createdAt,p=null!=u&&!1===u.updatedAt;if(l)return o&&o.$set&&(o=o.$set,s.$set={},c=s.$set),p||!r||o[r]||(c[r]=e),h||!t||o[t]||(c[t]=e),s;if(o=o||{},Array.isArray(s))return null==r||s.push({$set:(f={},(x=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(d=r),(d="symbol"==n(x)?x:x+"")in f)?Object.defineProperty(f,d,{value:e,enumerable:!0,configurable:!0,writable:!0}):f[d]=e,f)}),s;if(s.$set=s.$set||{},!p&&r&&(!o.$currentDate||!o.$currentDate[r])){var y=!1;if(-1!==r.indexOf("."))for(var b=r.split("."),m=1;m<b.length;++m){var g=b.slice(-m).join("."),v=b.slice(0,-m).join(".");if(null!=o[v]){o[v][g]=e,y=!0;break}if(o.$set&&o.$set[v]){o.$set[v][g]=e,y=!0;break}}y||(s.$set[r]=e),s.hasOwnProperty(r)&&delete s[r]}if(!h&&t){var x,w,_=i(a,"overwriteImmutable",!1),S=null!=o[t]||null!=(null==(w=o)?void 0:w.$set[t]);if(_&&S)null!=o[t]&&(s.$set[t]=o[t],delete o[t]);else{o[t]&&delete o[t],o.$set&&o.$set[t]&&delete o.$set[t];var j=!1;if(-1!==t.indexOf("."))for(var k=t.split("."),O=1;O<k.length;++O){var $=k.slice(-O).join("."),A=k.slice(0,-O).join(".");if(null!=o[A]){o[A][$]=e,j=!0;break}if(o.$set&&o.$set[A]){o.$set[A][$]=e,j=!0;break}}j||(s.$setOnInsert=s.$setOnInsert||{},s.$setOnInsert[t]=e)}}return 0===Object.keys(s.$set).length&&delete s.$set,s}},6379:(e,t,r)=>{"use strict";var n=r(489).ctor("require","modify","init","default","ignore");function i(){this.activePaths=new n}
2e.exports=i,i.prototype.strictMode=!0,i.prototype.fullPath=void 0,i.prototype.selected=void 0,i.prototype.shardval=void 0,i.prototype.saveError=void 0,i.prototype.validationError=void 0,i.prototype.adhocPaths=void 0,i.prototype.removing=void 0,i.prototype.inserting=void 0,i.prototype.saving=void 0,i.prototype.version=void 0,i.prototype._id=void 0,i.prototype.ownerDocument=void 0,i.prototype.populate=void 0,i.prototype.populated=void 0,i.prototype.primitiveAtomics=void 0,i.prototype.wasPopulated=!1,i.prototype.scope=void 0,i.prototype.session=null,i.prototype.pathsToScopes=null,i.prototype.cachedRequired=null},4962:(e,t)=>{"use strict";t.h={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1}},4034:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,o=r(1973);Object.defineProperty(i=function e(t){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),this._docs={},this._childDocs=[],null!=t&&(Object.assign(this,t=o(t)),"object"===n(t.subPopulate)&&(this.populate=t.subPopulate),null!=t.perDocumentLimit&&null!=t.limit))throw Error("Can not use `limit` and `perDocumentLimit` at the same time. Path: `"+t.path+"`.")},"prototype",{writable:!1}),e.exports=i},4756:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"enum",c),Object.defineProperty(s.prototype,"of",c),Object.defineProperty(s.prototype,"castNonArrays",c),e.exports=s},9586:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"subtype",c),e.exports=s},2869:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"min",c),Object.defineProperty(s.prototype,"max",c),Object.defineProperty(s.prototype,"expires",c),e.exports=s},887:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"excludeIndexes",c),Object.defineProperty(s.prototype,"_id",c),e.exports=s},8227:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"of",c),e.exports=s},8491:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"min",c),Object.defineProperty(s.prototype,"max",c),Object.defineProperty(s.prototype,"enum",c),Object.defineProperty(s.prototype,"populate",c),e.exports=s},8172:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"auto",c),Object.defineProperty(s.prototype,"populate",c),e.exports=s},3209:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"enum",c),Object.defineProperty(s.prototype,"match",c),Object.defineProperty(s.prototype,"lowercase",c),Object.defineProperty(s.prototype,"trim",c),Object.defineProperty(s.prototype,"uppercase",c),Object.defineProperty(s.prototype,"minLength",c),Object.defineProperty(s.prototype,"minlength",c),Object.defineProperty(s.prototype,"maxLength",c),Object.defineProperty(s.prototype,"maxlength",c),Object.defineProperty(s.prototype,"populate",c),e.exports=s},5446:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i=function(){return!!e})()}
2function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){var e,r;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),e=t,r=arguments,e=o(e),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,i()?Reflect.construct(e,r||[],o(this).constructor):e.apply(this,r))}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(r(1764)),c=r(3439);Object.defineProperty(s.prototype,"_id",c),e.exports=s},1764:(e,t,r)=>{"use strict";var n,i=r(1973),o=(Object.defineProperty(n=function e(t){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),null==t)return this;Object.assign(this,i(t))},"prototype",{writable:!1}),n),a=r(3439);Object.defineProperty(o.prototype,"type",a),Object.defineProperty(o.prototype,"validate",a),Object.defineProperty(o.prototype,"cast",a),Object.defineProperty(o.prototype,"required",a),Object.defineProperty(o.prototype,"default",a),Object.defineProperty(o.prototype,"ref",a),Object.defineProperty(o.prototype,"refPath",a),Object.defineProperty(o.prototype,"select",a),Object.defineProperty(o.prototype,"index",a),Object.defineProperty(o.prototype,"unique",a),Object.defineProperty(o.prototype,"immutable",a),Object.defineProperty(o.prototype,"sparse",a),Object.defineProperty(o.prototype,"text",a),Object.defineProperty(o.prototype,"transform",a),e.exports=o},1902:(e,t,r)=>{"use strict";var n,i=r(3439),o=(Object.defineProperty(n=function e(t){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),Object.assign(this,t),null!=t&&null!=t.options&&(this.options=Object.assign({},t.options))},"prototype",{writable:!1}),n);Object.defineProperty(o.prototype,"ref",i),Object.defineProperty(o.prototype,"refPath",i),Object.defineProperty(o.prototype,"localField",i),Object.defineProperty(o.prototype,"foreignField",i),Object.defineProperty(o.prototype,"justOne",i),Object.defineProperty(o.prototype,"count",i),Object.defineProperty(o.prototype,"match",i),Object.defineProperty(o.prototype,"options",i),Object.defineProperty(o.prototype,"skip",i),Object.defineProperty(o.prototype,"limit",i),Object.defineProperty(o.prototype,"perDocumentLimit",i),e.exports=o},3439:e=>{"use strict";e.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})},4292:(e,t,r)=>{"use strict";t.removeSubdocs=r(4393),t.saveSubdocs=r(535),t.sharding=r(7472),t.trackTransaction=r(442),t.validateBeforeSave=r(9888)},4393:(e,t,r)=>{"use strict";var n=r(9449);e.exports=function(e){e.s.hooks.pre("deleteOne",{document:!0,query:!1},function(e){if(this.$isSubdocument)e();else if(null!=this.$__){var t=this;n(this.$getAllSubdocs(),function(e,t){e.$__deleteOne(t)},function(r){if(r)return t.$__schema.s.hooks.execPost("deleteOne:error",t,[t],{error:r},function(t){e(t)});e()})}else e()},null,!0)}},535:(e,t,r)=>{"use strict";var n=r(9449);e.exports=function(e){e.s.hooks.pre("save",!1,function(e){if(this.$isSubdocument)e();else{var t=this,r=this.$getAllSubdocs();r.length?n(r,function(e,t){e.$__schema.s.hooks.execPre("save",e,function(e){t(e)})},function(r){if(r)return t.$__schema.s.hooks.execPost("save:error",t,[t],{error:r},function(t){e(t)});e()}):e()}},null,!0),e.s.hooks.post("save",function(e,t){if(this.$isSubdocument)t();else{var r=this,i=this.$getAllSubdocs();i.length?n(i,function(e,t){e.$__schema.s.hooks.execPost("save",e,[e],function(e){t(e)})},function(e){if(e)return r.$__schema.s.hooks.execPost("save:error",r,[r],{error:e},function(e){t(e)});t()}):t()}},null,!0)}},7472:(e,t,r)=>{"use strict";var n=r(8770).objectIdSymbol,i=r(6872);function o(){var e,t;
2if(this.$__.shardval){t=(e=Object.keys(this.$__.shardval)).length,this.$where=this.$where||{};for(var r=0;r<t;++r)this.$where[e[r]]=this.$__.shardval[e[r]]}}function a(){var e=this.$__schema.options.shardKey||this.$__schema.options.shardkey;if(i.isPOJO(e))for(var t,r=this.$__.shardval={},o=Object.keys(e),a=o.length,s=0;s<a;++s)null==(t=this.$__getValue(o[s]))?r[o[s]]=t:i.isMongooseObject(t)?r[o[s]]=t.toObject({depopulate:!0,_isNested:!0}):t instanceof Date||t[n]?r[o[s]]=t:"function"==typeof t.valueOf?r[o[s]]=t.valueOf():r[o[s]]=t}e.exports=function(e){e.post("init",function(){return a.call(this),this}),e.pre("save",function(e){o.call(this),e()}),e.pre("remove",function(e){o.call(this),e()}),e.post("save",function(){a.call(this)})},e.exports.storeShard=a},442:(e,t,r)=>{"use strict";function n(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=r(8770).arrayAtomicsSymbol,a=r(8770).sessionNewDocuments,s=r(6872);function c(e,t){var r=new Map;t=t||new Map;var i,a=n(Object.keys(e.$__.activePaths.init).concat(Object.keys(e.$__.activePaths.modify)));try{for(a.s();!(i=a.n()).done;){var c=i.value,u=e.$__getValue(c);if(null!=u&&Array.isArray(u)&&s.isMongooseDocumentArray(u)&&u.length&&null!=u[o]&&0!==Object.keys(u[o]).length){var f=t.get(c)||{};r.set(c,l(f,u[o]))}}}catch(e){a.e(e)}finally{a.f()}var d,h=n(e.$__dirty());try{for(h.s();!(d=h.n()).done;){var p=d.value,y=p.path,b=p.value;if(null!=b&&null!=b[o]&&0!==Object.keys(b[o]).length){var m=t.get(y)||{};r.set(y,l(m,b[o]))}}}catch(e){h.e(e)}finally{h.f()}return r}function l(e,t){return e=e||{},null!=t.$pullAll&&(e.$pullAll=(e.$pullAll||[]).concat(t.$pullAll)),null!=t.$push&&(e.$push=e.$push||{},e.$push.$each=(e.$push.$each||[]).concat(t.$push.$each)),null!=t.$addToSet&&(e.$addToSet=(e.$addToSet||[]).concat(t.$addToSet)),null!=t.$set&&(e.$set=Object.assign(e.$set||{},t.$set)),e}e.exports=function(e){e.pre("save",function(){var e=this.$session();if(null!=e&&null!=e.transaction&&null!=e[a])if(e[a].has(this)){for(var t=e[a].get(this),r=0,n=Object.keys(this.$__.activePaths.getStatePaths("modify"));r<n.length;r++){var i=n[r];t.modifiedPaths.add(i)}t.atomics=c(this,t.atomics)}else{var o={};this.isNew&&(o.isNew=!0),this.$__schema.options.versionKey&&(o.versionKey=this.get(this.$__schema.options.versionKey)),o.modifiedPaths=new Set(Object.keys(this.$__.activePaths.getStatePaths("modify"))),o.atomics=c(this),e[a].set(this,o)}})}},9888:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){e.pre("save",!1,function(e,r){var n=this,i=this;if(this.$isSubdocument)return e();if(r&&"object"===t(r)&&"validateBeforeSave"in r?r.validateBeforeSave:this.$__schema.options.validateBeforeSave){var o=r&&"object"===t(r)&&"validateModifiedOnly"in r?{validateModifiedOnly:r.validateModifiedOnly}:null;this.$validate(o).then(function(){n.$op="save",e()},function(t){i.$__schema.s.hooks.execPost("save:error",i,[i],{error:t},function(t){i.$op="save",e(t)})})}else e()},null,!0)}},2888:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return o(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
2}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var a=r(4531),s=r(9981),c=r(7291),l=r(2183),u=r(1973),f=r(23);function d(e){return function(t){t.options||(t.options={}),null!=e&&Array.isArray(e.virtuals)&&((e=Object.assign({},e)).virtuals=e.virtuals.filter(function(e){return"string"==typeof e&&e.startsWith(t.path+".")}).map(function(e){return e.slice(t.path.length+1)})),t.options.lean=e}}t.preparePopulationOptions=function(e,t){var r=e.options.populate,n=Object.keys(r).reduce(function(e,t){return e.concat([r[t]])},[]);return null!=t.lean&&n.filter(function(e){return null==(e&&e.options&&e.options.lean)}).forEach(d(t.lean)),n.forEach(function(t){t._localModel=e.model}),n},t.preparePopulationOptionsMQ=function(e,t){var r=e._mongooseOptions.populate,n=Object.keys(r).reduce(function(e,t){return e.concat([r[t]])},[]);null!=t.lean&&n.filter(function(e){return null==(e&&e.options&&e.options.lean)}).forEach(d(t.lean));var i=e&&e.options&&e.options.session||null;null!=i&&n.forEach(function(e){null!=e.options?"session"in e.options||(e.options.session=i):e.options={session:i}});var o=e._fieldsForExec();return n.forEach(function(e){e._queryProjection=o}),n.forEach(function(t){t._localModel=e.model}),n},t.createModel=function(e,r,n,i,o){e.hooks.execPreSync("createModel",r);var a=e.schema?e.schema.discriminatorMapping:null,s=a&&a.isRoot?a.key:null,l=r[s];if(s&&l&&e.discriminators){var f=e.discriminators[l]||c(e.discriminators,l);if(f){var d=u(i);return t.applyPaths(d,f.schema),new f(void 0,d,!0)}}var h={skipId:!0,isNew:!1,willInit:!0};return null!=o&&"defaults"in o&&(h.defaults=o.defaults),new e(void 0,n,h)},t.createModelAndInit=function(e,r,n,i,o,a,s){var c=t.createModel(e,r,n,i,o);try{c.$init(r,a?{populated:a}:void 0,s)}catch(e){s(e,c)}},t.applyPaths=function(e,t){var r,o,c=new Set;if(e){o=Object.keys(e);for(var u=[],d=0;d<o.length;++d){var h=o[d];"-"===o[d][0]&&(delete e[h],"-_id"===h?e._id=0:u.push(h.slice(1)))}o=Object.keys(e);for(var p=0;p<o.length;++p)if("+"!==o[p][0]){var y=e[o[p]];if(l(y)&&!("_id"===o[p]&&o.length>1)&&(!(o[p]===t.options.discriminatorKey&&o.length>1&&null!=y)||y)){r=!y;break}}for(var b=0;b<u.length;b++){var m=u[b],g=t.path(m);g&&g.selected&&!1===r?g&&g.selected&&!1===r&&c.add(m):(e[m]=0,r=!0)}}var v=[],x=[],w=[];switch(function t(n,i){if(i||(i=""),-1!==w.indexOf(n))return[];w.push(n);var o=[];return n.eachPath(function(n,s){if(i&&(n=i+"."+n),s.$isSchemaMap||n.endsWith(".$*")){var c=e&&"+"+n in e;s.options&&!1===s.options.select&&!c&&x.push(n)}else{var l=D(n,s);if(null!=l||Array.isArray(s)||!s.$isMongooseArray||s.$isMongooseDocumentArray||(l=D(n,s.caster)),null!=l&&o.push(l),s.schema){var u=t(s.schema,n);!1===r&&a(e,n,s.schema,v,u)}}}),w.pop(),o}(t),r){case!0:var _,S=i(x);try{for(S.s();!(_=S.n()).done;)e[_.value]=0}catch(e){S.e(e)}finally{S.f()}break;case!1:t&&t.paths._id&&t.paths._id.options&&!1===t.paths._id.options.select&&(e._id=0);var j,k=i(v);try{for(k.s();!(j=k.n()).done;){var O=j.value;c.has(O)||f(e,O)||(e[O]=e[O]||1)}}catch(e){k.e(e)}finally{k.f()}break;case void 0:if(null==e)break;for(var $=0,A=Object.keys(e||{});$<A.length;$++){var E=A[$];E.startsWith("+")&&delete e[E]}var N,P=i(x);try{for(P.s();!(N=P.n()).done;){var M=N.value;null==e[M]&&(e[M]=0)}}catch(e){P.e(e)}finally{P.f()}}function D(i,a){if(null!=e&&"boolean"==typeof a.selected&&(!1!==a.selected||!e[i]))if(r||!a.selected||i!==t.options.discriminatorKey||null==e[i]||e[i]){if(!1!==r||!a.selected||null==e[i]||e[i]){var c="+"+i;if(e&&c in e)return delete e[c],void(!1===r&&o.length>1&&!~o.indexOf(i)&&(e[i]=1));for(var l=i.split("."),u="",f=0;f<l.length;++f)if(u+=u.length?"."+l[f]:l[f],-1!==x.indexOf(u))return;if(!r&&a&&a.options&&a.options.$skipDiscriminatorCheck)for(var d="",h=0;h<l.length;++h){var p=s(e,d+=(0===d.length?"":".")+l[h],!1)||s(e,d+".$",!1);if(p&&"object"!==n(p))return}return(a.selected?v:x).push(i),i}delete e[i]}else delete e[i]}}},5506:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e,t,r){var n;return(n=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==a(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}
2finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(e,t)||l(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=l(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function l(e,t){if(e){if("string"==typeof e)return u(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var f,d=r(9620).EventEmitter,h=r(3138),p=r(5202),y=r(4289),b=r(1764),m=r(1902),g=r(459),v=r(4133),x=r(1973),w=r(9981),_=r(1981),S=r(5379),j=r(1428),k=r(1879),O=r(4913),$=r(3564),A=r(3767),E=r(6872),N=r(6870),P=r(8751),M=/\.\d+(\.|$)/,D=r(5130).middlewareFunctions,I=r(8859).middlewareFunctions,T=D.concat(I
2).reduce(function(e,t){return e.add(t)},new Set),C=E.isPOJO,B=0,R=/^\d+$/;function L(e,t){if(!(this instanceof L))return new L(e,t);if(this.obj=e,this.paths={},this.aliases={},this.subpaths={},this.virtuals={},this.singleNestedPaths={},this.nested={},this.inherits={},this.callQueue=[],this._indexes=[],this.methods=t&&t.methods||{},this.methodOptions={},this.statics=t&&t.statics||{},this.tree={},this.query=t&&t.query||{},this.childSchemas=[],this.plugins=[],this.$id=++B,this.mapPaths=[],this.s={hooks:new h},this.options=this.defaultOptions(t),Array.isArray(e)){var r,n=c(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;this.add(i)}}catch(e){n.e(e)}finally{n.f()}}else e&&this.add(e);if(t&&t.virtuals)for(var o=t.virtuals,a=0,s=Object.keys(o);a<s.length;a++){var l=s[a],u=o[l].options?o[l].options:void 0,f=this.virtual(l,u);o[l].get&&f.get(o[l].get),o[l].set&&f.set(o[l].set)}var d=e&&e._id&&E.isObject(e._id);this.paths._id||!this.options._id||d||v(this),this.setupTimestamp(this.options.timestamps)}function z(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var i=n[r],o=null;if(null!=t[i])o=t[i];else{var a=w(e.paths[i],"options");if(null==a)continue;o=a.alias}if(o){var s=e.paths[i].path;if(Array.isArray(o)){var l,u=c(o);try{for(u.s();!(l=u.n()).done;){var f=l.value;if("string"!=typeof f)throw Error("Invalid value for alias option on "+s+", got "+f);e.aliases[f]=s,e.virtual(f).get(function(e){return function(){return"function"==typeof this.get?this.get(e):this[e]}}(s)).set(function(e){return function(t){return this.$set(e,t)}}(s))}}catch(e){u.e(e)}finally{u.f()}}else{if("string"!=typeof o)throw Error("Invalid value for alias option on "+s+", got "+o);e.aliases[o]=s,e.virtual(o).get(function(e){return function(){return"function"==typeof this.get?this.get(e):this[e]}}(s)).set(function(e){return function(t){return this.$set(e,t)}}(s))}}}}L.prototype=Object.create(d.prototype),L.prototype.constructor=L,L.prototype.instanceOfSchema=!0,Object.defineProperty(L.prototype,"$schemaType",{configurable:!1,enumerable:!1,writable:!0}),Object.defineProperty(L.prototype,"childSchemas",{configurable:!1,enumerable:!0,writable:!0}),Object.defineProperty(L.prototype,"virtuals",{configurable:!1,enumerable:!0,writable:!0}),L.prototype.obj,L.prototype.paths,L.prototype.tree,L.prototype.clone=function(){var e=this,t=this._clone();return t.on("init",function(t){return e.emit("init",t)}),t},L.prototype._clone=function(e){var t=new(e=e||(null==this.base?L:this.base.Schema))({},this._userProvidedOptions);t.base=this.base,t.obj=this.obj,t.options=x(this.options),t.callQueue=this.callQueue.map(function(e){return e}),t.methods=x(this.methods),t.methodOptions=x(this.methodOptions),t.statics=x(this.statics),t.query=x(this.query),t.plugins=Array.prototype.slice.call(this.plugins),t._indexes=x(this._indexes),t.s.hooks=this.s.hooks.clone(),t.tree=x(this.tree),t.paths=Object.fromEntries(Object.entries(this.paths).map(function(e){var t=s(e,2);return[t[0],t[1].clone()]})),t.nested=x(this.nested),t.subpaths=x(this.subpaths);for(var r=0,n=Object.values(t.paths);r<n.length;r++){var i=n[r];if(i.$isSingleNested){for(var o=i.path,a=0,c=Object.keys(i.schema.paths);a<c.length;a++){var l=c[a];t.singleNestedPaths[o+"."+l]=i.schema.paths[l]}for(var u=0,f=Object.keys(i.schema.singleNestedPaths);u<f.length;u++){var d=f[u];t.singleNestedPaths[o+"."+d]=i.schema.singleNestedPaths[d]}for(var h=0,p=Object.keys(i.schema.subpaths);h<p.length;h++){var y=p[h];t.singleNestedPaths[o+"."+y]=i.schema.subpaths[y]}for(var b=0,m=Object.keys(i.schema.nested);b<m.length;b++){var g=m[b];t.singleNestedPaths[o+"."+g]="nested"}}}return t.childSchemas=function(e){for(var t=[],r=0,n=Object.keys(e.paths);r<n.length;r++){var i=n[r],o=e.paths[i];(o.$isMongooseDocumentArray||o.$isSingleNested)&&t.push({schema:o.schema,model:o.caster})}return t}(t),t.virtuals=x(this.virtuals),t.$globalPluginsApplied=this.$globalPluginsApplied,t.$isRootDiscriminator=this.$isRootDiscriminator,t.$implicitlyCreated=this.$implicitlyCreated,t.$id=++B,t.$originalSchemaId=this.$id,t.mapPaths=[].concat(this.mapPaths),null!=this.discriminatorMapping&&(t.discriminatorMapping=Object.assign({},this.discriminatorMapping)),null!=this.discriminators&&(t.discriminators=Object.assign({},this.discriminators)),null!=this._applyDiscriminators&&(t._applyDiscriminators=new Map(this._applyDiscriminators)),t.aliases=Object.assign({},this.aliases),t},L.prototype.pick=function(e,t){var r=new L({},t||this.options);if(!Array.isArray(e))throw new p('Schema#pick() only accepts an array argument, got "'+a(e)+'"');var n,i=c(e);try{for(i.s();!(n=i.n()).done;){var s=n.value;if(this.nested[s])r.add(o({},s,w(this.tree,s)));else{var l=this.path(s);if(null==l)throw new p("Path `"+s+"` is not in the schema");r.add(o({},s,l))}}}catch(e){i.e(e)}finally{i.f()}return r},L.prototype.omit=function(e,t){var r=new L(this,t||this.options);if(!Array.isArray(e))throw new p('Schema#omit() only accepts an array argument, got "'+a(e)+'"');for(var n in r.remove(e),r.singleNestedPaths)e.includes(n)&&delete r.singleNestedPaths[n];return r},L.prototype.defaultOptions=function(e){this._userProvidedOptions=null==e?{}:x(e);var t=this.base&&this.base.options||{};
2if((e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({strict:!("strict"in t)||t.strict,strictQuery:"strictQuery"in t&&t.strictQuery,bufferCommands:!0,capped:!1,versionKey:"__v",optimisticConcurrency:!1,minimize:!0,autoIndex:null,discriminatorKey:"__t",shardKey:null,read:null,validateBeforeSave:!0,validateModifiedOnly:!1,_id:!0,id:!("id"in t)||t.id,typeKey:"type"},e)).versionKey&&"string"!=typeof e.versionKey)throw new p("`versionKey` must be falsy or string, got `"+a(e.versionKey)+"`");if("string"==typeof e.read?e.read=j(e.read):Array.isArray(e.read)&&"string"==typeof e.read[0]&&(e.read={mode:j(e.read[0]),tags:e.read[1]}),e.optimisticConcurrency&&!e.versionKey)throw new p("Must set `versionKey` if using `optimisticConcurrency`");return e},L.prototype.discriminator=function(e,t,r){return this._applyDiscriminators=this._applyDiscriminators||new Map,this._applyDiscriminators.set(e,{schema:t,options:r}),this},L.prototype.add=function(e,t){if(e instanceof L||null!=e&&e.instanceOfSchema)return O(this,e),this;if(!1===e._id&&null==t&&(this.options._id=!1),"__proto__."===(t=t||"")||"constructor."===t||"prototype."===t)return this;for(var r=Object.keys(e),n=this.options.typeKey,i=0;i<r.length;i++){var c=r[i];if(!E.specialProperties.has(c)){var l=t+c,u=e[c];if(null==u)throw TypeError("Invalid value for schema path `"+l+'`, got value "'+u+'"');if("_id"!==c||!1!==u){var f=!1;if("string"==typeof u&&(f=null!=(null!=this.base?this.base.Schema.Types:L.Types)[u.charAt(0).toUpperCase()+u.substring(1)]),"_id"!==c&&("object"!==a(u)&&"function"!=typeof u&&!f||null==u))throw TypeError("Invalid schema configuration: `".concat(u,"` is not ")+"a valid type at path `".concat(c,"`. See ")+"https://bit.ly/mongoose-schematypes for a list of valid schema types.");if(u instanceof g||"VirtualType"===(u.constructor&&u.constructor.name||null))this.virtual(u);else{if(Array.isArray(u)&&1===u.length&&null==u[0])throw TypeError("Invalid value for schema Array path `"+l+'`, got value "'+u[0]+'"');if(C(u)||u instanceof b)if(Object.keys(u).length<1)t&&(this.nested[t.substring(0,t.length-1)]=!0),this.path(l,u);else if(!u[n]||"type"===n&&C(u.type)&&u.type.type)this.nested[l]=!0,this.add(u,l+".");else{var d=u[n];if(C(d)&&Object.keys(d).length>0){t&&(this.nested[t.substring(0,t.length-1)]=!0);var h={};this._userProvidedOptions.typeKey&&(h.typeKey=this._userProvidedOptions.typeKey),null!=this._userProvidedOptions.strict&&(h.strict=this._userProvidedOptions.strict),null!=this._userProvidedOptions.toObject&&(h.toObject=E.omit(this._userProvidedOptions.toObject,["transform"])),null!=this._userProvidedOptions.toJSON&&(h.toJSON=E.omit(this._userProvidedOptions.toJSON,["transform"]));var p=new L(d,h);p.$implicitlyCreated=!0;var y=Object.assign({},u,o({},n,p));this.path(t+c,y)}else if(t&&(this.nested[t.substring(0,t.length-1)]=!0),this.path(t+c,u),null!=u&&!u.instanceOfSchema&&E.isPOJO(u.discriminators)){var m=this.path(t+c);for(var v in u.discriminators)m.discriminator(v,u.discriminators[v])}}else if(t&&(this.nested[t.substring(0,t.length-1)]=!0),this.path(t+c,u),null!=u[0]&&!u[0].instanceOfSchema&&E.isPOJO(u[0].discriminators)){var x=this.path(t+c);for(var w in u[0].discriminators)x.discriminator(w,u[0].discriminators[w])}}}}}return z(this,Object.fromEntries(Object.entries(e).map(function(e){var r=s(e,1)[0];return[t+r,null]}))),this},L.prototype.alias=function(e,t){return z(this,o({},e,t)),this},L.prototype.removeIndex=function(e){if(arguments.length>1)throw Error("removeIndex() takes only 1 argument");if("object"!==a(e)&&"string"!=typeof e)throw Error("removeIndex() may only take either an object or a string as an argument");if("object"===a(e))for(var t=this._indexes.length-1;t>=0;--t)P.isDeepStrictEqual(this._indexes[t][0],e)&&this._indexes.splice(t,1);else for(var r=this._indexes.length-1;r>=0;--r)null!=this._indexes[r][1]&&this._indexes[r][1].name===e&&this._indexes.splice(r,1);return this},L.prototype.clearIndexes=function(){return this._indexes.length=0,this},L.reserved=Object.create(null),L.prototype.reserved=L.reserved;var F=L.reserved;function U(e){return/\.\d+/.test(e)?e.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):e}function q(e,t){if(0===e.mapPaths.length)return null;var r,n=c(e.mapPaths);try{for(n.s();!(r=n.n()).done;){var i=r.value.path;if(RegExp("^"+i.replace(/\.\$\*/g,"\\.[^.]+")+"$").test(t))return e.paths[i]}}catch(e){n.e(e)}finally{n.f()}return null}
2function V(e,t,r){var n=t.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(n.length<2)return e.paths.hasOwnProperty(n[0])?e.paths[n[0]]:"adhocOrUndefined";var i=e.path(n[0]),o=!1;if(!i)return"adhocOrUndefined";for(var a=n.length-1,s=1;s<n.length;++s){o=!1;var c=n[s];if(s===a&&i&&!/\D/.test(c)){i=i.$isMongooseDocumentArray?i.$embeddedSchemaType:i instanceof f.Array?i.caster:void 0;break}if(/\D/.test(c)){if(!i||!i.schema){i=void 0;break}o="nested"===i.schema.pathType(c),i=i.schema.path(c)}else i instanceof f.Array&&s!==a&&(i=i.caster)}return e.subpaths[r]=i,i?"real":o?"nested":"adhocOrUndefined"}function K(e,t){var r,n=c(e.childSchemas);try{for(n.s();!(r=n.n()).done;){var i=r.value.schema;i.$implicitlyCreated&&(Object.assign(i.options,t),K(i,t))}}catch(e){n.e(e)}finally{n.f()}}F.prototype=F.emit=F.listeners=F.removeListener=F.collection=F.errors=F.get=F.init=F.isModified=F.isNew=F.populated=F.remove=F.save=F.toObject=F.validate=1,F.collection=1,L.prototype.path=function(e,t){if(void 0===t){if(Object.prototype.hasOwnProperty.call(this.paths,e))return this.paths[e];var r=U(e),n=this.paths.hasOwnProperty(e)?this.paths[e]:this.subpaths.hasOwnProperty(r)?this.subpaths[r]:this.singleNestedPaths.hasOwnProperty(r)&&"object"===a(this.singleNestedPaths[r])?this.singleNestedPaths[r]:null;if(null!=n)return n;var i=q(this,e);return null!=i?i:null!=(n=this.hasMixedParent(r))?n:M.test(e)?(V(this,e,r),this.subpaths[r]):void 0}var o=-1===e.indexOf(".")?[e]:e.split("."),s=o.pop();if(E.specialProperties.has(s))throw Error("Cannot set special property `"+s+"` on a schema");var l=0===o.length?s:o[0];Object.prototype.hasOwnProperty.call(F,l)&&!this.options.suppressReservedKeysWarning&&E.warn("`".concat(l,"` is a reserved schema pathname and may break some functionality. ")+"You are allowed to use it, but use at your own risk. To disable this warning pass `suppressReservedKeysWarning` as a schema option."),"object"===a(t)&&E.hasUserDefinedProperty(t,"ref")&&N(t.ref,e);var u,f=this.tree,d="",h=c(o);try{for(h.s();!(u=h.n()).done;){var p=u.value;if(E.specialProperties.has(p))throw Error("Cannot set special property `"+p+"` on a schema");if(d=d+=(d.length>0?".":"")+p,f[p]||(this.nested[d]=!0,f[p]={}),"object"!==a(f[p])){var b="Cannot set nested path `"+e+"`. Parent path `"+d+"` already set to type "+f[p].name+".";throw Error(b)}f=f[p]}}catch(e){h.e(e)}finally{h.f()}f[s]=x(t),this.paths[e]=this.interpretAsType(e,t,this.options);var m=this.paths[e];if(m.$isSchemaMap){var g=e+".$*";this.paths[g]=m.$__schemaType,this.mapPaths.push(this.paths[g])}if(m.$isSingleNested){for(var v=0,w=Object.keys(m.schema.paths);v<w.length;v++){var _=w[v];this.singleNestedPaths[e+"."+_]=m.schema.paths[_]}for(var S=0,j=Object.keys(m.schema.singleNestedPaths);S<j.length;S++){var k=j[S];this.singleNestedPaths[e+"."+k]=m.schema.singleNestedPaths[k]}for(var O=0,$=Object.keys(m.schema.subpaths);O<$.length;O++){var A=$[O];this.singleNestedPaths[e+"."+A]=m.schema.subpaths[A]}for(var P=0,D=Object.keys(m.schema.nested);P<D.length;P++){var I=D[P];this.singleNestedPaths[e+"."+I]="nested"}Object.defineProperty(m.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),m.caster.base=this.base,this.childSchemas.push({schema:m.schema,model:m.caster})}else m.$isMongooseDocumentArray&&(Object.defineProperty(m.schema,"base",{configurable:!0,enumerable:!1,writable:!1,value:this.base}),m.casterConstructor.base=this.base,this.childSchemas.push({schema:m.schema,model:m.casterConstructor}));if(m.$isMongooseArray&&m.caster instanceof y){for(var T=e,C=m;C.$isMongooseArray;)T+=".$",C.$isMongooseDocumentArray?(C.$embeddedSchemaType._arrayPath=T,C.$embeddedSchemaType._arrayParentPath=e,C=C.$embeddedSchemaType):(C.caster._arrayPath=T,C.caster._arrayParentPath=e,C=C.caster),this.subpaths[T]=C;for(var B=0,R=[];B<R.length;B++){var L=R[B];this.subpaths[L.path]=L}}if(m.$isMongooseDocumentArray){for(var z=0,K=Object.keys(m.schema.paths);z<K.length;z++){var H=K[z],W=m.schema.paths[H];this.subpaths[e+"."+H]=W,"object"===a(W)&&null!=W&&null==W.$parentSchemaDocArray&&(W.$parentSchemaDocArray=m)}for(var J=0,G=Object.keys(m.schema.subpaths);J<G.length;J++){var Y=G[J],X=m.schema.subpaths[Y];this.subpaths[e+"."+Y]=X,"object"===a(X)&&null!=X&&null==X.$parentSchemaDocArray&&(X.$parentSchemaDocArray=m)}for(var Q=0,Z=Object.keys(m.schema.singleNestedPaths);Q<Z.length;Q++){var ee=Z[Q],et=m.schema.singleNestedPaths[ee];this.subpaths[e+"."+ee]=et,"object"===a(et)&&null!=et&&null==et.$parentSchemaDocArray&&(et.$parentSchemaDocArray=m)}}return this}
2,Object.defineProperty(L.prototype,"base",{configurable:!0,enumerable:!1,writable:!0,value:null}),L.prototype.interpretAsType=function(e,t,i){if(t instanceof y){if(t.path===e)return t;var s,c,l=t.clone();return l.path=e,l}var u=null!=this.base?this.base.Schema.Types:L.Types,f=null!=this.base?this.base.Types:r(8941);if(!(E.isPOJO(t)||t instanceof b)&&"Object"!==E.getFunctionName(t.constructor)){var d=t;(t={})[i.typeKey]=d}var h,m=t[i.typeKey]&&(t[i.typeKey]instanceof Function||"type"!==i.typeKey||!t.type.type)?t[i.typeKey]:{};if(E.isPOJO(m)||"mixed"===m)return new u.Mixed(e,t);if(Array.isArray(m)||m===Array||"array"===m||m===u.Array){var g=m===Array||"array"===m?t.cast||t.of:m[0];if(g&&g.instanceOfSchema){if(!(g instanceof L)){if(!this.options._isMerging)throw TypeError("Schema for array path `"+e+"` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with `npm list mongoose`. If you are still getting this error, please add `new Schema()` around the path: "+"".concat(e,": new Schema(...)"));g=new L(g)}return new u.DocumentArray(e,g,t)}if(g&&g[i.typeKey]&&g[i.typeKey].instanceOfSchema){if(!(g[i.typeKey]instanceof L)){if(!this.options._isMerging)throw TypeError("Schema for array path `"+e+"` is from a different copy of the Mongoose module. Please make sure you're using the same version of Mongoose everywhere with `npm list mongoose`. If you are still getting this error, please add `new Schema()` around the path: "+"".concat(e,": new Schema(...)"));g[i.typeKey]=new L(g[i.typeKey])}return new u.DocumentArray(e,g[i.typeKey],t,g)}if(Array.isArray(g))return new u.Array(e,this.interpretAsType(e,g,i),t);var v=null==g||!g[i.typeKey]||"type"===i.typeKey&&g.type.type?g:g[i.typeKey];if("string"==typeof g)g=u[g.charAt(0).toUpperCase()+g.substring(1)];else if(E.isPOJO(v)){if(Object.keys(v).length){var x={minimize:i.minimize};i.typeKey&&(x.typeKey=i.typeKey),i.hasOwnProperty("strict")&&(x.strict=i.strict),i.hasOwnProperty("strictQuery")&&(x.strictQuery=i.strictQuery),i.hasOwnProperty("toObject")&&(x.toObject=E.omit(i.toObject,["transform"])),i.hasOwnProperty("toJSON")&&(x.toJSON=E.omit(i.toJSON,["transform"])),this._userProvidedOptions.hasOwnProperty("_id")?x._id=this._userProvidedOptions._id:null!=L.Types.DocumentArray.defaultOptions._id&&(x._id=L.Types.DocumentArray.defaultOptions._id);var w=new L(v,x);return w.$implicitlyCreated=!0,new u.DocumentArray(e,w,t)}return new u.Array(e,u.Mixed,t)}if(g){if(Array.isArray(m=!g[i.typeKey]||"type"===i.typeKey&&g.type.type?g:g[i.typeKey]))return new u.Array(e,this.interpretAsType(e,m,i),t);if("ClockDate"===(h="string"==typeof m?m:m.schemaName||E.getFunctionName(m))&&(h="Date"),void 0===h)throw TypeError("Invalid schema configuration: "+"Could not determine the embedded type for array `".concat(e,"`. ")+"See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(!u.hasOwnProperty(h))throw TypeError("Invalid schema configuration: "+"`".concat(h,"` is not a valid type within the array `").concat(e,"`.")+"See https://bit.ly/mongoose-schematypes for a list of valid schema types.")}return new u.Array(e,g||u.Mixed,t,i)}if(m&&m.instanceOfSchema)return new u.Subdocument(m,e,t);if((h=n.isBuffer(m)?"Buffer":"function"==typeof m||"object"===a(m)?m.schemaName||E.getFunctionName(m):m===f.ObjectId?"ObjectId":m===f.Decimal128?"Decimal128":null==m?""+m:m.toString())&&(h=h.charAt(0).toUpperCase()+h.substring(1)),"ObjectID"===h&&(h="ObjectId"),"ClockDate"===h&&(h="Date"),void 0===h)throw TypeError("Invalid schema configuration: `".concat(e,"` schematype definition is ")+"invalid. See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.");if(null==u[h])throw TypeError("Invalid schema configuration: `".concat(h,"` is not ")+"a valid type at path `".concat(e,"`. See ")+"https://bit.ly/mongoose-schematypes for a list of valid schema types.");var _=new u[h](e,t);return _.$isSchemaMap&&(s=t,c={type:{}},E.hasUserDefinedProperty(s,"of")&&((c=E.isPOJO(s.of)&&Object.keys(s.of).length>0&&!E.hasUserDefinedProperty(s.of,this.options.typeKey)?o({},this.options.typeKey,new L(s.of)):E.isPOJO(s.of)?Object.assign({},s.of):o({},this.options.typeKey,s.of))[this.options.typeKey]&&c[this.options.typeKey].instanceOfSchema&&c[this.options.typeKey].eachPath(function(t,r){if(!0===r.options.select||!1===r.options.select)throw new p('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+e+"."+t+'"')}),E.hasUserDefinedProperty(s,"ref")&&(c.ref=s.ref)),_.$__schemaType=this.interpretAsType(e+".$*",c,i)),_},L.prototype.eachPath=function(e){for(var t=Object.keys(this.paths),r=t.length,n=0;n<r;++n)e(t[n],this.paths[t[n]]);return this},L.prototype.requiredPaths=function(e){if(this._requiredpaths&&!e)return this._requiredpaths;for(var t=Object.keys(this.paths),r=t.length,n=[];r--;){var i=t[r];this.paths[i].isRequired&&n.push(i)}return this._requiredpaths=n,this._requiredpaths},L.prototype.indexedPaths=function(){return this._indexedpaths||(this._indexedpaths=this.indexes()),this._indexedpaths},L.prototype.pathType=function(e){if(this.paths.hasOwnProperty(e))return"real";if(this.virtuals.hasOwnProperty(e))return"virtual";if(this.nested.hasOwnProperty(e))return"nested";var t=U(e);if(this.subpaths.hasOwnProperty(t)||this.subpaths.hasOwnProperty(e))return"real";var r=this.singleNestedPaths.hasOwnProperty(t)||this.singleNestedPaths.hasOwnProperty(e);return r?"nested"===r?"nested":"real":null!=q(this,e)?"real":/\.\d+\.|\.\d+$/.test(e)?V(this,e,t):"adhocOrUndefined"},L.prototype.hasMixedParent=function(e){var t=e.split(/\./g);e="";for(var r=0;r<t.length;++r)if(e=r>0?e+"."+t[r]:t[r],this.paths.hasOwnProperty(e)&&this.paths[e]instanceof f.Mixed)return this.paths[e];return null},L.prototype.setupTimestamp=function(e){return A(this,e)},L.prototype.queue=function(e,t){return this.callQueue.push([e,t]),this},L.prototype.pre=function(e){if(e instanceof RegExp){var t,r=Array.prototype.slice.call(arguments,1
2),n=c(T);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.test(i)&&this.pre.apply(this,[i].concat(r))}}catch(e){n.e(e)}finally{n.f()}return this}if(Array.isArray(e)){var o,a=Array.prototype.slice.call(arguments,1),s=c(e);try{for(s.s();!(o=s.n()).done;){var l=o.value;this.pre.apply(this,[l].concat(a))}}catch(e){s.e(e)}finally{s.f()}return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this},L.prototype.post=function(e){if(e instanceof RegExp){var t,r=Array.prototype.slice.call(arguments,1),n=c(T);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.test(i)&&this.post.apply(this,[i].concat(r))}}catch(e){n.e(e)}finally{n.f()}return this}if(Array.isArray(e)){var o,a=Array.prototype.slice.call(arguments,1),s=c(e);try{for(s.s();!(o=s.n()).done;){var l=o.value;this.post.apply(this,[l].concat(a))}}catch(e){s.e(e)}finally{s.f()}return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this},L.prototype.plugin=function(e,t){if("function"!=typeof e)throw Error('First param to `schema.plugin()` must be a function, got "'+a(e)+'"');if(t&&t.deduplicate){var r,n=c(this.plugins);try{for(n.s();!(r=n.n()).done;)if(r.value.fn===e)return this}catch(e){n.e(e)}finally{n.f()}}return this.plugins.push({fn:e,opts:t}),e(this,t),this},L.prototype.method=function(e,t,r){if("string"!=typeof e)for(var n in e)this.methods[n]=e[n],this.methodOptions[n]=x(r);else this.methods[e]=t,this.methodOptions[e]=x(r);return this},L.prototype.static=function(e,t){if("string"!=typeof e)for(var r in e)this.statics[r]=e[r];else this.statics[e]=t;return this},L.prototype.index=function(e,t){for(var r in e||(e={}),t||(t={}),t.expires&&E.expires(t),e)this.aliases[r]&&(e[this.aliases[r]]=e[r],delete e[r]);for(var n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];"ascending"===e[o]||"asc"===e[o]?e[o]=1:"descending"!==e[o]&&"desc"!==e[o]||(e[o]=-1)}return this._indexes.push([e,t]),this},L.prototype.set=function(e,t,r){if(1==arguments.length)return this.options[e];switch(e){case"read":"string"==typeof t?this.options[e]={mode:j(t),tags:r}:Array.isArray(t)&&"string"==typeof t[0]?this.options[e]={mode:j(t[0]),tags:t[1]}:this.options[e]=t,this._userProvidedOptions[e]=this.options[e];break;case"timestamps":this.setupTimestamp(t),this.options[e]=t,this._userProvidedOptions[e]=this.options[e];break;case"_id":this.options[e]=t,this._userProvidedOptions[e]=this.options[e],t&&!this.paths._id?v(this):!t&&null!=this.paths._id&&this.paths._id.auto&&this.remove("_id");break;default:this.options[e]=t,this._userProvidedOptions[e]=this.options[e]}return"strict"===e&&K(this,{strict:t}),"strictQuery"===e&&K(this,{strictQuery:t}),this},L.prototype.get=function(e){return this.options[e]};var H="2d 2dsphere hashed text".split(" ");function W(e,t){var r,n=t.split("."),i=n.pop(),o=e.tree,a=c(n);try{for(a.s();!(r=a.n()).done;)o=o[r.value]}catch(e){a.e(e)}finally{a.f()}delete o[i]}function J(e){return e.startsWith("$[")&&e.endsWith("]")}Object.defineProperty(L,"indexTypes",{get:function(){return H},set:function(){throw Error("Cannot overwrite Schema.indexTypes")}}),L.prototype.indexes=function(){return S(this)},L.prototype.virtual=function(e,t){if(e instanceof g||"VirtualType"===_(e))return this.virtual(e.path,e.options);if(t=new m(t),E.hasUserDefinedProperty(t,["ref","refPath"])){if(null==t.localField)throw Error("Reference virtuals require `localField` option");if(null==t.foreignField)throw Error("Reference virtuals require `foreignField` option");this.pre("init",function(r){if($.has(e,r)){var n=$.get(e,r);this.$$populatedVirtuals||(this.$$populatedVirtuals={}),t.justOne||t.count?this.$$populatedVirtuals[e]=Array.isArray(n)?n[0]:n:this.$$populatedVirtuals[e]=Array.isArray(n)?n:null==n?[]:[n],$.unset(e,r)}});var r=this.virtual(e);r.options=t,r.set(function(r){this.$$populatedVirtuals||(this.$$populatedVirtuals={}),t.justOne||t.count?(this.$$populatedVirtuals[e]=Array.isArray(r)?r[0]:r,"object"!==a(this.$$populatedVirtuals[e])&&(this.$$populatedVirtuals[e]=t.count?r:null)):(this.$$populatedVirtuals[e]=Array.isArray(r)?r:null==r?[]:[r],this.$$populatedVirtuals[e]=this.$$populatedVirtuals[e].filter(function(e){return e&&"object"===a(e)}))}),"function"==typeof t.get&&r.get(t.get);for(var n=e.split("."),i=n[0],o=0;o<n.length-1;++o)if(null!=this.paths[i]){if(this.paths[i].$isMongooseDocumentArray||this.paths[i].$isSingleNested){var s=n.slice(o+1).join(".");this.paths[i].schema.virtual(s,t);break}i+="."+n[o+1]}return r}var c=this.virtuals,l=e.split(".");if("real"===this.pathType(e))throw Error('Virtual path "'+e+'" conflicts with a real path in the schema');return c[e]=l.reduce(function(r,n,i){return r[n]||(r[n]=i===l.length-1?new g(t,e):{}),r[n]}
2,this.tree),c[e]},L.prototype.virtualpath=function(e){return this.virtuals.hasOwnProperty(e)?this.virtuals[e]:null},L.prototype.remove=function(e){return"string"==typeof e&&(e=[e]),Array.isArray(e)&&e.forEach(function(e){if(null!=this.path(e)||this.nested[e]){if(this.nested[e]){var t,r=c(Object.keys(this.paths).concat(Object.keys(this.nested)));try{for(r.s();!(t=r.n()).done;){var n=t.value;n.startsWith(e+".")&&(delete this.paths[n],delete this.nested[n],W(this,n))}}catch(e){r.e(e)}finally{r.f()}return delete this.nested[e],void W(this,e)}delete this.paths[e],W(this,e)}},this),this},L.prototype.removeVirtual=function(e){if("string"==typeof e&&(e=[e]),Array.isArray(e)){var t,r=c(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(null==this.virtuals[n])throw new p('Attempting to remove virtual "'.concat(n,'" that does not exist.'))}}catch(e){r.e(e)}finally{r.f()}var i,o=c(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;delete this.paths[a],delete this.virtuals[a],-1!==a.indexOf(".")?$.unset(a,this.tree):delete this.tree[a]}}catch(e){o.e(e)}finally{o.f()}}return this},L.prototype.loadClass=function(e,t){return e===Object.prototype||e===Function.prototype||e.prototype.hasOwnProperty("$isMongooseModelPrototype")||e.prototype.hasOwnProperty("$isMongooseDocumentPrototype")||(this.loadClass(Object.getPrototypeOf(e),t),t||Object.getOwnPropertyNames(e).forEach(function(t){if(!t.match(/^(length|name|prototype|constructor|__proto__)$/)){var r=Object.getOwnPropertyDescriptor(e,t);r.hasOwnProperty("value")&&this.static(t,r.value)}},this),Object.getOwnPropertyNames(e.prototype).forEach(function(r){if(!r.match(/^(constructor)$/)){var n=Object.getOwnPropertyDescriptor(e.prototype,r);t||"function"==typeof n.value&&this.method(r,n.value),"function"==typeof n.get&&(this.virtuals[r]&&(this.virtuals[r].getters=[]),this.virtual(r).get(n.get)),"function"==typeof n.set&&(this.virtuals[r]&&(this.virtuals[r].setters=[]),this.virtual(r).set(n.set))}},this)),this},L.prototype._getSchema=function(e){var t=this.path(e),r=[];if(t)return t.$fullPath=e,t;for(var n=e.split("."),i=0;i<n.length;++i)("$"===n[i]||J(n[i]))&&(n[i]="0"),R.test(n[i])&&(n[i]="$");return function e(t,n){for(var i,o,a=t.length+1;a--;)if(o=t.slice(0,a).join("."),i=n.path(o)){if(r.push(o),i.caster){if(i.caster instanceof f.Mixed)return i.caster.$fullPath=r.join("."),i.caster;if(a!==t.length){if(a+1===t.length&&i.$embeddedSchemaType&&("$"===t[a]||J(t[a])))return i.$embeddedSchemaType;if(i.schema){var s=void 0;return"$"===t[a]||J(t[a])?a+1===t.length?i.$embeddedSchemaType:((s=e(t.slice(a+1),i.schema))&&(s.$parentSchemaDocArray=s.$parentSchemaDocArray||(i.schema.$isSingleNested?null:i)),s):((s=e(t.slice(a),i.schema))&&(s.$parentSchemaDocArray=s.$parentSchemaDocArray||(i.schema.$isSingleNested?null:i)),s)}}}else if(i.$isSchemaMap){if(a>=t.length)return i;if(a+1>=t.length||i.$__schemaType instanceof f.Mixed)return i.$__schemaType;if(null!=i.$__schemaType.schema)return e(t.slice(a+1),i.$__schemaType.schema)}return i.$fullPath=r.join("."),i}}(n,this)},L.prototype._getPathType=function(e){return this.path(e)?"real":function e(t,r){for(var n,i,o=t.length+1;o--;){if(i=t.slice(0,o).join("."),n=r.path(i))return n.caster?n.caster instanceof f.Mixed?{schema:n,pathType:"mixed"}:o!==t.length&&n.schema?"$"===t[o]||J(t[o])?o===t.length-1?{schema:n,pathType:"nested"}:e(t.slice(o+1),n.schema):e(t.slice(o),n.schema):{schema:n,pathType:n.$isSingleNested?"nested":"array"}:{schema:n,pathType:"real"};if(o===t.length&&Object.prototype.hasOwnProperty.call(r.nested,i))return{schema:r,pathType:"nested"}}return{schema:n||r,pathType:"undefined"}}(e.split("."),this)},L.prototype._preCompile=function(){this.plugin(k,{deduplicate:!0})},e.exports=t=L,L.Types=f=r(5251),t.ObjectId=f.ObjectId},8997:(e,t,r)=>{"use strict";var n=r(5202),i=r(4289),o=r(3617),a=r(8413);function s(e,t){if(this.$parentSchemaType=t&&t.$parentSchemaType,!this.$parentSchemaType)throw new n("Cannot create DocumentArrayElement schematype without a parent");delete t.$parentSchemaType,i.call(this,e,t,"DocumentArrayElement"),this.$isMongooseDocumentArrayElement=!0}s.schemaName="DocumentArrayElement",s.defaultOptions={},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.cast=function(){var e;return(e=this.$parentSchemaType).cast.apply(e,arguments)[0]},s.prototype.doValidate=function(e,t,r,n){var i=a(this.caster,e);return!e||e instanceof i||(e=new i(e,r,null,null,n&&null!=n.index?n.index:null)),o.prototype.doValidate.call(this,e,t,r,n)},s.prototype.clone=function(){this.options.$parentSchemaType=this.$parentSchemaType;var e=i.prototype.clone.apply(this,arguments);return delete this.options.$parentSchemaType,e.caster=this.caster,e.schema=this.schema,e},e.exports=s},3617:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?n(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a,s=r(1795),c=r(9620).EventEmitter,l=r(4107),u=r(5446),f=r(4289),d=r(2874),h=r(8702),p=r(1521).W,y=r(9181),b=r(5008),m=r(8413),g=r(9691),v=r(4962).h,x=r(9098),w=r(6872),_=r(3346);function S(e,t,r){if(e.options.timeseries)throw new _(t,"timeseries");var n=S.defaultOptions&&S.defaultOptions._id;null!=n&&((r=r||{})._id=n),e=g(e,r),this.caster=j(e,null,r),this.caster.path=t,this.caster.prototype.$basePath=t,this.schema=e,this.$isSingleNested=!0,this.base=e.base,f.call(this,t,r,"Embedded")}function j(e,t,n){a||(a=r(2591));var i=function(e,t,r){this.$__parent=r,a.apply(this,arguments),null!=r&&this.$session(r.$session())};e._preCompile();var o=null!=t?t.prototype:a.prototype;for(var s in(i.prototype=Object.create(o)).$__setSchema(e),i.prototype.constructor=i,i.$__required=null==n?void 0:n.required,i.base=e.base,i.schema=e,i.$isSingleNested=!0,i.events=new c,i.prototype.toBSON=function(){return this.toObject(v)},e.methods)i.prototype[s]=e.methods[s];
2for(var l in e.statics)i[l]=e.statics[l];for(var u in c.prototype)i[u]=c.prototype[u];return i}e.exports=S,S.prototype=Object.create(f.prototype),S.prototype.constructor=S,S.prototype.OptionsConstructor=u,S.prototype.$conditionalHandlers.$geoWithin=function(e,t){return{$geometry:this.castForQuery(null,e.$geometry,t)}},S.prototype.$conditionalHandlers.$near=S.prototype.$conditionalHandlers.$nearSphere=b.cast$near,S.prototype.$conditionalHandlers.$within=S.prototype.$conditionalHandlers.$geoWithin=b.cast$within,S.prototype.$conditionalHandlers.$geoIntersects=b.cast$geoIntersects,S.prototype.$conditionalHandlers.$minDistance=p,S.prototype.$conditionalHandlers.$maxDistance=p,S.prototype.$conditionalHandlers.$exists=h,S.prototype.cast=function(e,t,r,n,i){if(e&&e.$isSingleNested&&e.parent===t)return e;if(null!=e&&("object"!==o(e)||Array.isArray(e)))throw new l(this.path,e);var a,s=this.schema.path(this.schema.options.discriminatorKey),c=null==s?null:s.getDefault(t),u=m(this.caster,e,c),f=t&&t.$__&&t.$__.selected,h=this.path,p=null==f?null:Object.keys(f).reduce(function(e,t){return t.startsWith(h+".")&&((e=e||{})[t.substring(h.length+1)]=f[t]),e},null);if(!r)return i=Object.assign({},i,{priorDoc:n}),0===Object.keys(e).length?new u({},p,t,void 0,i):new u(e,p,t,void 0,i);delete(a=new u(void 0,p,t,!1,{defaults:!1})).$__.defaults,a.$init(e);var y=x(p);return d(a,p,y),a},S.prototype.castForQuery=function(e,t,r,n){if(null!=e){if(!(i=this.$conditionalHandlers[e]))throw Error("Can't use "+e);return i.call(this,t)}if(null==t)return t;var i,o=m(this.caster,t);if(t instanceof o)return t;this.options.runSetters&&(t=this._applySetters(t,r));var a=null!=n&&null!=n.strict?n.strict:void 0;try{t=new o(t,a)}catch(e){if(!(e instanceof s))throw new s("Embedded",t,this.path,e,this);throw e}return t},S.prototype.doValidate=function(e,t,r,n){var i=m(this.caster,e);if(!e||e instanceof i||(e=new i(e,null,null!=r&&null!=r.$__?r:null)),n&&n.skipSchemaValidators)return e?e.validate().then(function(){return t(null)},function(e){return t(e)}):t(null);f.prototype.doValidate.call(this,e,function(r){return r?t(r):e?void e.validate().then(function(){return t(null)},function(e){return t(e)}):t(null)},r,n)},S.prototype.doValidateSync=function(e,t,r){if(!r||!r.skipSchemaValidators){var n=f.prototype.doValidateSync.call(this,e,t);if(n)return n}if(e)return e.validateSync()},S.prototype.discriminator=function(e,t,r){r=r||{};var n=w.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;return t.instanceOfSchema&&i&&(t=t.clone()),t=y(this.caster,e,t,n),this.caster.discriminators[e]=j(t,this.caster),this.caster.discriminators[e]},S.defaultOptions={},S.set=f.set,S.setters=[],S.get=f.get,S.prototype.toJSON=function(){return{path:this.path,options:this.options}},S.prototype.clone=function(){var e=new this.constructor(this.schema,this.path,i(i({},this.options),{},{_skipApplyDiscriminators:!0}));return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e.caster.discriminators=Object.assign({},this.caster.discriminators),e}},94:(e,t,r)=>{"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o,a,s=r(8702),c=r(3053),l=r(5202),u=r(4756),f=r(4289),d=f.CastError,h=r(3861),p=r(6069),y=r(6787),b=r(1973),m=r(7906),g=r(8751),v=r(6872),x=r(1521).W,w=r(5008),_=r(7291),S=Symbol("mongoose#isNestedArray"),j=Object.freeze({});function k(e,t,n,i){a||(a=r(8941).Embedded);var o,s,c="type";if(i&&i.typeKey&&(c=i.typeKey),this.schemaOptions=i,t){var l={};v.isPOJO(t)&&(t[c]?(delete(l=b(t))[c],t=t[c]):t=h),null!=n&&null!=n.ref&&null==l.ref&&(l.ref=n.ref),t===Object&&(t=h);var u="string"==typeof t?t:v.getFunctionName(t),d=r(5251),p=d.hasOwnProperty(u)?d[u]:t;if(this.casterConstructor=p,this.casterConstructor instanceof k&&(this.casterConstructor[S]=!0),"function"!=typeof p||p.$isArraySubdocument||p.$isSchemaMap)this.caster=p,this.caster instanceof a||(this.caster.path=e);else{var y=this.caster instanceof a?null:e;this.caster=new p(y,l)}this.$embeddedSchemaType=this.caster}if(this.$isMongooseArray=!0,f.call(this,e,n,"Array"),null!=this.defaultValue&&(s="function"==typeof(o=this.defaultValue)),!("defaultValue"in this)||void 0!==this.defaultValue){var m=function(){return s?o.call(this):null!=o?[].concat(o):[]};m.$runBeforeSetters=!s,this.default(m)}}k.schemaName="Array",k.options={castNonArrays:!0},k.defaultOptions={},k.set=f.set,k.setters=[],k.get=f.get,k.prototype=Object.create(f.prototype),k.prototype.constructor=k,k.prototype.OptionsConstructor=u,k._checkRequired=f.prototype.checkRequired,k.checkRequired=f.checkRequired,k.prototype.checkRequired=function(e,t){return"object"===i(e)&&f._isRef(this,e,t,!0)?!!e:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():k.checkRequired())(e)},k.prototype.enum=function(){for(var e=this;;){var t=e&&e.caster&&e.caster.instance;if("Array"!==t){if("String"!==t&&"Number"!==t)throw Error("`enum` can only be set on an array of str
2ings or numbers , not "+t);break}e=e.caster}var r=arguments;return!Array.isArray(arguments)&&v.isObject(arguments)&&(r=v.object.vals(r)),e.caster.enum.apply(e.caster,r),this},k.prototype.applyGetters=function(e,t){return null!=t&&null!=t.$__&&t.$populated(this.path)?e:f.prototype.applyGetters.call(this,e,t)},k.prototype._applySetters=function(e,t,r,n){if(this.casterConstructor.$isMongooseArray&&k.options.castNonArrays&&!this[S]){for(var i=0,o=this;null!=o&&o.$isMongooseArray&&!o.$isMongooseDocumentArray;)++i,o=o.casterConstructor;if(null!=e&&0!==e.length){var a=p(e);if(a.min===a.max&&a.max<i&&a.containsNonArrayItem)for(var s=a.max;s<i;++s)e=[e]}}return f.prototype._applySetters.call(this,e,t,r,n)},k.prototype.cast=function(e,t,n,i,a){if(o||(o=r(8941).Array),Array.isArray(e)){if(!e.length&&t){var s,c,l=t.schema.indexedPaths(),u=this.path;for(s=0,c=l.length;s<c;++s){var f=l[s][0][u];if("2dsphere"===f||"2d"===f)return}var p=this.path.endsWith(".coordinates")?this.path.substring(0,this.path.lastIndexOf(".")):null;if(null!=p){for(s=0,c=l.length;s<c;++s)if("2dsphere"===l[s][0][p])return}}a=a||j;var y=v.isMongooseArray(e)?e.__array:e,b=a.path||this.path;if(null!=a.arrayPathIndex&&(b+="."+a.arrayPathIndex),y=(e=o(y,b,t,this)).__array,n&&null!=t&&null!=t.$__&&t.$populated(this.path))return e;var m=this.caster,x=m.$isMongooseArray;if(m&&this.casterConstructor!==h)try{var w=y.length;for(s=0;s<w;
2s++){var _={};x&&(null!=a.arrayPath||null!=m._arrayParentPath)&&(_.arrayPathIndex=s),y[s]=m.applySetters(y[s],t,n,void 0,_)}}catch(t){throw new d("["+t.kind+"]",g.inspect(e),this.path+"."+s,t,this)}return e}var S=null!=this.options.castNonArrays?this.options.castNonArrays:k.options.castNonArrays;if(n||S)return t&&n&&t.markModified(this.path),this.cast([e],t,n);throw new d("Array",g.inspect(e),this.path,null,this)},k.prototype._castForPopulate=function(e,t){if(o||(o=r(8941).Array),Array.isArray(e)){var n,i=e.__array?e.__array:e,a=i.length,s=this.caster;if(s&&this.casterConstructor!==h)try{for(n=0;n<a;n++){var c={};s.$isMongooseArray&&null!=s._arrayParentPath&&(c.arrayPathIndex=n),i[n]=s.cast(i[n],t,!1,void 0,c)}}catch(t){throw new d("["+t.kind+"]",g.inspect(e),this.path+"."+n,t,this)}return e}throw new d("Array",g.inspect(e),this.path,null,this)},k.prototype.$toObject=k.prototype.toObject,k.prototype.discriminator=function(){for(var e,t=this;t.$isMongooseArray&&!t.$isMongooseDocumentArray;)if(null==(t=t.casterConstructor)||"function"==typeof t)throw new l("You can only add an embedded discriminator on a document array, "+this.path+" is a plain array");return(e=t).discriminator.apply(e,arguments)},k.prototype.clone=function(){var e=Object.assign({},this.options),t=new this.constructor(this.path,this.caster,e,this.schemaOptions);return t.validators=this.validators.slice(),void 0!==this.requiredValidator&&(t.requiredValidator=this.requiredValidator),t},k.prototype._castForQuery=function(e,t){var r=this,n=this.casterConstructor;if(e&&n.discriminators&&n.schema&&n.schema.options&&n.schema.options.discriminatorKey)if("string"==typeof e[n.schema.options.discriminatorKey]&&n.discriminators[e[n.schema.options.discriminatorKey]])n=n.discriminators[e[n.schema.options.discriminatorKey]];else{var i=_(n.discriminators,e[n.schema.options.discriminatorKey]);i&&(n=i)}var o=this.casterConstructor.prototype,a=o&&o.castForQuery,s=o&&o.cast,c=n.castForQuery,l=this.caster;return Array.isArray(e)?(this.setters.reverse().forEach(function(t){e=t.call(r,e,r)}),e=e.map(function(e){return v.isObject(e)&&e.$elemMatch?e:a?e=a.call(l,null,e,t):s?e=s.call(l,e):c?e=c.call(l,null,e,t):null!=e?e=new n(e):e})):a?e=a.call(l,null,e,t):s?e=s.call(l,e):c?e=c.call(l,null,e,t):null!=e&&(e=new n(e)),e},k.prototype.castForQuery=function(e,t,r){var n;if(null!=e){if(!(n=this.$conditionalHandlers[e]))throw Error("Can't use "+e+" with Array.");return n.call(this,t,r)}return this._castForQuery(t,r)};var O=k.prototype.$conditionalHandlers={};function $(e){return function(t){if(!Array.isArray(t))throw TypeError("conditional "+e+" requires an array");var r,i=[],o=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e))){t&&(e=t);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;i.push(y(this.casterConstructor.schema,a,null,this&&this.$$context))}}catch(e){o.e(e)}finally{o.f()}return i}}O.$all=function(e,t){var r=this;return Array.isArray(e)||(e=[e]),e=e.map(function(e){if(!v.isObject(e))return e;if(null!=e.$elemMatch)return{$elemMatch:y(r.casterConstructor.schema,e.$elemMatch,null,r&&r.$$context)};var t={};return t[r.path]=e,y(r.casterConstructor.schema,t,null,r&&r.$$context)[r.path]},this),this.castForQuery(null,e,t)},O.$options=String,O.$elemMatch=function(e,t){for(var r,n=Object.keys(e),i=n.length,o=0;o<i;++o){var a=n[o],s=e[a];m(a)&&null!=s&&(e[a]=this.castForQuery(a,s,t))}var c=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.options&&this.casterConstructor.schema.options.discriminatorKey,l=this&&this.casterConstructor&&this.casterConstructor.schema&&this.casterConstructor.schema.discriminators||{};return null!=c&&null!=e[c]&&null!=l[e[c]]?y(l[e[c]],e,null,this&&this.$$context):y(null!=(r=this.casterConstructor.schema)?r:t.schema,e,
2null,this&&this.$$context)},O.$geoIntersects=w.cast$geoIntersects,O.$or=$("$or"),O.$and=$("$and"),O.$nor=$("$nor"),O.$near=O.$nearSphere=w.cast$near,O.$within=O.$geoWithin=w.cast$within,O.$size=O.$minDistance=O.$maxDistance=x,O.$exists=s,O.$type=c,O.$eq=O.$gt=O.$gte=O.$lt=O.$lte=O.$not=O.$regex=O.$ne=k.prototype._castForQuery,O.$nin=f.prototype.$conditionalHandlers.$nin,O.$in=f.prototype.$conditionalHandlers.$in,e.exports=k},6795:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){!function(e,t,r){var i;(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var a=r(1795),s=r(4289),c=r(3087);function l(e,t){s.call(this,e,t,"BigInt")}function u(e,t){return this.castForQuery(null,e,t)}l.schemaName="BigInt",l.defaultOptions={},l.prototype=Object.create(s.prototype),l.prototype.constructor=l,l._cast=c,l.set=s.set,l.setters=[],l.get=s.get,l.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},l._checkRequired=function(e){return null!=e},l.checkRequired=s.checkRequired,l.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)},l.prototype.cast=function(e){var t;t="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():l.cast();try{return t(e)}catch(t){throw new a("BigInt",e,this.path,t,this)}},l.$conditionalHandlers=o(o({},s.prototype.$conditionalHandlers),{},{$gt:u,$gte:u,$lt:u,$lte:u}),l.prototype.castForQuery=function(e,t,r){var n;return null!=e?(n=l.$conditionalHandlers[e])?n.call(this,t):this.applySetters(null,t,r):this.applySetters(t,r)},l.prototype._castNullish=function(e){return void 0===e||("function"==typeof this.constructor.cast?this.constructor.cast():l.cast()),e},e.exports=l},6470:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var o=r(1795),a=r(4289),s=r(6670);function c(e,t){a.call(this,e,t,"Boolean")}c.schemaName="Boolean",c.defaultOptions={},c.prototype=Object.create(a.prototype),c.prototype.constructor=c,c._cast=s,c.set=a.set,c.setters=[],c.get=a.get,c.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},c._defaultCaster=function(e){if(null!=e&&"boolean"!=typeof e)throw Error();return e},c._checkRequired=function(e){return!0===e||!1===e},c.checkRequired=a.checkRequired,c.prototype.checkRequired=function(e){return this.constructor._checkRequired(e)},Object.defineProperty(c,"convertToTrue",{get:function(){return s.convertToTrue},set:function(e){s.convertToTrue=e}}),Object.defineProperty(c,"convertToFalse",{get:function(){return s.convertToFalse},set:function(e){s.convertToFalse=e}}),c.prototype.cast=function(e){var t;t="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():c.cast();try{return t(e)}catch(t){throw new o("Boolean",e,this.path,t,this)}},c.$conditionalHandlers=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?i(Object(r),!0).forEach(function(t){!function(e,t,r){var i;(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},a.prototype.$conditionalHandlers),c.prototype.castForQuery=function(e,t,r){var n;return null!=e?(n=c.$conditionalHandlers[e])?n.call(this,t):this.applySetters(null,t,r):this.applySetters(t,r)},c.prototype._castNullish=function(e){if(void 0===e)return e;var t="function"==typeof this.constructor.cast?this.constructor.cast():c.cast();return null==t?e:!(t.convertToFalse instanceof Set&&t.convertToFalse.has(e))&&(!!(t.convertToTrue instanceof Set&&t.convertToTrue.has(e))||e)},e.exports=c},8800:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=a(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==a(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s=r(4051),c=r(9586),l=r(4289),u=r(4282),f=r(6872),d=s.Binary,h=l.CastError;function p(e,t){l.call(this,e,t,"Buffer")}function y(e,t){return this.castForQuery(null,e,t)}p.schemaName="Buffer",p.defaultOptions={},p.prototype=Object.create(l.prototype),p.prototype.constructor=p,p.prototype.OptionsConstructor=c,p._checkRequired=function(e){return!(!e||!e.length)},p.set=l.set,p.setters=[],p.get=l.get,p.checkRequired=l.checkRequired,p.prototype.checkRequired=function(e,t){return l._isRef(this,e,t,!0)?!!e:this.constructor._checkRequired(e)},p.prototype.cast=function(e,t,r){if(l._isRef(this,e,t,r)){if(e&&e.isMongooseBuffer)return e;if(n.isBuffer(e))return e&&e.isMongooseBuffer||(e=new s(e,[this.path,t]),null!=this.options.subtype&&(e._subtype=this.options.subtype)),e;if(e instanceof d){if(i=new s(e.value(!0),[this.path,t]),"number"!=typeof e.sub_type)throw new h("Buffer",e,this.path,null,this);return i._subtype=e.sub_type,i}if(null==e||f.isNonBuiltinObject(e))return this._castRef(e,t,r)}if(e&&e._id&&(e=e._id),e&&e.isMongooseBuffer)return e;if(n.isBuffer(e))return e&&e.isMongooseBuffer||(e=new s(e,[this.path,t]),null!=this.options.subtype&&(e._subtype=this.options.subtype)),e;if(e instanceof d){if(i=new s(e.value(!0),[this.path,t]),"number"!=typeof e.sub_type)throw new h("Buffer",e,this.path,null,this);return i._subtype=e.sub_type,i}if(null===e)return e;var i,o=a(e);if("string"===o||"number"===o||Array.isArray(e)||"object"===o&&"Buffer"===e.type&&Array.isArray(e.data))return"number"===o&&(e=[e]),i=new s(e,[this.path,t]),null!=this.options.subtype&&(i._subtype=this.options.subtype),i;throw new h("Buffer",e,this.path,null,this)},p.prototype.subtype=function(e){return this.options.subtype=e,this},p.prototype.$conditionalHandlers=o(o({},l.prototype.$conditionalHandlers),{},{$bitsAllClear:u,$bitsAnyClear:u,$bitsAllSet:u,$bitsAnySet:u,$gt:y,$gte:y,$lt:y,$lte:y}),p.prototype.castForQuery=function(e,t,r){if(null!=e){if(!(n=this.$conditionalHandlers[e]))throw Error("Can't use "+e+" with Buffer.");return n.call(this,t)}var n,i=this.applySetters(t,r);return i?i.toObject({transform:!1,virtuals:!1}):i},e.exports=p},6535:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?n(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(4888),s=r(2869),c=r(4289),l=r(195),u=r(1981),f=r(6872),d=c.CastError;function h(e,t){c.call(this,e,t,"Date")}function p(e){return this.cast(e)}h.schemaName="Date",h.defaultOptions={},h.prototype=Object.create(c.prototype),h.prototype.constructor=h,h.prototype.OptionsConstructor=s,h._cast=l,h.set=c.set,h.setters=[],h.get=c.get,h.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},h._defaultCaster=function(e){if(null!=e&&!(e instanceof Date))throw Error();return e},h.prototype.expires=function(e){return"Object"!==u(this._index)&&(this._index={}),this._index.expires=e,f.expires(this._index),this},h._checkRequired=function(e){return e instanceof Date},h.checkRequired=c.checkRequired,h.prototype.checkRequired=function(e,t){return"object"===o(e)&&c._isRef(this,e,t,!0)?null!=e:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():h.checkRequired())(e)},h.prototype.min=function(e,t){if(this.minValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.minValidator},this)),e){var r=t||a.messages.Date.min;"string"==typeof r&&(r=r.replace(/{MIN}/,e===Date.now?"Date.now()":e.toString()));var n=this;this.validators.push({validator:this.minValidator=function(t){var r=e;"function"==typeof e&&e!==Date.now&&(r=r.call(this));var i=r===Date.now?r():n.cast(r);return null===t||t.valueOf()>=i.valueOf()},message:r,type:"min",min:e})}return this},h.prototype.max=function(e,t){if(this.maxValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.maxValidator},this)),e){var r=t||a.messages.Date.max;"string"==typeof r&&(r=r.replace(/{MAX}/,e===Date.now?"Date.now()":e.toString()));var n=this;this.validators.push({validator:this.maxValidator=function(t){var r=e;"function"==typeof r&&r!==Date.now&&(r=r.call(this));var i=r===Date.now?r():n.cast(r);return null===t||t.valueOf()<=i.valueOf()},message:r,type:"max",max:e})}return this},h.prototype.cast=function(e){var t;t="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():h.cast();try{return t(e)}catch(t){throw new d("date",e,this.path,t,this)}},h.prototype.$conditionalHandlers=i(i({},c.prototype.$conditionalHandlers),{},{$gt:p,$gte:p,$lt:p,$lte:p}),h.prototype.castForQuery=function(e,t,r){if(null==e)return this.applySetters(t,r);var n=this.$conditionalHandlers[e];if(!n)throw Error("Can't use "+e+" with Date.");return n.call(this,t)},e.exports=h},6621:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){!function(e,t,r){var i;(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEac
2h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var a=r(4289),s=a.CastError,c=r(6209),l=r(1563);function u(e,t){a.call(this,e,t,"Decimal128")}function f(e){return this.cast(e)}u.schemaName="Decimal128",u.defaultOptions={},u.prototype=Object.create(a.prototype),u.prototype.constructor=u,u._cast=c,u.set=a.set,u.setters=[],u.get=a.get,u.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},u._defaultCaster=function(e){if(null!=e&&!l(e,"Decimal128"))throw Error();return e},u._checkRequired=function(e){return l(e,"Decimal128")},u.checkRequired=a.checkRequired,u.prototype.checkRequired=function(e,t){return a._isRef(this,e,t,!0)?!!e:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():u.checkRequired())(e)},u.prototype.cast=function(e,t,r){var n;if(a._isRef(this,e,t,r))return l(e,"Decimal128")?e:this._castRef(e,t,r);n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():u.cast();try{return n(e)}catch(t){throw new s("Decimal128",e,this.path,t,this)}},u.prototype.$conditionalHandlers=o(o({},a.prototype.$conditionalHandlers),{},{$gt:f,$gte:f,$lt:f,$lte:f}),e.exports=u},4504:(e,t,r)=>{"use strict";var n,i,o=r(94),a=r(1795),s=r(8997),c=r(9620).EventEmitter,l=r(887),u=r(4289),f=r(9181),d=r(9691),h=r(719),p=r(6872),y=r(8413),b=r(3346),m=r(8770).arrayAtomicsSymbol,g=r(8770).arrayPathSymbol,v=r(8770).documentArrayParent;function x(e,t,r,n){if(t.options&&t.options.timeseries)throw new b(e,"timeseries");var i=x.defaultOptions&&x.defaultOptions._id;null!=i&&((n=n||{})._id=i),null!=n&&null!=n._id?t=d(t,n):null!=r&&null!=r._id&&(t=d(t,r));var a=w(t,r);a.prototype.$basePath=e,o.call(this,e,a,r),this.schema=t,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=a,a.base=t.base;var c=this.defaultValue;"defaultValue"in this&&void 0===c||this.default(function(){var e=c.call(this);return null==e||Array.isArray(e)||(e=[e]),e}),this.$embeddedSchemaType=new s(e+".$",{required:this&&this.schemaOptions&&this.schemaOptions.required||!1,$parentSchemaType:this}),this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}function w(e,t,n){function o(){i.apply(this,arguments),null!=this.__parentArray&&null!=this.__parentArray.getArrayParent()&&this.$session(this.__parentArray.getArrayParent().$session())}i||(i=r(1568)),e._preCompile();var a=null!=n?n.prototype:i.prototype;for(var s in o.prototype=Object.create(a),o.prototype.$__setSchema(e),o.schema=e,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new c,o.base=e.base,e.methods)o.prototype[s]=e.methods[s];
2for(var l in e.statics)o[l]=e.statics[l];for(var u in c.prototype)o[u]=c.prototype[u];return o.options=t,o}x.schemaName="DocumentArray",x.options={castNonArrays:!0},x.prototype=Object.create(o.prototype),x.prototype.constructor=x,x.prototype.OptionsConstructor=l,x.prototype.discriminator=function(e,t,r){"function"==typeof e&&(e=p.getFunctionName(e)),r=r||{};var n=p.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;t.instanceOfSchema&&i&&(t=t.clone());var o=w(t=f(this.casterConstructor,e,t,n),null,this.casterConstructor);o.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(o,"name",{value:e})}catch(e){}return this.casterConstructor.discriminators[e]=o,this.casterConstructor.discriminators[e]},x.prototype.doValidate=function(e,t,o,a){n||(n=r(6077));var s=this;try{u.prototype.doValidate.call(this,e,function(r){if(r)return t(r);var c,l=e&&e.length;if(!l||a&&a.updateValidator)return t();function u(e){null!=e&&(c=e),--l||t(c)}p.isMongooseDocumentArray(e)||(e=new n(e,s.path,o));for(var f=0,d=l;f<d;++f){var h=e[f];if(null!=h){if(!(h instanceof i)){var b=y(s.casterConstructor,e[f]);h=e[f]=new b(h,e,void 0,void 0,f)}
2null==a||!a.validateModifiedOnly||h.$isModified()?h.$__validate(u):--l||t(c)}else--l||t(c)}},o)}catch(e){return t(e)}},x.prototype.doValidateSync=function(e,t,r){var n=u.prototype.doValidateSync.call(this,e,t);if(null!=n)return n;var o=e&&e.length,a=null;if(o){for(var s=0;s<o;++s){var c=e[s];if(c){if(!(c instanceof i)){var l=y(this.casterConstructor,e[s]);c=e[s]=new l(c,e,void 0,void 0,s)}if(null==r||!r.validateModifiedOnly||c.$isModified()){var f=c.validateSync();f&&null==a&&(a=f)}}}return a}},x.prototype.getDefault=function(e,t,i){var o="function"==typeof this.defaultValue?this.defaultValue.call(e):this.defaultValue;if(null==o||i&&i.skipCast)return o;n||(n=r(6077)),Array.isArray(o)||(o=[o]),o=new n(o,this.path,e);for(var a=0;a<o.length;++a){var s=new(y(this.casterConstructor,o[a]))({},o,void 0,void 0,a);s.$init(o[a]),s.isNew=!0,Object.assign(s.$__.activePaths.default,s.$__.activePaths.init),s.$__.activePaths.init={},o[a]=s}return o};var _=Object.freeze({transform:!1,virtuals:!1}),S=Object.freeze({skipId:!1,willInit:!0});x.prototype.cast=function(e,t,o,s,c){if(n||(n=r(6077)),null!=e&&null!=e[g]&&e===s)return e;var l,u,f=(c=c||{}).path||this.path;if(!Array.isArray(e)){if(!o&&!x.options.castNonArrays)throw new a("DocumentArray",e,this.path,null,this);return t&&o&&t.markModified(f),this.cast([e],t,o,s,c)}c.skipDocumentArrayCast&&!p.isMongooseDocumentArray(e)||(e=new n(e,f,t)),null!=s&&(e[m]=s[m]||{}),null!=c.arrayPathIndex&&(e[g]=f+"."+c.arrayPathIndex);for(var d=p.isMongooseDocumentArray(e)?e.__array:e,b=d.length,w=0;w<b;++w)if(d[w]){var j=y(this.casterConstructor,d[w]),k=h(d[w],!0);if(d[w]!==k&&(d[w]=k),d[w]instanceof i){if(d[w][v]!==t)if(o){var O=new j(null,e,S,l,w);d[w]=O.$init(d[w])}else{var $=new j(d[w],e,void 0,void 0,w);d[w]=$}null==d[w].__index&&d[w].$setIndex(w)}else if(null!=d[w])if(o)t?l||(l=function(e,t,r){if(r&&t){for(var n,i,o,a=e.path+".",s=Object.keys(t),c=s.length,l={};c--;)if((i=s[c]).startsWith(a)){if("$"===(o=i.substring(a.length)))continue;o.startsWith("$.")&&(o=o.substring(2)),n||(n=!0),l[o]=t[i]}return n&&l||void 0}}(this,t.$__.selected,o)):l=!0,u=new j(null,e,S,l,w),d[w]=u.$init(d[w]);else if(s&&"function"==typeof s.id&&(u=s.id(d[w]._id)),s&&u&&p.deepEqual(u.toObject(_),d[w]))u.set(d[w]),d[w]=u;else try{u=new j(d[w],e,void 0,void 0,w),d[w]=u}catch(t){throw new a("embedded",d[w],e[g],t,this)}}return e},x.prototype.clone=function(){var e=Object.assign({},this.options),t=new this.constructor(this.path,this.schema,e,this.schemaOptions);return t.validators=this.validators.slice(),void 0!==this.requiredValidator&&(t.requiredValidator=this.requiredValidator),t.Constructor.discriminators=Object.assign({},this.Constructor.discriminators),t},x.prototype.applyGetters=function(e,t){return u.prototype.applyGetters.call(this,e,t)},x.defaultOptions={},x.set=u.set,x.setters=[],x.get=u.get,e.exports=x},5251:(e,t,r)=>{"use strict";t.Array=r(94),t.Boolean=r(6470),t.BigInt=r(6795),t.Buffer=r(8800),t.Date=r(6535),t.Decimal128=t.Decimal=r(6621),t.DocumentArray=r(4504),t.Map=r(71),t.Mixed=r(3861),t.Number=r(1751),t.ObjectId=r(7116),t.String=r(6542),t.Subdocument=r(3617),t.UUID=r(2729),t.Oid=t.ObjectId,t.Object=t.Mixed,t.Bool=t.Boolean,t.ObjectID=t.ObjectId},71:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}function a(){return(a="u">typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!({}).hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(null,arguments)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}
2function c(e,t){return(c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var l=r(3828),u=r(8227),f=r(4289),d=function(e){var t;function u(e,t){var r,i,a;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,u),(i=u,a=[e,t,"Map"],i=s(i),r=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,o()?Reflect.construct(i,a||[],s(this).constructor):i.apply(this,a))).$isSchemaMap=!0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(u,e),t=[{key:"set",value:function(e,t){return f.set(e,t)}},{key:"cast",value:function(e,t,n){if(e instanceof l)return e;var o=this.path;if(n){var a=new l({},o,t,this.$__schemaType);if(e instanceof r.g.Map){var s,c=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,void 0):void 0}}(e))){t&&(e=t);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(e.keys());try{for(c.s();!(s=c.n()).done;){var u=s.value,f=e.get(u);f=null==f?a.$__schemaType._castNullish(f):a.$__schemaType.cast(f,t,!0,null,{path:o+"."+u}),a.$init(u,f)}}catch(e){c.e(e)}finally{c.f()}}else for(var d=0,h=Object.keys(e);d<h.length;d++){var p=h[d],y=e[p];y=null==y?a.$__schemaType._castNullish(y):a.$__schemaType.cast(y,t,!0,null,{path:o+"."+p}),a.$init(p,y)}return a}return new l(e,o,t,this.$__schemaType)}},{key:"clone",value:function(){var e,t,r=(e=this,"function"==typeof(t=a(s(u.prototype),"clone",e))?function(r){return t.apply(e,r)}:t)([]);return null!=this.$__schemaType&&(r.$__schemaType=this.$__schemaType.clone()),r}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(i.key),i)}}(u.prototype,t),Object.defineProperty(u,"prototype",{writable:!1}),u}(f);d.schemaName="Map",d.prototype.OptionsConstructor=u,d.defaultOptions={},e.exports=d},3861:(e,t,r)=>{"use strict";var n=r(4289),i=r(8107),o=r(5721),a=r(6872);function s(e,t){if(t&&t.default){var r=t.default;Array.isArray(r)&&0===r.length?t.default=Array:!t.shared&&o(r)&&0===Object.keys(r).length&&(t.default=function(){return{}})}n.call(this,e,t,"Mixed"),this[i.schemaMixedSymbol]=!0}s.schemaName="Mixed",s.defaultOptions={},s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.get=n.get,s.set=n.set,s.setters=[],s.prototype.cast=function(e){return e instanceof Error?a.errorToPOJO(e):e},s.prototype.castForQuery=function(e,t){return t},e.exports=s},1751:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?n(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(4888),s=r(8491),c=r(4289),l=r(3065),u=r(4282),f=r(6872),d=c.CastError;function h(e,t){c.call(this,e,t,"Number")}function p(e){return this.cast(e)}h.get=c.get,h.set=c.set,h.setters=[],h._cast=l,h.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},h._defaultCaster=function(e){if("number"!=typeof e)throw Error();return e},h.schemaName="Number",h.defaultOptions={},h.prototype=Object.create(c.prototype),h.prototype.constructor=h,h.prototype.OptionsConstructor=s,h._checkRequired=function(e){return"number"==typeof e||e instanceof Number},h.checkRequired=c.checkRequired,h.prototype.checkRequired=function(e,t){return"object"===o(e)&&c._isRef(this,e,t,!0)?null!=e:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():h.checkRequired())(e)},h.prototype.min=function(e,t){if(this.minValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.minValidator},this)),null!=e){var r=t||a.messages.Number.min;r=r.replace(/{MIN}/,e),this.validators.push({validator:this.minValidator=function(t){return null==t||t>=e},message:r,type:"min",min:e})}return this},h.prototype.max=function(e,t){if(this.maxValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.maxValidator},this)),null!=e){var r=t||a.messages.Number.max;r=r.replace(/{MAX}/,e),this.validators.push({validator:this.maxValidator=function(t){return null==t||t<=e},message:r,type:"max",max:e})}return this},h.prototype.enum=function(e,t){return this.enumValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.enumValidator},this)),Array.isArray(e)||(f.isPOJO(e)&&null!=e.values?(t=e.message,e=e.values):"number"==typeof e&&(e=Array.prototype.slice.call(arguments),t=null),f.isPOJO(e)&&(e=Object.values(e)),t=t||a.messages.Number.enum),t=t??a.messages.Number.enum,this.enumValidator=function(t){return null==t||-1!==e.indexOf(t)},this.validators.push({validator:this.enumValidator,message:t,type:"enum",enumValues:e}),this},h.prototype.cast=function(e,t,r){if("number"!=typeof e&&c._isRef(this,e,t,r)&&(null==e||f.isNonBuiltinObject(e)))return this._castRef(e,t,r);var n,i=e&&void 0!==e._id?e._id:e;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():h.cast();try{return n(i)}catch(e){throw new d("Number",i,this.path,e,this)}},h.prototype.$conditionalHandlers=i(i({},c.prototype.$conditionalHandlers),{},{$bitsAllClear:u,$bitsAnyClear:u,$bitsAllSet:u,$bitsAnySet:u,$gt:p,$gte:p,$lt:p,$lte:p,$mod:function(e){var t=this;return Array.isArray(e)?e.map(function(e){return t.cast(e)}):[this.cast(e)]}}),h.prototype.castForQuery=function(e,t,r){var n;if(null!=e){if(!(n=this.$conditionalHandlers[e]))throw new d("number",t,this.path,null,this);return n.call(this,t,r)}return this.applySetters(t,r)},e.exports=h},7116:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?i(Object(r),!0).forEach(function(t){!function(e,t,r){var i;(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var a,s=r(8172),c=r(4289),l=r(4731),u=r(1981),f=r(6079),d=r(1563),h=r(6872),p=c.CastError;function y(e,t){var r="string"==typeof e&&24===e.length&&/^[a-f0-9]+$/i.test(e),n=t&&t.suppressWarning;!r&&void 0!==e||n||h.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),c.call(this,e,t,"ObjectId")}function b(e){return this.cast(e)}function m(){return new f}function g(e){return a||(a=r(8727)),this instanceof a&&void 0===e?new f:e}y.schemaName="ObjectId",y.defaultOptions={},y.prototype=Object.create(c.prototype),y.prototype.constructor=y,y.prototype.OptionsConstructor=s,y.get=c.get,y.set=c.set,y.setters=[],y.prototype.auto=function(e){return e&&(this.default(m),this.set(g)),this},y._checkRequired=function(e){return d(e,"ObjectId")},y._cast=l,y.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},y._defaultCaster=function(e){if(!d(e,"ObjectId"))throw Error(e+" is not an instance of ObjectId");return e},y.checkRequired=c.checkRequired,y.prototype.checkRequired=function(e,t){return c._isRef(this,e,t,!0)?!!e:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():y.checkRequired())(e)},y.prototype.cast=function(e,t,r){var n;if(!d(e,"ObjectId")&&c._isRef(this,e,t,r)){if("objectid"===(u(e)||"").toLowerCase())return new f(e.toHexString());if(null==e||h.isNonBuiltinObject(e))return this._castRef(e,t,r)}n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():y.cast();try{return n(e)}catch(t){throw new p("ObjectId",e,this.path,t,this)}},y.prototype.$conditionalHandlers=o(o({},c.prototype.$conditionalHandlers),{},{$gt:b,$gte:b,$lt:b,$lte:b}),m.$runBeforeSetters=!0,e.exports=y},4282:(e,t,r)=>{"use strict";var n=r(365).Buffer,i=r(1795);function o(e,t){var r=Number(t);if(isNaN(r))throw new i("number",t,e);return r}e.exports=function(e){var t=this;return Array.isArray(e)?e.map(function(e){return o(t.path,e)}):n.isBuffer(e)?e:o(t.path,e)}},8702:(e,t,r)=>{"use strict";var n=r(6670);e.exports=function(e){return n(e,null!=this?this.path:null)}},5008:(e,t,r)=>{"use strict";var n=r(1521).i,i=r(1521).W;function o(e,t){switch(e.$geometry.type){case"Polygon":case"LineString":case"Point":n(e.$geometry.coordinates,t)}return a(t,e),e}function a(e,t){t.$maxDistance&&(t.$maxDistance=i.call(e,t.$maxDistance)),t.$minDistance&&(t.$minDistance=i.call(e,t.$minDistance))}t.cast$geoIntersects=function(e){if(e.$geometry)return o(e,this),e},t.cast$near=function(e){var t=r(94);if(Array.isArray(e))return n(e,this),e;if(a(this,e),e&&e.$geometry)return o(e,this);if(!Array.isArray(e))throw TypeError("$near must be either an array or an object with a $geometry property");return t.prototype.castForQuery.call(this,null,e)},t.cast$within=function(e){var t=this;if(a(this,e),e.$box||e.$polygon){var r=e.$box?"$box":"$polygon";e[r].forEach(function(e){if(!Array.isArray(e))throw TypeError("Invalid $within $box argument. Expected an array, received "+e);e.forEach(function(r,n){e[n]=i.call(t,r)})})}else if(e.$center||e.$centerSphere){var n=e.$center?"$center":"$centerSphere";e[n].forEach(function(r,o){Array.isArray(r)?r.forEach(function(e,n){r[n]=i.call(t,e)}):e[n][o]=i.call(t,r)})}else e.$geometry&&o(e,this);return e}},1521:(e,t,r)=>{"use strict";var n=r(1751);function i(e){return n.cast()(e)}t.W=i,t.i=function e(t,r){t.forEach(function(n,o){Array.isArray(n)?e(n,r):t[o]=i.call(r,n)})}},6495:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(1795),o=r(6670),a=r(2417);e.exports=function(e,t){if(null==e||"object"!==n(e))throw new i("$text",e,t);
2return null!=e.$search&&(e.$search=a(e.$search,t+".$search")),null!=e.$language&&(e.$language=a(e.$language,t+".$language")),null!=e.$caseSensitive&&(e.$caseSensitive=o(e.$caseSensitive,t+".$castSensitive")),null!=e.$diacriticSensitive&&(e.$diacriticSensitive=o(e.$diacriticSensitive,t+".$diacriticSensitive")),e}},3053:e=>{"use strict";e.exports=function(e){if(Array.isArray(e)){if(!e.every(function(e){return"number"==typeof e||"string"==typeof e}))throw Error("$type array values must be strings or numbers");return e}if("number"!=typeof e&&"string"!=typeof e)throw Error("$type parameter must be number, string, or array of numbers and strings");return e}},6542:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=o(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==o(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var s=r(4289),c=r(4888),l=r(3209),u=r(2417),f=r(6872),d=r(1563),h=s.CastError;function p(e,t){this.enumValues=[],this.regExp=null,s.call(this,e,t,"String")}function y(e,t){return this.castForQuery(null,e,t)}function b(e){return null==e?this._castNullish(e):this.cast(e,this)}p.schemaName="String",p.defaultOptions={},p.prototype=Object.create(s.prototype),p.prototype.constructor=p,Object.defineProperty(p.prototype,"OptionsConstructor",{configurable:!1,enumerable:!1,writable:!1,value:l}),p._cast=u,p.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},p._defaultCaster=function(e){if(null!=e&&"string"!=typeof e)throw Error();return e},p.get=s.get,p.set=s.set,p.setters=[],p._checkRequired=function(e){return(e instanceof String||"string"==typeof e)&&e.length},p.checkRequired=s.checkRequired,p.prototype.enum=function(){if(this.enumValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.enumValidator},this),this.enumValidator=!1),void 0===arguments[0]||!1===arguments[0])return this;f.isObject(arguments[0])?Array.isArray(arguments[0].values)?(e=arguments[0].values,t=arguments[0].message):(e=f.object.vals(arguments[0]),t=c.messages.String.enum):(e=arguments,t=c.messages.String.enum);var e,t,r,n=function(e){var t="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return a(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a(e,void 0):void 0}}(e))){t&&(e=t);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){s=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(s)throw i}}}}(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;void 0!==i&&this.enumValues.push(this.cast(i))}}catch(e){n.e(e)}finally{n.f()}var o=this.enumValues;return this.enumValidator=function(e){return void 0===e||~o.indexOf(e)},this.validators.push({validator:this.enumValidator,message:t,type:"enum",enumValues:o}),this},p.prototype.lowercase=function(e){var t=this;return arguments.length>0&&!e?this:this.set(function(e){return"string"!=typeof e&&(e=t.cast(e)),e?e.toLowerCase():e})},p.prototype.uppercase=function(e){var t=this;return arguments.length>0&&!e?this:this.set(function(e){return"string"!=typeof e&&(e=t.cast(e)),e?e.toUpperCase():e})},p.prototype.trim=function(e){var t=this;return arguments.length>0&&!e?this:this.set(function(e){return"string"!=typeof e&&(e=t.cast(e)),e?e.trim():e})},p.prototype.minlength=function(e,t){if(this.minlengthValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.minlengthValidator},this)),null!=e){var r=t||c.messages.String.minlength;r=r.replace(/{MINLENGTH}/,e),this.validators.push({validator:this.minlengthValidator=function(t){return null===t||t.length>=e},message:r,type:"minlength",minlength:e})}return this},p.prototype.minLength=p.prototype.minlength,p.prototype.maxlength=function(e,t){if(this.maxlengthValidator&&(this.validators=this.validators.filter(function(e){return e.validator!==this.maxlengthValidator},this)),null!=e){var r=t||c.messages.String.maxlength;r=r.replace(/{MAXLENGTH}/,e),this.validators.push({validator:this.maxlengthValidator=function(t){return null===t||t.length<=e},message:r,type:"maxlength",maxlength:e})}return this},p.prototype.maxLength=p.prototype.maxlength,p.prototype.match=function(e,t){var r=t||c.messages.String.match;return this.validators.push({validator:function(t){return!!e&&(e.lastIndex=0,null==t||""===t||e.test(t))},message:r,type:"regexp",regexp:e}),this},p.prototype.checkRequired=function(e,t){return"object"===o(e)&&s._isRef(this,e,t,!0)?null!=e:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():p.checkRequired())(e)},p.prototype.cast=function(e,t,r){var n;if("string"!=typeof e&&s._isRef(this,e,t,r))return this._castRef(e,t,r);n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():p.cast();try{return n(e)}catch(t){throw new h("string",e,this.path,null,this)}};var m=i(i({},s.prototype.$conditionalHandlers),{},{$all:function(e,t){var r=this;return Array.isArray(e)?e.map(function(e){return r.castForQuery(null,e,t)}):[this.castForQuery(null,e,t)]},$gt:y,$gte:y,$lt:y,$lte:y,$options:b,$regex:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)?e:b.call(this,e)},$not:y});Object.defineProperty(p.prototype,"$conditionalHandlers",{configurable:!1,enumerable:!1,writable:!1,value:Object.freeze(m)}),p.prototype.castForQuery=function(e,t,r){var n;if(null!=e){if(!(n=this.$conditionalHandlers[e]))throw Error("Can't use "+e+" with String.");return n.call(this,t,r)}return"[object RegExp]"===Object.prototype.toString.call(t)||d(t,"BSONRegExp")?t:this.applySetters(t,r)},e.exports=p},8107:(e,t)=>{"use strict";t.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed"),t.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")},2729:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?o(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==i(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var s=r(4051),c=r(4289),l=c.CastError,u=r(6872),f=r(4282),d=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,h=s.Binary;function p(e){"string"!=typeof e&&(e="");var t,r=new s(null!=(t=e.replace(/[{}-]/g,""))&&n.from(t,"hex"));return r._subtype=4,r}function y(e){var t;return"string"!=typeof e&&null!=e?(t=null!=e&&e.toString("hex")).substring(0,8)+"-"+t.substring(8,12)+"-"+t.substring(12,16)+"-"+t.substring(16,20)+"-"+t.substring(20,32):e}function b(e,t){c.call(this,e,t,"UUID"),this.getters.push(function(e){return null!=e&&null!=e.$__?e:y(e)})}function m(e){return this.cast(e)}function g(e){var t=this;return e.map(function(e){return t.cast(e)})}b.schemaName="UUID",b.defaultOptions={},b.prototype=Object.create(c.prototype),b.prototype.constructor=b,b._cast=function(e){if(null==e)return e;function t(e){var t=new s(e);return t._subtype=4,t}if("string"==typeof e){if(d.test(e))return p(e);throw new l(b.schemaName,e,this.path)}if(n.isBuffer(e))return t(e);if(e instanceof h)return t(e.value(!0));if(e.toString&&e.toString!==Object.prototype.toString&&d.test(e.toString()))return p(e.toString());throw new l(b.schemaName,e,this.path)},b.get=c.get,b.set=c.set,b.setters=[],b.cast=function(e){return 0==arguments.length||(!1===e&&(e=this._defaultCaster),this._cast=e),this._cast},b._checkRequired=function(e){return null!=e},b.checkRequired=c.checkRequired,b.prototype.checkRequired=function(e){return n.isBuffer(e)&&(e=y(e)),null!=e&&d.test(e)},b.prototype.cast=function(e,t,r){var n;if(u.isNonBuiltinObject(e)&&c._isRef(this,e,t,r))return this._castRef(e,t,r);n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():b.cast();try{return n(e)}catch(t){throw new l(b.schemaName,e,this.path,t,this)}},b.prototype.$conditionalHandlers=a(a({},c.prototype.$conditionalHandlers),{},{$bitsAllClear:f,$bitsAnyClear:f,$bitsAllSet:f,$bitsAnySet:f,$all:g,$gt:m,$gte:m,$in:g,$lt:m,$lte:m,$ne:m,$nin:g}),b.prototype.castForQuery=function(e,t,r){var n;if(null!=e){if(!(n=this.$conditionalHandlers[e]))throw Error("Can't use "+e+" with UUID.");return n.call(this,t,r)}return this.cast(t)},e.exports=b},4289:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(4888),a=r(1764),s=r(8702),c=r(3053),l=r(1973),u=r(8828),f=r(8857),d=r(9130),h=r(1490),p=r(8770).schemaTypeSymbol,y=r(6872),b=r(8770).validatorErrorSymbol,m=r(8770).documentIsModified,g=r(8770).populateModelSymbol,v=o.CastError,x=o.ValidatorError,w={_skipMarkModified:!0};function _(e,t,r){this[p]=!0,this.path=e,this.instance=r,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=this.constructor.hasOwnProperty("setters")?this.constructor.setters.slice():[],this.splitPath(),t=t||{};for(var n=this.constructor.defaultOptions||{},o=0,s=Object.keys(n);o<s.length;o++){var c=s[o];n.hasOwnProperty(c)&&!Object.prototype.hasOwnProperty.call(t,c)&&(t[c]=n[c])}null==t.select&&delete t.select;var l=this.OptionsConstructor||a;this.options=new l(t),this._index=null,y.hasUserDefinedProperty(this.options,"immutable")&&(this.$immutable=this.options.immutable,u(this));for(var f=0,d=Object.keys(this.options);f<d.length;f++){var h=d[f];if("cast"!==h){if(y.hasUserDefinedProperty(this.options,h)&&"function"==typeof this[h]){if("index"===h&&this._index){if(!1===t.index){var b=this._index;if("object"===i(b)&&null!=b){if(b.unique)throw Error('Path "'+this.path+'" may
2not have `index` set to false and `unique` set to true');if(b.sparse)throw Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}this._index=!1}continue}var m=t[h];if("default"===h){this.default(m);continue}var g=Array.isArray(m)?m:[m];this[h].apply(this,g)}}else Array.isArray(this.options[h])?this.castFunction.apply(this,this.options[h]):this.castFunction(this.options[h])}Object.defineProperty(this,"$$context",{enumerable:!1,configurable:!1,writable:!0,value:null})}function S(e,t){if(void 0!==e&&!e){var r=new(t.ErrorConstructor||x)(t);return r[b]=!0,r}}function j(e,t){return this.castForQuery(null,e,t)}function k(e,t){var r=this;return Array.isArray(e)?e.map(function(e){return Array.isArray(e)&&0===e.length?e:r.castForQuery(null,e,t)}):[this.castForQuery(null,e,t)]}_.prototype.OptionsConstructor=a,_.prototype.path,_.prototype.validators,_.prototype.isRequired,_.prototype.splitPath=function(){return null!=this._presplitPath?this._presplitPath:null!=this.path?(this._presplitPath=-1===this.path.indexOf(".")?[this.path]:this.path.split("."),this._presplitPath):void 0},_.cast=function(e){return 0==arguments.length||(!1===e&&(e=function(e){return e}),this._cast=e),this._cast},_.prototype.castFunction=function(e,t){return 0==arguments.length||(!1===e&&(e=this.constructor._defaultCaster||function(e){return e}),"string"==typeof e?this._castErrorMessage=e:(null!=e&&(this._castFunction=e),null!=t&&(this._castErrorMessage=t))),this._castFunction},_.prototype.cast=function(){throw Error("Base SchemaType class does not implement a `cast()` function")},_.set=function(e,t){this.hasOwnProperty("defaultOptions")||(this.defaultOptions=Object.assign({},this.defaultOptions)),this.defaultOptions[e]=t},_.get=function(e){this.getters=this.hasOwnProperty("getters")?this.getters:[],this.getters.push(e)},_.prototype.default=function(e){if(1==arguments.length){if(void 0===e)return void(this.defaultValue=void 0);if(null!=e&&e.instanceOfSchema)throw new o("Cannot set default value of path `"+this.path+"` to a mongoose Schema instance.");return this.defaultValue=e,this.defaultValue}return arguments.length>1&&(this.defaultValue=Array.prototype.slice.call(arguments)),this.defaultValue},_.prototype.index=function(e){return this._index=e,y.expires(this._index),this},_.prototype.unique=function(e){if(!1===this._index){if(!e)return;throw Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}return(this.options.hasOwnProperty("index")||!1!==e)&&(null==this._index||!0===this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.unique=e),this},_.prototype.text=function(e){if(!1===this._index){if(!e)return this;throw Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}return(this.options.hasOwnProperty("index")||!1!==e)&&(null===this._index||void 0===this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.text=e),this},_.prototype.sparse=function(e){if(!1===this._index){if(!e)return this;throw Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}return(this.options.hasOwnProperty("index")||!1!==e)&&(null==this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.sparse=e),this},_.prototype.immutable=function(e){return this.$immutable=e,u(this),this},_.prototype.transform=function(e){return this.options.transform=e,this},_.prototype.set=function(e){if("function"!=typeof e)throw TypeError("A setter must be a function.");return this.setters.push(e),this},_.prototype.get=function(e){if("function"!=typeof e)throw TypeError("A getter must be a function.");return this.getters.push(e),this},_.prototype.validate=function(e,t,r){var n,a,s,c;if("function"==typeof e||e&&"RegExp"===y.getFunctionName(e.constructor))return"function"==typeof t?(n={validator:e,message:t}).type=r||"user defined":t instanceof Object&&!r?((n=d(t)?Object.assign({},t):l(t)).message||(n.message=n.msg),n.validator=e,n.type=n.type||"user defined"):(null==t&&(t=o.messages.general.default),r||(r="user defined"),n={message:t,type:r,validator:e}),this.validators.push(n),this;for(a=0,s=arguments.length;a<s;a++){if(c=arguments[a],!y.isPOJO(c))throw Error("Invalid validator. Received ("+i(c)+") "+c+". See https://mongoosejs.com/docs/api/schematype.html#SchemaType.prototype.validate()");this.validate(c.validator,c)}return this},_.prototype.required=function(e,t){var r={};if(arguments.length>0&&null==e||("object"===i(e)&&(t=(r=e).message||t,e=e.isRequired),!1===e))return this.validators=this.validators.filter(function(e){return e.validator!==this.requiredValidator},this),this.isRequired=!1,delete this.originalRequiredValue,this;var n=this;this.isRequired=!0,this.requiredValidator=function(t){var r=this&&this.$__&&this.$__.cachedRequired;if(null!=r&&!this.$__isSelected(n.path)&&!this[m](n.path))return!0;
2if(null!=r&&n.path in r){var i=!r[n.path]||n.checkRequired(t,this);return delete r[n.path],i}return"function"==typeof e&&!e.apply(this)||n.checkRequired(t,this)},this.originalRequiredValue=e,"string"==typeof e&&(t=e,e=void 0);var a=t||o.messages.general.required;return this.validators.unshift(Object.assign({},r,{validator:this.requiredValidator,message:a,type:"required"})),this},_.prototype.ref=function(e){return this.options.ref=e,this},_.prototype.getDefault=function(e,t,r){var n;if(null!=(n="function"==typeof this.defaultValue?this.defaultValue===Date.now||this.defaultValue===Array||"objectid"===this.defaultValue.name.toLowerCase()?this.defaultValue.call(e):this.defaultValue.call(e,e):this.defaultValue)){if("object"!==i(n)||this.options&&this.options.shared||(n=l(n)),r&&r.skipCast)return this._applySetters(n,e);var o=this.applySetters(n,e,t,void 0,w);return o&&!Array.isArray(o)&&o.$isSingleNested&&(o.$__parent=e),o}return n},_.prototype._applySetters=function(e,t,r,n,i){var o=e;if(r)return o;for(var a=this.setters,s=a.length-1;s>=0;s--)o=a[s].call(t,o,n,this,i);return o},_.prototype._castNullish=function(e){return e},_.prototype.applySetters=function(e,t,r,n,i){var o=this._applySetters(e,t,r,n,i);return null==o?this._castNullish(o):o=this.cast(o,t,r,n,i)},_.prototype.applyGetters=function(e,t){var r=e,n=this.getters,i=n.length;if(0===i)return r;for(var o=0;o<i;++o)r=n[o].call(t,r,this);return r},_.prototype.select=function(e){return this.selected=!!e,this},_.prototype.doValidate=function(e,t,r,n){var o=this,a=!1,s=this.path,c=this.validators.filter(function(e){return"object"===i(e)&&null!==e}),u=c.length;if(!u)return t(null);for(var f=0,p=c.length;f<p&&0!==function(){if(a)return 0;var t,i=c[f],u=i.validator,h=d(i)?Object.assign({},i):l(i);if(h.path=n&&n.path?n.path:s,h.fullPath=o.$fullPath,h.value=e,u instanceof RegExp)return y(u.test(e),h,r),1;if("function"!=typeof u)return 1;if(void 0===e&&u!==o.requiredValidator)return y(!0,h,r),1;try{t=h.propsParameter?u.call(r,e,h):u.call(r,e)}catch(e){t=!1,h.reason=e,e.message&&(h.message=e.message)}null!=t&&"function"==typeof t.then?t.then(function(e){y(e,h,r)},function(e){h.reason=e,h.message=e.message,y(t=!1,h,r)}):y(t,h,r)}();++f);function y(e,r,n){!a&&(void 0===e||e?--u<=0&&h(function(){t(null)}):((a=new(r.ErrorConstructor||x)(r,n))[b]=!0,h(function(){t(a)})))}},_.prototype.doValidateSync=function(e,t,r){var n=this.path;if(!this.validators.length)return null;var o=this.validators;if(void 0===e){if(0===this.validators.length||"required"!==this.validators[0].type)return null;o=[this.validators[0]]}var a=null,s=0,c=o.length;for(s=0;s<c;++s){var u=o[s];if(null!==u&&"object"===i(u)){var h=u.validator,p=d(u)?Object.assign({},u):l(u);p.path=r&&r.path?r.path:n,p.fullPath=this.$fullPath,p.value=e;var y=!1;if(!f(h)){if(h instanceof RegExp)a=S(h.test(e),p);else if("function"==typeof h){try{y=p.propsParameter?h.call(t,e,p):h.call(t,e)}catch(e){y=!1,p.reason=e}if((null==y||"function"!=typeof y.then)&&(a=S(y,p)))break}}}}return a},_._isRef=function(e,t,r,i){var o=i&&e.options&&(e.options.ref||e.options.refPath);if(!o&&r&&null!=r.$__){var a=r.$__fullPath(e.path,!0),s=r.ownerDocument();o=null!=a&&s.$populated(a)||r.$populated(e.path)}return!!o&&(null==t||!(n.isBuffer(t)||"Binary"===t._bsontype||!y.isObject(t))||i)},_.prototype._castRef=function(e,t,r){if(null==e)return e;if(null!=e.$__)return e.$__.wasPopulated=e.$__.wasPopulated||{value:e._id},e;if(n.isBuffer(e)||!y.isObject(e)){if(r)return e;throw new v(this.instance,e,this.path,null,this)}var i=t.$__fullPath(this.path,!0),o=t.ownerDocument().$populated(i,!0),a=e;return t.$__.populated&&t.$__.populated[i]&&t.$__.populated[i].options&&t.$__.populated[i].options.options&&t.$__.populated[i].options.options.lean||((a=new o.options[g](e)).$__.wasPopulated={value:a._id}),a},_.prototype.$conditionalHandlers={$all:function(e,t){var r=this;return Array.isArray(e)?e.map(function(e){return r.castForQuery(null,e,t)}):[this.castForQuery(null,e,t)]},$eq:j,$in:k,$ne:j,$nin:k,$exists:s,$type:c},_.prototype.castForQuery=function(e,t,r){var n;if(null!=e){if(!(n=this.$conditionalHandlers[e]))throw Error("Can't use "+e);return n.call(this,t,r)}return this.applySetters(t,r)},_.checkRequired=function(e){return 0!=arguments.length&&(this._checkRequired=e),this._checkRequired},_.prototype.checkRequired=function(e){return null!=e},_.prototype.clone=function(){var e=Object.assign({},this.options),t=new this.constructor(this.path,e,this.instance);return t.validators=this.validators.slice(),void 0!==this.requiredValidator&&(t.requiredValidator=this.requiredValidator),void 0!==this.defaultValue&&(t.defaultValue=this.defaultValue),void 0!==this.$immutable&&void 0===this.options.immutable&&(t.$immutable=this.$immutable,u(t)),void 0!==this._index&&(t._index=this._index),void 0!==this.selected&&(t.selected=this.selected),void 0!==this.isRequired&&(t.isRequired=this.isRequired),void 0!==this.originalRequiredValue&&(t.originalRequiredValue=this.originalRequiredValue),t.getters=this.getters.slice(),t.setters=this.setters.slice(),t},e.exports=t=_,t.CastError=v,t.ValidatorError=x},489:(e,t,r)=>{"use strict";r(6872);var n=e.exports=function(){};n.ctor=function(){var e=Array.prototype.slice.call(arguments),t=function(){n.apply(this,arguments),this.paths={},this.states={}};return(t.prototype=new n).stateNames=e,e.forEach(function(e){t.prototype[e]=function(t){this._changeState(t,e)}}),t},n.prototype._changeState=function(e,t){var r=this.paths[e];if(r!==t){var n=this.states[r];n&&delete n[e],this.paths[e]=t,this.states[t]=this.states[t]||{},this.states[t][e]=!0}},n.prototype.clear=function(e){if(null!=this.states[e])for(var t,r=Object.keys(this.states[e]),n=r.length;n--;)t=r[n],delete this.states[e][t],delete this.paths[t]},n.prototype.clearPath=function(e){var t=this.paths[e];t&&(delete this.paths[e],delete this.states[t][e])},n.prototype.getStatePaths=function(e){return null!=this.states[e]?this.states[e]:{}},n.prototype.some=function(){var e=this,t=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(t,function(t){return null!=e.states[t]&&Object.keys(e.states[t]).length})},n.prototype._iter=function(e){return function(){var t=Array.prototype.slice.call(arguments),r=t.pop();t.length||(t=this.stateNames);var n=this;return t.reduce(function(e,t){return null==n.states[t]?e:e.concat(Object.keys(n.states[t]))},[])[e](function(e,t,n){return r(e,t,n)})}},n.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)},n.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)}},1568:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(9620).EventEmitter,a=r(2591),s=r(6872),c=r(8770).documentArrayParent;function l(e,t,r,o,l){var u;s.isMongooseDocumentArray(t)?(this.__parentArray=t,this[c]=t.$parent()):(this.__parentArray=void 0,this[c]=void 0),this.$setIndex(l),this.$__parent=this[c],"object"===i(r)&&null!=r?(u=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?n(Object(r),!0).forEach(function(t){!function(e,t,r){var n;(n=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==i(n)?n:n+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({isNew:!0},r),r=void 0):u={isNew:!0},a.call(this,e,o,this[c],r,u)}for(var u in l.prototype=Object.create(a.prototype),l.prototype.constructor=l,Object.defineProperty(l.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1}),Object.defineProperty(l.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0}),o.prototype)l[u]=o.prototype[u];l.prototype.$setIndex=function(e){if(this.__index=e,null!=this.$__&&null!=this.$__.validationError)for(var t=0,r=Object.keys(this.$__.validationError.errors);t<r.length;t++){var n=r[t];this.invalidate(n,this.$__.validationError.errors[n])}},l.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.arr[0].populate("path")`, use `doc.populate("arr.0.path")`')},l.prototype.$__removeFromParent=function(){var e=this._doc._id;if(!e)throw Error("For your own good, Mongoose does not know how to remove an ArraySubdocument that has no _id");this.__parentArray.pull({_id:e})},l.prototype.$__fullPath=function(e,t){return null==this.__index?null:(this.$__.fullPath||this.ownerDocument(),t?e?this.$__.fullPath+"."+e:this.$__.fullPath:e?this.$__.fullPath+"."+this.__index+"."+e:this.$__.fullPath+"."+this.__index)},l.prototype.$__pathRelativeToParent=function(e,t){return null!=this.__index&&this.__parentArray&&this.__parentArray.$path?t?null==e?this.__parentArray.$path():this.__parentArray.$path()+"."+e:null==e?this.__parentArray.$path()+"."+this.__index:this.__parentArray.$path()+"."+this.__index+"."+e:null},l.prototype.$parent=function(){return this[c]},l.prototype.parentArray=function(){return this.__parentArray},e.exports=l},6077:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r){var i;return(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(8075),a=r(9261),s=r(8727),c=r(8770).arrayAtomicsSymbol,l=r(8770).arrayAtomicsBackupSymbol,u=r(8770).arrayParentSymbol,f=r(8770).arrayPathSymbol,d=r(8770).arraySchemaSymbol,h=Array.prototype.push,p=/^\d+$/;e.exports=function(e,t,r){var n=[],y=i(i(i(i(i({},c,{}),l,void 0),f,t),d,void 0),u,void 0);if(Array.isArray(e)&&(e[f]===t&&e[u]===r&&(y[c]=Object.assign({},e[c])),e.forEach(function(e){h.call(n,e)})),y[f]=t,y.__array=n,r&&r instanceof s)for(y[u]=r,y[d]=r.$__schema.path(t);null!=y[d]&&y[d].$isMongooseArray&&!y[d].$isMongooseDocumentArray;)y[d]=y[d].casterConstructor;var b=new Proxy(n,{get:function(e,t){return"isMongooseArray"===t||"isMongooseArrayProxy"===t||"isMongooseDocumentArray"===t||"isMongooseDocumentArrayProxy"===t||(y.hasOwnProperty(t)?y[t]:a.hasOwnProperty(t)?a[t]:o.hasOwnProperty(t)?o[t]:n[t])},set:function(e,t,r){return"string"==typeof t&&p.test(t)?a.set.call(b,t,r,!1):y.hasOwnProperty(t)?y[t]=r:n[t]=r,!0}});return b}},1255:(e,t)=>{"use strict";t.isMongooseDocumentArray=function(e){return Array.isArray(e)&&e.isMongooseDocumentArray}},9261:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return o(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}
2}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var a=r(8075),s=r(8727),c=r(4731),l=r(7291),u=r(4962).h,f=r(6872),d=r(1563),h=r(8770).arrayParentSymbol,p=r(8770).arrayPathSymbol,y=r(8770).arraySchemaSymbol,b=r(8770).documentArrayParent,m={toBSON:function(){return this.toObject(u)},getArrayParent:function(){return this[h]},_cast:function(e,t,r){if(null==this[y])return e;var i=this[y].casterConstructor;if((i.$isMongooseDocumentArray?f.isMongooseDocumentArray(e):e instanceof i)||e&&e.constructor&&e.constructor.baseCasterConstructor===i)return e[b]&&e.__parentArray||(e[b]=this[h],e.__parentArray=this),e.$setIndex(t),e;if(null==e)return null;if((n.isBuffer(e)||d(e,"ObjectId")||!f.isObject(e))&&(e={_id:e}),e&&i.discriminators&&i.schema&&i.schema.options&&i.schema.options.discriminatorKey)if("string"==typeof e[i.schema.options.discriminatorKey]&&i.discriminators[e[i.schema.options.discriminatorKey]])i=i.discriminators[e[i.schema.options.discriminatorKey]];else{var o=l(i.discriminators,e[i.schema.options.discriminatorKey]);o&&(i=o)}if(i.$isMongooseDocumentArray)return i.cast(e,this,void 0,void 0,t);var a=new i(e,this,r,void 0,t);return a.isNew=!0,a},id:function(e){try{t=c(e).toString()}catch(e){t=null}var t,r,n,o,a=i(this);try{for(a.s();!(o=a.n()).done;){var l=o.value;if(l&&null!=(n=l.get("_id"))){if(n instanceof s){if(r||(r=String(e)),r==n._id)return l}else if(d(e,"ObjectId")||d(n,"ObjectId")){if(t==n)return l}else if(e==n||f.deepEqual(e,n))return l}}}catch(e){a.e(e)}finally{a.f()}return null},toObject:function(e){return[].concat(this.map(function(t){return null==t?null:"function"!=typeof t.toObject?t:t.toObject(e)}))},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},push:function(){var e=a.push.apply(this,arguments);return g(this),e},pull:function(){var e=a.pull.apply(this,arguments);return g(this),e},shift:function(){var e=a.shift.apply(this,arguments);return g(this),e},splice:function(){var e=a.splice.apply(this,arguments);return g(this),e},inspect:function(){return this.toObject()},create:function(e){var t=this[y].casterConstructor;if(e&&t.discriminators&&t.schema&&t.schema.options&&t.schema.options.discriminatorKey)if("string"==typeof e[t.schema.options.discriminatorKey]&&t.discriminators[e[t.schema.options.discriminatorKey]])t=t.discriminators[e[t.schema.options.discriminatorKey]];else{var r=l(t.discriminators,e[t.schema.options.discriminatorKey]);r&&(t=r)}return new t(e,this)},notify:function(e){var t=this;return function r(n,i){for(var o=(i=i||t).length;o--;)null!=i[o]&&("save"===e&&(n=t[o]),f.isMongooseArray(i[o])?r(n,i[o]):i[o]&&i[o].emit(e,n))}},set:function(e,t,r){var n=this.__array;if(r)return n[e]=t,this;var i=m._cast.call(this,t,e);return m._markModified.call(this,e),n[e]=i,this},_markModified:function(e,t){var r,n=this[h];if(n){if(r=this[p],arguments.length&&(r=null!=t?r+"."+e.__index+"."+t:r+"."+e),null!=r&&r.endsWith(".$"))return this;n.markModified(r,0!=arguments.length?e:n)}return this}};function g(e){var t=e[h];if(t&&null!=t.$__.populated){var r,n=i(Object.keys(t.$__.populated).filter(function(t){return t.startsWith(e[p]+".")}));try{for(n.s();!(r=n.n()).done;)!function(){var n=r.value,i=n.slice((e[p]+".").length);Array.isArray(t.$__.populated[n].value)&&(t.$__.populated[n].value=e.map(function(e){return e.$populated(i)}))}()}catch(e){n.e(e)}finally{n.f()}}}e.exports=m},1362:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r){var i;return(i=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(i)?i:i+"")in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(8727),a=r(8075),s=r(8770).arrayAtomicsSymbol,c=r(8770).arrayAtomicsBackupSymbol,l=r(8770).arrayParentSymbol,u=r(8770).arrayPathSymbol,f=r(8770).arraySchemaSymbol,d=Array.prototype.push,h=/^\d+$/;e.exports=function(e,t,r,n){if(Array.isArray(e)){var p,y=e.length;if(0===y)p=[];else if(1===y)(p=[,])[0]=e[0];else if(y<1e4)p=[],d.apply(p,e);else{p=[];for(var b=0;b<y;++b)d.call(p,e[b])}}else p=[];var m=i(i(i(i(i(i(i(i({},s,{}),c,void 0),u,t),f,n),l,void 0),"isMongooseArray",!0),"isMongooseArrayProxy",!0),"__array",p);e&&null!=e[s]&&(m[s]=e[s]),null!=r&&r instanceof o&&(m[l]=r,m[f]=n||r.schema.path(t));var g=new Proxy(p,{get:function(e,t){return m.hasOwnProperty(t)?m[t]:a.hasOwnProperty(t)?a[t]:"string"==typeof t&&h.test(t)&&null!=(null==n?void 0:n.$embeddedSchemaType)?n.$embeddedSchemaType.applyGetters(p[t],r):p[t]},set:function(e,t,r){return"string"==typeof t&&h.test(t)?a.set.call(g,t,r,!1):m.hasOwnProperty(t)?m[t]=r:p[t]=r,!0}});return g}},7339:(e,t)=>
2{"use strict";t.isMongooseArray=function(e){return Array.isArray(e)&&e.isMongooseArray}},8075:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=a(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw o}}}}function a(e,t){if(e){if("string"==typeof e)return s(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var c=r(8727),l=r(1568),u=r(5202),f=r(4134),d=r(1973),h=r(4962).h,p=r(3564),y=r(6872),b=r(1563),m=r(8770).arrayAtomicsSymbol,g=r(8770).arrayParentSymbol,v=r(8770).arrayPathSymbol,x=r(8770).arraySchemaSymbol,w=r(8770).populateModelSymbol,_=Symbol("mongoose#Array#sliced"),S=Array.prototype.push,j={$__getAtomics:function(){var e=[],t=Object.keys(this[m]||{}),r=t.length,n=Object.assign({},h,{_isNested:!0});if(0===r)return e[0]=["$set",this.toObject(n)],e;for(;r--;){var i=t[r],o=this[m][i];y.isMongooseObject(o)?o=o.toObject(n):Array.isArray(o)?o=this.toObject.call(o,n):null!=o&&Array.isArray(o.$each)?o.$each=this.toObject.call(o.$each,n):null!=o&&"function"==typeof o.valueOf&&(o=o.valueOf()),"$addToSet"===i&&(o={$each:o}),e.push([i,o])}return e},$atomics:function(){return this[m]},$parent:function(){return this[g]},$path:function(){return this[v]},$shift:function(){this._registerAtomic("$pop",-1),this._markModified();var e=this.__array;if(!e._shifted)return e._shifted=!0,[].shift.call(e)},$pop:function(){if(this._registerAtomic("$pop",1),this._markModified(),!this._popped)return this._popped=!0,[].pop.call(this)},$schema:function(){return this[x]},_cast:function(e){var t,r=!1,i=this[g];if(i&&(r=i.$populated(this[v],!0)),r&&null!=e){if(null==(t=r.options[w]))throw new u("No populated model found for path `"+this[v]+"`. This is likely a bug in Mongoose, please report an issue on github.com/Automattic/mongoose.");return(n.isBuffer(e)||b(e,"ObjectId")||!y.isObject(e))&&(e={_id:e}),e.schema&&e.schema.discriminatorMapping&&void 0!==e.schema.discriminatorMapping.key||(e=new t(e)),this[x].caster.applySetters(e,i,!0)}return this[x].caster.applySetters(e,i,!1)},_mapCast:function(e,t){return this._cast(e,this.length+t)},_markModified:function(e){var t,r=this[g];if(r){if(t=this[v],arguments.length&&(t=t+"."+e),null!=t&&t.endsWith(".$"))return this;r.markModified(t,0!=arguments.length?e:r)}return this},_registerAtomic:function(e,t){if(!this[_]){if("$set"===e)return this[m]={$set:t},f(this[g],this[v]),this._markModified(),this;var r,n=this[m];if("$pop"===e&&!("$pop"in n)){var c=this;this[g].once("save",function(){c._popped=c._shifted=null})}if(n.$set||Object.keys(n).length&&!(e in n))return this[m]={$set:this},this;if("$pullAll"===e||"$addToSet"===e)n[e]||(n[e]=[]),n[e]=n[e].concat(t);else if("$pullDocs"===e){var u=n.$pull||(n.$pull={});t[0]instanceof l?(r=u.$or||(u.$or=[]),Array.prototype.push.apply(r,t.map(function(e){return e.toObject({transform:function(t,r){return null==e||null==e.$__||Object.keys(e.$__.activePaths.getStatePaths("default")).forEach(function(e){p.unset(e,r),function e(t,r,n){if("string"==typeof r){if(-1===r.indexOf("."))return;r=p.stringToParts(r)}(n=n||0)>=r.length||null!=t&&"object"===i(t)&&(e(t[r[0]],r,n+1),null!=t[r[0]]&&"object"===i(t[r[0]])&&0===Object.keys(t[r[0]]).length&&delete t[r[0]])}(r,e)}),r},virtuals:!1})}))):(r=u._id||(u._id={$in:[]})).$in=r.$in.concat(t)}else if("$push"===e)if(n.$push=n.$push||{$each:[]},null!=t&&y.hasUserDefinedProperty(t,"$each"))n.$push=t;else if(1===t.length)n.$push.$each.push(t[0]);else if(t.length<1e4)(d=n.$push.$each).push.apply(d,function(e){if(Array.isArray(e))return s(e)}(t)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||a(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());else{var d,h,b=o(t);try{for(b.s();!(h=b.n()).done;){var x=h.value;
2n.$push.$each.push(x)}}catch(e){b.e(e)}finally{b.f()}}else n[e]=t;return this}},addToSet:function(){k(this,arguments);var e=[].map.call(arguments,this._mapCast,this),t=[],r="";e[0]instanceof l?r="doc":e[0]instanceof Date?r="date":b(e[0],"ObjectId")&&(r="ObjectId");var n=y.isMongooseArray(e)?e.__array:e,i=y.isMongooseArray(this)?this.__array:this;return n.forEach(function(e){var n,o=+e;switch(r){case"doc":n=this.some(function(t){return t.equals(e)});break;case"date":n=this.some(function(e){return+e===o});break;case"ObjectId":n=this.find(function(t){return t.toString()===e.toString()});break;default:n=~this.indexOf(e)}n||(this._markModified(),i.push(e),this._registerAtomic("$addToSet",e),[].push.call(t,e))},this),t},hasAtomics:function(){return y.isPOJO(this[m])?Object.keys(this[m]).length:0},includes:function(e,t){return -1!==this.indexOf(e,t)},indexOf:function(e,t){b(e,"ObjectId")&&(e=e.toString()),t=t??0;for(var r=this.length,n=t;n<r;++n)if(e==this[n])return n;return -1},inspect:function(){return JSON.stringify(this)},nonAtomicPush:function(){var e=[].map.call(arguments,this._mapCast,this);this._markModified();var t=[].push.apply(this,e);return this._registerAtomic("$set",this),t},pop:function(){this._markModified();var e=[].pop.call(this);return this._registerAtomic("$set",this),e},pull:function(){var e=this,t=[].map.call(arguments,function(t,r){return e._cast(t,r,{defaults:!1})},this),r=this[g].get(this[v]);y.isMongooseArray(r)&&(r=r.__array);var n,i=r.length;for(this._markModified();i--;)(n=r[i])instanceof c?t.some(function(e){return n.equals(e)})&&r.splice(i,1):~this.indexOf.call(t,n)&&r.splice(i,1);return t[0]instanceof l?this._registerAtomic("$pullDocs",t.map(function(e){var t=e.$__getValue("_id");return void 0===t||e.$isDefault("_id")?e:t})):this._registerAtomic("$pullAll",t),f(this[g],this[v])>0&&this._registerAtomic("$set",this),this},push:function(){var e,t=arguments,r=t,n=null!=t[0]&&y.hasUserDefinedProperty(t[0],"$each"),i=y.isMongooseArray(this)?this.__array:this;if(n&&(r=t[0],t=t[0].$each),null==this[x])return S.apply(this,t);k(this,t),t=[].map.call(t,this._mapCast,this);var o=this[m];return this._markModified(),n?(r.$each=t,0!==(o.$push&&o.$push.$each&&o.$push.$each.length||0)&&o.$push.$position!=r.$position?(null!=r.$position?([].splice.apply(i,[r.$position,0].concat(t)),e=i.length):e=[].push.apply(i,t),this._registerAtomic("$set",this)):null!=r.$position?([].splice.apply(i,[r.$position,0].concat(t)),e=this.length):e=[].push.apply(i,t)):(r=t,e=S.apply(i,t)),this._registerAtomic("$push",r),e},remove:function(){return this.pull.apply(this,arguments)},set:function(e,t,r){var n=this.__array;if(r)return n[e]=t,this;var i=j._cast.call(this,t,e);return j._markModified.call(this,e),n[e]=i,this},shift:function(){var e=y.isMongooseArray(this)?this.__array:this;this._markModified();var t=[].shift.call(e);return this._registerAtomic("$set",this),t},sort:function(){var e=y.isMongooseArray(this)?this.__array:this,t=[].sort.apply(e,arguments);return this._registerAtomic("$set",this),t},splice:function(){var e,t,r=y.isMongooseArray(this)?this.__array:this;if(this._markModified(),k(this,Array.prototype.slice.call(arguments,2)),arguments.length){if(null==this[x])e=arguments;else{e=[];for(var n=0;n<arguments.length;++n)e[n]=n<2?arguments[n]:this._cast(arguments[n],arguments[0]+(n-2))}t=[].splice.apply(r,e),this._registerAtomic("$set",this)}return t},toBSON:function(){return this.toObject(h)},toObject:function(e){var t=y.isMongooseArray(this)?this.__array:this;return e&&e.depopulate?((e=d(e))._isNested=!0,[].concat(t).map(function(t){return t instanceof c?t.toObject(e):t})):[].concat(t)},$toObject:function(){return this.constructor.prototype.toObject.apply(this,arguments)},unshift:function(){k(this,arguments),e=null==this[x]?arguments:[].map.call(arguments,this._cast,this);var e,t=y.isMongooseArray(this)?this.__array:this;return this._markModified(),[].unshift.apply(t,e),this._registerAtomic("$set",this),this.length}};function k(e,t){var r,n,a,s,l=null==e?null:e[x]&&e[x].caster&&e[x].caster.options&&e[x].caster.options.ref||null;0===e.length&&0!==t.length&&function(e,t){if(!t)return!1;var r,n=o(e);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(null==i)return!1;var a=i.constructor;if(!(i instanceof c)||a.modelName!==t&&a.baseModelName!==t)return!1}}catch(e){n.e(e)}finally{n.f()}return!0}(t,l)&&e[g].$populated(e[v],[],(n={},a=w,s=t[0].constructor,(r=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=i(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(a),(a="symbol"==i(r)?r:r+"")in n)?Object.defineProperty(n,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[a]=s,n))}for(var O=0,$=["filter","flat","flatMap","map","slice"];O<$.length;O++)!function(){var e=$[O];null==Array.prototype[e]||(j[e]=function(){var t=[].concat(y.isMongooseArray(this)?this.__array:this);return t[e].apply(t,arguments)})}();e.exports=j},4051:(e,t,r)=>{"use strict";var n=r(365).Buffer,i=r(4029).Binary,o=r(6872);function a(e,t,r){var i,s,l,u,f=e;return null==e&&(f=0),Array.isArray(t)?(s=t[0],l=t[1]):i=t,u="number"==typeof f||f instanceof Number?n.alloc(f):n.from(f,i,r),o.decorate(u,a.mixin),u.isMongooseBuffer=!0,u[a.pathSymbol]=s,u[c]=l,u._subtype=0,u}var s=Symbol.for("mongoose#Buffer#_path"),c=Symbol.for("mongoose#Buffer#_parent");a.pathSymbol=s,a.mixin={_subtype:void 0,_markModified:function(){var e=this[c];return e&&e.markModified(this[a.pathSymbol]),this},write:function(){var e=n.prototype.write.apply(this,arguments);return e>0&&this._markModified(),e},copy:function(e){var t=n.prototype.copy.apply(this,arguments);return e&&e.isMongooseBuffer&&e._markModified(),t}}
2,o.each(["writeUInt8","writeUInt16","writeUInt32","writeInt8","writeInt16","writeInt32","writeFloat","writeDouble","fill","utf8Write","binaryWrite","asciiWrite","set","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE"],function(e){n.prototype[e]&&(a.mixin[e]=function(){var t=n.prototype[e].apply(this,arguments);return this._markModified(),t})}),a.mixin.toObject=function(e){var t="number"==typeof e?e:this._subtype||0;return new i(n.from(this),t)},a.mixin.$toObject=a.mixin.toObject,a.mixin.toBSON=function(){return new i(this,this._subtype||0)},a.mixin.equals=function(e){if(!n.isBuffer(e)||this.length!==e.length)return!1;for(var t=0;t<this.length;++t)if(this[t]!==e[t])return!1;return!0},a.mixin.subtype=function(e){if("number"!=typeof e)throw TypeError("Invalid subtype. Expected a number");this._subtype!==e&&this._markModified(),this._subtype=e},a.Binary=i,e.exports=a},5003:(e,t,r)=>{"use strict";e.exports=r(4029).Decimal128},8941:(e,t,r)=>{"use strict";t.Array=r(1362),t.Buffer=r(4051),t.Document=t.Embedded=r(1568),t.DocumentArray=r(6077),t.Decimal128=r(5003),t.ObjectId=r(6079),t.Map=r(3828),t.Subdocument=r(2591),t.UUID=r(8369)},3828:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return o(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t,r,n){var i=s(f(1&n?e.prototype:e),t,r);return 2&n&&"function"==typeof i?function(e){return i.apply(r,e)}:i}function s(){return(s="u">typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!({}).hasOwnProperty.call(e,t)&&null!==(e=f(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(null,arguments)}function c(e){var t="function"==typeof Map?new Map:void 0;return(c=function(e){if(null===e||!function(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(l())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&u(i,r.prototype),i}(e,arguments,f(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function u(e,t){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=r(3861),h=r(5202),p=r(1973),y=r(6872).deepEqual,b=r(1981),m=r(719),g=r(8751),v=r(2862),x=r(1563),w=r(8770).populateModelSymbol,_=function(e){var t;function r(e,t,i,o){var a,s,c;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),"Object"===b(e)&&(e=Object.keys(e).reduce(function(t,r){return t.concat([[r,e[r]]])},[])),(s=r,c=[e],s=f(s),a=function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,l()?Reflect.construct(s,c||[],f(this).constructor):s.apply(this,c))).$__parent=null!=i&&null!=i.$__?i:null,a.$__path=t,a.$__schemaType=o??new d(t),a.$__runDeferred(),a}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(r,e),t=[{key:"$init",value:function(e,t){S(e),a(r,"set",this,3)([e,t]),null!=t&&t.$isSingleNested&&(t.$basePath=this.$__path+"."+e)}},{key:"$__set",value:function(e,t){a(r,"set",this,3)([e,t])}},{key:"get",value:function(e,t){return x(e,"ObjectId")&&(e=e.toString()),!1===(t=t||{}).getters?a(r,"get",this,3)([e]):this.$__schemaType.applyGetters(a(r,"get",this,3)([e]),this.$__parent)}},{key:"set",value:function(e,t){if(x(e,"ObjectId")&&(e=e.toString()),S(e),t=m(t),null==this.$__schemaType)return this.$__deferred=this.$__deferred||[],void this.$__deferred.push({key:e,value:t});var n,i=this.$__parent,o=null!=i&&i.$__&&i.$__.populated?i.$populated(l.call(this),!0)||i.$populated(this.$__path,!0):null,s=this.get(e);
2if(null!=o){if(this.$__schemaType.$isSingleNested)throw new h("Cannot manually populate single nested subdoc underneath Map "+'at path "'.concat(this.$__path,'". Try using an array instead of a Map.'));Array.isArray(t)&&this.$__schemaType.$isMongooseArray?t=t.map(function(e){return null==e.$__&&(e=new o.options[w](e)),e.$__.wasPopulated={value:e._id},e}):(null==t.$__&&(t=new o.options[w](t)),t.$__.wasPopulated={value:t._id})}else try{var c=this.$__schemaType.$isMongooseDocumentArray||this.$__schemaType.$isSingleNested?{path:l.call(this)}:null;t=this.$__schemaType.applySetters(t,this.$__parent,!1,this.get(e),c)}catch(e){if(null!=this.$__parent&&null!=this.$__parent.$__)return void this.$__parent.invalidate(l.call(this),e);throw e}function l(){return n||(n=this.$__path+"."+e)}a(r,"set",this,3)([e,t]),null==i||null==i.$__||y(t,s)||i.markModified(l.call(this))}},{key:"clear",value:function(){a(r,"clear",this,3)([]);var e=this.$__parent;null!=e&&e.markModified(this.$__path)}},{key:"delete",value:function(e){return x(e,"ObjectId")&&(e=e.toString()),this.set(e,void 0),a(r,"delete",this,3)([e])}},{key:"toBSON",value:function(){return new Map(this)}},{key:"toObject",value:function(e){if(e&&e.flattenMaps){var t,r={},n=i(this.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value;r[o]=p(this.get(o),e)}}catch(e){n.e(e)}finally{n.f()}return r}return new Map(this)}},{key:"$toObject",value:function(){return this.constructor.prototype.toObject.apply(this,arguments)}},{key:"toJSON",value:function(e){if("boolean"!=typeof(e&&e.flattenMaps)||e.flattenMaps){var t,r={},n=i(this.keys());try{for(n.s();!(t=n.n()).done;){var o=t.value;r[o]=p(this.get(o),e)}}catch(e){n.e(e)}finally{n.f()}return r}return new Map(this)}},{key:"inspect",value:function(){return new Map(this)}},{key:"$__runDeferred",value:function(){if(this.$__deferred){var e,t=i(this.$__deferred);try{for(t.s();!(e=t.n()).done;){var r=e.value;this.set(r.key,r.value)}}catch(e){t.e(e)}finally{t.f()}this.$__deferred=null}}}],function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(i.key),i)}}(r.prototype,t),Object.defineProperty(r,"prototype",{writable:!1}),r}(c(Map));function S(e){var t=n(e);if("string"!==t)throw TypeError("Mongoose maps only support string keys, got ".concat(t));if(e.startsWith("$"))throw Error('Mongoose maps do not support keys that start with "$", got "'.concat(e,'"'));if(e.includes("."))throw Error('Mongoose maps do not support keys that contain ".", got "'.concat(e,'"'));if(v.has(e))throw Error('Mongoose maps do not support reserved key name "'.concat(e,'"'))}g.inspect.custom&&Object.defineProperty(_.prototype,g.inspect.custom,{enumerable:!1,writable:!1,configurable:!1,value:_.prototype.inspect}),Object.defineProperty(_.prototype,"$__set",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(_.prototype,"$__parent",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(_.prototype,"$__path",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(_.prototype,"$__schemaType",{enumerable:!1,writable:!0,configurable:!1}),Object.defineProperty(_.prototype,"$isMongooseMap",{enumerable:!1,writable:!1,configurable:!1,value:!0}),Object.defineProperty(_.prototype,"$__deferredCalls",{enumerable:!1,writable:!1,configurable:!1,value:!0}),e.exports=_},6079:(e,t,r)=>{"use strict";var n=r(4029).ObjectId,i=r(8770).objectIdSymbol;Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),n.prototype.hasOwnProperty("valueOf")||(n.prototype.valueOf=function(){return this.toString()}),n.prototype[i]=!0,e.exports=n},2591:(e,t,r)=>{"use strict";function n(){var e,t,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,o,a){var s=Object.create((n&&n.prototype instanceof l?n:l).prototype);return i(s,"_invoke",function(r,n,i){var o,a,s,l=0,u=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,a=0,s=e,d.n=r,c}};function h(r,n){for(a=r,s=n,t=0;!f&&l&&!i&&t<u.length;t++){var i,o=u[t],h=d.p,p=o[2];r>3?(i=p===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=r<2&&h<o[1])?(a=0,d.v=n,d.n=o[1]):h<p&&(i=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,d.n=p,a=0))}if(i||r>1)return c;throw f=!0,n}return function(i,u,p){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),a=u,s=p;(t=a<2?e:s)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.v=s);try{if(l=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,s)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(f=d.n<0)?s:r.call(n,d))!==c)break}catch(t){o=e,a=1,s=t}finally{l=1}}return{value:t,done:f}}}(r,o,a),!0),s}var c={};function l(){}function u(){}function f(){}t=Object.getPrototypeOf;var d=f.prototype=l.prototype=Object.create([][o]?t(t([][o]())):(i(t={},o,function(){return this}),t));function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,i(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=f,i(d,"constructor",f),i(f,"constructor",u),u.displayName="GeneratorFunction",i(f,a,"GeneratorFunction"),i(d),i(d,a,"Generator"),i(d,o,function(){return this}),i(d,"toString",function(){return"[object Generator]"}),(n=function(){return{w:s,m:h}})()}function i(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(i=function(e,t,r,n){function a(t,r){i(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))})(e,t,r,n)}function o(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s,c,l=r(8727),u=r(1490),f=r(4962).h,d=r(8751),h=r(6872);function p(e,t,r,n,i){if("object"===a(n)&&null!=n&&null==i&&(i=n,n=void 0),null!=r){var o={isNew:r.isNew};"defaults"in r.$__&&(o.defaults=r.$__.defaults),i=Object.assign(o,i)}null!=i&&null!=i.path&&(this.$basePath=i.path),l.call(this,e,t,n,i),delete this.$__.priorDoc}e.exports=p,p.prototype=Object.create(l.prototype),Object.defineProperty(p.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0}),Object.defineProperty(p.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0}),p.prototype.toBSON=function(){return this.toObject(f)},p.prototype.save=(s=n().m(function e(t){var r=this;return n().w(function(e){for(;;)if(0===e.n)return(t=t||{}).suppressWarning||h.warn("mongoose: calling `save()` on a subdoc does **not** save the document to MongoDB, it only runs save middleware. Use `subdoc.save({ suppressWarning: true })` to hide this warning if you're sure this behavior is right for your app."),e.a(2,new Promise(function(e,t){r.$__save(function(n){if(null!=n)return t(n);e(r)})}))},e)}),c=function(){var e=this,t=arguments;return new Promise(function(r,n){var i=s.apply(e,t);function a(e){o(i,r,n,a,c,"next",e)}function c(e){o(i,r,n,a,c,"throw",e)}a(void 0)})},function(e){return c.apply(this,arguments)}),p.prototype.$__fullPath=function(e){return this.$__.fullPath||this.ownerDocument(),e?this.$__.fullPath+"."+e:this.$__.fullPath},p.prototype.$__pathRelativeToParent=function(e){return null==e?this.$basePath:[this.$basePath,e].join(".")},p.prototype.$__save=function(e){var t=this;return u(function(){return e(null,t)})},p.prototype.$isValid=function(e){var t=this.$parent(),r=this.$__pathRelativeToParent(e);return null!=t&&null!=r?t.$isValid(r):l.prototype.$isValid.call(this,e)},p.prototype.markModified=function(e){l.prototype.markModified.call(this,e);var t=this.$parent(),r=this.$__pathRelativeToParent(e);if(null!=t&&null!=r){var n=this.$__pathRelativeToParent().replace(/\.$/,"");t.isDirectModified(n)||this.isNew||this.$__parent.markModified(r,this)}},p.prototype.isModified=function(e,t,r){var n=this,i=this.$parent();return null!=i?(Array.isArray(e)||"string"==typeof e?e=(e=Array.isArray(e)?e:e.split(" ")).map(function(e){return n.$__pathRelativeToParent(e)}).filter(function(e){return null!=e}):e||(e=this.$__pathRelativeToParent()),i.$isModified(e,t,r)):l.prototype.isModified.call(this,e,t,r)},p.prototype.$markValid=function(e){l.prototype.$markValid.call(this,e);var t=this.$parent(),r=this.$__pathRelativeToParent(e);null!=t&&null!=r&&t.$markValid(r)},p.prototype.invalidate=function(e,t,r){l.prototype.invalidate.call(this,e,t,r);var n=this.$parent(),i=this.$__pathRelativeToParent(e);
2if(null!=n&&null!=i)n.invalidate(i,t,r);else if("cast"===t.kind||"CastError"===t.name||null==i)throw t;return this.ownerDocument().$__.validationError},p.prototype.$ignore=function(e){l.prototype.$ignore.call(this,e);var t=this.$parent(),r=this.$__pathRelativeToParent(e);null!=t&&null!=r&&t.$ignore(r)},p.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;for(var e=this,t=[],r=new Set([e]);"function"==typeof e.$__pathRelativeToParent;){t.unshift(e.$__pathRelativeToParent(void 0,!0));var n=e.$parent();if(null==n)break;if(e=n,r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");r.add(e)}return this.$__.fullPath=t.join("."),this.$__.ownerDocument=e,this.$__.ownerDocument},p.prototype.$__fullPathWithIndexes=function(){for(var e=this,t=[],r=new Set([e]);"function"==typeof e.$__pathRelativeToParent;){t.unshift(e.$__pathRelativeToParent(void 0,!1));var n=e.$parent();if(null==n)break;if(e=n,r.has(e))throw Error("Infinite subdocument loop: subdoc with _id "+e._id+" is a parent of itself");r.add(e)}return t.join(".")},p.prototype.parent=function(){return this.$__parent},p.prototype.$parent=p.prototype.parent,p.prototype.$__deleteOne=function(e){if(null!=e)return e(null,this)},p.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)},p.prototype.deleteOne=function(e,t){return"function"==typeof e&&(t=e,e=null),function(e){var t=e.ownerDocument();function r(){t.$removeListener("save",r),t.$removeListener("deleteOne",r),e.emit("deleteOne",e),e.constructor.emit("deleteOne",e),t=e=null}t.$on("save",r),t.$on("deleteOne",r)}(this),e&&e.noop||this.$__removeFromParent(),this.$__deleteOne(t)},p.prototype.populate=function(){throw Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')},p.prototype.inspect=function(){return this.toObject({transform:!1,virtuals:!1,flattenDecimals:!1})},d.inspect.custom&&(p.prototype[d.inspect.custom]=p.prototype.inspect)},8369:(e,t,r)=>{"use strict";e.exports=r(4029).UUID},6872:(e,t,r)=>{"use strict";var n=r(365).Buffer;function i(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return o(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var s,c=r(4029).UUID,l=r(2068),u=r(3564),f=r(6079),d=r(4034),h=r(1973),p=r(1490),y=r(5721),b=r(7339),m=r(1255),g=r(1563),v=r(6749),x=r(6584),w=r(8486),_=r(4913),S=r(2862),j=r(3636).trustedSymbol;t.specialProperties=S,t.isMongooseArray=b.isMongooseArray,t.isMongooseDocumentArray=m.isMongooseDocumentArray,t.registerMongooseArray=b.registerMongooseArray,t.registerMongooseDocumentArray=m.registerMongooseDocumentArray;var k=/\s/,O=/\s+/;t.toCollectionName=function(e,t){return"system.profile"===e||"system.indexes"===e?e:"function"==typeof t?t(e):e},t.deepEqual=function e(r,i){if(r===i)return!0;if("object"!==a(r)||"object"!==a(i))return r===i;if(r instanceof Date&&i instanceof Date)return r.getTime()===i.getTime();if(g(r,"ObjectId")&&g(i,"ObjectId")||g(r,"Decimal128")&&g(i,"Decimal128"))return r.toString()===i.toString();if(r instanceof RegExp&&i instanceof RegExp)return r.source===i.source&&r.ignoreCase===i.ignoreCase&&r.multiline===i.multiline&&r.global===i.global&&r.dotAll===i.dotAll&&r.unicode===i.unicode&&r.sticky===i.sticky&&r.hasIndices===i.hasIndices;if(null==r||null==i||r.prototype!==i.prototype)return!1;if(r instanceof Map||i instanceof Map)return r instanceof Map&&i instanceof Map&&e(Array.from(r.keys()),Array.from(i.keys()))&&e(Array.from(r.values()),Array.from(i.values())
2);if(r instanceof Number&&i instanceof Number)return r.valueOf()===i.valueOf();if(n.isBuffer(r))return t.buffer.areEqual(r,i);if(Array.isArray(r)||Array.isArray(i)){if(!Array.isArray(r)||!Array.isArray(i))return!1;var o=r.length;if(o!==i.length)return!1;for(var s=0;s<o;++s)if(!e(r[s],i[s]))return!1;return!0}null!=r.$__?r=r._doc:x(r)&&(r=r.toObject()),null!=i.$__?i=i._doc:x(i)&&(i=i.toObject());var c=Object.keys(r),l=Object.keys(i),u=c.length;if(u!==l.length)return!1;for(var f=u-1;f>=0;f--)if(c[f]!==l[f])return!1;for(var d=0;d<c.length;d++){var h=c[d];if(!e(r[h],i[h]))return!1}return!0},t.last=function(e){if(e.length>0)return e[e.length-1]},t.promiseOrCallback=w,t.cloneArrays=function(e){return Array.isArray(e)?e.map(function(e){return t.cloneArrays(e)}):e},t.omit=function(e,t){if(null==t)return Object.assign({},e);Array.isArray(t)||(t=[t]);var r,n=Object.assign({},e),o=i(t);try{for(o.s();!(r=o.n()).done;)delete n[r.value]}catch(e){o.e(e)}finally{o.f()}return n},t.merge=function e(r,n,i,o){i=i||{};var a,s=Object.keys(n),c=0,l=s.length;n[j]&&(r[j]=n[j]),o=o||"";for(var u=i.omitNested||{};c<l;)if(a=s[c++],!(i.omit&&i.omit[a]||u[o]||S.has(a)))if(null==r[a])r[a]=n[a];else if(t.isObject(n[a])){if(t.isObject(r[a])||(r[a]={}),null!=n[a]){if(i.isDiscriminatorSchemaMerge&&(n[a].$isSingleNested&&r[a].$isMongooseDocumentArray||n[a].$isMongooseDocumentArray&&r[a].$isSingleNested))continue;if(n[a].instanceOfSchema){r[a].instanceOfSchema?_(r[a],n[a].clone(),i.isDiscriminatorSchemaMerge):r[a]=n[a].clone();continue}if(g(n[a],"ObjectId")){r[a]=new f(n[a]);continue}}e(r[a],n[a],i,o?o+"."+a:a)}else i.overwrite&&(r[a]=n[a]);return r},t.toObject=function e(n){var o;if(s||(s=r(8727)),null==n)return n;if(n instanceof s)return n.toObject();if(Array.isArray(n)){o=[];var a,c=i(n);try{for(c.s();!(a=c.n()).done;){var l=a.value;o.push(e(l))}}catch(e){c.e(e)}finally{c.f()}return o}if(t.isPOJO(n)){o={},n[j]&&(o[j]=n[j]);for(var u=0,f=Object.keys(n);u<f.length;u++){var d=f[u];S.has(d)||(o[d]=e(n[d]))}return o}return n},t.isObject=y,t.isPOJO=r(4673),t.isNonBuiltinObject=function(e){return!("object"!==a(e)||t.isNativeObject(e)||t.isMongooseType(e)||e instanceof c||null==e)},t.isNativeObject=function(e){return Array.isArray(e)||e instanceof Date||e instanceof Boolean||e instanceof Number||e instanceof String},t.isEmptyObject=function(e){return null!=e&&"object"===a(e)&&0===Object.keys(e).length},t.hasKey=function(e,r){for(var n=0,i=Object.keys(e);n<i.length;n++){var o=i[n];if(o===r||t.isPOJO(e[o])&&t.hasKey(e[o],r))return!0}return!1},t.tick=function(e){if("function"==typeof e)return function(){try{e.apply(this,arguments)}catch(e){p(function(){throw e})}}},t.isMongooseType=function(e){return g(e,"ObjectId")||g(e,"Decimal128")||e instanceof n},t.isMongooseObject=x,t.expires=function(e){e&&"Object"===e.constructor.name&&"expires"in e&&(e.expireAfterSeconds="string"!=typeof e.expires?e.expires:Math.round(l(e.expires)/1e3),delete e.expires)},t.populate=function(e,r,n,o,s,c,l,u){var f,p=null;if(1==arguments.length){if(e instanceof d)return e._docs=[],e._childDocs=[],[e];if(Array.isArray(e))return(f=[],e.forEach(function(e){k.test(e.path)?e.path.split(O).forEach(function(t){var r=Object.assign({},e);r.path=t,f.push(r)}):f.push(e)}),f).map(function(e){return t.populate(e)[0]});p=t.isObject(e)?Object.assign({},e):{path:e}}else p="object"===a(n)?{path:e,select:r,match:n,options:o}:{path:e,select:r,model:n,match:o,options:s,populate:c,justOne:l,count:u};if("string"!=typeof p.path)throw TypeError("utils.populate: invalid path. Expected string. Got typeof `"+a(e)+"`");return function(e){if(Array.isArray(e.populate)){var r=[];e.populate.forEach(function(e){if(k.test(e.path)){var n=Object.assign({},e);n.path.split(O).forEach(function(e){n.path=e,r.push(t.populate(n)[0])})}else r.push(t.populate(e)[0])}),e.populate=t.populate(r)}else null!=e.populate&&"object"===a(e.populate)&&(e.populate=t.populate(e.populate));var n=[],o=k.test(e.path)?e.path.split(O):[e.path];null!=e.options&&(e.options=h(e.options));var s,c=i(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;n.push(new d(Object.assign({},e,{path:l})))}}catch(e){c.e(e)}finally{c.f()}return n}(p)},t.getValue=function(e,t,r){return u.get(e,t,A,r)};var $=Object.freeze({getters:!1});function A(e,t){var r=(null==e?void 0:e._doc)||e;return null!=r&&r.isMongooseArrayProxy&&(r=r.__array),r instanceof Map?r.get(t,$):r[t]}t.setValue=function(e,t,r,n,i){u.set(e,t,r,"_doc",n,i)},t.object={},t.object.vals=function(e){for(var t=Object.keys(e),r=t.length,n=[];r--;)n.push(e[t[r]]);return n};var E=Object.prototype.hasOwnProperty;t.object.hasOwnProperty=function(e,t){return E.call(e,t)},t.isNullOrUndefined=function(e){return null==e},t.array={},t.array.flatten=function e(t,r,n){return n||(n=[]),t.forEach(function(t){Array.isArray(t)?e(t,r,n):r&&!r(t)||n.push(t)}),n};var N=Object.prototype.hasOwnProperty;t.hasUserDefinedProperty=function(e,r){if(null==e)return!1;if(Array.isArray(r)){var n,o=i(r);try{for(o.s();!(n=o.n()).done;){var s=n.value;if(t.hasUserDefinedProperty(e,s))return!0}}catch(e){o.e(e)}finally{o.f()}return!1}if(N.call(e,r))return!0;
2if("object"===a(e)&&r in e){var c=e[r];return c!==Object.prototype[r]&&c!==Array.prototype[r]}return!1},t.isArrayIndex=function(e){return"number"==typeof e?e>=0&&e<=0xffffffff:"string"==typeof e&&!!/^\d+$/.test(e)&&(e*=1)>=0&&e<=0xffffffff},t.array.unique=function(e){var t,r=new Set,n=new Set,o=[],a=i(e);try{for(a.s();!(t=a.n()).done;){var s=t.value;if("number"==typeof s||"string"==typeof s||null==s){if(r.has(s))continue;o.push(s),r.add(s)}else if(g(s,"ObjectId")){if(n.has(s.toString()))continue;o.push(s),n.add(s.toString())}else o.push(s)}}catch(e){a.e(e)}finally{a.f()}return o},t.buffer={},t.buffer.areEqual=function(e,t){if(!n.isBuffer(e)||!n.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;++r)if(e[r]!==t[r])return!1;return!0},t.getFunctionName=v,t.decorate=function(e,t){for(var r in t)S.has(r)||(e[r]=t[r])},t.mergeClone=function(e,r){x(r)&&(r=r.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1}));for(var i,o=Object.keys(r),a=o.length,s=0;s<a;)if(i=o[s++],!S.has(i))if(void 0===e[i])e[i]=h(r[i],{transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1});else{var c=r[i];if(null==c||!c.valueOf||c instanceof Date||(c=c.valueOf()),t.isObject(c)){var l=c;x(c)&&!c.isMongooseBuffer&&(l=l.toObject({transform:!1,virtuals:!1,depopulate:!0,getters:!1,flattenDecimals:!1})),c.isMongooseBuffer&&(l=n.from(l)),t.mergeClone(e[i],l)}else e[i]=h(c,{flattenDecimals:!1})}},t.each=function(e,t){var r,n=i(e);try{for(n.s();!(r=n.n()).done;)t(r.value)}catch(e){n.e(e)}finally{n.f()}},t.getOption=function(e){var t,r=i(Array.prototype.slice.call(arguments,1));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(null!=n&&null!=n[e])return n[e]}}catch(e){r.e(e)}finally{r.f()}return null},t.noop=function(){},t.errorToPOJO=function(e){if(!(e instanceof Error))throw Error("`error` must be `instanceof Error`.");var t,r={},n=i(Object.getOwnPropertyNames(e));try{for(n.s();!(t=n.n()).done;){var o=t.value;r[o]=e[o]}}catch(e){n.e(e)}finally{n.f()}return r},t.warn=function(e){return({env:{}}).emitWarning(e,{code:"MONGOOSE"})},t.injectTimestampsOption=function(e,t){null!=t&&(e.timestamps=t)}},459:(e,t,r)=>{"use strict";function n(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e){if(e){if("string"==typeof e)return i(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=r(6872);function a(e,t){this.path=t,this.getters=[],this.setters=[],this.options=Object.assign({},e)}a.prototype._applyDefaultGetters=function(){if(!(this.getters.length>0||this.setters.length>0)){var e="$"+this.path;this.getters.push(function(){return this.$locals[e]}),this.setters.push(function(t){this.$locals[e]=t})}},a.prototype.clone=function(){var e=new a(this.options,this.path);return e.getters=[].concat(this.getters),e.setters=[].concat(this.setters),e},a.prototype.get=function(e){return this.getters.push(e),this},a.prototype.set=function(e){return this.setters.push(e),this},a.prototype.applyGetters=function(e,t){o.hasUserDefinedProperty(this.options,["ref","refPath"])&&t.$$populatedVirtuals&&t.$$populatedVirtuals.hasOwnProperty(this.path)&&(e=t.$$populatedVirtuals[this.path]);var r,i=e,a=n(this.getters);try{for(a.s();!(r=a.n()).done;)i=r.value.call(t,i,this,t)}catch(e){a.e(e)}finally{a.f()}return i},a.prototype.applySetters=function(e,t){var r,i=e,o=n(this.setters);try{for(o.s();!(r=o.n()).done;)i=r.value.call(t,i,this,t)}catch(e){o.e(e)}finally{o.f()}return i},e.exports=a},7406:(e,t,r)=>{t.bignum=r(815),t.define=r(8721).define,t.base=r(6002),t.constants=r(4319),t.decoders=r(4049),t.encoders=r(6860)},8721:(e,t,r)=>{var n=r(7406),i=r(376);function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){var t;try{t=Object(function(){var e=Error("Cannot find module 'vm'");throw e.code="MODULE_NOT_FOUND",e}())("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return i(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},o.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},o.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},4989:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(376),o=r(6002).Reporter,a=r(365).Buffer;function s(e,t){o.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function c(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof c||(e=new c(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+n(e));this.value=e,this.length=e.length}}i(s,o),t.C=s,s.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},s.prototype.restore=function(e){var t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,o.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.R=c,c.prototype.join=function(e,t){return e||(e=new a(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},6002:(e,t,r)=>{t.Reporter=r(1269).b,t.DecoderBuffer=r(4989).C,t.EncoderBuffer=r(4989).R,t.Node=r(3304)},3304:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(6002).Reporter,o=r(6002).EncoderBuffer,a=r(6002).DecoderBuffer,s=r(1130),c=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(c);function u(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}
vendor: 9,139 bytes, line 2
2e.exports=u;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){var e=this._baseState,t={};f.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},u.prototype._wrap=function(){var e=this._baseState;l.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},u.prototype._init=function(e){var t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),s.equal(t.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(s(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!==n(e)||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0),t[e[r]]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){u.prototype[e]=function(){throw Error(e+" not implemented for encoding: "+this._baseState.enc)}}),c.forEach(function(e){u.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(r),this}}),u.prototype.use=function(e){s(e);var t=this._baseState;return s(null===t.use),t.use=e,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(e){var t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},u.prototype.explicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},u.prototype.implicit=function(e){var t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},u.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},u.prototype.key=function(e){var t=this._baseState;return s(null===t.key),t.key=e,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(e){var t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},u.prototype.contains=function(e){var t=this._baseState;return s(null===t.use),t.contains=e,this},u.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var n,i=r.default,o=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){var c=null;if(null!==r.explicit?c=r.explicit:null!==r.implicit?c=r.implicit:null!==r.tag&&(c=r.tag),null!==c||r.any){if(o=this._peekTag(e,c,r.any),e.isError(o))return o}else{var l=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(l)}}if(r.obj&&o&&(n=e.enterObject()),o){if(null!==r.explicit){var u=this._decodeTag(e,r.explicit);if(e.isError(u))return u;e=u}var f=e.offset;if(null===r.use&&null===r.choice){r.any&&(l=e.save());var d=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(d))return d;r.any?i=e.raw(l):e=d}if(t&&t.track&&null!==r.tag&&t.track(e.path(),f,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var h=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(h,t)}}return r.obj&&o&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},u.prototype._decodeGeneric=function(e,t,r){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},u.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},u.prototype._decodeChoice=function(e,t){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(o){var a=e.save(),s=r.choice[o];try{var c=s._decode(e,t);if(e.isError(c))return!1;n={type:o,value:c},i=!0}catch(t){return e.restore(a),!1}return!0},this),i?n:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function(e){return new o(e,this.reporter)},u.prototype._encode=function(e,t,r){var n=this._baseState;if(null===n.default||n.default!==e){var i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},u.prototype._encodeValue=function(e,t,r){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(e,t||new i);var a=null;if(this.reporter=t,o.optional&&void 0===e){if(null===o.default)return;e=o.default}var s=null,c=!1;if(o.any)a=this._createEncoderBuffer(e);else if(o.choice)a=this._encodeChoice(e,t);else if(o.contains)s=this._getUse(o.contains,r)._encode(e,t),c=!0;else if(o.children)s=o.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if("object"!==n(e))return t.error("Child expected, but input is not object");var o=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),o},this).filter(function(e){return e}),s=this._createEncoderBuffer(s);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return t.error("Too many args for : "+o.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var l=this.clone();l._baseState.implicit=null,s=this._createEncoderBuffer(e.map(function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)},l))}else null!==o.use?a=this._getUse(o.use,r)._encode(e,t):(s=this._encodePrimitive(o.tag,e),c=!0);if(!o.any&&null===o.choice){var u=null!==o.implicit?o.implicit:o.tag,f=null===o.implicit?"universal":"context";null===u?null===o.use&&t.error("Tag could be omitted only for .use()"):null===o.use&&(a=this._encodeComposite(u,c,f,s))}return null!==o.explicit&&(a=this._encodeComposite(o.explicit,!1,"context",a)),a},u.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},u.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw Error("Unsupported tag: "+e)},u.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},1269:(e,t,r)=>{var n=r(376);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.b=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof o;
vendor: 5,408 bytes, line 2
2if(t=n?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw Error(this.message)}catch(e){this.stack=e.stack}return this}},2007:(e,t,r)=>{var n=r(4319);t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n._reverse(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n._reverse(t.tag)},4319:(e,t,r)=>{t._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0),t[e[r]]=r}),t},t.der=r(2007)},4201:(e,t,r)=>{var n=r(376),i=r(7406),o=i.base,a=i.bignum,s=i.constants.der;function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){o.Node.call(this,"der",e)}function u(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var n=s.tagClass[r>>6],i=!(32&r);if(31&~r)r&=31;else{var o=r;for(r=0;!(128&~o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(!(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var a=e.readUInt8(r);if(e.isError(a))return a;n|=a}return n}e.exports=c,c.prototype.decode=function(e,t){return e instanceof o.DecoderBuffer||(e=new o.DecoderBuffer(e,t)),this.tree._decode(e,t)},n(l,o.Node),l.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var n=e.save(),i=u(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},l.prototype._decodeTag=function(e,t,r){var n=u(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var i=f(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},l.prototype._skipUntilEnd=function(e,t){for(;;){var r=u(e,t);if(e.isError(r))return r;var n,i=f(e,r.primitive,t);if(e.isError(i))return i;if(n=r.primitive||null!==i?e.skip(i):this._skipUntilEnd(e,t),e.isError(n))return n;if("end"===r.tagStr)break}},l.prototype._decodeList=function(e,t,r,n){for(var i=[];!e.isEmpty();){var o=this._peekTag(e,"end");if(e.isError(o))return o;var a=r.decode(e,"der",n);if(e.isError(a)&&o)break;i.push(a)}return i},l.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var n=e.raw();if(n.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===t){var a=e.raw().toString("ascii");return this._isNumstr(a)?a:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t||"objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},l.prototype._decodeObjid=function(e,t,r){for(var n,i=[],o=0;!e.isEmpty();){var a=e.readUInt8();o<<=7,o|=127&a,128&a||(i.push(o),o=0)}128&a&&i.push(o);var s=i[0]/40|0,c=i[0]%40;if(n=r?i:[s,c].concat(i.slice(1)),t){var l=t[n.join(" ")];void 0===l&&(l=t[n.join(".")]),void 0!==l&&(n=l)}return n},l.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),c=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),c=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,a,s,c,0)},l.prototype._decodeNull=function(e){return null},l.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},l.prototype._decodeInt=function(e,t){var r=new a(e.raw());return t&&(r=t[r.toString(10)]||r),r},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},4049:(e,t,r)=>{t.der=r(4201),t.pem=r(618)},618:(e,t,r)=>{var n=r(376),i=r(365).Buffer,o=r(4201);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,c=-1,l=0;l<r.length;l++){var u=r[l].match(a);
2if(null!==u&&u[2]===n){if(-1!==s){if("END"!==u[1])break;c=l;break}if("BEGIN"!==u[1])break;s=l}}if(-1===s||-1===c)throw Error("PEM section not found for: "+n);var f=r.slice(s+1,c).join("");f.replace(/[^a-z0-9\+\/=]+/gi,"");var d=new i(f,"base64");return o.prototype.decode.call(this,d,t)}},1889:(e,t,r)=>{var n=r(376),i=r(365).Buffer,o=r(7406),a=o.base,s=o.constants.der;function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){a.Node.call(this,"der",e)}function u(e){return e<10?"0"+e:e}e.exports=c,c.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(l,a.Node),l.prototype._encodeComposite=function(e,t,r,n){var o,a=function(e,t,r,n){var i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}return i>=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=s.tagClassByName[r||"universal"]<<6)}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var c=1,l=n.length;l>=256;l>>=8)c++;(o=new i(2+c))[0]=a,o[1]=128|c,l=1+c;for(var u=n.length;u>0;l--,u>>=8)o[l]=255&u;return this._createEncoderBuffer([o,n])},l.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},l.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e))for(e=e.slice(),n=0;n<e.length;n++)e[n]|=0;if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n<e.length;n++){var a=e[n];for(o++;a>=128;a>>=7)o++}var s=new i(o),c=s.length-1;for(n=e.length-1;n>=0;n--)for(a=e[n],s[c--]=127&a;(a>>=7)>0;)s[c--]=128|127&a;return this._createEncoderBuffer(s)},l.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[u(n.getFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(n.getFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},l.prototype._encodeNull=function(){return this._createEncoderBuffer("")},l.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},l.prototype._encodeBool=function(e){return this._createEncoderBuffer(255*!!e)},l.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},l.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;
2var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},6860:(e,t,r)=>{t.der=r(1889),t.pem=r(1610)},1610:(e,t,r)=>{var n=r(376),i=r(1889);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},9373:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}var o,a,s=r(9978).codes,c=s.ERR_AMBIGUOUS_ARGUMENT,l=s.ERR_INVALID_ARG_TYPE,u=s.ERR_INVALID_ARG_VALUE,f=s.ERR_INVALID_RETURN_VALUE,d=s.ERR_MISSING_ARGS,h=r(1935),p=r(8751).inspect,y=r(8751).types,b=y.isPromise,m=y.isRegExp,g=Object.assign,v=Object.is?Object.is:r(4710);function x(){var e=r(9015);o=e.isDeepEqual,a=e.isDeepStrictEqual}var w=!1,_=e.exports=O,S={};function j(e){if(e.message instanceof Error)throw e.message;throw new h(e)}function k(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new h({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function O(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];k.apply(void 0,[O,t.length].concat(t))}_.fail=function e(t,r,n,i,o){var a,s=arguments.length;if(0===s?a="Failed":1===s?(n=t,t=void 0):(!1===w&&(w=!0,(({env:{}}).emitWarning?({env:{}}).emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===s&&(i="!=")),n instanceof Error)throw n;var c={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:o||e};void 0!==n&&(c.message=n);var l=new h(c);throw a&&(l.message=a,l.generatedMessage=!0),l},_.AssertionError=h,_.ok=O,_.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&j({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},_.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&j({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},_.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&x(),o(t,r)||j({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},_.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&x(),o(t,r)&&j({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},_.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&x(),a(t,r)||j({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},_.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&x(),a(t,r)&&j({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},_.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");v(t,r)||j({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},_.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");v(t,r)&&j({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var $=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&m(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])})};function A(e,t,r,n){if("function"!=typeof t){if(m(t))return t.test(e);
2if(2==arguments.length)throw new l("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var s=new h({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw s.operator=n.name,s}var c=Object.keys(t);if(t instanceof Error)c.push("name","message");else if(0===c.length)throw new u("error",t,"may not be an empty object");return void 0===o&&x(),c.forEach(function(i){"string"==typeof e[i]&&m(t[i])&&t[i].test(e[i])||function(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new h({actual:new $(e,i),expected:new $(t,i,e),operator:"deepStrictEqual",stackStartFn:o});throw s.actual=e,s.expected=t,s.operator=o.name,s}j({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,i,r,c,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e){if("function"!=typeof e)throw new l("fn","Function",e);try{e()}catch(e){return e}return S}function N(e){return b(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function P(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!N(t=e()))throw new f("instance of Promise","promiseFn",t)}else{if(!N(e))throw new l("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return S}).catch(function(e){return e})})}function M(e,t,r,n){if("string"==typeof r){if(4==arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(t===S){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";j({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:e})}if(r&&!A(t,r,n,e))throw t}function D(e,t,r,n){if(t!==S){if("string"==typeof r&&(n=r,r=void 0),!r||A(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";j({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function I(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];k.apply(void 0,[I,t.length].concat(t))}_.throws=function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];M.apply(void 0,[e,E(t)].concat(n))},_.rejects=function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return P(t).then(function(t){return M.apply(void 0,[e,t].concat(n))})},_.doesNotThrow=function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,E(t)].concat(n))},_.doesNotReject=function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return P(t).then(function(t){return D.apply(void 0,[e,t].concat(n))})},_.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=p(t);var n=new h({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var s=n.stack.split("\n"),c=0;c<a.length;c++){var l=s.indexOf(a[c]);if(-1!==l){s=s.slice(0,l);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},_.strict=g(I,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict},1935:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return t&&("object"===u(t)||"function"==typeof t)?t:o(e)}function o(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return s(e,arguments,l(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function s(e,t,r){return(s=!function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&c(i,r.prototype),i}:Reflect.construct).apply(null,arguments)}
2function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){return(u="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}var f=r(8751).inspect,d=r(9978).codes.ERR_INVALID_ARG_TYPE;function h(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var p={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function y(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function b(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}e.exports=function(e){var t;function r(e){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),"object"!==u(e)||null===e)throw new d("options","Object",e);var t,n=e.message,a=e.operator,s=e.stackStartFn,c=e.actual,f=e.expected,m=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)t=i(this,l(r).call(this,String(n)));else if("object"===u(c)&&null!==c&&"object"===u(f)&&null!==f&&"stack"in c&&c instanceof Error&&"stack"in f&&f instanceof Error&&(c=y(c),f=y(f)),"deepStrictEqual"===a||"strictEqual"===a)t=i(this,l(r).call(this,function(e,t,r){var n="",i="",o=0,a="",s=!1,c=b(e),l=c.split("\n"),f=b(t).split("\n"),d=0,y="";if("strictEqual"===r&&"object"===u(e)&&"object"===u(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===f.length&&l[0]!==f[0]){var m=l[0].length+f[0].length;if(m<=10){if(("object"!==u(e)||null===e)&&("object"!==u(t)||null===t)&&(0!==e||0!==t))return"".concat(p[r],"\n\n")+"".concat(l[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&m<80){for(;l[0][d]===f[0][d];)d++;d>2&&(y="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var g=l[l.length-1],v=f[f.length-1];g===v&&(d++<2?a="\n ".concat(g).concat(a):n=g,l.pop(),f.pop(),0!==l.length&&0!==f.length);)g=l[l.length-1],v=f[f.length-1];var x=Math.max(l.length,f.length);if(0===x){var w=c.split("\n");if(w.length>30)for(w[26]="".concat("","...").concat("");w.length>27;)w.pop();return"".concat(p.notIdentical,"\n\n").concat(w.join("\n"),"\n")}d>3&&(a="\n".concat("","...").concat("").concat(a),s=!0),""!==n&&(a="\n ".concat(n).concat(a),n="");var _=0,S=p[r]+"\n".concat("","+ actual").concat(""," ").concat("","- expected").concat(""),j=" ".concat("","...").concat(""," Lines skipped");for(d=0;d<x;d++){var k=d-o;if(l.length<d+1)k>1&&d>2&&(k>4?(i+="\n".concat("","...").concat(""),s=!0):k>3&&(i+="\n ".concat(f[d-2]),_++),i+="\n ".concat(f[d-1]),_++),o=d,n+="\n".concat("","-").concat(""," ").concat(f[d]),_++;else if(f.length<d+1)k>1&&d>2&&(k>4?(i+="\n".concat("","...").concat(""),s=!0):k>3&&(i+="\n ".concat(l[d-2]),_++),i+="\n ".concat(l[d-1]),_++),o=d,i+="\n".concat("","+").concat(""," ").concat(l[d]),_++;else{var O=f[d],$=l[d],A=$!==O&&(!h($,",")||$.slice(0,-1)!==O);A&&h(O,",")&&O.slice(0,-1)===$&&(A=!1,$+=","),A?(k>1&&d>2&&(k>4?(i+="\n".concat("","...").concat(""),s=!0):k>3&&(i+="\n ".concat(l[d-2]),_++),i+="\n ".concat(l[d-1]),_++),o=d,i+="\n".concat("","+").concat(""," ").concat($),n+="\n".concat("","-").concat(""," ").concat(O),_+=2):(i+=n,n="",1!==k&&0!==d||(i+="\n ".concat($),_++))}if(_>20&&d<x-2)return"".concat(S).concat(j,"\n").concat(i,"\n").concat("","...").concat("").concat(n,"\n")+"".concat("","...").concat("")}
2return"".concat(S).concat(s?j:"","\n").concat(i).concat(n).concat(a).concat(y)}(c,f,a)));else if("notDeepStrictEqual"===a||"notStrictEqual"===a){var g=p[a],v=b(c).split("\n");if("notStrictEqual"===a&&"object"===u(c)&&null!==c&&(g=p.notStrictEqualObject),v.length>30)for(v[26]="".concat("","...").concat("");v.length>27;)v.pop();t=1===v.length?i(this,l(r).call(this,"".concat(g," ").concat(v[0]))):i(this,l(r).call(this,"".concat(g,"\n\n").concat(v.join("\n"),"\n")))}else{var x=b(c),w="",_=p[a];"notDeepEqual"===a||"notEqual"===a?(x="".concat(p[a],"\n\n").concat(x)).length>1024&&(x="".concat(x.slice(0,1021),"...")):(w="".concat(b(f)),x.length>512&&(x="".concat(x.slice(0,509),"...")),w.length>512&&(w="".concat(w.slice(0,509),"...")),"deepEqual"===a||"equal"===a?x="".concat(_,"\n\n").concat(x,"\n\nshould equal\n\n"):w=" ".concat(a," ").concat(w)),t=i(this,l(r).call(this,"".concat(x).concat(w)))}return Error.stackTraceLimit=m,t.generatedMessage=!n,Object.defineProperty(o(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=c,t.expected=f,t.operator=a,Error.captureStackTrace&&Error.captureStackTrace(o(t),s),t.stack,t.name="AssertionError",i(t)}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(r,e),t=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},t,{customInspect:!1,depth:0}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(a(Error))},9978:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s,c,l={};function u(e,t,r){r||(r=Error);var n=function(r){function n(r,a,s){var c,l;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),(c=(l=o(n).call(this,"string"==typeof t?t:t(r,a,s)))&&("object"===i(l)||"function"==typeof l)?l:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)).code=e,c}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,r),n}(r);l[e]=n}function f(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",function(e,t,n){if(void 0===s&&(s=r(9373)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&"not "===t.substr(0,4)?(o="must not be",t=t.replace(/^not /,"")):o="must be",(void 0===l||l>e.length)&&(l=e.length)," argument"===e.substring(l-9,l))a="The ".concat(e," ").concat(o," ").concat(f(t,"type"));else{var o,a,c,l,u=("number"!=typeof c&&(c=0),c+1>e.length||-1===e.indexOf(".",c)?"argument":"property");a='The "'.concat(e,'" ').concat(u," ").concat(o," ").concat(f(t,"type"))}return a+". Received type ".concat(i(n))},TypeError),u("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>
22&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=r(8751));var i=c.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",function(e,t,r){var n;return n=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(i(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(n,".")},TypeError),u("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(9373)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=l},9015:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(e){return(o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},c=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},l=Object.is?Object.is:r(4710),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(2191);function d(e){return e.call.bind(e)}var h=d(Object.prototype.hasOwnProperty),p=d(Object.prototype.propertyIsEnumerable),y=d(Object.prototype.toString),b=r(8751).types,m=b.isAnyArrayBuffer,g=b.isArrayBufferView,v=b.isDate,x=b.isMap,w=b.isRegExp,_=b.isSet,S=b.isNativeError,j=b.isBoxedPrimitive,k=b.isNumberObject,O=b.isStringObject,$=b.isBooleanObject,A=b.isBigIntObject,E=b.isSymbolObject,N=b.isFloat32Array,P=b.isFloat64Array;function M(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=0x100000000}function D(e){return Object.keys(e).filter(M).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function I(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)}function T(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==o(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==o(t)||null===e||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var i=y(e);if(i!==y(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var s=D(e),c=D(t);return s.length===c.length&&B(e,t,r,n,1,s)}if("[object Object]"===i&&(!x(e)&&x(t)||!_(e)&&_(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||!(a?e.source===t.source&&e.flags===t.flags:RegExp.prototype.toString.call(e)===RegExp.prototype.toString.call(t)))return!1}else if(S(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(g(e)){if(!r&&(N(e)||P(e))){if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1}else if(e.byteLength!==t.byteLength||0!==I(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))return!1;var u=D(e),d=D(t);return u.length===d.length&&B(e,t,r,n,0,u)}if(_(e))return!(!_(t)||e.size!==t.size)&&B(e,t,r,n,2);
2if(x(e))return!(!x(t)||e.size!==t.size)&&B(e,t,r,n,3);if(m(e)){if(e.byteLength!==t.byteLength||0!==I(new Uint8Array(e),new Uint8Array(t)))return!1}else if(j(e)&&(k(e)?!(k(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t))):O(e)?!O(t)||String.prototype.valueOf.call(e)!==String.prototype.valueOf.call(t):$(e)?!$(t)||Boolean.prototype.valueOf.call(e)!==Boolean.prototype.valueOf.call(t):A(e)?!A(t)||BigInt.prototype.valueOf.call(e)!==BigInt.prototype.valueOf.call(t):!E(t)||Symbol.prototype.valueOf.call(e)!==Symbol.prototype.valueOf.call(t)))return!1}return B(e,t,r,n,0)}function C(e,t){return t.filter(function(t){return p(e,t)})}function B(e,t,r,n,a,l){if(5==arguments.length){l=Object.keys(e);var f=Object.keys(t);if(l.length!==f.length)return!1}for(var d=0;d<l.length;d++)if(!h(t,l[d]))return!1;if(r&&5==arguments.length){var y=u(e);if(0!==y.length){var b=0;for(d=0;d<y.length;d++){var m=y[d];if(p(e,m)){if(!p(t,m))return!1;l.push(m),b++}else if(p(t,m))return!1}var g=u(t);if(y.length!==g.length&&C(t,g).length!==b)return!1}else{var v=u(t);if(0!==v.length&&0!==C(t,v).length)return!1}}if(0===l.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var x=n.val1.get(e);if(void 0!==x){var w=n.val2.get(t);if(void 0!==w)return x===w}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var _=function(e,t,r,n,a,l){var u=0;if(2===l){if(!function(e,t,r,n){for(var i=null,a=s(e),c=0;c<a.length;c++){var l=a[c];if("object"===o(l)&&null!==l)null===i&&(i=new Set),i.add(l);else if(!t.has(l)){if(r||!function(e,t,r){var n=L(r);return null!=n?n:t.has(n)&&!e.has(n)}(e,t,l))return!1;null===i&&(i=new Set),i.add(l)}}if(null!==i){for(var u=s(t),f=0;f<u.length;f++){var d=u[f];if("object"===o(d)&&null!==d){if(!R(i,d,r,n))return!1}else if(!r&&!e.has(d)&&!R(i,d,r,n))return!1}return 0===i.size}return!0}(e,t,r,a))return!1}else if(3===l){if(!function(e,t,r,n){for(var a=null,s=c(e),l=0;l<s.length;l++){var u=i(s[l],2),f=u[0],d=u[1];if("object"===o(f)&&null!==f)null===a&&(a=new Set),a.add(f);else{var h=t.get(f);if(void 0===h&&!t.has(f)||!T(d,h,r,n)){if(r||!function(e,t,r,n,i){var o=L(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!T(n,a,!1,i))&&!e.has(o)&&T(n,a,!1,i)}(e,t,f,d,n))return!1;null===a&&(a=new Set),a.add(f)}}}if(null!==a){for(var p=c(t),y=0;y<p.length;y++){var b=i(p[y],2),m=(f=b[0],b[1]);if("object"===o(f)&&null!==f){if(!z(a,e,f,m,r,n))return!1}else if(!(r||e.has(f)&&T(e.get(f),m,!1,n)||z(a,e,f,m,!1,n)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(1===l)for(;u<e.length;u++){if(!h(e,u)){if(h(t,u))return!1;for(var f=Object.keys(e);u<f.length;u++){var d=f[u];if(!h(t,d)||!T(e[d],t[d],r,a))return!1}return f.length===Object.keys(t).length}if(!h(t,u)||!T(e[u],t[u],r,a))return!1}for(u=0;u<n.length;u++){var p=n[u];if(!T(e[p],t[p],r,a))return!1}return!0}(e,t,r,l,n,a);return n.val1.delete(e),n.val2.delete(t),_}function R(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(T(t,a,r,n))return e.delete(a),!0}return!1}function L(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e*=1;case"number":if(f(e))return!1}return!0}function z(e,t,r,n,i,o){for(var a=s(e),c=0;c<a.length;c++){var l=a[c];if(T(r,l,i,o)&&T(n,t.get(l),i,o))return e.delete(l),!0}return!1}e.exports={isDeepEqual:function(e,t){return T(e,t,!1)},isDeepStrictEqual:function(e,t){return T(e,t,!0)}}},7943:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=s(e),a=o[0],c=o[1],l=new i(3*(a+c)/4-c),u=0,f=c>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(function(e,t,n){for(var i,o=[],a=t;a<n;a+=3)o.push(r[(i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]))>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,a,a+16383>
2s?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return -1===r&&(r=t),[r,r===t?0:4-r%4]}n[45]=62,n[95]=63},815:function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"use strict";function i(e,t){if(!e)throw Error(t||"Assertion failed")}function o(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"===n(e)?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{d="u">typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function c(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,n){for(var o=0,a=0,s=Math.min(e.length,r),c=t;c<s;c++){var l=e.charCodeAt(c)-48;o*=n,a=l>=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&a<n,"Invalid character"),o+=a}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(a.isBN=function(e){return e instanceof a||null!==e&&"object"===n(e)&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return 0>e.cmp(t)?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"===n(e))return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,r):(this._parseBase(e,t,o),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(i(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&0x3ffffff,this.words[o+1]=a>>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&0x3ffffff,this.words[o+1]=a>>>26-s&0x3ffffff,(s+=24)>=26&&(s-=26,o++);return this._strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[a]|=0x3ffffff&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[a]|=0x3ffffff&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=0x3ffffff;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,u=r;u<s;u+=n)c=l(e,u,u+n,t),this.imuln(i),this.words[0]+c<0x4000000?this.words[0]+=c:this._iaddn(c);if(0!==a){var f=1;for(c=l(e,u,e.length,t),u=0;u<a;u++)f*=t;this.imuln(f),this.words[0]+c<0x4000000?this.words[0]+=c:this._iaddn(c)}this._strip()},a.prototype.copy=function(e){e.words=Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype._move=function(e){u(e,this)},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d,h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,0x2000000,0x290d741,0x1000000,
vendor: 11,230 bytes, line 2
20x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function b(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=0x3ffffff&a,c=a/0x4000000|0;r.words[0]=s;for(var l=1;l<n;l++){for(var u=c>>>26,f=0x3ffffff&c,d=Math.min(l,t.length-1),h=Math.max(0,l-e.length+1);h<=d;h++){var p=l-h|0;u+=(a=(i=0|e.words[p])*(o=0|t.words[h])+f)/0x4000000|0,f=0x3ffffff&a}r.words[l]=0|f,c=0|u}return 0!==c?r.words[l]=0|c:r.length--,r._strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],c=(0xffffff&(s<<n|o)).toString(16);o=s>>>24-n&0xffffff,(n+=2)>=26&&(n-=26,a--),r=0!==o||a!==this.length-1?h[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],u=y[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var d=f.modrn(u).toString(e);r=(f=f.idivn(u)).isZero()?d+r:h[l-d.length]+d+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},d&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(d,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=e.allocUnsafe?e.allocUnsafe(o):new e(o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},a.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},a.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},a.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},a.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=0x3ffffff&~this.words[n];for(r>0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-r,n++);n<this.length;n++)this.words[n]=0;return this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=0x3ffffff&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=0x3ffffff&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=0x3ffffff&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=0x3ffffff&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,o,a=e.words,s=t.words,c=r.words,l=0,u=0|a[0],f=8191&u,d=u>>>13,h=0|a[1],p=8191&h,y=h>>>13,b=0|a[2],m=8191&b,g=b>>>13,v=0|a[3],x=8191&v,w=v>>>13,_=0|a[4],S=8191&_,j=_>>>13,k=0|a[5],O=8191&k,$=k>>>13,A=0|a[6],E=8191&A,N=A>>>13,P=0|a[7],M=8191&P,D=P>>>13,I=0|a[8],T=8191&I,C=I>>>13,B=0|a[9],R=8191&B,L=B>>>13,z=0|s[0],F=8191&z,U=z>>>13,q=0|s[1],V=8191&q,K=q>>>13,H=0|s[2],W=8191&H,J=H>>>13,G=0|s[3],Y=8191&G,X=G>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,et=0|s[5],er=8191&et,en=et>>>13,ei=0|s[6],eo=8191&ei,ea=ei>>>13,es=0|s[7],ec=8191&es,el=es>>>13,eu=0|s[8],ef=8191&eu,ed=eu>>>13,eh=0|s[9],ep=8191&eh,ey=eh>>>13;r.negative=e.negative^t.negative,r.length=19;var eb=(l+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,U))+Math.imul(d,F)|0))<<13)|0;l=((o=Math.imul(d,U))+(i>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,n=Math.imul(p,F),i=(i=Math.imul(p,U))+Math.imul(y,F)|0,o=Math.imul(y,U);var em=(l+(n=n+Math.imul(f,V)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(d,V)|0))<<13)|0;l=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,n=Math.imul(m,F),i=(i=Math.imul(m,U))+Math.imul(g,F)|0,o=Math.imul(g,U),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,K)|0;var eg=(l+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,J)|0)+Math.imul(d,W)|0))<<13)|0;l=((o=o+Math.imul(d,J)|0)+(i>>>13)|0)+(eg>>>26)|0,eg&=0x3ffffff,n=Math.imul(x,F),i=(i=Math.imul(x,U))+Math.imul(w,F)|0,o=Math.imul(w,U),n=n+Math.imul(m,V)|0,i=(i=i+Math.imul(m,K)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0;var ev=(l+(n=n+Math.imul(f,Y)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(d,Y)|0))<<13)|0;l=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,n=Math.imul(S,F),i=(i=Math.imul(S,U))+Math.imul(j,F)|0,o=Math.imul(j,U),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,X)|0;var ex=(l+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(d,Z)|0))<<13)|0;l=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,n=Math.imul(O,F),i=(i=Math.imul(O,U))+Math.imul($,F)|0,o=Math.imul($,U),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,J)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0;var ew=(l+(n=n+Math.imul(f,er)|0)|0)+((8191&(i=(i=i+Math.imul(f,en)|0)+Math.imul(d,er)|0))<<13)|0;l=((o=o+Math.imul(d,en)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,n=Math.imul(E,F),i=(i=Math.imul(E,U))+Math.imul(N,F)|0,o=Math.imul(N,U),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul($,V)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,X)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(y,er)|0,o=o+Math.imul(y,en)|0;var e_=(l+(n=n+Math.imul(f,eo)|0)|0)+((8191&(i=(i=i+Math.imul(f,ea)|0)+Math.imul(d,eo)|0))<<13)|0;l=((o=o+Math.imul(d,ea)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,n=Math.imul(M,F),i=(i=Math.imul(M,U))+Math.imul(D,F)|0,o=Math.imul(D,U),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul($,W)|0,o=o+Math.imul($,J)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(j,Y)|0,o=o+Math.imul(j,
vendor: 7,211 bytes, line 2
2X)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,ee)|0,n=n+Math.imul(m,er)|0,i=(i=i+Math.imul(m,en)|0)+Math.imul(g,er)|0,o=o+Math.imul(g,en)|0,n=n+Math.imul(p,eo)|0,i=(i=i+Math.imul(p,ea)|0)+Math.imul(y,eo)|0,o=o+Math.imul(y,ea)|0;var eS=(l+(n=n+Math.imul(f,ec)|0)|0)+((8191&(i=(i=i+Math.imul(f,el)|0)+Math.imul(d,ec)|0))<<13)|0;l=((o=o+Math.imul(d,el)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,n=Math.imul(T,F),i=(i=Math.imul(T,U))+Math.imul(C,F)|0,o=Math.imul(C,U),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul($,Y)|0,o=o+Math.imul($,X)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(x,er)|0,i=(i=i+Math.imul(x,en)|0)+Math.imul(w,er)|0,o=o+Math.imul(w,en)|0,n=n+Math.imul(m,eo)|0,i=(i=i+Math.imul(m,ea)|0)+Math.imul(g,eo)|0,o=o+Math.imul(g,ea)|0,n=n+Math.imul(p,ec)|0,i=(i=i+Math.imul(p,el)|0)+Math.imul(y,ec)|0,o=o+Math.imul(y,el)|0;var ej=(l+(n=n+Math.imul(f,ef)|0)|0)+((8191&(i=(i=i+Math.imul(f,ed)|0)+Math.imul(d,ef)|0))<<13)|0;l=((o=o+Math.imul(d,ed)|0)+(i>>>13)|0)+(ej>>>26)|0,ej&=0x3ffffff,n=Math.imul(R,F),i=(i=Math.imul(R,U))+Math.imul(L,F)|0,o=Math.imul(L,U),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(C,V)|0,o=o+Math.imul(C,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,J)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul($,Z)|0,o=o+Math.imul($,ee)|0,n=n+Math.imul(S,er)|0,i=(i=i+Math.imul(S,en)|0)+Math.imul(j,er)|0,o=o+Math.imul(j,en)|0,n=n+Math.imul(x,eo)|0,i=(i=i+Math.imul(x,ea)|0)+Math.imul(w,eo)|0,o=o+Math.imul(w,ea)|0,n=n+Math.imul(m,ec)|0,i=(i=i+Math.imul(m,el)|0)+Math.imul(g,ec)|0,o=o+Math.imul(g,el)|0,n=n+Math.imul(p,ef)|0,i=(i=i+Math.imul(p,ed)|0)+Math.imul(y,ef)|0,o=o+Math.imul(y,ed)|0;var ek=(l+(n=n+Math.imul(f,ep)|0)|0)+((8191&(i=(i=i+Math.imul(f,ey)|0)+Math.imul(d,ep)|0))<<13)|0;l=((o=o+Math.imul(d,ey)|0)+(i>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,n=Math.imul(R,V),i=(i=Math.imul(R,K))+Math.imul(L,V)|0,o=Math.imul(L,K),n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,J)|0,n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,er)|0,i=(i=i+Math.imul(O,en)|0)+Math.imul($,er)|0,o=o+Math.imul($,en)|0,n=n+Math.imul(S,eo)|0,i=(i=i+Math.imul(S,ea)|0)+Math.imul(j,eo)|0,o=o+Math.imul(j,ea)|0,n=n+Math.imul(x,ec)|0,i=(i=i+Math.imul(x,el)|0)+Math.imul(w,ec)|0,o=o+Math.imul(w,el)|0,n=n+Math.imul(m,ef)|0,i=(i=i+Math.imul(m,ed)|0)+Math.imul(g,ef)|0,o=o+Math.imul(g,ed)|0;var eO=(l+(n=n+Math.imul(p,ep)|0)|0)+((8191&(i=(i=i+Math.imul(p,ey)|0)+Math.imul(y,ep)|0))<<13)|0;l=((o=o+Math.imul(y,ey)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,n=Math.imul(R,W),i=(i=Math.imul(R,J))+Math.imul(L,W)|0,o=Math.imul(L,J),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(E,er)|0,i=(i=i+Math.imul(E,en)|0)+Math.imul(N,er)|0,o=o+Math.imul(N,en)|0,n=n+Math.imul(O,eo)|0,i=(i=i+Math.imul(O,ea)|0)+Math.imul($,eo)|0,o=o+Math.imul($,ea)|0,n=n+Math.imul(S,ec)|0,i=(i=i+Math.imul(S,el)|0)+Math.imul(j,ec)|0,o=o+Math.imul(j,el)|0,n=n+Math.imul(x,ef)|0,i=(i=i+Math.imul(x,ed)|0)+Math.imul(w,ef)|0,o=o+Math.imul(w,ed)|0;var e$=(l+(n=n+Math.imul(m,ep)|0)|0)+((8191&(i=(i=i+Math.imul(m,ey)|0)+Math.imul(g,ep)|0))<<13)|0;l=((o=o+Math.imul(g,ey)|0)+(i>>>13)|0)+(e$>>>26)|0,e$&=0x3ffffff,n=Math.imul(R,Y),i=(i=Math.imul(R,X))+Math.imul(L,Y)|0,o=Math.imul(L,X),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(M,er)|0,i=(i=i+Math.imul(M,en)|0)+Math.imul(D,er)|0,o=o+Math.imul(D,en)|0,n=n+Math.imul(E,eo)|0,i=(i=i+Math.imul(E,ea)|0)+Math.imul(N,eo)|0,o=o+Math.imul(N,ea)|0,n=n+Math.imul(O,ec)|0,i=(i=i+Math.imul(O,el)|0)+Math.imul($,ec)|0,o=o+Math.imul($,el)|0,n=n+Math.imul(S,ef)|0,i=(i=i+Math.imul(S,ed)|0)+Math.imul(j,ef)|0,o=o+Math.imul(j,ed)|0;var eA=(l+(n=n+Math.imul(x,ep)|0)|0)+((8191&(i=(i=i+Math.imul(x,ey)|0)+Math.imul(w,ep)|0))<<13)|0;l=((o=o+Math.imul(w,ey)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,n=Math.imul(R,Z),i=(i=Math.imul(R,ee))+Math.imul(L,Z)|0,o=Math.imul(L,ee),n=n+Math.imul(T,er)|0,i=(i=i+Math.imul(T,en)|0)+Math.imul(C,er)|0,o=o+Math.imul(C,en)|0,n=n+Math.imul(M,eo)|0,i=(i=i+Math.imul(M,ea)|0)+Math.imul(D,eo)|0,o=o+Math.imul(D,ea)|0,n=n+Math.imul(E,ec)|0,i=(i=i+Math.imul(E,el)|0)+Math.imul(N,ec)|0,o=o+Math.imul(N,el)|0,n=n+Math.imul(O,ef)|0,i=(i=i+Math.imul(O,ed)|0)+Math.imul($,ef)|0,o=o+Math.imul($,ed)|0;var eE=(l+(n=n+Math.imul(S,ep)|0)|0)+((8191&(i=(i=i+Math.imul(S,ey)|0)+Math.imul(j,ep)|0))<<13)|0;l=((o=o+Math.imul(j,ey)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,n=Math.imul(R,er),i=(i=Math.imul(R,en))+Math.imul(L,er)|0,o=Math.imul(L,en),n=n+Math.imul(T,eo)|0,i=(i=i+Math.imul(T,ea)|0)+Math.imul(C,eo)|0,o=o+Math.imul(C,ea)|0,n=n+Math.imul(M,ec)|0,i=(i=i+Math.imul(M,el)|0)+Math.imul(D,ec)|0,o=o+Math.imul(D,el)|0,n=n+Math.imul(E,ef)|0,i=(i=i+Math.imul(E,ed)|0)+Math.imul(N,ef)|0,o=o+Math.imul(N,ed)|0;var eN=(l+(n=n+Math.imul(O,ep)|0)|0)+((8191&(i=(i=i+Math.imul(O,ey)|0)+Math.imul($,ep)|0))<<13)|0;l=((o=o+Math.imul($,ey)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,n=Math.imul(R,eo),i=(i=Math.imul(R,ea))+Math.imul(L,eo)|0,o=Math.imul(L,ea),n=n+Math.imul(T,ec)|0,i=(i=i+Math.imul(T,el)|0)+Math.imul(C,ec)|0,o=o+Math.imul(C,el)|0,n=n+Math.imul(M,ef)|0,i=(i=i+Math.imul(M,ed)|0)+Math.imul(D,ef)|0,o=o+Math.imul(D,ed)|0;var eP=(l+(n=n+Math.imul(E,ep)|0)|0)+((8191&(i=(i=i+Math.imul(E,ey)|0)+Math.imul(N,ep)|0))<<13)|0;l=((o=o+Math.imul(N,ey)|0)+(i>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,n=Math.imul(R,ec),i=(i=Math.imul(R,el))+Math.imul(L,ec)|0,o=Math.imul(L,el),n=n+Math.imul(T,ef)|0,i=(i=i+Math.imul(T,ed)|0)+Math.imul(C,ef)|0,o=o+Math.imul(C,ed)|0;var eM=(l+(n=n+Math.imul(M,ep)|0)|0)+((8191&(i=(i=i+Math.imul(M,ey)|0)+Math.imul(D,ep)|0))<<13)|0;l=((o=o+Math.imul(D,ey)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,n=Math.imul(R,ef),i=(i=Math.imul(R,ed))+Math.imul(L,ef)|0,o=Math.imul(L,ed);var eD=(l+(n=n+Math.imul(T,ep)|0)|0)+((8191&(i=(i=i+Math.imul(T,ey)|0)+Math.imul(C,ep)|0))<<13)|0;l=((o=o+Math.imul(C,ey)|0)+(i>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff;var eI=(l+(n=Math.imul(R,ep))|0)+((8191&(i=(i=Math.imul(R,ey))+Math.imul(L,ep)|0))<<13)|0;return l=((o=Math.imul(L,ey))+(i>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,c[0]=eb,c[1]=em,c[2]=eg,c[3]=ev,c[4]=ex,c[5]=ew,c[6]=e_,c[7]=eS,c[8]=ej,c[9]=ek,c[10]=eO,c[11]=e$,c[12]=eA,c[13]=eE,c[14]=eN,c[15]=eP,c[16]=eM,c[17]=eD,c[18]=eI,0!==l&&(c[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=0x3ffffff&n,c=Math.min(o,t.length-1),l=Math.max(0,o-e.length+1);l<=c;l++){var u=o-l,f=(0|e.words[u])*(0|t.words[l]),d=0x3ffffff&f;s=0x3ffffff&(d=d+s|0),i+=(a=(a=a+(f/0x4000000|0)|0)+(d>>>
vendor: 5,435 bytes, line 2
226)|0)>>>26,a&=0x3ffffff}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function v(e,t){this.x=e,this.y=t}Math.imul||(m=b),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?b(this,e,t):(r<1024,g(this,e,t))},v.prototype.makeRBT=function(e){for(var t=Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},v.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,c=Math.cos(2*Math.PI/s),l=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var f=c,d=l,h=0;h<a;h++){var p=r[u+h],y=n[u+h],b=r[u+h+a],m=n[u+h+a],g=f*b-d*m;m=f*m+d*b,b=g,r[u+h]=p+b,n[u+h]=y+m,r[u+h+a]=p-b,n[u+h+a]=y-m,h!==s&&(g=c*f-l*d,d=c*d+l*f,f=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=0x3ffffff&i,r=i<0x4000000?0:i/0x4000000|0}return e},v.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(!(-8192&o))},v.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=Array(n),s=Array(n),c=Array(n),l=Array(n),u=Array(n),f=Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,l,n),this.transform(a,o,s,c,n,i),this.transform(l,o,u,f,n,i);for(var h=0;h<n;h++){var p=s[h]*u[h]-c[h]*f[h];c[h]=s[h]*f[h]+c[h]*u[h],s[h]=p}return this.conjugate(s,c,n),this.transform(s,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=Array(this.length+e.length),g(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){var t=e<0;t&&(e=-e),i("number"==typeof e),i(e<0x4000000);for(var r=0,n=0;n<this.length;n++){var o=(0|this.words[n])*e,a=(0x3ffffff&o)+(0x3ffffff&r);r>>=26,r+=(o/0x4000000|0)+(a>>>26),this.words[n]=0x3ffffff&a}return 0!==r&&(this.words[n]=r,this.length++),0===e&&(this.length=1,this._normSign()),t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=0x3ffffff>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,c=(0|this.words[t])-s<<r;this.words[t]=c|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},a.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var n,o=e%26,a=Math.min((e-o)/26,this.length),s=0x3ffffff^0x3ffffff>>>o<<o;if(n-=a,n=Math.max(0,n),r){for(var c=0;c<a;c++)r.words[c]=this.words[c];r.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=n);c--){var u=0|this.words[c];this.words[c]=l<<26-o|u>>>o,l=u&s}return r&&0!==l&&(r.words[r.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r||!(this.words[r]&1<<t))},a.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<<t),0===this.length&&(this.words[0]=0,this.length=1),this._strip())},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return i("number"==typeof e),i(e<0x4000000),e<0?this.isubn(-e):0!==this.negative?(1===this.length&&(0|this.words[0])<=e?
vendor: 6,119 bytes, line 2
2(this.words[0]=e-(0|this.words[0]),this.negative=0):(this.negative=0,this.isubn(e),this.negative=1),this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=0x4000000;t++)this.words[t]-=0x4000000,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(i("number"==typeof e),i(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=0x4000000,this.words[t+1]-=1;return this._strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var c=(0|e.words[n])*t;s=((o-=0x3ffffff&c)>>26)-(c/0x4000000|0),this.words[n+r]=0x3ffffff&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=0x3ffffff&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=0x3ffffff&o;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new a(null)).length=c+1,s.words=Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var u=n.clone()._ishlnsubmul(i,1,c);0===u.negative&&(n=u,s&&(s.words[c]=1));for(var f=c-1;f>=0;f--){var d=0x4000000*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(d=Math.min(d/o|0,0x3ffffff),n._ishlnsubmul(i,d,f);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){var n,o,s;return i(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t)},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.mod.abs(),n=e.abs().iushrn(1),i=1&e.words[0],o=r.cmp(n);if(o<0||1===i&&0===o)return t.div;var s=new a(1);return s.negative=this.negative^e.negative,t.div.iadd(s)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=0x3ffffff);for(var r=0x4000000%e,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%e;return t?-n:n},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=0x3ffffff);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+0x4000000*r;this.words[n]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new a(1),o=new a(0),s=new a(0),c=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var u=r.clone(),f=t.clone();!t.isZero();){for(var d=0,h=1;0==(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var p=0,y=1;0==(r.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(u),c.isub(f)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),o.isub(c)):(r.isub(t),s.isub(n),c.isub(o))}return{a:s,b:c,gcd:r.iushln(l)}},a.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new a(1),s=new a(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return 0>(n=0===t.cmpn(1)?o:s).cmpn(0)&&n.iadd(e),n},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=0x3ffffff,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;
vendor: 12,896 bytes, line 2
2if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return -1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return -1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return -1===this.cmpn(e)},a.prototype.lt=function(e){return -1===this.cmp(e)},a.prototype.lten=function(e){return 0>=this.cmpn(e)},a.prototype.lte=function(e){return 0>=this.cmp(e)},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new O(e)},a.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var x={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function j(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function $(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new a(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n)var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},o(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=0x3ffffff&t,t=64*n+(t/0x4000000|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},o(S,w),o(j,w),o(k,w),k.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=0x3ffffff&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){var t;if(x[e])return x[e];if("k256"===e)t=new _;else if("p224"===e)t=new S;else if("p192"===e)t=new j;else{if("p25519"!==e)throw Error("Unknown prime "+e);t=new k}return x[e]=t,t},O.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var s=new a(1).toRed(this),c=s.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var f=this.pow(u,n),d=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),p=o;0!==h.cmp(s);){for(var y=h,b=0;0!==y.cmp(s);b++)y=y.redSqr();i(b<p);var m=this.pow(f,new a(1).iushln(p-b-1));d=d.redMul(m),f=m.redSqr(),h=h.redMul(f),p=b}return d},O.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},O.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var f=l>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4==++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}c=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new $(e)},o($,O),$.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},$.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},$.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},$.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},$.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7179:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){this.rand=e}if(e.exports=function(e){return o||(o=new i(null)),o.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"===("u"<typeof self?"undefined":n(self)))self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"===("u"<typeof window?"undefined":n(window))&&(i.prototype._rand=function(){throw Error("Not implemented yet")});else try{var o,a=r(9214);if("function"!=typeof a.randomBytes)throw Error("Not supported");i.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},7463:(e,t,r)=>{var n=r(9047).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,n,i){for(var o,a,s,c,l=r[0],u=r[1],f=r[2],d=r[3],h=e[0]^t[0],p=e[1]^t[1],y=e[2]^t[2],b=e[3]^t[3],m=4,g=1;g<i;g++)o=l[h>>>24]^u[p>>>16&255]^f[y>>>8&255]^d[255&b]^t[m++],a=l[p>>>24]^u[y>>>16&255]^f[b>>>8&255]^d[255&h]^t[m++],s=l[y>>>24]^u[b>>>16&255]^f[h>>>8&255]^d[255&p]^t[m++],c=l[b>>>24]^u[h>>>16&255]^f[p>>>8&255]^d[255&y]^t[m++],h=o,p=a,y=s,b=c;return o=(n[h>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&b])^t[m++],[o>>>=0,a=((n[p>>>24]<<24|n[y>>>16&255]<<16|n[b>>>8&255]<<8|n[255&h])^t[m++])>>>0,s=((n[y>>>24]<<24|n[b>>>16&255]<<16|n[h>>>8&255]<<8|n[255&p])^t[m++])>>>0,c=((n[b>>>24]<<24|n[h>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^t[m++])>>>0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var l=s^s<<1^s<<2^s<<3^s<<4;l=l>>>8^255&l^99,r[a]=l,n[l]=a;var u=e[a],f=e[u],d=e[f],h=257*e[l]^0x1010100*l;i[0][a]=h<<24|h>>>8,i[1][a]=h<<16|h>>>16,i[2][a]=h<<8|h>>>24,i[3][a]=h,h=0x1010101*d^65537*f^257*u^0x1010100*a,o[0][l]=h<<24|h>>>8,o[1][l]=h<<16|h>>>16,o[2][l]=h<<8|h>>>24,o[3][l]=h,0===a?a=s=1:(a=u^e[e[e[d^u]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function l(e){this._key=i(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o<t;o++)i[o]=e[o];for(o=t;o<n;o++){var a=i[o-1];o%t==0?(a=a<<8|a>>>24,a=(c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a])^s[o/t|0]<<24):t>6&&o%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),i[o]=i[o-t]^a}for(var l=[],u=0;u<n;u++){var f=n-u,d=i[f-(u%4?0:4)];l[u]=u<4||f<=4?d:c.INV_SUB_MIX[0][c.SBOX[d>>>24]]^c.INV_SUB_MIX[1][c.SBOX[d>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[d>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nR
2ounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},l.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},l.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=l},3499:(e,t,r)=>{var n=r(7463),i=r(9047).Buffer,o=r(8842),a=r(376),s=r(1225),c=r(5176),l=r(4001);function u(e,t,r,a){o.call(this);var c=i.alloc(4,0);this._cipher=new n.AES(t);var u=this._cipher.encryptBlock(c);this._ghash=new s(u),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new s(r),o=t.length,a=o%16;n.update(t),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var c=i.alloc(8);c.writeUIntBE(8*o,0,8),n.update(c),e._finID=n.state;var u=i.from(e._finID);return l(u),u}(this,r,u),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(u,o),u.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},u.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw Error("Attempting to get auth tag in unsupported state");return this._authTag},u.prototype.setAuthTag=function(e){if(!this._decrypt)throw Error("Attempting to set auth tag in unsupported state");this._authTag=e},u.prototype.setAAD=function(e){if(this._called)throw Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=u},4881:(e,t,r)=>{var n=r(8613),i=r(7909),o=r(4946);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},7909:(e,t,r)=>{var n=r(3499),i=r(9047).Buffer,o=r(6572),a=r(7188),s=r(8842),c=r(7463),l=r(1248);function u(e,t,r){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new c.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var s=o[e.toLowerCase()];if(!s)throw TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new u(s.module,t,r)}r(376)(u,s),u.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding){var t=this._mode.decrypt(this,e),r=t[15];if(r<1||r>16)throw Error("unable to decrypt data");for(var n=-1;++n<r;)if(t[n+(16-r)]!==r)throw Error("unable to decrypt data");return 16!==r?t.slice(0,16-r):void 0}if(e)throw Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw TypeError("invalid suite type");var n=l(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},8613:(e,t,r)=>{var n=r(6572),i=r(3499),o=r(9047).Buffer,a=r(7188),s=r(8842),c=r(7463),l=r(1248);function u(e,t,r){s.call(this),this._cache=new d,this._cipher=new c.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(376)(u,s),u.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function d(){this.cache=o.allocUnsafe(0)}function h(e,t,r){var s=n[e.toLowerCase()];if(!s)throw TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new u(s.module,t,r)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=o.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=h,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw TypeError("invalid suite type");var i=l(t,!1,r.key,r.iv);
2return h(e,i.key,i.iv)}},1225:(e,t,r)=>{var n=r(9047).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(this.state[~~(a/8)]&1<<7-a%8&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=!!(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=-0x1f000000^n[0])}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},4001:e=>{e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},9628:(e,t,r)=>{var n=r(5176);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;return e._prev=t,n(e._cipher.decryptBlock(t),r)}},6674:(e,t,r)=>{var n=r(9047).Buffer,i=r(5176);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,o(e,t,r)]);break}i=e._cache.length,a=n.concat([a,o(e,t.slice(0,i),r)]),t=t.slice(i)}return a}},9971:(e,t,r)=>{var n=r(9047).Buffer;t.encrypt=function(e,t,r){for(var i=t.length,o=n.allocUnsafe(i),a=-1;++a<i;)o[a]=function(e,t,r){for(var i,o,a=-1,s=0;++a<8;)i=t&1<<7-a?128:0,s+=(128&(o=e._cipher.encryptBlock(e._prev)[0]^i))>>a%8,e._prev=function(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}(e._prev,r?i:o);return s}(e,t[a],r);return o}},8194:(e,t,r)=>{var n=r(9047).Buffer;t.encrypt=function(e,t,r){for(var i=t.length,o=n.allocUnsafe(i),a=-1;++a<i;)o[a]=function(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}(e,t[a],r);return o}},8871:(e,t,r)=>{var n=r(5176),i=r(9047).Buffer,o=r(4001);t.encrypt=function(e,t){var r=Math.ceil(t.length/16),a=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var c=function(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}(e),l=a+16*s;e._cache.writeUInt32BE(c[0],l+0),e._cache.writeUInt32BE(c[1],l+4),e._cache.writeUInt32BE(c[2],l+8),e._cache.writeUInt32BE(c[3],l+12)}var u=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,u)}},8972:(e,t)=>{t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},6572:(e,t,r)=>{var n={ECB:r(8972),CBC:r(9628),CFB:r(6674),CFB8:r(8194),CFB1:r(9971),OFB:r(2343),CTR:r(8871),GCM:r(8871)},i=r(4946);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},2343:(e,t,r)=>{var n=r(365).Buffer,i=r(5176);t.encrypt=function(e,t){for(;e._cache.length<t.length;)e._cache=n.concat([e._cache,(e._prev=e._cipher.encryptBlock(e._prev),e._prev)]);var r=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),i(t,r)}},7188:(e,t,r)=>{var n=r(7463),i=r(9047).Buffer,o=r(8842);function a(e,t,r,a){o.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=e}r(376)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},5972:(e,t,r)=>{var n=r(7729),i=r(4881),o=r(6572),a=r(3519),s=r(1248);function c(e,t,r){if(o[e=e.toLowerCase()])return i.createCipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e});throw TypeError("invalid suite type")}function l(e,t,r){if(o[e=e.toLowerCase()])return i.createDecipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){if(o[e=e.toLowerCase()])r=o[e].key,n=o[e].iv;else{if(!a[e])throw TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var r,n,i=s(t,!1,r,n);return c(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=c,t.createDecipher=t.Decipher=function(e,t){if(o[e=e.toLowerCase()])r=o[e].key,n=o[e].iv;else{if(!a[e])throw TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var r,n,i=s(t,!1,r,n);return l(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=l,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},7729:(e,t,r)=>{var n=r(8842),i=r(167),o=r(376),a=r(9047).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function c(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var c=e.iv;a.isBuffer(c)||(c=a.from(c)),this._des=i.create({key:o,iv:c,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=c,o(c,n),c.prototype._update=function(e){return a.from(this._des.update(e))},c.prototype._final=function(){return a.from(this._des.final())}},3519:(e,t)=>{t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},4364:(e,t,r)=>{"use strict";var n=r(815),i=r(5760),o=r(9047).Buffer;function a(e){var t,r=e.modulus.byteLength();do t=new n(i(r));while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2))return t}function s(e,t){var r,i={blinder:(r=a(t)).toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed(),unblinder:r.invm(t.modulus)},s=t.modulus.byteLength(),c=new n(e).mul(i.blinder).umod(t.modulus),l=c.toRed(n.mont(t.prime1)),u=c.toRed(n.mont(t.prime2)),f=t.coefficient,d=t.prime1,h=t.prime2,p=l.redPow(t.exponent1).fromRed(),y=u.redPow(t.exponent2).fromRed(),b=p.isub(y).imul(f).umod(d).imul(h);return y.iadd(b).imul(i.unblinder).umod(t.modulus).toArrayLike(o,"be",s)}s.getr=a,e.exports=s},3363:(e,t,r)=>{"use strict";e.exports=r(5207)},1022:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(8339),o=r(8237),a=r(376),s=r(1437),c=r(1113),l=r(5207);function u(e){o.Writable.call(this);var t=l[e];if(!t)throw Error("Unknown message digest");
2this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){o.Writable.call(this);var t=l[e];if(!t)throw Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new u(e)}function h(e){return new f(e)}Object.keys(l).forEach(function(e){l[e].id=n.from(l[e].id,"hex"),l[e.toLowerCase()]=l[e]}),a(u,o.Writable),u.prototype._write=function(e,t,r){this._hash.update(e),r()},u.prototype.update=function(e,t){return this._hash.update("string"==typeof e?n.from(e,t):e),this},u.prototype.sign=function(e,t){this.end();var r=s(this._hash.digest(),e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},a(f,o.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,t){return this._hash.update("string"==typeof e?n.from(e,t):e),this},f.prototype.verify=function(e,t,r){var i="string"==typeof t?n.from(t,r):t;return this.end(),c(i,this._hash.digest(),e,this._signType,this._tag)},e.exports={Sign:d,Verify:h,createSign:d,createVerify:h}},1437:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(8736),o=r(4364),a=r(8333).ec,s=r(815),c=r(2914),l=r(1308);function u(e,t,r,o){if((e=n.from(e.toArray())).length<t.byteLength()){var a=n.alloc(t.byteLength()-e.length);e=n.concat([a,e])}var s=r.length,c=function(e,t){e=(e=f(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),l=n.alloc(s);l.fill(1);var u=n.alloc(s);return u=i(o,u).update(l).update(n.from([0])).update(e).update(c).digest(),l=i(o,u).update(l).digest(),{k:u=i(o,u).update(l).update(n.from([1])).update(e).update(c).digest(),v:l=i(o,u).update(l).digest()}}function f(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function d(e,t,r){var o,a;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),o=n.concat([o,t.v]);a=f(o,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==a.cmp(e))return a}e.exports=function(e,t,r,i,h){var p=c(t);if(p.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw Error("wrong private key type");var y=e,b=l[p.curve.join(".")];if(!b)throw Error("unknown curve "+p.curve.join("."));var m=new a(b).keyFromPrivate(p.privateKey).sign(y);return n.from(m.toDER())}if("dsa"===p.type){if("dsa"!==i)throw Error("wrong private key type");return function(e,t,r){for(var i,o,a,c,l,h=t.params.priv_key,p=t.params.p,y=t.params.q,b=t.params.g,m=new s(0),g=f(e,y).mod(y),v=!1,x=u(h,y,e,r);!1===v;)i=l=d(y,x,r),m=b.toRed(s.mont(p)).redPow(i).fromRed().mod(y),0===(v=l.invm(y).imul(g.add(h.mul(m))).mod(y)).cmpn(0)&&(v=!1,m=new s(0));return o=m,a=v,o=o.toArray(),a=a.toArray(),128&o[0]&&(o=[0].concat(o)),128&a[0]&&(a=[0].concat(a)),c=(c=[48,o.length+a.length+4,2,o.length]).concat(o,[2,a.length],a),n.from(c)}(e,p,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw Error("wrong private key type");if(void 0!==t.padding&&1!==t.padding)throw Error("illegal or unsupported padding mode");e=n.concat([h,e]);for(var g=p.modulus.byteLength(),v=[0,1];e.length+v.length+1<g;)v.push(255);v.push(0);for(var x=-1;++x<e.length;)v.push(e[x]);return o(v,p)},e.exports.getKey=u,e.exports.makeKey=d},1113:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(815),o=r(8333).ec,a=r(2914),s=r(1308);function c(e,t){if(0>=e.cmpn(0)||e.cmp(t)>=0)throw Error("invalid sig")}e.exports=function(e,t,r,l,u){var f,d,h,p,y,b,m,g,v,x,w,_=a(r);if("ec"===_.type){if("ecdsa"!==l&&"ecdsa/rsa"!==l)throw Error("wrong public key type");var S=e,j=t,k=s[_.data.algorithm.curve.join(".")];if(!k)throw Error("unknown curve "+_.data.algorithm.curve.join("."));var O=new o(k),$=_.data.subjectPrivateKey.data;return O.verify(j,S,$)}if("dsa"===_.type){if("dsa"!==l)throw Error("wrong public key type");return f=e,d=t,h=_.data.p,p=_.data.q,y=_.data.g,b=_.data.pub_key,g=(m=a.signature.decode(f,"der")).s,v=m.r,c(g,p),c(v,p),x=i.mont(h),w=g.invm(p),0===y.toRed(x).redPow(new i(d).mul(w).mod(p)).fromRed().mul(b.toRed(x).redPow(v.mul(w).mod(p)).fromRed()).mod(h).mod(p).cmp(v)}if("rsa"!==l&&"ecdsa/rsa"!==l)throw Error("wrong public key type");t=n.concat([u,t]);for(var A=_.modulus.byteLength(),E=[1],N=0;t.length+E.length+2<A;)E.push(255),N+=1;E.push(0);for(var P=-1;++P<t.length;)E.push(t[P]);E=n.from(E);var M=i.mont(_.modulus);e=(e=new i(e).toRed(M)).redPow(new i(_.publicExponent));var D=+(N<8);for(A=Math.min((e=n.from(e.fromRed().toArray())).length,E.length),e.length!==E.length&&(D=1),P=-1;++P<A;)D|=e[P]^E[P];return 0===D}},5176:(e,t,r)=>{var n=r(365).Buffer;e.exports=function(e,t){for(var r=Math.min(e.length,t.length),i=new n(r),o=0;o<r;++o)i[o]=e[o]^t[o];return i}},365:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(7943),o=r(8405),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>
vendor: 4,383 bytes, line 2
20x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var i=t;if("string"==typeof i&&""!==i||(i="utf8"),!c.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|y(e,i),a=s(o),l=a.write(e,i);return l!==o&&(a=a.slice(0,l)),a}if(ArrayBuffer.isView(e)){if(P(e,Uint8Array)){var u=new Uint8Array(e);return h(u.buffer,u.byteOffset,u.byteLength)}return d(e)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e));if(P(e,ArrayBuffer)||e&&P(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(P(e,SharedArrayBuffer)||e&&P(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var f=e.valueOf&&e.valueOf();if(null!=f&&f!==e)return c.from(f,t,r);var b=function(e){if(c.isBuffer(e)){var t,r=0|p(e.length),n=s(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(b)return b;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(e))}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),s(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=s(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),c.prototype),n}function p(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||P(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(e));var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(e).length;default:if(o)return i?-1:A(e).length;t=(""+t).toLowerCase(),o=!0}}function b(e,t,r){var n,o,a,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=M[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return n=this,o=t,a=r,0===o&&a===n.length?i.fromByteArray(n):i.fromByteArray(n.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}
2else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,c/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===c)return u*a}else -1!==u&&(o-=o-u),u=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){for(var f=!0,d=0;d<c;d++)if(l(e,o+d)!==l(t,d)){f=!1;break}if(f)return o}return -1}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,c,l=e[i],u=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(u=l);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)>127&&(u=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&l)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(u=c)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}var d=n.length;if(d<=w)return String.fromCharCode.apply(String,n);for(var h="",p=0;p<d;)h+=String.fromCharCode.apply(String,n.slice(p,p+=w));return h}t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"u"<typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)},c.allocUnsafe=function(e){return f(e)},c.allocUnsafeSlow=function(e){return f(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(P(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),P(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var r,n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(P(o,Uint8Array))i+o.length>n.length?c.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!c.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?x(this,0,e):b.apply(this,arguments)}
vendor: 9,794 bytes, line 2
2,c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,i,o){if(P(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||r>e.length||i<0||o>this.length)throw RangeError("out of range index");if(i>=o&&t>=r)return 0;if(i>=o)return -1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(a,s),u=this.slice(i,o),f=e.slice(t,r),d=0;d<l;++d)if(u[d]!==f[d]){a=u[d],s=f[d];break}return a<s?-1:+(s<a)},c.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i,o,a,s,c,l,u,f,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s,c=parseInt(t.substr(2*a,2),16);if((s=c)!=s)break;e[r+a]=c}return a}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,N(A(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=t,s=r,N(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,s);case"base64":return c=t,l=r,N(E(e),this,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,f=r,N(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-u),this,u,f);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function _(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function S(e,t,r,n,i,o){if(!c.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function j(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,i){return t*=1,r>>>=0,i||j(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function O(e,t,r,n,i){return t*=1,r>>>=0,i||j(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||_(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e*=1,t>>>=0,r>>>=0,n||S(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e*=1,t>>>=0,r>>>=0,n||S(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);S(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);S(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||S(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=c.isBuffer(e)?e:c.from(e,n),s=a.length;
2if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var $=/[^+/0-9A-Za-z-_]/g;function A(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function E(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace($,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function P(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var M=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},5326:(e,t,r)=>{"use strict";var n=r(5246),i=r(1919),o=r(4341);e.exports=r(4817)||n.call(o,i)},9278:(e,t,r)=>{"use strict";var n=r(5246),i=r(1919),o=r(5326);e.exports=function(){return o(n,i,arguments)}},1919:e=>{"use strict";e.exports=Function.prototype.apply},4341:e=>{"use strict";e.exports=Function.prototype.call},6751:(e,t,r)=>{"use strict";var n=r(5246),i=r(4820),o=r(4341),a=r(5326);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return a(n,o,e)}},4817:e=>{"use strict";e.exports="u">typeof Reflect&&Reflect&&Reflect.apply},3862:(e,t,r)=>{"use strict";var n=r(2637),i=r(7385),o=r(6751),a=r(9278);e.exports=function(e){var t=o(arguments),r=1+e.length-(arguments.length-1);return n(t,r>0?r:0,!0)},i?i(e.exports,"apply",{value:a}):e.exports.apply=a},4609:(e,t,r)=>{"use strict";var n=r(6893),i=r(6751),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},8842:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(4723).Transform,o=r(113).s,a=r(376),s=r(2988);function c(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}a(c,i),c.prototype.update=function(e,t,r){var n=s(e,t),i=this._update(n);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},c.prototype.setAutoPadding=function(){},c.prototype.getAuthTag=function(){throw Error("trying to get auth tag in unsupported state")},c.prototype.setAuthTag=function(){throw Error("trying to set auth tag in unsupported state")},c.prototype.setAAD=function(){throw Error("trying to set aad in unsupported state")},c.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},c.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},c.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},c.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw Error("canât switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=c},2077:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===i(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e}
2,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===i(e)},t.isObject=function(e){return"object"===n(e)&&null!==e},t.isDate=function(e){return"[object Date]"===i(e)},t.isError=function(e){return"[object Error]"===i(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(365).Buffer.isBuffer},4637:(e,t,r)=>{var n=r(365).Buffer,i=r(8333),o=r(815);e.exports=function(e){return new s(e)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=a[e],this.curveType||(this.curveType={name:e}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function c(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new n(e);if(r&&i.length<r){var o=new n(r-i.length);o.fill(0),i=n.concat([o,i])}return t?i.toString(t):i}a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1,s.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},s.prototype.computeSecret=function(e,t,r){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),c(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},s.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),c(r,e)},s.prototype.getPrivateKey=function(e){return c(this.keys.getPrivate(),e)},s.prototype.setPublicKey=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.keys._importPublic(e),this},s.prototype.setPrivateKey=function(e,t){t=t||"utf8",n.isBuffer(e)||(e=new n(e,t));var r=new o(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},8339:(e,t,r)=>{"use strict";var n=r(376),i=r(722),o=r(8100),a=r(1806),s=r(8842);function c(e){s.call(this,"digest"),this._hash=e}n(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new c(a(e))}},3277:(e,t,r)=>{var n=r(722);e.exports=function(e){return(new n).update(e).digest()}},8736:(e,t,r)=>{"use strict";var n=r(376),i=r(2912),o=r(8842),a=r(9047).Buffer,s=r(3277),c=r(8100),l=r(1806),u=a.alloc(128);function f(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new c:l(e)).update(t).digest():t.length<r&&(t=a.concat([t,u],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new c:l(e),this._hash.update(n)}n(f,o),f.prototype._update=function(e){this._hash.update(e)},f.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new c:l(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new f("rmd160",t):"md5"===e?new i(s,t):new f(e,t)}},2912:(e,t,r)=>{"use strict";var n=r(376),i=r(9047).Buffer,o=r(8842),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},462:(e,t,r)=>{"use strict";t.O6=r(5760),r(8339),r(8736);var n=(["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(r(3363))),r(9379));n.pbkdf2,n.pbkdf2Sync;var i=r(5972);i.Cipher,i.createCipher,i.Cipheriv,i.createCipheriv,i.Decipher,i.createDecipher,i.Decipheriv,i.createDecipheriv,i.getCiphers,i.listCiphers;var o=r(1822);o.DiffieHellmanGroup,o.createDiffieHellmanGroup,o.getDiffieHellman,o.createDiffieHellman,o.DiffieHellman;var a=r(1022);a.createSign,a.Sign,a.createVerify,a.Verify,r(4637);var s=r(2368);s.publicEncrypt,s.privateEncrypt,s.publicDecrypt,s.privateDecrypt;var c=r(9301);c.randomFill,c.randomFillSync},3793:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(7385),o=r(5710),a=r(4820),s=r(1554);e.exports=function(e,t,r){if(!e||"object"!==n(e)&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!==n(t))throw new a("`property` must be a string or a symbol`");
2if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,f=arguments.length>6&&arguments[6],d=!!s&&s(e,t);if(i)i(e,t,{configurable:null===u&&d?d.configurable:!u,enumerable:null===c&&d?d.enumerable:!c,value:r,writable:null===l&&d?d.writable:!l});else{if(!f&&(c||l||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},7921:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(3818),o="function"==typeof Symbol&&"symbol"===n(Symbol("foo")),a=Object.prototype.toString,s=Array.prototype.concat,c=r(3793),l=r(2579)(),u=function(e,t,r,n){if(t in e){if(!0===n){if(e[t]===r)return}else if("function"!=typeof n||"[object Function]"!==a.call(n)||!n())return}l?c(e,t,r,!0):c(e,t,r)},f=function(e,t){var r=arguments.length>2?arguments[2]:{},n=i(t);o&&(n=s.call(n,Object.getOwnPropertySymbols(t)));for(var a=0;a<n.length;a+=1)u(e,n[a],t[n[a]],r[n[a]])};f.supportsDescriptors=!!l,e.exports=f},167:(e,t,r)=>{"use strict";t.utils=r(5061),t.Cipher=r(7499),t.DES=r(9484),t.CBC=r(8254),t.EDE=r(5573)},8254:(e,t,r)=>{"use strict";var n=r(1130),i=r(376),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];for(o._update.call(this,a,0,r,n),s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{for(o._update.call(this,e,t,r,n),s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},7499:(e,t,r)=>{"use strict";var n=r(1130);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=Array(((this.bufferOff+e.length)/this.blockSize|0)*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var i=e.length-(e.length-t)%this.blockSize;t<i;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},9484:(e,t,r)=>{"use strict";var n=r(1130),i=r(376),o=r(5061),a=r(7499);function s(){this.tmp=[,,],this.keys=null}function c(e){a.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}i(c,a),e.exports=c,c.create=function(e){return new c(e)};var l=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(e,t){e.keys=Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0),i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var s=l[a>>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,e.keys,a)}},c.prototype._update=function(e,t,r,n){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt
vendor: 7,646 bytes, line 2
2(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},c.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},c.prototype._unpad=function(e){if(!1===this.padding)return e;for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},c.prototype._encrypt=function(e,t,r,n,i){for(var a=t,s=r,c=0;c<e.keys.length;c+=2){var l=e.keys[c],u=e.keys[c+1];o.expand(s,e.tmp,0),l^=e.tmp[0],u^=e.tmp[1];var f=o.substitute(l,u),d=s;s=(a^o.permute(f))>>>0,a=d}o.rip(s,a,n,i)},c.prototype._decrypt=function(e,t,r,n,i){for(var a=r,s=t,c=e.keys.length-2;c>=0;c-=2){var l=e.keys[c],u=e.keys[c+1];o.expand(a,e.tmp,0),l^=e.tmp[0],u^=e.tmp[1];var f=o.substitute(l,u),d=a;a=(s^o.permute(f))>>>0,s=d}o.rip(a,s,n,i)}},5573:(e,t,r)=>{"use strict";var n=r(1130),i=r(376),o=r(7499),a=r(9484);function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function c(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(c,o),e.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},5061:(e,t)=>{"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<<t&0xfffffff|e>>>28-t};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,n,i){for(var o=0,a=0,s=r.length>>>1,c=0;c<s;c++)o<<=1,o|=e>>>r[c]&1;for(c=s;c<r.length;c++)a<<=1,a|=t>>>r[c]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(e>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<i.length;r++)t<<=1,t|=e>>>i[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],o=0;o<t;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},1822:(e,t,r)=>{var n=r(365).Buffer,i=r(2227),o=r(9799),a=r(6951),s={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(e){return new a(new n(o[e].prime,"hex"),new n(o[e].gen,"hex"))},t.createDiffieHellman=t.DiffieHellman=function e(t,r,o,c){return n.isBuffer(r)||void 0===s[r]?e(t,"binary",r,o):(r=r||"binary",c=c||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,c)),"number"==typeof t?new a(i(t,o),o,!0):(n.isBuffer(t)||(t=new n(t,r)),new a(t,o,!0)))}},6951:(e,t,r)=>{var n=r(365).Buffer,i=r(815),o=new(r(9318)),a=new i(24),s=new i(11),c=new i(10),l=new i(3),u=new i(7),f=r(2227),d=r(5760);function h(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._pub=new i(e),this}function p(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this._priv=new i(e),this}e.exports=b;var y={};function b(e,t,r){this.setGenerator(t),this.__prime=new i(e),this._prime=i.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=p):this._primeCode=8}function m(e,t){var r=new n(e.toArray());return t?r.toString(t):r}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in y)return y[n];var i,d=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!o.test(e))return d+=1+("02"===r||"05"===r?8:4),y[n]=d,d;switch(o.test(e.shrn(1))||(d+=2),r){case"02":e.mod(a).cmp(s)&&(d+=8);break;case"05":(i=e.mod(c)).cmp(l)&&i.cmp(u)&&(d+=8);break;default:d+=4}return y[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new i(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var t=new n((e=(e=new i(e)).toRed(this._prime)).redPow(this._priv).fromRed().toArray()),r=this.getPrime();if(t.length<r.length){var o=new n(r.length-t.length);o.fill(0),t=n.concat([o,t])}return t},b.prototype.getPublicKey=function(e){return m(this._pub,e)},b.prototype.getPrivateKey=function(e){return m(this._priv,e)},b.prototype.getPrime=function(e){return m(this.__prime,e)},b.prototype.getGenerator=function(e){return m(this._gen,e)},b.prototype.setGenerator=function(e,t){return t=t||"utf8",n.isBuffer(e)||(e=new n(e,t)),this.__gen=e,this._gen=new i(e),this}},2227:(e,t,r)=>{var n=r(5760);e.exports=m,m.simpleSieve=y,m.fermatTest=b;var i=r(815),o=new i(24),a=new(r(9318)),s=new i(1),c=new i(2),l=new i(5),u=(new i(16),new i(8),new i(10)),f=new i(3),d=(new i(7),new i(11)),h=new i(4),p=(new i(12),null);function y(e){for(var t=function(){if(null!==p)return p;var e=[];e[0]=2;
vendor: 5,085 bytes, line 2
2for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function b(e){var t=i.mont(e);return 0===c.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function m(e,t){var r,p;if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;r.mod(u).cmp(f);)r.iadd(h)}else for(;r.mod(o).cmp(d);)r.iadd(h);if(y(p=r.shrn(1))&&y(r)&&b(p)&&b(r)&&a.test(p)&&a.test(r))return r}}},9200:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,o=r(6751),a=r(1554);try{i=[].__proto__===Array.prototype}catch(e){if(!e||"object"!==n(e)||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!i&&a&&a(Object.prototype,"__proto__"),c=Object,l=c.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof l&&function(e){return l(null==e?e:c(e))}},8333:(e,t,r)=>{"use strict";t.version=r(8597).i8,t.utils=r(7891),t.rand=r(7179),t.curve=r(4720),t.curves=r(1478),t.ec=r(5806),t.eddsa=r(8318)},9952:(e,t,r)=>{"use strict";var n=r(815),i=r(7891),o=i.getNAF,a=i.getJSF,s=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw Error("Not implemented")},c.prototype.validate=function(){throw Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,c,l=[];for(a=0;a<n.length;a+=r.step){c=0;for(var u=a+r.step-1;u>=a;u--)c=(c<<1)+n[u];l.push(c)}for(var f=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a<l.length;a++)(c=l[a])===h?d=d.mixedAdd(r.points[a]):c===-h&&(d=d.mixedAdd(r.points[a].neg()));f=f.add(d)}return f.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,a=o(t,r,this._bitLength),c=this.jpoint(null,null,null),l=a.length-1;l>=0;l--){for(var u=0;l>=0&&0===a[l];l--)u++;if(l>=0&&u++,c=c.dblp(u),l<0)break;var f=a[l];s(0!==f),c="affine"===e.type?f>0?c.mixedAdd(i[f-1>>1]):c.mixedAdd(i[-f-1>>1].neg()):f>0?c.add(i[f-1>>1]):c.add(i[-f-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var s,c,l,u=this._wnafT1,f=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(l=t[s])._getNAFPoints(e);u[s]=p.wnd,f[s]=p.points}for(s=n-1;s>=1;s-=2){var y=s-1,b=s;if(1===u[y]&&1===u[b]){var m=[t[y],null,null,t[b]];0===t[y].y.cmp(t[b].y)?(m[1]=t[y].add(t[b]),m[2]=t[y].toJ().mixedAdd(t[b].neg())):0===t[y].y.cmp(t[b].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[b]),m[2]=t[y].add(t[b].neg())):(m[1]=t[y].toJ().mixedAdd(t[b]),m[2]=t[y].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[y],r[b]);for(h=Math.max(v[0].length,h),d[y]=Array(h),d[b]=Array(h),c=0;c<h;c++){var x=0|v[0][c],w=0|v[1][c];d[y][c]=g[3*(x+1)+(w+1)],d[b][c]=0,f[y]=m}}else d[y]=o(r[y],u[y],this._bitLength),d[b]=o(r[b],u[b],this._bitLength),h=Math.max(d[y].length,h),h=Math.max(d[b].length,h)}var _=this.jpoint(null,null,null),S=this._wnafT4;for(s=h;s>=0;s--){for(var j=0;s>=0;){var k=!0;for(c=0;c<n;c++)S[c]=0|d[c][s],0!==S[c]&&(k=!1);if(!k)break;j++,s--}if(s>=0&&j++,_=_.dblp(j),s<0)break;for(c=0;c<n;c++){var O=S[c];0!==O&&(O>0?l=f[c][O-1>>1]:O<0&&(l=f[c][-O-1>>1].neg()),_="affine"===l.type?_.mixedAdd(l):_.add(l))}}for(s=0;s<n;s++)f[s]=null;return i?_:_.toP()},c.BasePoint=l,l.prototype.eq=function(){throw Error("Not implemented")},l.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw Error("Unknown point format")},l.prototype.encodeCompressed=function(e){return this.encode(e,!0)},l.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},l.prototype.encode=function(e,t){return i.encode(this._encode(t),e)}
vendor: 13,462 bytes, line 2
2,l.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},l.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},l.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},l.prototype._getBeta=function(){return null},l.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},958:(e,t,r)=>{"use strict";var n=r(7891),i=r(815),o=r(376),a=r(9952),s=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function l(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,a),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");var c=s.fromRed().isOdd();return(t&&!c||!t&&c)&&(s=s.redNeg()),this.point(e,s)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(l,a.BasePoint),c.prototype.pointFromJSON=function(e){return l.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new l(this,e,t,r,n)},l.fromJSON=function(e,t){return new l(e,t[0],t[1],t[2])},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),l=o.redMul(s),u=i.redMul(s),f=a.redMul(o);return this.curve.point(c,l,f,u)},l.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(c)),r=l.redSqr().redSub(l).redSub(l)):(i=this.z.redSqr(),o=l.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=l.redMul(n.redSub(c)),r=l.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),l=o.redMul(a),u=s.redMul(c),f=o.redMul(c),d=a.redMul(s);return this.curve.point(l,u,d,f)},l.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),l=i.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(c).redMul(u);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(l)):(t=n.redMul(l).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(l)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},4720:(e,t,r)=>{"use strict";t.base=r(9952),t.short=r(1585),t.mont=r(6773),t.edwards=r(958)},6773:(e,t,r)=>{"use strict";var n=r(815),i=r(376),o=r(9952),a=r(7891);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new c(this,e,t)},s.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1585:(e,t,r)=>{"use strict";var n=r(7891),i=r(815),o=r(376),a=r(9952),s=n.assert;function c(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function l(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,a),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=0>n[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,c,l,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),y=new i(0),b=new i(0),m=new i(1),g=0;0!==d.cmpn(0);){var v=h.div(d);l=h.sub(v.mul(d)),u=b.sub(v.mul(p));var x=m.sub(v.mul(y));if(!n&&0>l.cmp(f))t=c.neg(),r=p,n=l.neg(),o=u;else if(n&&2==++g)break;c=l,h=d,d=l,b=p,p=u,m=y,y=x}a=l.neg(),s=u;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a,b:s}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),l=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(l).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],c=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),c=c.neg(!0)),n[2*o]=s,n[2*o+1]=c,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var l=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return l},o(l,a.BasePoint),c.prototype.point=function(e,t,r){return new l(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return l.fromJSON(this,e,t)},l.prototype._getBeta=function(){if(this.curve.endo){var e=this.prec
vendor: 8,229 bytes, line 2
2omputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},l.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},l.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},l.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(u,a.BasePoint),c.prototype.jpoint=function(e,t,r){return new u(this,e,t,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),u=l.redMul(s),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),u=r.redMul(c),f=s.redSqr().redIAdd(l).redISub(u).redISub(u),d=s.redMul(u.redISub(f)).redISub(i.redMul(l)),h=this.z.redMul(a);return this.curve.jpoint(f,d,h)},u.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,c=s.redSqr().redSqr(),l=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),f=l.redSqr(),d=f.redSqr(),h=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),p=o.redMul(f),y=h.redSqr().redISub(p.redAdd(p)),b=p.redISub(y),m=h.redMul(b);m=m.redIAdd(m).redISub(d);var g=l.redMul(s);t+1<e&&(c=c.redMul(d)),o=y,s=g,l=m}return this.curve.jpoint(o,l.redMul(i),s)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),c=s.redSqr().redISub(a).redISub(a),l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),e=c,t=s.redMul(a.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),d=f.redSqr(),h=this.x.redAdd(f).redSqr().redISub(u).redISub(d);h=h.redIAdd(h);var p=u.redAdd(u).redIAdd(u),y=p.redSqr(),b=d.redIAdd(d);b=(b=b.redIAdd(b)).redIAdd(b),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},u.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=s.redSqr().redISub(a).redISub(a);e=c;var l=o.redIAdd(o);l=(l=l.redIAdd(l)).redIAdd(l),t=s.redMul(a.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),d=this.x.redMul(f),h=this.x.redSub(u).redMul(this.x.redAdd(u));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var b=f.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),t=h.redMul(p.redISub(e)).redISub(b)}return this.curve.jpoint(e,t,r)},u.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),l=(c=c.redIAdd(c)).redMul(a),u=s.redSqr().redISub(l.redAdd(l)),f=l.redISub(u),d=a.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(f).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,h,p)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var l=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(c),u=t.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(s).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.y.redMul(l.redMul(c.redISub(l)).redISub(a.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,d,h)},u.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},u.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)}
vendor: 5,337 bytes, line 2
2,u.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1478:(e,t,r)=>{"use strict";var n,i=r(3192),o=r(4720),a=r(7891).assert;function s(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var n=new s(r);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}),n}})}t.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(8948)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
2,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},5806:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(815),o=r(9742),a=r(7891),s=r(1478),c=r(7179),l=a.assert,u=r(3598),f=r(5206);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(l(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new u(this,e)},d.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||c(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(t.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},d.prototype._truncateToN=function(e,t,r){if(i.isBN(e)||"number"==typeof e)o=(e=new i(e,16)).byteLength();else if("object"===n(e))o=e.length,e=new i(e,16);else{var o,a=e.toString();o=a.length+1>>>1,e=new i(a,16)}"number"!=typeof r&&(r=8*o);var s=r-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,a){if("object"===n(r)&&(a=r,r=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!i.isBN(e)){l("object"===n(e)&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),l(e.length>>>0===e.length);for(var s=0;s<e.length;s++)l((255&e[s])===e[s])}t=this.keyFromPrivate(t,r),l(!(e=this._truncateToN(e,!1,a.msgBitLength)).isNeg(),"Can not sign a negative message");var c=this.n.byteLength(),u=t.getPrivate().toArray("be",c),d=e.toArray("be",c);l(new i(d).eq(e),"Can not sign message");for(var h=new o({hash:this.hash,entropy:u,nonce:d,pers:a.pers,persEnc:a.persEnc||"utf8"}),p=this.n.sub(new i(1)),y=0;;y++){var b=a.k?a.k(y):new i(h.generate(this.n.byteLength()));if(!(0>=(b=this._truncateToN(b,!0)).cmpn(1)||b.cmp(p)>=0)){var m=this.g.mul(b);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var x=b.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(x=x.umod(this.n)).cmpn(0)){var w=!!m.getY().isOdd()|2*(0!==g.cmp(v));return a.canonical&&x.cmp(this.nh)>0&&(x=this.n.sub(x),w^=1),new f({r:v,s:x,recoveryParam:w})}}}}}},d.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(t=new f(t,"hex")).r,a=t.s;if(0>o.cmpn(1)||o.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),l=c.mul(e).umod(this.n),u=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(l,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(l,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,n){l((3&r)===r,"The recovery param is more than two bits"),t=new f(t,n);var o=this.n,a=new i(e),s=t.r,c=t.s,u=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),y=c.mul(h).umod(o);return this.g.mulAdd(p,s,y)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")}},3598:(e,t,r)=>{"use strict";var n=r(815),i=r(7891).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){e.x||e.y?("mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y)):this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},5206:(e,t,r)=>{"use strict";var n=r(815),i=r(7891),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4||0===e[t.place])return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function l(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function u(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}
2e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o||o+r.place!==e.length||2!==e[r.place++])return!1;var a=c(e,r);if(!1===a||128&e[r.place])return!1;var l=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var u=c(e,r);if(!1===u||e.length!==u+r.place||128&e[r.place])return!1;var f=e.slice(r.place,u+r.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(l),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=l(t),r=l(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,t.length),(n=n.concat(t)).push(2),u(n,r.length);var o=n.concat(r),a=[48];return u(a,o.length),a=a.concat(o),i.encode(a,e)}},8318:(e,t,r)=>{"use strict";var n=r(3192),i=r(1478),o=r(7891),a=o.assert,s=o.parseBytes,c=r(9371),l=r(2214);function u(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=u,u.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},u.prototype.verify=function(e,t,r){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},u.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},u.prototype.makeSignature=function(e){return e instanceof l?e:new l(this,e)},u.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=128*!!e.getX().isOdd(),t},u.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},u.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(e){return o.intFromLE(e)},u.prototype.isPoint=function(e){return e instanceof this.pointClass}},9371:(e,t,r)=>{"use strict";var n=r(7891),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},2214:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(815),o=r(7891),a=o.assert,s=o.cachedProperty,c=o.parseBytes;function l(e,t){this.eddsa=e,"object"!==n(t)&&(t=c(t)),Array.isArray(t)&&(a(t.length===2*e.encodingLength,"Signature has invali
2d size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(l,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(l,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(l,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(l,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=l},8948:e=>
vendor: 26,139 bytes, line 2
2{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},
27891:(e,t,r)=>{"use strict";var n=r(815),i=r(1130),o=r(5522);t.assert=i,t.toArray=o.toArray,t.zero2=o.zero2,t.toHex=o.toHex,t.encode=o.encode,t.getNAF=function(e,t,r){var n,i=Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<t+1,a=e.clone();for(n=0;n<i.length;n++){var s,c=a.andln(o-1);a.isOdd()?(s=c>(o>>1)-1?(o>>1)-c:c,a.isubn(s)):s=0,i[n]=s,a.iushrn(1)}return i},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,l=t.andln(3)+o&3;3===c&&(c=-1),3===l&&(l=-1),a=1&c?3!=(n=e.andln(7)+i&7)&&5!==n||2!==l?c:-c:0,r[0].push(a),s=1&l?3!=(n=t.andln(7)+o&7)&&5!==n||2!==c?l:-l:0,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new n(e,"hex","le")}},7385:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},5885:e=>{"use strict";e.exports=EvalError},2378:e=>{"use strict";e.exports=Error},5114:e=>{"use strict";e.exports=RangeError},4191:e=>{"use strict";e.exports=ReferenceError},5710:e=>{"use strict";e.exports=SyntaxError},4820:e=>{"use strict";e.exports=TypeError},5999:e=>{"use strict";e.exports=URIError},2244:e=>{"use strict";e.exports=Object},8028:e=>{"use strict";function t(e,t){if(null==e)throw TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var c=o[a],l=Object.getOwnPropertyDescriptor(i,c);void 0!==l&&l.enumerable&&(r[c]=i[c])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,
2configurable:!0,writable:!0,value:t})}}},9620:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r,n="object"===("u"<typeof Reflect?"undefined":t(Reflect))?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&"function"==typeof e.on&&b(e,"error",i,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+t(e))}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,o,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var s=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):y(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function b(e,r,n,i){if("function"==typeof e.on)i.once?e.once(r,n):e.on(r,n);else{if("function"!=typeof e.addEventListener)throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+t(e));e.addEventListener(r,function t(o){i.once&&e.removeEventListener(r,t),n(o)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var l=c.length,u=y(c,l);for(r=0;r<l;++r)i(u[r],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit
2("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},1248:(e,t,r)=>{var n=r(9047).Buffer,i=r(722);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),c=n.alloc(o||0),l=n.alloc(0);a>0||o>0;){var u=new i;u.update(l),u.update(e),t&&u.update(t),l=u.digest();var f=0;if(a>0){var d=s.length-a;f=Math.min(a,l.length),l.copy(s,d,0,f),a-=f}if(f<l.length&&o>0){var h=c.length-o,p=Math.min(o,l.length-f);l.copy(c,h,f,f+p),o-=p}}return l.fill(0),{key:s,iv:c}}},5337:(e,t,r)=>{"use strict";var n=r(8625),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a;if(!n(t))throw TypeError("iterator must be a function");arguments.length>=3&&(a=r),"[object Array]"===i.call(e)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,a):function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,a)}},5929:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw TypeError("Function.prototype.bind called on incompatible "+i);for(var o,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=r(0,i.length-a.length),c=[],l=0;l<s;l++)c[l]="$"+l;if(o=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(c)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var t=i.apply(this,n(a,arguments));return Object(t)===t?t:this}return i.apply(e,n(a,arguments))}),i.prototype){var u=function(){};u.prototype=i.prototype,o.prototype=new u,u.prototype=null}return o}},5246:(e,t,r)=>{"use strict";var n=r(5929);e.exports=Function.prototype.bind||n},7856:e=>{"use strict";function t(){var e,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function s(t,i,o,a){var s=Object.create((i&&i.prototype instanceof l?i:l).prototype);return r(s,"_invoke",function(t,r,i){var o,a,s,l=0,u=i||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,a=0,s=e,d.n=r,c}};function h(t,r){for(a=t,s=r,n=0;!f&&l&&!i&&n<u.length;n++){var i,o=u[n],h=d.p,p=o[2];t>3?(i=p===r)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=t<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(i=t<3||o[0]>r||r>p)&&(o[4]=t,o[5]=r,d.n=p,a=0))}if(i||t>1)return c;throw f=!0,r}return function(i,u,p){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),a=u,s=p;(n=a<2?e:s)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.v=s);try{if(l=2,o){if(a||(i="next"),n=o[i]){if(!(n=n.call(o,s)))throw TypeError("iterator result is not an object");
2if(!n.done)return n;s=n.value,a<2&&(a=0)}else 1===a&&(n=o.return)&&n.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((n=(f=d.n<0)?s:t.call(r,d))!==c)break}catch(t){o=e,a=1,s=t}finally{l=1}}return{value:n,done:f}}}(t,o,a),!0),s}var c={};function l(){}function u(){}function f(){}n=Object.getPrototypeOf;var d=f.prototype=l.prototype=Object.create([][o]?n(n([][o]())):(r(n={},o,function(){return this}),n));function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return u.prototype=f,r(d,"constructor",f),r(f,"constructor",u),u.displayName="GeneratorFunction",r(f,a,"GeneratorFunction"),r(d),r(d,a,"Generator"),r(d,o,function(){return this}),r(d,"toString",function(){return"[object Generator]"}),(t=function(){return{w:s,m:h}})()}function r(e,t,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(r=function(e,t,n,i){function a(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(a("next",0),a("throw",1),a("return",2))})(e,t,n,i)}var n=t().m(function e(){return t().w(function(e){for(;;)if(0===e.n)return e.a(2)},e)}).constructor;e.exports=function(){return n}},6893:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,o=r(2244),a=r(2378),s=r(5885),c=r(5114),l=r(4191),u=r(5710),f=r(4820),d=r(5999),h=r(3646),p=r(8002),y=r(7803),b=r(4207),m=r(707),g=r(6396),v=r(4335),x=Function,w=function(e){try{return x('"use strict"; return ('+e+").constructor;")()}catch(e){}},_=r(1554),S=r(7385),j=function(){throw new f},k=_?function(){try{return j}catch(e){try{return _(arguments,"callee").get}catch(e){return j}}}():j,O=r(5990)(),$=r(2460),A=r(3316),E=r(8717),N=r(1919),P=r(4341),M={},D="u">typeof Uint8Array&&$?$(Uint8Array):i,I={__proto__:null,"%AggregateError%":"u"<typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"u"<typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":O&&$?$([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":M,"%AsyncGenerator%":M,"%AsyncGeneratorFunction%":M,"%AsyncIteratorPrototype%":M,"%Atomics%":"u"<typeof Atomics?i:Atomics,"%BigInt%":"u"<typeof BigInt?i:BigInt,"%BigInt64Array%":"u"<typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"u"<typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"u"<typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"u"<typeof Float16Array?i:Float16Array,"%Float32Array%":"u"<typeof Float32Array?i:Float32Array,"%Float64Array%":"u"<typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"u"<typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":M,"%Int8Array%":"u"<typeof Int8Array?i:Int8Array,"%Int16Array%":"u"<typeof Int16Array?i:Int16Array,"%Int32Array%":"u"<typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
2IteratorPrototype%":O&&$?$($([][Symbol.iterator]())):i,"%JSON%":"object"===("u"<typeof JSON?"undefined":n(JSON))?JSON:i,"%Map%":"u"<typeof Map?i:Map,"%MapIteratorPrototype%":"u">typeof Map&&O&&$?$((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"u"<typeof Promise?i:Promise,"%Proxy%":"u"<typeof Proxy?i:Proxy,"%RangeError%":c,"%ReferenceError%":l,"%Reflect%":"u"<typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"u"<typeof Set?i:Set,"%SetIteratorPrototype%":"u">typeof Set&&O&&$?$((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"u"<typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&$?$(""[Symbol.iterator]()):i,"%Symbol%":O?Symbol:i,"%SyntaxError%":u,"%ThrowTypeError%":k,"%TypedArray%":D,"%TypeError%":f,"%Uint8Array%":"u"<typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"u"<typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"u"<typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"u"<typeof Uint32Array?i:Uint32Array,"%URIError%":d,"%WeakMap%":"u"<typeof WeakMap?i:WeakMap,"%WeakRef%":"u"<typeof WeakRef?i:WeakRef,"%WeakSet%":"u"<typeof WeakSet?i:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":N,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":A,"%Math.abs%":h,"%Math.floor%":p,"%Math.max%":y,"%Math.min%":b,"%Math.pow%":m,"%Math.round%":g,"%Math.sign%":v,"%Reflect.getPrototypeOf%":E};if($)try{null.error}catch(e){var T=$($(e));I["%Error.prototype%"]=T}var C=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&$&&(r=$(i.prototype))}return I[t]=r,r},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]}
2,R=r(5246),L=r(9021),z=R.call(P,Array.prototype.concat),F=R.call(N,Array.prototype.splice),U=R.call(P,String.prototype.replace),q=R.call(P,String.prototype.slice),V=R.call(P,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,W=function(e,t){var r,n=e;if(L(B,n)&&(n="%"+(r=B[n])[0]+"%"),L(I,n)){var i=I[n];if(i===M&&(i=C(n)),void 0===i&&!t)throw new f("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new f('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=q(e,0,1),r=q(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,K,function(e,t,r,i){n[n.length]=r?U(i,H,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=W("%"+n+"%",t),o=i.name,a=i.value,s=!1,c=i.alias;c&&(n=c[0],F(r,z([0,1],c)));for(var l=1,d=!0;l<r.length;l+=1){var h=r[l],p=q(h,0,1),y=q(h,-1);if(('"'===p||"'"===p||"`"===p||'"'===y||"'"===y||"`"===y)&&p!==y)throw new u("property names with quotes must have matching quotes");if("constructor"!==h&&d||(s=!0),L(I,o="%"+(n+="."+h)+"%"))a=I[o];else if(null!=a){if(!(h in a)){if(!t)throw new f("base intrinsic for "+e+" exists, but the property is not available.");return}if(_&&l+1>=r.length){var b=_(a,h);a=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:a[h]}else d=L(a,h),a=a[h];d&&!s&&(I[o]=a)}}return a}},3316:(e,t,r)=>{"use strict";e.exports=r(2244).getPrototypeOf||null},8717:e=>{"use strict";e.exports="u">typeof Reflect&&Reflect.getPrototypeOf||null},2460:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(8717),o=r(3316),a=r(9200);e.exports=i?function(e){return i(e)}:o?function(e){if(!e||"object"!==n(e)&&"function"!=typeof e)throw TypeError("getProto: not an object");return o(e)}:a?function(e){return a(e)}:null},5466:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},1554:(e,t,r)=>{"use strict";var n=r(5466);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},2579:(e,t,r)=>{"use strict";var n=r(7385),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},5990:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i="u">typeof Symbol&&Symbol,o=r(3031);e.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"===n(i("foo"))&&"symbol"===n(Symbol("bar"))&&o()}},3031:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===t(Symbol.iterator))return!0;var e={},r=Symbol("test"),n=Object(r);if("string"==typeof r||"[object Symbol]"!==Object.prototype.toString.call(r)||"[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(var i in e[r]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,r);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},5994:(e,t,r)=>{"use strict";var n=r(3031);e.exports=function(){return n()&&!!Symbol.toStringTag}},5125:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(5948),o=r(8237).Transform;function a(e){o.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(376)(a,o),a.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},a.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},a.prototype.update=function(e,t){if(this._finalized)throw Error("Digest already called");for(var r=i(e,t),n=this._block,o=0;this._blockOffset+r.length-o>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)n[a]=r[o],a+=1,o+=1;this._update(),this._blockOffset=0}for(;o<r.length;)n[this._blockOffset]=r[o],this._blockOffset+=1,o+=1;for(var s=0,c=8*r.length;c>0;++s)this._length[s]+=c,(c=this._length[s]/0x100000000|0)>0&&(this._length[s]-=0x100000000*c);return this},a.prototype._update=function(){throw Error("_update is not implemented")},a.prototype.digest=function(e){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw Error("_digest is not implemented")},e.exports=a},5948:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(2988),o="u">typeof Uint8Array,a=o&&"u">typeof ArrayBuffer&&ArrayBuffer.isView;e.exports=function(e,t){if("string"==typeof e||n.isBuffer(e)||o&&e instanceof Uint8Array||a&&a(e))return i(e,t);throw TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')}},3192:(e,t,r)=>{t.utils=r(8244),t.common=r(5386),t.sha=r(2507),t.ripemd=r(9993),t.hmac=r(8534),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160},5386:(e,t,r)=>{"use strict";var n=r(8244),i=r(1130);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}
vendor: 5,809 bytes, line 2
2t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},8534:(e,t,r)=>{"use strict";var n=r(8244),i=r(1130);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},9993:(e,t,r)=>{"use strict";var n=r(8244),i=r(5386),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,l=i.BlockHash;function u(){if(!(this instanceof u))return new u;l.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}n.inherits(u,l),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],l=this.h[3],u=this.h[4],b=r,m=n,g=i,v=l,x=u,w=0;w<80;w++){var _,S,j=a(o(c(r,f(w,n,i,l),e[d[w]+t],(_=w)<=15?0:_<=31?0x5a827999:_<=47?0x6ed9eba1:_<=63?0x8f1bbcdc:0xa953fd4e),p[w]),u);r=u,u=l,l=o(i,10),i=n,n=j,j=a(o(c(b,f(79-w,m,g,v),e[h[w]+t],(S=w)<=15?0x50a28be6:S<=31?0x5c4dd124:S<=47?0x6d703ef3:0x7a6d76e9*(S<=63)),y[w]),x),b=x,x=v,v=o(g,10),g=m,m=j}j=s(this.h[1],i,v),this.h[1]=s(this.h[2],l,x),this.h[2]=s(this.h[3],u,b),this.h[3]=s(this.h[4],r,m),this.h[4]=s(this.h[0],n,g),this.h[0]=j},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},2507:(e,t,r)=>{"use strict";t.sha1=r(9382),t.sha224=r(5123),t.sha256=r(4032),t.sha384=r(1364),t.sha512=r(2161)},9382:(e,t,r)=>{"use strict";var n=r(8244),i=r(5386),o=r(8355),a=n.rotl32,s=n.sum32,c=n.sum32_5,l=o.ft_1,u=i.BlockHash,f=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}n.inherits(d,u),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=c(a(i,5),l(p,o,u,d),h,r[n],f[p]);h=d,d=u,u=a(o,30),o=i,i=y}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5123:(e,t,r)=>{"use strict";var n=r(8244),i=r(4032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},4032:(e,t,r)=>{"use strict";var n=r(8244),i=r(5386),o=r(8355),a=r(1130),s=n.sum32,c=n.sum32_4,l=n.sum32_5,u=o.ch32,f=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,y=o.g1_256,b=i.BlockHash,m=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
276c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function g(){if(!(this instanceof g))return new g;b.call(this),this.h=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],this.k=m,this.W=Array(64)}n.inherits(g,b),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=this.h[5],x=this.h[6],w=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var _=l(w,h(g),u(g,v,x),this.k[n],r[n]),S=s(d(i),f(i,o,b));w=x,x=v,v=g,g=s(m,_),m=b,b=o,o=i,i=s(_,S)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],b),this.h[3]=s(this.h[3],m),this.h[4]=s(this.h[4],g),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],x),this.h[7]=s(this.h[7],w)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},1364:(e,t,r)=>{"use strict";var n=r(8244),i=r(2161);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},2161:(e,t,r)=>{"use strict";var n=r(8244),i=r(5386),o=r(1130),a=n.rotr64_hi,s=n.rotr64_lo,c=n.shr64_hi,l=n.shr64_lo,u=n.sum64,f=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,b=n.sum64_5_lo,m=i.BlockHash,g=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179],this.k=g,this.W=Array(160)}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=function(e,t){var r=a(e,t,19)^a(t,e,29)^c(e,t,6);return r<0&&(r+=0x100000000),r}(r[n-4],r[n-3]),o=function(e,t){var r=s(e,t,19)^s(t,e,29)^l(e,t,6);return r<0&&(r+=0x100000000),r}(r[n-4],r[n-3]),u=r[n-14],f=r[n-13],d=function(e,t){var r=a(e,t,1)^a(e,t,8)^c(e,t,7);return r<0&&(r+=0x100000000),r}(r[n-30],r[n-29]),y=function(e,t){var r=s(e,t,1)^s(e,t,8)^l(e,t,7);return r<0&&(r+=0x100000000),r}(r[n-30],r[n-29]),b=r[n-32],m=r[n-31];r[n]=h(i,o,u,f,d,y,b,m),r[n+1]=p(i,o,u,f,d,y,b,m)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],c=this.h[2],l=this.h[3],h=this.h[4],p=this.h[5],m=this.h[6],g=this.h[7],v=this.h[8],x=this.h[9],w=this.h[10],_=this.h[11],S=this.h[12],j=this.h[13],k=this.h[14],O=this.h[15];o(this.k.length===r.length);for(var $=0;$<r.length;$+=2){var A=k,E=O,N=function(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=0x100000000),r}(v,x),P=function(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=0x100000000),r}(v,x),M=function(e,t,r){var n=e&t^~e&r;return n<0&&(n+=0x100000000),n}(v,w,S),D=function(e,t,r){var n=e&t^~e&r;return n<0&&(n+=0x100000000),n}(x,_,j),I=this.k[$],T=this.k[$+1],C=r[$],B=r[$+1],R=y(A,E,N,P,M,D,I,T,C,B),L=b(A,E,N,P,M,D,I,T,C,B);A=function(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=0x100000000),r}(n,i);var z=f(A,E=function(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=0x100000000),r}(n,i),N=function(e,t,r){var n=e&t^e&r^t&r;return n<0&&(n+=0x100000000),n}(n,c,h),P=function(e,t,r){var n=e&t^e&r^t&r;return n<0&&(n+=0x100000000),n}(i,l,p)),F=d(A,E,N,P);k=S,O=j,S=w,j=_,w=v,_=x,v=f(m,g,R,L),x=d(g,g,R,L),m=h,g=p,h=c,p=l,c=n,l=i,n=f(R,L,z,F),i=d(R,L,z,F)}u(this.h,0,n,i),u(this.h,2,c,l),u(this.h,4,h,p),u(this.h,6,m,g),u(this.h,8,v,x),u(this.h,10,w,_),u(this.h,12,S,j),u(this.h,14,k,O)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8355:(e,t,r)=>{"use strict";var n=r(8244).rotr32;function i(e,t,r){return e&t^e&r^t&r}t.ft_1=function(e,t,r,n){return 0===e?t&r^~t&n:1===e||3===e?t^r^n:2===e?i(t,r,n):void 0},t.ch32=function(e,t,r){return e&t^~e&r},t.maj32=i,t.p32=function(e,t,r){return e^t^r},t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},8244:(e,t,r)=>{"use strict";var n=r(1130);function i(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=r(376),t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o,a,s=e.charCodeAt(i);s<128?r[n++]=s:(s<2048?r[n++]=s>>6|192:((o=e,a=i,55296!=(64512&o.charCodeAt(a))||a<0||a+1>=o.length||56320!=(64512&o.charCodeAt(a+1)))?r[n++]=s>>12|224:(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128),r[n++]=s>>6&63|128),r[n++]=63&s|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},t.htonl=i,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=i(o)),r+=a(o.toString(16))}return r},t.zero2=o,t.zero8=a,t.join32=function(e,t,r,i){var o,a=r-t;n(a%4==0);for(var s=Array(a/4),c=0,l=t;c<s.length;c++,l+=4)o="big"===i?e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],s[c]=o>>>0;return s},t.split32=function(e,t){for(var r=Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0;e[t]=+(o<n)+r+i>>>
20,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return+(t+n>>>0<t)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=t;return e+r+i+a+(0+(+((c=c+n>>>0)<t)+ +((c=c+o>>>0)<o)+ +((c=c+s>>>0)<s)))>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,l){var u=t;return e+r+i+a+c+(0+(+((u=u+n>>>0)<t)+ +((u=u+o>>>0)<o)+ +((u=u+s>>>0)<s)+ +((u=u+l>>>0)<l)))>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,l){return t+n+o+s+l>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},9021:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty;e.exports=r(5246).call(n,i)},9742:(e,t,r)=>{"use strict";var n=r(3192),i=r(5522),o=r(1130);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=0x1000000000000},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},8405:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,l=c>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+f],f+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+f],f+=d,u-=8);if(0===o)o=1-l;else{if(o===c)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,l=8*o-i-1,u=(1<<l)-1,f=u>>1,d=5960464477539062e-23*(23===i),h=n?0:o-1,p=n?1:-1,y=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?d/c:d*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(t*c-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=p,a/=256,l-=8);e[r+h-p]|=128*y}},376:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},2755:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(5994)(),o=r(4609)("Object.prototype.toString"),a=function(e){return!(i&&e&&"object"===n(e)&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},s=function(e){return!!a(e)||null!==e&&"object"===n(e)&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},c=function(){return a(arguments)}();a.isLegacyArguments=s,e.exports=c?a:s},8625:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r,n,i=Function.prototype.toString,o="object"===("u"<typeof Reflect?"undefined":t(Reflect))&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},o(function(){throw 42},null,r)}catch(e){e!==n&&(o=null)}else o=null;var a=/^\s*class\b/,s=function(e){try{var t=i.call(e);return a.test(t)}catch(e){return!1}},c=function(e){try{return!s(e)&&(i.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),d=function(){return!1};if("object"===("u"<typeof document?"undefined":t(document))){var h=document.all;l.call(h)===l.call(document.all)&&(d=function(e){if((f||!e)&&(void 0===e||"object"===t(e)))try{var r=l.call(e);return("[object HTMLAllCollection]"===r||"[object HTML document.all class]"===r||"[object HTMLCollection]"===r||"[object Object]"===r)&&null==e("")}catch(e){}return!1})}
2e.exports=o?function(e){if(d(e))return!0;if(!e||"function"!=typeof e&&"object"!==t(e))return!1;try{o(e,null,r)}catch(e){if(e!==n)return!1}return!s(e)&&c(e)}:function(e){if(d(e))return!0;if(!e||"function"!=typeof e&&"object"!==t(e))return!1;if(u)return c(e);if(s(e))return!1;var r=l.call(e);return!("[object Function]"!==r&&"[object GeneratorFunction]"!==r&&!/^\[object HTML/.test(r))&&c(e)}},6738:(e,t,r)=>{"use strict";var n=r(4609),i=r(8894)(/^\s*(?:function)?\*/),o=r(5994)(),a=r(2460),s=n("Object.prototype.toString"),c=n("Function.prototype.toString"),l=r(7856);e.exports=function(e){if("function"!=typeof e)return!1;if(i(c(e)))return!0;if(!o)return"[object GeneratorFunction]"===s(e);if(!a)return!1;var t=l();return t&&a(e)===t.prototype}},2703:e=>{"use strict";e.exports=function(e){return e!=e}},2191:(e,t,r)=>{"use strict";var n=r(3862),i=r(7921),o=r(2703),a=r(4828),s=r(2568),c=n(a(),Number);i(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},4828:(e,t,r)=>{"use strict";var n=r(2703);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},2568:(e,t,r)=>{"use strict";var n=r(7921),i=r(4828);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2975:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i,o=r(4609),a=r(5994)(),s=r(9021),c=r(1554);if(a){var l=o("RegExp.prototype.exec"),u={},f=function(){throw u},d={toString:f,valueOf:f};"symbol"===n(Symbol.toPrimitive)&&(d[Symbol.toPrimitive]=f),i=function(e){if(!e||"object"!==n(e))return!1;var t=c(e,"lastIndex");if(!t||!s(t,"value"))return!1;try{l(e,d)}catch(e){return e===u}}}else{var h=o("Object.prototype.toString");i=function(e){return!(!e||"object"!==n(e)&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=i},7913:(e,t,r)=>{"use strict";var n=r(1482);e.exports=function(e){return!!n(e)}},7577:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},3138:e=>{"use strict";function t(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(e){if("string"==typeof e)return i(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t,r){if(s())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var i=new(e.bind.apply(e,n));return r&&a(i,r.prototype),i}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}function c(){this._pres=new Map,this._posts=new Map}function l(e,t,r,n,i,o,a){return o.useErrorHandlers?e.execPost(r,n,i,{error:t},function(e){return"function"==typeof a&&a(e)}):"function"==typeof a&&a(t)}function u(e,t,r,n){var i;try{i=e.apply(t,r)}catch(e){return n(e)}f(i)&&i.then(function(){return n()},function(e){return n(e)})}function f(e){return"object"===r(e)&&null!==e&&"function"==typeof e.then}function d(e){var t=!1,r=this;return function(){var n=arguments;if(!t)return t=!0,h(function(){return e.apply(r,n)})}}c.skipWrappedFunction=function(){if(!(this instanceof c.skipWrappedFunction))return o(c.skipWrappedFunction,Array.prototype.slice.call(arguments));this.args=Array.prototype.slice.call(arguments)},c.overwriteResult=function(){if(!(this instanceof c.overwriteResult))return o(c.overwriteResult,Array.prototype.slice.call(arguments));this.args=Array.prototype.slice.call(arguments)},c.prototype.execPre=function(e,t,r,n){3==arguments.length&&(n=r,r=[]);var i=this._pres.get(e)||[],o=i.length,a=i.numAsync||0,s=0,l=a,p=!1,y=r,b=null;if(!o)return h(function(){n(null)});function m(){if(!(s>=o)){var e=i[s];if(e.isAsync){var r=[d(g),d(function(e){if(e){if(p)return;if(!(e instanceof c.skipWrappedFunction))return p=!0,n(e);b=e}if(0==--l&&s>=o)return n(b)})];
2u(e.fn,t,r,r[0])}else if(e.fn.length>0){for(var a=[d(g)],v=arguments.length>=2?arguments:[null].concat(y),x=1;x<v.length;++x)x===v.length-1&&"function"==typeof v[x]||a.push(v[x]);u(e.fn,t,a,a[0])}else{var w=null;try{w=e.fn.call(t)}catch(e){if(null!=e)return n(e)}if(f(w))w.then(function(){return g()},function(e){return g(e)});else{if(++s>=o)return l>0?void 0:h(function(){n(b)});m()}}}}function g(e){if(e){if(p)return;if(!(e instanceof c.skipWrappedFunction))return p=!0,n(e);b=e}if(++s>=o)return l>0?void 0:n(b);m.apply(t,arguments)}m.apply(null,[null].concat(r))},c.prototype.execPreSync=function(e,t,r){for(var n=this._pres.get(e)||[],i=n.length,o=0;o<i;++o)n[o].fn.apply(t,r||[])},c.prototype.execPost=function(e,t,r,n,i){arguments.length<5&&(i=n,n=null);var o=this._posts.get(e)||[],a=o.length,s=0,l=null;if(n&&n.error&&(l=n.error),!a)return h(function(){i.apply(null,[l].concat(r))});!function e(){for(var n=o[s].fn,h=0,y=r.length,b=[],m=0;m<y;++m)h+=r[m]&&r[m]._kareemIgnore?0:1,r[m]&&r[m]._kareemIgnore||b.push(r[m]);if(l)if(p(o[s],h)){var g=d(function(t){if(t){if(t instanceof c.overwriteResult)return r=t.args,++s>=a?i.call(null,l):e();l=t}if(++s>=a)return i.call(null,l);e()});u(n,t,[l].concat(b).concat([g]),g)}else{if(++s>=a)return i.call(null,l);e()}else{var v,x,w=d(function(t){return t?t instanceof c.overwriteResult?(r=t.args,++s>=a?i.apply(null,[null].concat(r)):e()):(l=t,e()):++s>=a?i.apply(null,[null].concat(r)):void e()});if(p(o[s],h))return++s>=a?i.apply(null,[null].concat(r)):e();if(n.length===h+1)u(n,t,b.concat([w]),w);else{try{x=n.apply(t,b)}catch(e){v=e,l=e}if(f(x))return x.then(function(e){w(e instanceof c.overwriteResult?e:null)},function(e){return w(e)});if(x instanceof c.overwriteResult&&(r=x.args),++s>=a)return i.apply(null,[v].concat(r));e()}}}()},c.prototype.execPostSync=function(e,t,r){for(var n=this._posts.get(e)||[],i=n.length,o=0;o<i;++o){var a=n[o].fn.apply(t,r||[]);a instanceof c.overwriteResult&&(r=a.args)}return r},c.prototype.createWrapperSync=function(e,t){var r=this;return function(){r.execPreSync(e,this,arguments);var n=t.apply(this,arguments);return r.execPostSync(e,this,[n])[0]}},c.prototype.wrap=function(e,t,r,o,a){var s=o.length>0?o[o.length-1]:null,u=Array.from(o);"function"==typeof s&&u.pop();var d=this,h=(a=a||{}).checkForPromise;this.execPre(e,r,o,function(o){if(o&&!(o instanceof c.skipWrappedFunction)){for(var p=a.numCallbackParams||0,y=a.contextParameter?[r]:[],b=y.length;b<p;++b)y.push(null);return l(d,o,e,r,y,a,s)}var m,g,v=t.length;if(o instanceof c.skipWrappedFunction)return m=o.args[0],x.apply(void 0,[null].concat(function(e){if(Array.isArray(e))return i(e)}(g=o.args)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(g)||n(g)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));try{m=t.apply(r,u.concat(x))}catch(e){return x(e)}if(h){if(f(m))return m.then(function(e){return x(null,e)},function(e){return x(e)});if(v<u.length+1)return x(null,m)}function x(){var t=Array.from(arguments);if(t.shift(),a.nullResultByDefault&&0===t.length&&t.push(null),arguments[0])return l(d,arguments[0],e,r,t,a,s);d.execPost(e,r,t,function(){null!==s&&(arguments[0]?s(arguments[0]):s.apply(r,arguments))})}})},c.prototype.filter=function(e){for(var t=this,r=this.clone(),n=Array.from(r._pres.keys()),i=0;i<n.length;i++)!function(){var o=n[i],a=t._pres.get(o).map(function(e){return Object.assign({},e,{name:o})}).filter(e);if(0===a.length)return r._pres.delete(o);a.numAsync=a.filter(function(e){return e.isAsync}).length,r._pres.set(o,a)}();for(var o=Array.from(r._posts.keys()),a=0;a<o.length;a++)!function(){var n=o[a],i=t._posts.get(n).map(function(e){return Object.assign({},e,{name:n})}).filter(e);if(0===i.length)return r._posts.delete(n);r._posts.set(n,i)}();return r},c.prototype.hasHooks=function(e){return this._pres.has(e)||this._posts.has(e)},c.prototype.createWrapper=function(e,t,r,n){var i=this;return this.hasHooks(e)?function(){i.wrap(e,t,r||this,Array.from(arguments),n)}:function(){var e=arguments,r=this;h(function(){return t.apply(r,e)})}},c.prototype.pre=function(e,t,n,i,o){var a={};"object"===r(t)&&null!==t?t=(a=t).isAsync:"boolean"!=typeof arguments[1]&&(n=t,t=!1);var s=this._pres.get(e)||[];if(this._pres.set(e,s),t&&(s.numAsync=s.numAsync||0,++s.numAsync),"function"!=typeof n)throw Error('pre() requires a function, got "'+r(n)+'"');return o?s.unshift(Object.assign({},a,{fn:n,isAsync:t})):s.push(Object.assign({},a,{fn:n,isAsync:t})),this},c.prototype.post=function(e,t,n,i){var o=this._posts.get(e)||[];if("function"==typeof t&&(i=!!n,n=t,t={}),"function"!=typeof n)throw Error('post() requires a function, got "'+r(n)+'"');return i?o.unshift(Object.assign({},t,{fn:n})):o.push(Object.assign({},t,{fn:n})),this._posts.set(e,o),this},c.prototype.clone=function(){var e,r=new c,n=t(this._pres.keys());try{for(n.s();!(e=n.n()).done;){var i=e.value,o=this._pres.get(i).slice();o.numAsync=this._pres.get(i).numAsync,r._pres.set(i,o)}}catch(e){n.e(e)}finally{n.f()}var a,s=t(this._posts.keys());try{for(s.s();!(a=s.n()).done;){var l=a.value;r._posts.set(l,this._posts.get(l).slice())}}catch(e){s.e(e)}finally{s.f()}return r},c.prototype.merge=function(e,r){var n,i=(r=1==arguments.length||r)?this.clone():this,o=t(e._pres.keys());try{for(o.s();!(n=o.n()).done;)!function(){var t=n.value,r=i._pres.get(t)||[],o=e._pres.get(t).filter(function(e){return -1===r.map(function(e){return e.fn}).indexOf(e.fn)}),a=r.concat(o);a.numAsync=r.numAsync||0,a.numAsync+=o.filter(function(e){return e.isAsync}).length,i._pres.set(t,a)}()}catch(e){o.e(e)}finally{o.f()}var a,s=t(e._posts.keys());try{for(s.s();!(a=s.n()).done;)!function(){var t=a.value,r=i._posts.get(t)||[],n=e._posts.get(t).filter(function(e){return -1===r.indexOf(e)});i._posts.set(t,r.concat(n))}()}catch(e){s.e(e)}finally{s.f()}return i};var h=(r({env:{}}),function(e){setTimeout(e,0)});function p(e,t){return!!e.errorHandler||e.fn.length===t+2}e.exports=c},3646:e=>{"use strict";e.exports=Math.abs},8002:e=>{"use strict";e.exports=Math.floor},8654:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},7803:e=>{"use strict";e.exports=Math.max},4207:e=>{"use strict";e.exports=Math.min},707:e=>{"use strict";e.exports=Math.pow},6396:e=>{"use strict";e.exports=Math.round},4335:(e,t,r)=>{"use strict";var n=r(8654);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},722:(e,t,r)=>{"use strict";var n=r(376),i=r(5125),o=r(9047).Buffer,a=Array(16);function s(){i.call(this,64),this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476}function c(e,t){return e<<t|e>>>32-t}function l(e,t,r,n,i,o,a){return c(e+(t&r|~t&n)+i+o|0,a)+t|0}function u(e,t,r,n,i,o,a){return c(e+(t&n|r&~n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return c(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return c(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=0;e<16;++e)a[e]=this._block.readInt32LE(4*e);var t=this._a,r=this._b,n=this._c,i=this._d;t=l(t,r,n,i,a[0],0xd76aa478,7),i=l(i,t,r,n,a[1],0xe8c7b756,12),n=l(n,i,t,r,a[2],0x242070db,17),r=l(r,n,i,t,a[3],0xc1bdceee,22),t=l(t,r,n,i,a[4],0xf57c0faf,7),i=l(i,t,r,n,a[5],0x4787c62a,12),n=l(n,i,t,r,a[6],0xa8304613,17),r=l(r,n,i,t,a[7],0xfd469501,22),t=l(t,r,n,i,a[8],0x698098d8,7),i=l(i,t,r,n,a[9],0x8b44f7af,12),n=l(n,i,t,r,a[10],0xffff5bb1,17),r
2=l(r,n,i,t,a[11],0x895cd7be,22),t=l(t,r,n,i,a[12],0x6b901122,7),i=l(i,t,r,n,a[13],0xfd987193,12),n=l(n,i,t,r,a[14],0xa679438e,17),t=u(t,r=l(r,n,i,t,a[15],0x49b40821,22),n,i,a[1],0xf61e2562,5),i=u(i,t,r,n,a[6],0xc040b340,9),n=u(n,i,t,r,a[11],0x265e5a51,14),r=u(r,n,i,t,a[0],0xe9b6c7aa,20),t=u(t,r,n,i,a[5],0xd62f105d,5),i=u(i,t,r,n,a[10],0x2441453,9),n=u(n,i,t,r,a[15],0xd8a1e681,14),r=u(r,n,i,t,a[4],0xe7d3fbc8,20),t=u(t,r,n,i,a[9],0x21e1cde6,5),i=u(i,t,r,n,a[14],0xc33707d6,9),n=u(n,i,t,r,a[3],0xf4d50d87,14),r=u(r,n,i,t,a[8],0x455a14ed,20),t=u(t,r,n,i,a[13],0xa9e3e905,5),i=u(i,t,r,n,a[2],0xfcefa3f8,9),n=u(n,i,t,r,a[7],0x676f02d9,14),t=f(t,r=u(r,n,i,t,a[12],0x8d2a4c8a,20),n,i,a[5],0xfffa3942,4),i=f(i,t,r,n,a[8],0x8771f681,11),n=f(n,i,t,r,a[11],0x6d9d6122,16),r=f(r,n,i,t,a[14],0xfde5380c,23),t=f(t,r,n,i,a[1],0xa4beea44,4),i=f(i,t,r,n,a[4],0x4bdecfa9,11),n=f(n,i,t,r,a[7],0xf6bb4b60,16),r=f(r,n,i,t,a[10],0xbebfbc70,23),t=f(t,r,n,i,a[13],0x289b7ec6,4),i=f(i,t,r,n,a[0],0xeaa127fa,11),n=f(n,i,t,r,a[3],0xd4ef3085,16),r=f(r,n,i,t,a[6],0x4881d05,23),t=f(t,r,n,i,a[9],0xd9d4d039,4),i=f(i,t,r,n,a[12],0xe6db99e5,11),n=f(n,i,t,r,a[15],0x1fa27cf8,16),t=d(t,r=f(r,n,i,t,a[2],0xc4ac5665,23),n,i,a[0],0xf4292244,6),i=d(i,t,r,n,a[7],0x432aff97,10),n=d(n,i,t,r,a[14],0xab9423a7,15),r=d(r,n,i,t,a[5],0xfc93a039,21),t=d(t,r,n,i,a[12],0x655b59c3,6),i=d(i,t,r,n,a[3],0x8f0ccc92,10),n=d(n,i,t,r,a[10],0xffeff47d,15),r=d(r,n,i,t,a[1],0x85845dd1,21),t=d(t,r,n,i,a[8],0x6fa87e4f,6),i=d(i,t,r,n,a[15],0xfe2ce6e0,10),n=d(n,i,t,r,a[6],0xa3014314,15),r=d(r,n,i,t,a[13],0x4e0811a1,21),t=d(t,r,n,i,a[4],0xf7537e82,6),i=d(i,t,r,n,a[11],0xbd3af235,10),n=d(n,i,t,r,a[2],0x2ad7d2bb,15),r=d(r,n,i,t,a[9],0xeb86d391,21),this._a=this._a+t|0,this._b=this._b+r|0,this._c=this._c+n|0,this._d=this._d+i|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},9318:(e,t,r)=>{var n=r(815),i=r(7179);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=Math.ceil(e.bitLength()/8);do var r=new n(this.rand.generate(t));while(r.cmp(e)>=0)return r},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var l=e.shrn(c),u=s.toRed(o);t>0;t--){var f=this._randrange(new n(2),s);r&&r(f);var d=f.toRed(o).redPow(l);if(0!==d.cmp(a)&&0!==d.cmp(u)){for(var h=1;h<c;h++){if(0===(d=d.redSqr()).cmp(a))return!1;if(0===d.cmp(u))break}if(h===c)return!1}}return!0},o.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),o=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var c=e.shrn(s),l=a.toRed(i);t>0;t--){var u=this._randrange(new n(2),a),f=e.gcd(u);if(0!==f.cmpn(1))return f;var d=u.toRed(i).redPow(c);if(0!==d.cmp(o)&&0!==d.cmp(l)){for(var h=1;h<s;h++){if(0===(d=d.redSqr()).cmp(o))return d.fromRed().subn(1).gcd(e);if(0===d.cmp(l))break}if(h===s)return(d=d.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},1130:e=>{function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}},5522:(e,t)=>{"use strict";function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n<e.length;n++)t+=r(e[n].toString(16));return t}t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}},3564:(e,t,r)=>{"use strict";e.exports=r(8424)},8424:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(7355),o=["__proto__","constructor","prototype"];function a(e){return e}t.get=function(e,r,o,s){"function"==typeof o&&(o.length<2?s=o:l=o,o=void 0),s||(s=a);var c="string"==typeof e?i(e):e;if(!Array.isArray(c))throw TypeError("Invalid `path`. Must be either string or array");for(var l,u,f=r,d=0;d<c.length;++d){if(u=c[d],"string"!=typeof c[d]&&"number"!=typeof c[d])throw TypeError("Eac
2h segment of path to `get()` must be a string or number, got "+n(c[d]));if(Array.isArray(f)&&!/^\d+$/.test(u)){var h=c.slice(d);return[].concat(f).map(function(e){return e?t.get(h,e,o||l,s):s(void 0)})}if(l)f=l(f,u);else{var p=o&&f[o]?f[o]:f;f=p instanceof Map?p.get(u):p[u]}if(!f)break}return s(f)},t.has=function(e,t){var r="string"==typeof e?i(e):e;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");for(var o=r.length,a=t,s=0;s<o;++s){if("string"!=typeof r[s]&&"number"!=typeof r[s])throw TypeError("Each segment of path to `has()` must be a string or number, got "+n(r[s]));if(null==a||"object"!==n(a)||!(r[s]in a))return!1;a=a[r[s]]}return!0},t.unset=function(e,t){var r="string"==typeof e?i(e):e;if(!Array.isArray(r))throw TypeError("Invalid `path`. Must be either string or array");for(var a=r.length,s=t,c=0;c<a;++c){if(null==s||"object"!==n(s)||!(r[c]in s))return!1;if("string"!=typeof r[c]&&"number"!=typeof r[c])throw TypeError("Each segment of path to `unset()` must be a string or number, got "+n(r[c]));if(-1!==o.indexOf(r[c]))return!1;if(c===a-1)return delete s[r[c]],!0;s=s instanceof Map?s.get(r[c]):s[r[c]]}return!0},t.set=function(e,r,s,c,l,u){"function"==typeof c&&(c.length<2?l=c:h=c,c=void 0),l||(l=a);var f="string"==typeof e?i(e):e;if(!Array.isArray(f))throw TypeError("Invalid `path`. Must be either string or array");if(null!=s){for(var d=0;d<f.length;++d){if("string"!=typeof f[d]&&"number"!=typeof f[d])throw TypeError("Each segment of path to `set()` must be a string or number, got "+n(f[d]));if(-1!==o.indexOf(f[d]))return}for(var h,p,y=u||/\$/.test(e)&&!1!==u,b=s,m=(d=0,f.length-1);d<m;++d)if("$"!=(p=f[d])){if(Array.isArray(b)&&!/^\d+$/.test(p)){var g=f.slice(d);if(!y&&Array.isArray(r))for(var v=0;v<b.length&&v<r.length;++v)t.set(g,r[v],b[v],c||h,l,y);else for(v=0;v<b.length;++v)t.set(g,r,b[v],c||h,l,y);return}if(h)b=h(b,p);else{var x=c&&b[c]?b[c]:b;b=x instanceof Map?x.get(p):x[p]}if(!b)return}else if(d==m-1)break;if(p=f[m],c&&b[c]&&(b=b[c]),Array.isArray(b)&&!/^\d+$/.test(p))if(!y&&Array.isArray(r))!function e(t,r,n,i,o,a){for(var s,c=0;c<t.length&&c<r.length;++c)Array.isArray(s=t[c])&&Array.isArray(r[c])?e(s,r[c],n,i,o,a):s&&(i?i(s,n,a(r[c])):(s[o]&&(s=s[o]),s[n]=a(r[c])
2))}(b,r,p,h,c,l);else for(v=0;v<b.length;++v){var w=b[v];w&&(h?h(w,p,l(r)):(w[c]&&(w=w[c]),w[p]=l(r)))}else h?h(b,p,l(r)):b instanceof Map?b.set(p,l(r)):b[p]=l(r)}},t.stringToParts=i},7355:e=>{"use strict";e.exports=function(e){for(var t=[],r="",n="DEFAULT",i=0;i<e.length;++i)"IN_SQUARE_BRACKETS"!==n||/\d/.test(e[i])||"]"===e[i]||(n="DEFAULT",r=t[t.length-1]+"["+r,t.splice(t.length-1,1)),"["===e[i]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(t.push(r),r=""),n="IN_SQUARE_BRACKETS"):"]"===e[i]?"IN_SQUARE_BRACKETS"===n?(n="IMMEDIATELY_AFTER_SQUARE_BRACKETS",t.push(r),r=""):(n="DEFAULT",r+=e[i]):"."===e[i]?("IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&(t.push(r),r=""),n="DEFAULT"):r+=e[i];return"IMMEDIATELY_AFTER_SQUARE_BRACKETS"!==n&&t.push(r),t}},2068:e=>{function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t,r,n){return Math.round(e/r)+" "+n+(t>=1.5*r?"s":"")}
2e.exports=function(e,n){n=n||{};var i,o,a=t(e);if("string"===a&&e.length>0){var s=e;if(!((s=String(s)).length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(c){var l=parseFloat(c[1]);switch((c[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*l;case"weeks":case"week":case"w":return 6048e5*l;case"days":case"day":case"d":return 864e5*l;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*l;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*l;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*l;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l}}}return}if("number"===a&&isFinite(e))return n.long?(o=Math.abs(e))>=864e5?r(e,o,864e5,"day"):o>=36e5?r(e,o,36e5,"hour"):o>=6e4?r(e,o,6e4,"minute"):o>=1e3?r(e,o,1e3,"second"):e+" ms":(i=Math.abs(e))>=864e5?Math.round(e/864e5)+"d":i>=36e5?Math.round(e/36e5)+"h":i>=6e4?Math.round(e/6e4)+"m":i>=1e3?Math.round(e/1e3)+"s":e+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},692:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},4710:(e,t,r)=>{"use strict";var n=r(7921),i=r(3862),o=r(692),a=r(9292),s=r(9228),c=i(a(),Object);n(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},9292:(e,t,r)=>{"use strict";var n=r(692);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9228:(e,t,r)=>{"use strict";var n=r(9292),i=r(7921);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6164:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}if(!Object.keys){var i,o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=r(5184),c=Object.prototype.propertyIsEnumerable,l=!c.call({toString:null},"toString"),u=c.call(function(){},"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("u"<typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&o.call(window,e)&&null!==window[e]&&"object"===n(window[e]))try{d(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();i=function(e){var t=null!==e&&"object"===n(e),r="[object Function]"===a.call(e),i=s(e),c=t&&"[object String]"===a.call(e),h=[];if(!t&&!r&&!i)throw TypeError("Object.keys called on a non-object");var y=u&&r;if(c&&e.length>0&&!o.call(e,0))for(var b=0;b<e.length;++b)h.push(String(b));if(i&&e.length>0)for(var m=0;m<e.length;++m)h.push(String(m));else for(var g in e)y&&"prototype"===g||!o.call(e,g)||h.push(String(g));if(l)for(var v=function(e){if("u"<typeof window||!p)return d(e);try{return d(e)}catch(e){return!1}}(e),x=0;x<f.length;++x)v&&"constructor"===f[x]||!o.call(e,f[x])||h.push(f[x]);return h}}e.exports=i},3818:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(5184),o=Object.keys,a=o?function(e){return o(e)}:r(6164),s=Object.keys;a.shim=function(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)}):Object.keys=a,Object.keys||a},e.exports=a},5184:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=Object.prototype.toString;e.exports=function(e){var n=r.call(e),i="[object Arguments]"===n;
2return i||(i="[object Array]"!==n&&null!==e&&"object"===t(e)&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),i}},7061:(e,t,r)=>{"use strict";var n=r(7406);t.certificate=r(458),t.RSAPrivateKey=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}),t.RSAPublicKey=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});var i=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())});t.PublicKey=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())}),t.PrivateKey=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())}),t.EncryptedPrivateKey=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}),t.DSAPrivateKey=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}),t.DSAparam=n.define("DSAparam",function(){this.int()});var o=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.ECPrivateKey=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(o),this.key("publicKey").optional().explicit(1).bitstr())}),t.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},458:(e,t,r)=>{"use strict";var n=r(7406),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),c=n.define("RelativeDistinguishedName",function(){this.setof(o)}),l=n.define("RDNSequence",function(){this.seqof(c)}),u=n.define("Name",function(){this.choice({rdnSequence:this.use(l)})}),f=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),d=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),h=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(f),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())});e.exports=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())})},1120:(e,t,r)=>{"use strict";var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(1248),s=r(4881),c=r(9047).Buffer;e.exports=function(e,t){var r,l=e.toString(),u=l.match(n);if(u){var f="aes"+u[1],d=c.from(u[2],"hex"),h=c.from(u[3].replace(/[\r\n]/g,""),"base64"),p=a(t,d.slice(0,8),parseInt(u[1],10)).key,y=[],b=s.createDecipheriv(f,p,d);y.push(b.update(h)),y.push(b.final()),r=c.concat(y)}else{var m=l.match(o);r=c.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:l.match(i)[1],data:r}}},2914:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(7061),o=r(2562),a=r(1120),s=r(4881),c=r(9379).pbkdf2Sync,l=r(9047).Buffer;function u(e){"object"!==n(e)||l.isBuffer(e)||(g=e.passphrase,e=e.key),"string"==typeof e&&(e=l.from(e));var t,r,u,f,d,h,p,y,b,m,g,v,x,w=a(e,g),_=w.tag,S=w.data;switch(_){case"CERTIFICATE":x=i.certificate.decode(S,"der").tbsCertificate.subjectPublicKeyInfo;
2case"PUBLIC KEY":switch(x||(x=i.PublicKey.decode(S,"der")),v=x.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(x.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return x.subjectPrivateKey=x.subjectPublicKey,{type:"ec",data:x};case"1.2.840.10040.4.1":return x.algorithm.params.pub_key=i.DSAparam.decode(x.subjectPublicKey.data,"der"),{type:"dsa",data:x.algorithm.params};default:throw Error("unknown key id "+v)}case"ENCRYPTED PRIVATE KEY":t=S=i.EncryptedPrivateKey.decode(S,"der"),r=g,u=t.algorithm.decrypt.kde.kdeparams.salt,f=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=o[t.algorithm.decrypt.cipher.algo.join(".")],h=t.algorithm.decrypt.cipher.iv,p=t.subjectPrivateKey,y=c(r,u,f,parseInt(d.split("-")[1],10)/8,"sha1"),b=s.createDecipheriv(d,y,h),(m=[]).push(b.update(p)),m.push(b.final()),S=l.concat(m);case"PRIVATE KEY":switch(v=(x=i.PrivateKey.decode(S,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(x.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:x.algorithm.curve,privateKey:i.ECPrivateKey.decode(x.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return x.algorithm.params.priv_key=i.DSAparam.decode(x.subjectPrivateKey,"der"),{type:"dsa",params:x.algorithm.params};default:throw Error("unknown key id "+v)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(S,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(S,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(S,"der")};case"EC PRIVATE KEY":return{curve:(S=i.ECPrivateKey.decode(S,"der")).parameters.value,privateKey:S.privateKey};default:throw Error("unknown key type "+_)}}u.signature=i.signature,e.exports=u},9379:(e,t,r)=>{"use strict";t.pbkdf2=r(8099),t.pbkdf2Sync=r(3180)},8099:(e,t,r)=>{"use strict";var n,i,o=r(9047).Buffer,a=r(2042),s=r(8994),c=r(3180),l=r(7238),u=r.g.crypto&&r.g.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function h(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(e,t,r,n,i){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)}).then(function(e){return o.from(e)})}e.exports=function(e,t,i,y,b,m){if("function"==typeof b&&(m=b,b=void 0),y=a(i,y),e=l(e,s,"Password"),t=l(t,s,"Salt"),"function"!=typeof m)throw Error("No callback provided to pbkdf2");var g,v,x=f[(b=b||"sha1").toLowerCase()];x&&"function"==typeof r.g.Promise?(g=(function(e){if(r.g.process&&!r.g.process.browser||!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var t=p(n=n||o.alloc(8),n,10,128,e).then(function(){return!0},function(){return!1});return d[e]=t,t})(x).then(function(r){return r?p(e,t,i,y,x):c(e,t,i,y,b)}),v=m,g.then(function(e){h()(function(){v(null,e)})},function(e){h()(function(){v(e)})})):h()(function(){var r;try{r=c(e,t,i,y,b)}catch(e){return void m(e)}m(null,r)})}},8994:(e,t,r)=>{"use strict";e.exports=r.g.process&&r.g.process.browser?"utf-8":r.g.process&&r.g.process.version?parseInt((void 0).split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8"},2042:e=>{"use strict";var t=isFinite;e.exports=function(e,r){if("number"!=typeof e)throw TypeError("Iterations not a number");if(e<0||!t(e))throw TypeError("Bad iterations");
2if("number"!=typeof r)throw TypeError("Key length not a number");if(r<0||r>0x3fffffff||r!=r)throw TypeError("Bad key length");return r+0}},3180:(e,t,r)=>{"use strict";var n=r(3277),i=r(8100),o=r(1806),a=r(9047).Buffer,s=r(2042),c=r(8994),l=r(7238),u=a.alloc(128),f={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},d={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function h(e){return(new i).update(e).digest()}function p(e,t,r){var i="rmd160"===e||"ripemd160"===e?h:"md5"===e?n:function(t){return o(e).update(t).digest()},s="sha512"===e||"sha384"===e?128:64;t.length>s?t=i(t):t.length<s&&(t=a.concat([t,u],s));for(var c=a.allocUnsafe(s+f[e]),l=a.allocUnsafe(s+f[e]),d=0;d<s;d++)c[d]=54^t[d],l[d]=92^t[d];var p=a.allocUnsafe(s+r+4);c.copy(p,0,0,s),this.ipad1=p,this.ipad2=c,this.opad=l,this.alg=e,this.blocksize=s,this.hash=i,this.size=f[e]}p.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){n=s(r,n),e=l(e,c,"Password"),t=l(t,c,"Salt");var o=(i||"sha1").toLowerCase(),u=d[o]||o,h=f[u];if("number"!=typeof h||!h)throw TypeError("Digest algorithm not supported: "+i);var y=new p(u,e,t.length),b=a.allocUnsafe(n),m=a.allocUnsafe(t.length+4);t.copy(m,0,0,t.length);for(var g=0,v=Math.ceil(n/h),x=1;x<=v;x++){m.writeUInt32BE(x,t.length);for(var w=y.run(m,y.ipad1),_=w,S=1;S<r;S++){_=y.run(_,y.ipad2);for(var j=0;j<h;j++)w[j]^=_[j]}w.copy(b,g),g+=h}return b}},7238:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(2988),o="u">typeof Uint8Array,a=o&&"u">typeof ArrayBuffer&&ArrayBuffer.isView;e.exports=function(e,t,r){if("string"==typeof e||n.isBuffer(e)||o&&e instanceof Uint8Array||a&&a(e))return i(e,t);throw TypeError(r+" must be a string, a Buffer, a Uint8Array, or a DataView")}},7373:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},8927:e=>{"use strict";e.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw TypeError('"callback" argument must be a function');var i,o,a=arguments.length;switch(a){case 0:case 1:return({env:{}}).nextTick(e);case 2:return({env:{}}).nextTick(function(){e.call(null,t)});case 3:return({env:{}}).nextTick(function(){e.call(null,t,r)});case 4:return({env:{}}).nextTick(function(){e.call(null,t,r,n)});default:for(i=Array(a-1),o=0;o<i.length;)i[o++]=arguments[o];return({env:{}}).nextTick(function(){e.apply(null,i)})}}}},2368:(e,t,r)=>{t.publicEncrypt=r(2385),t.privateDecrypt=r(8752),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},4075:(e,t,r)=>{var n=r(8339),i=r(9047).Buffer;e.exports=function(e,t){for(var r,o=i.alloc(0),a=0;o.length<t;)r=function(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}(a++),o=i.concat([o,n("sha1").update(e).update(r).digest()]);return o.slice(0,t)}},8752:(e,t,r)=>{var n=r(2914),i=r(4075),o=r(782),a=r(815),s=r(4364),c=r(8339),l=r(1675),u=r(9047).Buffer;e.exports=function(e,t,r){var f,d=e.padding?e.padding:r?1:4,h=n(e),p=h.modulus.byteLength();if(t.length>p||new a(t).cmp(h.modulus)>=0)throw Error("decryption error");f=r?l(new a(t),h):s(t,h);var y=u.alloc(p-f.length);if(f=u.concat([y,f],p),4===d)return function(e,t){var r=e.modulus.byteLength(),n=c("sha1").update(u.alloc(0)).digest(),a=n.length;if(0!==t[0])throw Error("decryption error");var s=t.slice(1,a+1),l=t.slice(a+1),f=o(s,i(l,a)),d=o(l,i(f,r-a-1));if(function(e,t){e=u.from(e),t=u.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var i=-1;++i<n;)r+=e[i]^t[i];return r}(n,d.slice(0,a)))throw Error("decryption error");for(var h=a;0===d[h];)h++;if(1!==d[h++])throw Error("decryption error");return d.slice(h)}(h,f);if(1===d){for(var b=f,m=b.slice(0,2),g=2,v=0;0!==b[g++];)if(g>=b.length){v++;break}var x=b.slice(2,g-1);if(("0002"!==m.toString("hex")&&!r||"0001"!==m.toString("hex")&&r)&&v++,x.length<8&&v++,v)throw Error("decryption error");return b.slice(g)}if(3===d)return f;throw Error("unknown padding")}},2385:(e,t,r)=>{var n=r(2914),i=r(5760),o=r(8339),a=r(4075),s=r(782),c=r(815),l=r(1675),u=r(4364),f=r(9047).Buffer;e.exports=function(e,t,r){var d,h=e.padding?e.padding:r?1:4,p=n(e);if(4===h)d=function(e,t){var r=e.modulus.byteLength(),n=t.length,l=o("sha1").update(f.alloc(0)).digest(),u=l.length,d=2*u;if(n>r-d-2)throw Error("message too long");var h=f.alloc(r-n-d-2),p=r-u-1,y=i(u),b=s(f.concat([l,h,f.alloc(1,1),t],p),a(y,p)),m=s(y,a(b,u));return new c(f.concat([f.alloc(1),m,b],r))}(p,t);else if(1===h)d=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw Error("message too long");return n=r?f.alloc(a-o-3,255):function(e){for(var t,r=f.allocUnsafe(e),n=0,o=i(2*e),a=0;n<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(r[n++]=t);return r}(a-o-3),new c(f.concat([f.from([0,r?1:2]),n,f.alloc(1),t],a))}(p,t,r);else{if(3!==h)throw Error("unknown padding");if((d=new c(t)).cmp(p.modulus)>=0)throw Error("data too long for modulus")}return r?u(d,p):l(d,p)}},1675:(e,t,r)=>{var n=r(815),i=r(9047).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},782:e=>{e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},5760:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r.g.crypto||r.g.msCrypto;i&&i.getRandomValues?e.exports=function(e,t){if(e>0xffffffff)throw RangeError("requested too many random bytes");var r=n.allocUnsafe(e);if(e>0)if(e>65536)for(var o=0;o<e;o+=65536)i.getRandomValues(r.slice(o,o+65536));else i.getRandomValues(r);return"function"==typeof t?({env:{}}).nextTick(function(){t(null,r)}
2):r}:e.exports=function(){throw Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},9301:(e,t,r)=>{"use strict";var n=r(9047),i=r(5760),o=n.Buffer,a=n.kMaxLength,s=r.g.crypto||r.g.msCrypto;function c(e,t){if("number"!=typeof e||e!=e)throw TypeError("offset must be a number");if(e>0xffffffff||e<0)throw TypeError("offset must be a uint32");if(e>a||e>t)throw RangeError("offset out of range")}function l(e,t,r){if("number"!=typeof e||e!=e)throw TypeError("size must be a number");if(e>0xffffffff||e<0)throw TypeError("size must be a uint32");if(e+t>r||e>a)throw RangeError("buffer too small")}function u(e,t,r,n){if(!n)return i(r).copy(e,t),e;i(r,function(r,i){if(r)return n(r);i.copy(e,t),n(null,e)})}s&&s.getRandomValues,t.randomFill=function(e,t,n,i){if(!(o.isBuffer(e)||e instanceof r.g.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,n=e.length;else if("function"==typeof n)i=n,n=e.length-t;else if("function"!=typeof i)throw TypeError('"cb" argument must be a function');return c(t,e.length),l(n,t,e.length),u(e,t,n,i)},t.randomFillSync=function(e,t,n){if(void 0===t&&(t=0),!(o.isBuffer(e)||e instanceof r.g.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');return c(t,e.length),void 0===n&&(n=e.length-t),l(n,t,e.length),u(e,t,n)}},4611:(e,t,r)=>{"use strict";var n=r(8927),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=Object.create(r(2077));o.inherits=r(376);var a=r(3196),s=r(679);o.inherits(f,a);for(var c=i(s.prototype),l=0;l<c.length;l++){var u=c[l];f.prototype[u]||(f.prototype[u]=s.prototype[u])}function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},3684:(e,t,r)=>{"use strict";e.exports=o;var n=r(4951),i=Object.create(r(2077));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(376),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},3196:(e,t,r)=>{"use strict";var n=r(8927);e.exports=g;var i,o=r(7577);g.ReadableState=m,r(9620).EventEmitter;var a=function(e,t){return e.listeners(t).length},s=r(6054),c=r(4083).Buffer,l=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},u=Object.create(r(2077));u.inherits=r(376);var f=r(4616),d=void 0;d=f&&f.debuglog?f.debuglog("stream"):function(){};var h,p=r(9072),y=r(4798);u.inherits(g,s);var b=["error","close","destroy","pause","resume"];function m(e,t){e=e||{};var n=t instanceof(i=i||r(4611));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r(113).s),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function g(e){if(i=i||r(4611),!(this instanceof g))return new g(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function v(e,t,r,n,i){var o,a,s,u,f,d=e._readableState;return null===t?(d.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,_(e)}}(e,d)):(i||(o=d,a=t,c.isBuffer(a)||a instanceof l||"string"==typeof a||void 0===a||o.objectMode||(s=TypeError("Invalid non-string/buffer chunk")),f=s),f?e.emit("error",f):d.objectMode||t&&t.length>0?("string"==typeof t||d.objectMode||Object.getPrototypeOf(t)===c.prototype||(u=t,t=c.from(u)),n?d.endEmitted?e.emit("error",Error("stream.unshift() after end event")):x(e,d,t,!0):d.ended?e.emit("error",Error("stream.push() after EOF")):(d.reading=!1,d.decoder&&!r?(t=d.decoder.write(t),d.objectMode||0!==t.length?x(e,d,t,!1):j(e,d)):x(e,d,t,!1))
vendor: 4,170 bytes, line 2
2):n||(d.reading=!1)),!d.ended&&(d.needReadable||d.length<d.highWaterMark||0===d.length)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&_(e)),j(e,t)}function w(e,t){var r;return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&((r=e)>=8388608?r=8388608:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),t.highWaterMark=r),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),A(e)}function j(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(d("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){d("readable nexttick read 0"),e.read(0)}function $(e,t){t.reading||(d("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function E(e,t){var r,n,i,o;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):(n=t.buffer,i=t.decoder,e<n.head.data.length?(o=n.head.data.slice(0,e),n.head.data=n.head.data.slice(e)):o=e===n.head.data.length?n.shift():i?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0==(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,n):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,n),r=o),r)}function N(e){var t=e._readableState;if(t.length>0)throw Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(P,t,e))}function P(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(e,t){this.push(null),t(e)},g.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),v(this,e,t,!1,r)},g.prototype.unshift=function(e){return v(this,e,null,!0,!1)},g.prototype.isPaused=function(){return!1===this._readableState.flowing},g.prototype.setEncoding=function(e){return h||(h=r(113).s),this._readableState.decoder=new h(e),this._readableState.encoding=e,this},g.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):_(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",i=!0),t.ended||t.reading?d("reading or ended",i=!1):i&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=w(r,t))),null===(n=e>0?E(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&N(this)),null!==n&&this.emit
2("data",n),n},g.prototype._read=function(e){this.emit("error",Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||void 0===e||void 0===e?m:c;function c(){d("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",function t(n,o){d("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",b),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",h),u=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&l())});var l=function(){var e=r._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(r,"data")&&(e.flowing=!0,A(r))};e.on("drain",l);var u=!1,f=!1;function h(t){d("ondata"),f=!1,!1!==e.write(t)||f||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==M(i.pipes,e))&&!u&&(d("false write response, pause",i.awaitDrain),i.awaitDrain++,f=!0),r.pause())}function p(t){d("onerror",t),m(),e.removeListener("error",p),0===a(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",b),m()}function b(){d("onfinish"),e.removeListener("close",y),m()}function m(){d("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prepe
2ndListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",y),e.once("finish",b),e.emit("pipe",r),i.flowing||(d("pipe resume"),r.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},g.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&_(this):n.nextTick(O,this))}return r},g.prototype.addListener=g.prototype.on,g.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!0,e.resumeScheduled||(e.resumeScheduled=!0,n.nextTick($,this,e))),this},g.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this},g.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){d("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<b.length;o++)e.on(b[o],this.emit.bind(this,b[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=E},4951:(e,t,r)=>{"use strict";e.exports=a;var n=r(4611),i=Object.create(r(2077));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){c(e,t,r)}):c(this,null,null)}function c(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(376),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},679:(e,t,r)=>{"use strict";var n=r(8927);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree.next=t}}e.exports=b;var o,a=["v0.10","v0.9."].indexOf((void 0).slice(0,5))>-1?setImmediate:n.nextTick;b.WritableState=y;var s=Object.create(r(2077));s.inherits=r(376);var c,l={deprecate:r(8016)},u=r(6054),f=r(4083).Buffer,d=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},h=r(4798);function p(){}function y(e,t){o=o||r(4611),e=e||{};var s=t instanceof o;this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var c=e.highWaterMark,l=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=c||0===c?c:s&&(l||0===l)?l:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){var r=t,i=e,o=r._writableState,s=o.sync,c=o.writecb;if(o.writing=!1,o.writecb=null,o.length-=o.writelen,o.writelen=0,i)--o.pe
2ndingcb,s?(n.nextTick(c,i),n.nextTick(_,r,o),r._writableState.errorEmitted=!0,r.emit("error",i)):(c(i),r._writableState.errorEmitted=!0,r.emit("error",i),_(r,o));else{var l=x(o);l||o.corked||o.bufferProcessing||!o.bufferedRequest||v(r,o),s?a(g,r,o,l,c):g(r,o,l,c)}},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function b(e){if(o=o||r(4611),!(c.call(b,this)||this instanceof o))return new b(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function m(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function g(e,t,r,n){r||0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain")),t.pendingcb--,n(),_(e,t)}function v(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,m(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,u=r.callback;if(m(e,t,!1,t.objectMode?1:c.length,c,l,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function w(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),_(e,t)})}function _(e,t){var r=x(t);return r&&(t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,n.nextTick(w,e,t)):(t.prefinished=!0,e.emit("prefinish"))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}s.inherits(b,u),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===b&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,r){var i,o,a,s,c,l,u,h,y=this._writableState,b=!1,g=!y.objectMode&&(h=e,f.isBuffer(h)||h instanceof d);return g&&!f.isBuffer(e)&&(i=e,e=f.from(i)),"function"==typeof t&&(r=t,t=null),g?t="buffer":t||(t=y.defaultEncoding),"function"!=typeof r&&(r=p),y.ended?(o=r,a=Error("write after end"),this.emit("error",a),n.nextTick(o,a)):(g||(s=e,c=r,l=!0,u=!1,null===s?u=TypeError("May not write null values to stream"):"string"==typeof s||void 0===s||y.objectMode||(u=TypeError("Invalid non-string/buffer chunk")),u&&(this.emit
2("error",u),n.nextTick(c,u),l=!1),l))&&(y.pendingcb++,b=function(e,t,r,n,i,o){if(!r){var a,s,c=(a=n,s=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof a||(a=f.from(a,s)),a);n!==c&&(r=!0,i="buffer",n=c)}var l=t.objectMode?1:n.length;t.length+=l;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,l,n,i,o);return u}(this,y,g,e,t,r)),b},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||v(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,r){r(Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,r){var i,o=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||(i=r,o.ending=!0,_(this,o),i&&(o.finished?n.nextTick(i):this.once("finish",i)),o.ended=!0,this.writable=!1)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=h.destroy,b.prototype._undestroy=h.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}},9072:(e,t,r)=>{"use strict";var n=r(4083).Buffer,i=r(2361);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);for(var t,r,i=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=a,t.copy(i,r),a+=o.data.length,o=o.next;return i},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},4798:(e,t,r)=>{"use strict";var n=r(8927);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},6054:(e,t,r)=>{e.exports=r(9620).EventEmitter},4083:(e,t,r)=>{var n=r(365),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},8237:(e,t,r)=>{(t=e.exports=r(3196)).Stream=t,t.Readable=t,t.Writable=r(679),t.Duplex=r(4611),t.Transform=r(4951),t.PassThrough=r(3684)},8100:(e,t,r)=>{"use strict";var n=r(365).Buffer,i=r(376),o=r(5125),a=Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function f(e,t){return e<<t|e>>>32-t}function d(){o.call(this,64),this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476,this._e=0xc3d2e1f0}i(d,o),d.prototype._update=function(){for(var e,t,r,n,i,o,d,h,p,y,b,m,g,v,x,w,_,S,j,k,O,$,A,E,N,P,M,D,I,T,C,B,R,L,z,F,U,q,V,K,H,W,J,G,Y,X,Q,Z,ee,et,er,en,ei=0;ei<16;++ei)a[ei]=this._block.readInt32LE(4*ei);for(var eo=0|this._a,ea=0|this._b,es=0|this._c,ec=0|this._d,el=0|this._e,eu=0|this._a,ef=0|this._b,ed=0|this._c,eh=0|this._d,ep=0|this._e,ey=0;ey<80;ey+=1)ey<16?(e=eo,t=ea,r=es,n=ec,i=el,er=f(e+(t^r^n)+a[s[ey]]+0|0,l[ey])+i|0,o=eu,d=ef,h=ed,p=eh,y=ep,en=f(o+(d^(h|~p))+a[c[ey]]+0x50a28be6|0,u[ey])+y|0):ey<32?(b=eo,m=ea,g=es,v=ec,x=el,er=f(b+(m&g|~m&v)+a[s[ey]]+0x5a827999|0,l[ey])+x|0,w=eu,_=ef,S=ed,j=eh,k=ep,en=f(w+(_&j|S&~j)+a[c[ey]]+0x5c4dd124|0,u[ey])+k|0):ey<48?(O=eo,$=ea,A=es,E=ec,N=el,er=f(O+(($|~A)^E)+a[s[ey]]+0x6ed9eba1|0,l[ey])+N|0,P=eu,M=ef,D=ed,I=eh,T=ep,en=f(P+((M|~D)^I)+a[c[ey]]+0x6d703ef3|0,u[ey])+T|0):ey<64?(C=eo,B=ea,R=es,L=ec,z=el,er=f
2(C+(B&L|R&~L)+a[s[ey]]+0x8f1bbcdc|0,l[ey])+z|0,F=eu,U=ef,q=ed,V=eh,K=ep,en=f(F+(U&q|~U&V)+a[c[ey]]+0x7a6d76e9|0,u[ey])+K|0):(H=eo,W=ea,J=es,G=ec,Y=el,er=f(H+(W^(J|~G))+a[s[ey]]+0xa953fd4e|0,l[ey])+Y|0,X=eu,Q=ef,Z=ed,ee=eh,et=ep,en=f(X+(Q^Z^ee)+a[c[ey]]+0|0,u[ey])+et|0),eo=el,el=ec,ec=f(es,10),es=ea,ea=er,eu=ep,ep=eh,eh=f(ed,10),ed=ef,ef=en;var eb=this._b+es+eh|0;this._b=this._c+ec+ep|0,this._c=this._d+el+eu|0,this._d=this._e+eo+ef|0,this._e=this._a+ea+ed|0,this._a=eb},d.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},9047:(e,t,r)=>{var n=r(365),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},8894:(e,t,r)=>{"use strict";var n=r(4609),i=r(2975),o=n("RegExp.prototype.exec"),a=r(4820);e.exports=function(e){if(!i(e))throw new a("`regex` must be a RegExp");return function(t){return null!==o(e,t)}}},2637:(e,t,r)=>{"use strict";var n=r(6893),i=r(3793),o=r(2579)(),a=r(1554),s=r(4820),c=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>0xffffffff||c(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(l=!1)}return(n||l||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},2159:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(2988);function o(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}o.prototype.update=function(e,t){e=i(e,t||"utf8");for(var r=this._block,n=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var c=a%n,l=Math.min(o-s,n-c),u=0;u<l;u++)r[c+u]=e[s+u];s+=l,(a+=l)%n==0&&this._update(r)}return this._len+=o,this},o.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=0xffffffff)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=r>>>0;this._block.writeUInt32BE((r-n)/0x100000000,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},o.prototype._update=function(){throw Error("_update must be implemented by subclass")},e.exports=o},1806:(e,t,r)=>{"use strict";e.exports=function(t){var r=t.toLowerCase(),n=e.exports[r];if(!n)throw Error(r+" is not supported (we accept pull requests)");return new n},e.exports.sha=r(9675),e.exports.sha1=r(2950),e.exports.sha224=r(8881),e.exports.sha256=r(9642),e.exports.sha384=r(8220),e.exports.sha512=r(6859)},9675:(e,t,r)=>{"use strict";var n=r(376),i=r(2159),o=r(9047).Buffer,a=[0x5a827999,0x6ed9eba1,-0x70e44324,-0x359d3e2a],s=Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476,this._e=0xc3d2e1f0,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var l=0;l<80;++l){var u,f,d,h,p,y=~~(l/20),b=((u=r)<<5|u>>>27)+(f=n,d=i,h=o,0===y?f&d|~f&h:2===y?f&d|f&h|d&h:f^d^h)+s+t[l]+a[y]|0;s=o,o=i,i=(p=n)<<30|p>>>2,n=r,r=b}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},2950:(e,t,r)=>{"use strict";var n=r(376),i=r(2159),o=r(9047).Buffer,a=[0x5a827999,0x6ed9eba1,-0x70e44324,-0x359d3e2a],s=Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476,this._e=0xc3d2e1f0,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0;c<16;++c)t[c]=e.readInt32BE(4*c);for(;c<80;++c)t[c]=(u=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|u>>>31;for(var l=0;l<80;++l){var u,f,d,h,p,y,b=~~(l/20),m=((f=r)<<5|f>>>27)+(d=n,h=i,p=o,0===b?d&h|~d&p:2===b?d&h|d&p|h&p:d^h^p)+s+t[l]+a[b]|0;s=o,o=i,i=(y=n)<<30|y>>>2,n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},8881:(e,t,r)=>{"use strict";var n=r(376),i=r(9642),o=r(2159),a=r(9047).Buffer,s=Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=0xc1059ed8,this._b=0x367cd507,this._c=0x3070dd17,this._d=0xf70e5939,this._e=0xffc00b31,this._f=0x68581511,this._g=0x64f98fa7,this._h=0xbefa4fa4,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},9642:(e,t,r)=>{"use strict";var n=r(376),i=r(2159),o=r(9047).Buffer,a=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
276c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],s=Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=0x6a09e667,this._b=0xbb67ae85,this._c=0x3c6ef372,this._d=0xa54ff53a,this._e=0x510e527f,this._f=0x9b05688c,this._g=0x1f83d9ab,this._h=0x5be0cd19,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0|this._f,l=0|this._g,u=0|this._h,f=0;f<16;++f)t[f]=e.readInt32BE(4*f);for(;f<64;++f)t[f]=(((h=t[f-2])>>>17|h<<15)^(h>>>19|h<<13)^h>>>10)+t[f-7]+(((p=t[f-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3)+t[f-16]|0;for(var d=0;d<64;++d){var h,p,y,b,m,g,v,x,w,_=u+(((y=s)>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(b=s,m=c,(g=l)^b&(m^g))+a[d]+t[d]|0,S=(((v=r)>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+((x=r)&(w=n)|i&(x|w))|0;u=l,l=c,c=s,s=o+_|0,o=i,i=n,n=r,r=_+S|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=c+this._f|0,this._g=l+this._g|0,this._h=u+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},8220:(e,t,r)=>{"use strict";var n=r(376),i=r(6859),o=r(2159),a=r(9047).Buffer,s=Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=0xcbbb9d5d,this._bh=0x629a292a,this._ch=0x9159015a,this._dh=0x152fecd8,this._eh=0x67332667,this._fh=0x8eb44a87,this._gh=0xdb0c2e0d,this._hh=0x47b5481d,this._al=0xc1059ed8,this._bl=0x367cd507,this._cl=0x3070dd17,this._dl=0xf70e5939,this._el=0xffc00b31,this._fl=0x68581511,this._gl=0x64f98fa7,this._hl=0xbefa4fa4,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},6859:(e,t,r)=>{"use strict";var n=r(376),i=r(2159),o=r(9047).Buffer,a=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817],s=Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function u(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return+(e>>>0<t>>>0)}
2n(c,i),c.prototype.init=function(){return this._ah=0x6a09e667,this._bh=0xbb67ae85,this._ch=0x3c6ef372,this._dh=0xa54ff53a,this._eh=0x510e527f,this._fh=0x9b05688c,this._gh=0x1f83d9ab,this._hh=0x5be0cd19,this._al=0xf3bcc908,this._bl=0x84caa73b,this._cl=0xfe94f82b,this._dl=0x5f1d36f1,this._el=0xade682d1,this._fl=0x2b3e6c1f,this._gl=0xfb41bd6b,this._hl=0x137e2179,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,c=0|this._fh,d=0|this._gh,h=0|this._hh,p=0|this._al,y=0|this._bl,b=0|this._cl,m=0|this._dl,g=0|this._el,v=0|this._fl,x=0|this._gl,w=0|this._hl,_=0;_<32;_+=2)t[_]=e.readInt32BE(4*_),t[_+1]=e.readInt32BE(4*_+4);for(;_<160;_+=2){var S,j,k,O,$,A,E,N,P=t[_-30],M=t[_-30+1],D=((S=P)>>>1|(j=M)<<31)^(S>>>8|j<<24)^S>>>7,I=((k=M)>>>1|(O=P)<<31)^(k>>>8|O<<24)^(k>>>7|O<<25),T=(($=P=t[_-4])>>>19|(A=M=t[_-4+1])<<13)^(A>>>29|$<<3)^$>>>6,C=((E=M)>>>19|(N=P)<<13)^(N>>>29|E<<3)^(E>>>6|N<<26),B=t[_-14],R=t[_-14+1],L=t[_-32],z=t[_-32+1],F=I+R|0,U=D+B+f(F,I)|0;U=(U=U+T+f(F=F+C|0,C)|0)+L+f(F=F+z|0,z)|0,t[_]=U,t[_+1]=F}for(var q=0;q<160;q+=2){U=t[q],F=t[q+1];var V,K,H,W,J,G,Y,X,Q,Z,ee=(V=r)&(K=n)|i&(V|K),et=(H=p)&(W=y)|b&(H|W),er=l(r,p),en=l(p,r),ei=u(s,g),eo=u(g,s),ea=a[q],es=a[q+1],ec=(J=s,G=c,(Y=d)^J&(G^Y)),el=(X=g,Q=v,(Z=x)^X&(Q^Z)),eu=w+eo|0,ef=h+ei+f(eu,w)|0;ef=(ef=(ef=ef+ec+f(eu=eu+el|0,el)|0)+ea+f(eu=eu+es|0,es)|0)+U+f(eu=eu+F|0,F)|0;var ed=en+et|0,eh=er+ee+f(ed,en)|0;h=d,w=x,d=c,x=v,c=s,v=g,s=o+ef+f(g=m+eu|0,m)|0,o=i,m=b,i=n,b=y,n=r,y=p,r=ef+eh+f(p=eu+ed|0,eu)|0}this._al=this._al+p|0,this._bl=this._bl+y|0,this._cl=this._cl+b|0,this._dl=this._dl+m|0,this._el=this._el+g|0,this._fl=this._fl+v|0,this._gl=this._gl+x|0,this._hl=this._hl+w|0,this._ah=this._ah+r+f(this._al,p)|0,this._bh=this._bh+n+f(this._bl,y)|0,this._ch=this._ch+i+f(this._cl,b)|0,this._dh=this._dh+o+f(this._dl,m)|0,this._eh=this._eh+s+f(this._el,g)|0,this._fh=this._fh+c+f(this._fl,v)|0,this._gh=this._gh+d+f(this._gl,x)|0,this._hh=this._hh+h+f(this._hl,w)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},4723:(e,t,r)=>{e.exports=i;var n=r(9620).EventEmitter;function i(){n.call(this)}r(376)(i,n),i.Readable=r(5967),i.Writable=r(8872),i.Duplex=r(7772),i.Transform=r(6473),i.PassThrough=r(5970),i.finished=r(7155),i.pipeline=r(6420),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",l),e.on("error",l),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},8442:e=>{"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r={};function n(e,t,n){n||(n=Error);var i=function(e){function r(r,n,i){return e.call(this,"string"==typeof t?t:t(r,n,i))||this}return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e,r}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invali
2d for option "'+e+'"'},TypeError),n("ERR_INVALID_ARG_TYPE",function(e,r,n){if("string"==typeof r&&"not "===r.substr(0,4)?(o="must not be",r=r.replace(/^not /,"")):o="must be",(void 0===c||c>e.length)&&(c=e.length)," argument"===e.substring(c-9,c))a="The ".concat(e," ").concat(o," ").concat(i(r,"type"));else{var o,a,s,c,l=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s)?"argument":"property");a='The "'.concat(e,'" ').concat(l," ").concat(o," ").concat(i(r,"type"))}return a+". Received type ".concat(t(n))},TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=r},7772:(e,t,r)=>{"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var i=r(5967),o=r(8872);r(376)(l,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var c=a[s];l.prototype[c]||(l.prototype[c]=o.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||({env:{}}).nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5970:(e,t,r)=>{"use strict";e.exports=i;var n=r(6473);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(376)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},5967:(e,t,r)=>{"use strict";e.exports=j,j.ReadableState=S,r(9620).EventEmitter;var n,i,o=function(e,t){return e.listeners(t).length},a=r(2289),s=r(365).Buffer,c=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},l=r(964);i=l&&l.debuglog?l.debuglog("stream"):function(){};var u,f,d,h=r(2803),p=r(6781),y=r(1441).getHighWaterMark,b=r(8442).q,m=b.ERR_INVALID_ARG_TYPE,g=b.ERR_STREAM_PUSH_AFTER_EOF,v=b.ERR_METHOD_NOT_IMPLEMENTED,x=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(376)(j,a);var w=p.errorOrDestroy,_=["error","close","destroy","pause","resume"];function S(e,t,i){n=n||r(7772),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=r(113).s),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function j(e){if(n=n||r(7772),!(this instanceof j))return new j(e);var t=this instanceof n;this._readableState=new S(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function k(e,t,r,n,o){i("readableAddChunk",t);var a,l,u,f,d,h=e._readableState;if(null===t)h.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,E(e)))}}(e,h);else{if(o||(a=h,l=t,s.isBuffer(l)||l instanceof c||"string"==typeof l||void 0===l||a.objectMode||(u=new m("chunk",["string","Buffer","Uint8Array"],l)),d=u),d)w(e,d);else if(h.objectMode||t&&t.length>0)if("string"==typeof t||h.objectMode||Object.getPrototypeOf(t)===s.prototype||(f=t,t=s.from(f)),n)h.endEmitted?w(e,new x):O(e,h,t,!0);else if(h.ended)w(e,new g);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(t=h.decoder.write(t),h.objectMode||0!==t.length?O(e,h,t,!1):N(e,h)):O(e,h,t,!1)}else n||(h.reading=!1,N(e,h))}return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),N(e,t)}function $(e,t){var r;return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&((r=e)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),t.highWaterMark=r),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,({env:{}}).nextTick(E,e))}function E(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,T(e)}function N(e,t){t.readingMore||(t.readingMore=!0,({env:{}}).nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function M(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){i("readable nexttick read 0"),e.read(0)}function I(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),T(e),t.flowing&&!t.reading&&e.read(0)}function T(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function B(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,({env:{}}).nextTick(R,t,e))}function R(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function L(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),j.prototype.destroy=p.destroy,j.prototype._undestroy=p.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),k(this,e,t,!1,r)},j.prototype.unshift=function(e){return k(this,e,null,!0,!1)},j.prototype.isPaused=function(){return!1===this._readableState.flowing},j.prototype.setEncoding=function(e){u||(u=r(113).s);var t=new u(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;
2for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},j.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return i("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):A(this),null;if(0===(e=$(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,o=t.needReadable;return i("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&i("length less than watermark",o=!0),t.ended||t.reading?i("reading or ended",o=!1):o&&(i("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=$(r,t))),null===(n=e>0?C(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},j.prototype._read=function(e){w(this,new v("_read()"))},j.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||void 0===e||void 0===e?p:s;function s(){i("onend"),e.end()}n.endEmitted?({env:{}}).nextTick(a):r.once("end",a),e.on("unpipe",function t(o,a){i("onunpipe"),o===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",p),r.removeListener("data",u),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=function(){var e=r._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(r,"data")&&(e.flowing=!0,T(r))};e.on("drain",c);var l=!1;function u(t){i("ondata");var o=e.write(t);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==L(n.pipes,e))&&!l&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){i("onerror",t),p(),e.removeListener("error",f),0===o(e,"error")&&w(e,t)}function d(){e.removeListener("finish",h),p()}function h(){i("onfinish"),e.removeListener("close",d),p()}function p(){i("unpipe"),r.unpipe(e)}return r.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prepe
2ndListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",d),e.once("finish",h),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},j.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=L(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},j.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?A(this):n.reading||({env:{}}).nextTick(D,this))),r},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&({env:{}}).nextTick(M,this),r},j.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||({env:{}}).nextTick(M,this),t},j.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,e.resumeScheduled||(e.resumeScheduled=!0,({env:{}}).nextTick(I,this,e))),e.paused=!1,this},j.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<_.length;a++)e.on(_[a],this.emit.bind(this,_[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(j.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(6428)),f(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),j._fromList=C,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(j.from=function(e,t){return void 0===d&&(d=r(8271)),d(j,e,t)})},6473:(e,t,r)=>{"use strict";e.exports=u;var n=r(8442).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(7772);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(376)(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},8872:(e,t,r)=>{"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree.next=t}}e.exports=j,j.WritableState=S;var i,o,a={deprecate:r(8016)},s=r(2289),c=r(365).Buffer,l=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},u=r(6781),f=r(1441).getHighWaterMark,d=r(8442).q,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENT
2ED,y=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,m=d.ERR_STREAM_DESTROYED,g=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,x=d.ERR_UNKNOWN_ENCODING,w=u.errorOrDestroy;function _(){}function S(e,t,o){i=i||r(7772),e=e||{},"boolean"!=typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){var r=t,n=e,i=r._writableState,o=i.sync,a=i.writecb;if("function"!=typeof a)throw new y;if(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,n)--i.pendingcb,o?(({env:{}}).nextTick(a,n),({env:{}}).nextTick(N,r,i),r._writableState.errorEmitted=!0,w(r,n)):(a(n),r._writableState.errorEmitted=!0,w(r,n),N(r,i));else{var s=A(i)||r.destroyed;s||i.corked||i.bufferProcessing||!i.bufferedRequest||$(r,i),o?({env:{}}).nextTick(O,r,i,s,a):O(r,i,s,a)}},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function j(e){var t=this instanceof(i=i||r(7772));if(!t&&!o.call(j,this))return new j(e);this._writableState=new S(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),s.call(this)}function k(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain")),t.pendingcb--,n(),N(e,t)}function $(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=Array(t.bufferedRequestCount),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,k(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,u=r.callback;if(k(e,t,!1,t.objectMode?1:c.length,c,l,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function A(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),N(e,t)})}function N(e,t){var r=A(t);if(r&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,({env:{}}).nextTick(E,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(376)(j,s),S.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(S.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(e){return!!o.call(this,e)||this===j&&e&&e._writableState instanceof S}})):o=function(e){return e instanceof this},j.prototype.pipe=function(){w(this,new b)},j.prototype.write=function(e,t,r){var n,i,o,a,s,u,f,d=this._writableState,p=!1,y=!d.objectMode&&(f=e,c.isBuffer(f)||f instanceof l);return y&&!c.isBuffer(e)&&(n=e,e=c.from(n)),"function"==typeof t&&(r=t,t=null),y?t="buffer":t||(t=d.defaultEncoding),"function"!=typeof r&&(r=_),d.ending?(i=r,w(this,o=new v),({env:{}}).nextTick(i,o)):(y||(a=e,s=r,null===a?u=new g:"string"==typeof a||d.objectMode||(u=new h("chunk",["string","Buffer"],a)),!u||(w(this,u),({env:{}}).nextTick(s,u),0)))&&(d.pendingcb++,p=function(e,t,r,n,i,o){if(!r){var a,s,l=(a=n,s=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof a||(a=c.from(a,s)),a);n!==l&&(r=!0,i="buffer",n=l)}var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else k(e,t,!1,u,n,i,o);return f}(this,d,y,e,t,r)),p},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||$(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),j.prototype._write=function(e,t,r){r(new p("_write()"))},j.prototype._writev=null,j.prototype.end=function(e,t,r){var n,i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||(n=r,i.ending=!0,N(this,i),n&&(i.finished?({env:{}}).nextTick(n):this.once("finish",n)),i.ended=!0,this.writable=!1),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),j.prototype.destroy=u.destroy,j.prototype._undestroy=u.undestroy,j.prototype._destroy=function(e,t){t(e)}},6428:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,r){var i;return(i=function(e){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"===n(i)?i:String(i))in e)?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,a=r(7155),s=Symbol("lastResolve"),c=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[s];if(null!==t){var r=e[h].read();null!==r&&(e[f]=null,e[s]=null,e[c]=null,t(p(r,!1)))}}function b(e){({env:{}}).nextTick(y,e)}var m=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((i(o={get stream(){return this[h]},next:function(){var e,t=this,r=this[l];if(null!==r)return Promise.reject(r);if(this[u])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(e,r){({env:{}}).nextTick(function(){t[l]?r(t[l]):e(p(void 0,!0))})});var n,i=this[f];if(i)n=new Promise((e=this,function(t,r){i.then(function(){e[u]?t(p(void 0,!0)):e[d](t,r)},r)}));else{var o=this[h].read();if(null!==o)return Promise.resolve(p(o,!1));n=new Promise(this[d])}return this[f]=n,n}},Symbol.asyncIterator,function(){return this}),i(o,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),o),m);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,u,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[f]=null,r[s]=null,r[c]=null,e(p(n,!1))):(r[s]=e,r[c]=t)},writable:!0}),t));return r[f]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];return null!==t&&(r[f]=null,r[s]=null,r[c]=null,t(e)),void(r[l]=e)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[c]=null,n(p(void 0,!0))),r[u]=!0}),e.on("readable",b.bind(null,r)),r}},2803:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?i(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],(i=a(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){var t=function(e){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==n(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}var s=r(365).Buffer,c=r(9862).inspect,l=c&&c.custom||"inspect";e.exports=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n=s.allocUnsafe(e>>>0),i=this.head,o=0;i;)t=i.data,r=o,s.prototype.copy.call(t,n,r),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return c(this,o(o({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}()},6781:e=>{"use strict";function t(e,t){n(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n(e,t){e.emit("error",t)}e.exports={destroy:function(e,i){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?i?i(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,({env:{}}).nextTick(n,this,e)):({env:{}}).nextTick(n,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!i&&e?o._writableState?o._writableState.errorEmitted?({env:{}}).nextTick(r,o):(o._writableState.errorEmitted=!0,({env:{}}).nextTick(t,o,e)):({env:{}}).nextTick(t,o,e):i?(({env:{}}).nextTick(r,o),i(e)):({env:{}}).nextTick(r,o)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},7155:(e,t,r)=>{"use strict";var n=r(8442).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),a=o||i,s=!1,o=function(){if(!s){s=!0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t)}};
2var a,s,c=r.readable||!1!==r.readable&&t.readable,l=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||d()},f=t._writableState&&t._writableState.finished,d=function(){l=!1,f=!0,c||o.call(t)},h=t._readableState&&t._readableState.endEmitted,p=function(){c=!1,h=!0,l||o.call(t)},y=function(e){o.call(t,e)},b=function(){var e;return c&&!h?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):l&&!f?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},m=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",b),t.req?m():t.on("request",m)):l&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",p),t.on("finish",d),!1!==r.error&&t.on("error",y),t.on("close",b),function(){t.removeListener("complete",d),t.removeListener("abort",b),t.removeListener("request",m),t.req&&t.req.removeListener("finish",d),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",d),t.removeListener("end",p),t.removeListener("error",y),t.removeListener("close",b)}}},8271:e=>{e.exports=function(){throw Error("Readable.from is not available in the browser")}},6420:(e,t,r)=>{"use strict";var n,i=r(8442).q,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function c(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];var u,f,d=(u=t).length?"function"!=typeof u[u.length-1]?s:u.pop():s;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map(function(e,i){var o,s,l,u,p,y,b=i<t.length-1;return o=i>0,l=s=function(e){f||(f=e),e&&h.forEach(c),b||(h.forEach(c),d(f))},u=!1,s=function(){u||(u=!0,l.apply(void 0,arguments))},p=!1,e.on("close",function(){p=!0}),void 0===n&&(n=r(7155)),n(e,{readable:b,writable:o},function(e){if(e)return s(e);p=!0,s()}),y=!1,function(t){if(!p&&!y)return y=!0,e.setHeader&&"function"==typeof e.abort?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new a("pipe"))}});return t.reduce(l)}},1441:(e,t,r)=>{"use strict";var n=r(8442).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=null!=t.highWaterMark?t.highWaterMark:i?t[r]:null;if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},2289:(e,t,r)=>{e.exports=r(9620).EventEmitter},113:(e,t,r)=>{"use strict";var n=r(4368).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4368:(e,t,r)=>{var n=r(365),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},2988:(e,t,r)=>{"use strict";var n=r(9047).Buffer,i=r(8311),o=r(1786),a=ArrayBuffer.isView||function(e){try{return o(e),!0}catch(e){return!1}},s="u">typeof Uint8Array,c="u">typeof ArrayBuffer&&"u">typeof Uint8Array,l=c&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);e.exports=function(e,t){if(n.isBuffer(e))return!e.constructor||"isBuffer"in e?e:n.from(e);if("string"==typeof e)return n.from(e,t);if(c&&a(e)){if(0===e.byteLength)return n.alloc(0);if(l){var r=n.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}var o=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),u=n.from(o);if(u.length===e.byteLength)return u}if(s&&e instanceof Uint8Array)return n.from(e);var f=i(e);if(f)for(var d=0;d<e.length;d+=1){var h=e[d];if("number"!=typeof h||h<0||h>255||~~h!==h)throw RangeError("Array items must be numbers in the range 0-255.")}if(f||n.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return n.from(e);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}
2,8311:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},1786:(e,t,r)=>{"use strict";var n=r(4820),i=r(4609)("TypedArray.prototype.buffer",!0),o=r(7913);e.exports=i||function(e){if(!o(e))throw new n("Not a Typed Array");return e.buffer}},8016:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},8538:e=>{function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return e&&"object"===t(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},9957:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2755),o=r(6738),a=r(1482),s=r(7913);function c(e){return e.call.bind(e)}var l="u">typeof BigInt,u="u">typeof Symbol,f=c(Object.prototype.toString),d=c(Number.prototype.valueOf),h=c(String.prototype.valueOf),p=c(Boolean.prototype.valueOf);if(l)var y=c(BigInt.prototype.valueOf);if(u)var b=c(Symbol.prototype.valueOf);function m(e,t){if("object"!==n(e))return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===f(e)}function v(e){return"[object Set]"===f(e)}function x(e){return"[object WeakMap]"===f(e)}function w(e){return"[object WeakSet]"===f(e)}function _(e){return"[object ArrayBuffer]"===f(e)}function S(e){return"u">typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function j(e){return"[object DataView]"===f(e)}function k(e){return"u">typeof DataView&&(j.working?j(e):e instanceof DataView)}t.isArgumentsObject=i,t.isGeneratorFunction=o,t.isTypedArray=s,t.isPromise=function(e){return"u">typeof Promise&&e instanceof Promise||null!==e&&"object"===n(e)&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||k(e)},t.isUint8Array=function(e){return"Uint8Array"===a(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},t.isUint16Array=function(e){return"Uint16Array"===a(e)},t.isUint32Array=function(e){return"Uint32Array"===a(e)},t.isInt8Array=function(e){return"Int8Array"===a(e)},t.isInt16Array=function(e){return"Int16Array"===a(e)},t.isInt32Array=function(e){return"Int32Array"===a(e)},t.isFloat32Array=function(e){return"Float32Array"===a(e)},t.isFloat64Array=function(e){return"Float64Array"===a(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},g.working="u">typeof Map&&g(new Map),t.isMap=function(e){return"u">typeof Map&&(g.working?g(e):e instanceof Map)},v.working="u">typeof Set&&v(new Set),t.isSet=function(e){return"u">typeof Set&&(v.working?v(e):e instanceof Set)},x.working="u">typeof WeakMap&&x(new WeakMap),t.isWeakMap=function(e){return"u">typeof WeakMap&&(x.working?x(e):e instanceof WeakMap)},w.working="u">typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},_.working="u">typeof ArrayBuffer&&_(new ArrayBuffer),t.isArrayBuffer=S,j.working="u">typeof ArrayBuffer&&"u">typeof DataView&&j(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=k;var O="u">typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function $(e){return"[object SharedArrayBuffer]"===f(e)}function A(e){return void 0!==O&&(void 0===$.working&&($.working=$(new O)),$.working?$(e):e instanceof O)}function E(e){return m(e,d)}function N(e){return m(e,h)}function P(e){return m(e,p)}function M(e){return l&&m(e,y)}function D(e){return u&&m(e,b)}t.isSharedArrayBuffer=A,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===f(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===f(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===f(e)},t.isGeneratorObject=function(e){return"[object Generator]"===f(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===f(e)},t.isNumberObject=E,t.isStringObject=N,t.isBooleanObject=P,t.isBigIntObject=M,t.isSymbolObject=D,t.isBoxedPrimitive=function(e){return E(e)||N(e)||P(e)||M(e)||D(e)},t.isAnyArrayBuffer=function(e){return"u">typeof Uint8Array&&(S(e)||A(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},8751:(e,t,r)=>{function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r<i;s=n[++r])b(s)||!w(s)?a+=" "+s:a+=" "+c(s);return a},t.deprecate=function(e,t){var r=!1;return function(){return r||(console.error(t),r=!0),e.apply(this,arguments)}};var a={},s=/^$/;function c(e,r){var n={seen:[],stylize:u};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),f(n,e,n.depth)}function l(e,t){var r=c.styles[t];return r?"\x1b["+c.colors[r][0]+"m"+e+"\x1b["+c.colors[r][1]+"m":e}function u(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&j(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i,o,a=r.inspect(n,e);return g(a)||(a=f(e,a,n)),a}var s=function(e,t){if(v(t))return e.stylize("undefined","undefined");
2if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(s)return s;var c=Object.keys(r),l=(w={},c.forEach(function(e,t){w[e]=!0}),w);if(e.showHidden&&(c=Object.getOwnPropertyNames(r)),S(r)&&(c.indexOf("message")>=0||c.indexOf("description")>=0))return d(r);if(0===c.length){if(j(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(x(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return d(r)}var w,k,O="",$=!1,E=["{","}"];return p(r)&&($=!0,E=["[","]"]),j(r)&&(O=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(O=" "+RegExp.prototype.toString.call(r)),_(r)&&(O=" "+Date.prototype.toUTCString.call(r)),S(r)&&(O=" "+d(r)),0!==c.length||$&&0!=r.length?n<0?x(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),k=$?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)A(t,String(a))?o.push(h(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))}),o}(e,r,n,l,c):c.map(function(t){return h(e,r,n,l,t,$)}),e.seen.pop(),i=O,o=E,k.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?o[0]+(""===i?"":i+"\n ")+" "+k.join(",\n ")+" "+o[1]:o[0]+i+" "+k.join(", ")+" "+o[1]):E[0]+O+E[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(0>e.seen.indexOf(c.value)?(s=b(r)?f(e,c.value,null):f(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function b(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e){return void 0===e}function x(e){return w(e)&&"[object RegExp]"===k(e)}function w(e){return"object"===n(e)&&null!==e}function _(e){return w(e)&&"[object Date]"===k(e)}function S(e){return w(e)&&("[object Error]"===k(e)||e instanceof Error)}function j(e){return"function"==typeof e}function k(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!a[e=e.toUpperCase()])if(s.test(e)){var r=void 0;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9957),t.isArray=p,t.isBoolean=y,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=g,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=v,t.isRegExp=x,t.types.isRegExp=x,t.isObject=w,t.isDate=_,t.types.isDate=_,t.isError=S,t.types.isNativeError=S,t.isFunction=j,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(8538);var $=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[O((e=new Date).getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),$[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(376),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var E="u">typeof Symbol?Symbol("util.promisify.custom"):void 0;function N(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(E&&e[E]){var t;if("function"!=typeof(t=e[E]))throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,E,{value:t,enumerable:!1,writable:!1,
2configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),E&&Object.defineProperty(t,E,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=E,t.callbackify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!=typeof n)throw TypeError("The last argument must be of type Function");var i=this,o=function(){return n.apply(i,arguments)};e.apply(this,t).then(function(e){({env:{}}).nextTick(o.bind(null,null,e))},function(e){({env:{}}).nextTick(N.bind(null,e,o))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},1482:(e,t,r)=>{"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(5337),o=r(6461),a=r(3862),s=r(4609),c=r(1554),l=r(2460),u=s("Object.prototype.toString"),f=r(5994)(),d="u"<typeof globalThis?r.g:globalThis,h=o(),p=s("String.prototype.slice"),y=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return -1},b={__proto__:null};i(h,f&&c&&l?function(e){var t=new d[e];if(Symbol.toStringTag in t&&l){var r=l(t),n=c(r,Symbol.toStringTag);if(!n&&r&&(n=c(l(r),Symbol.toStringTag)),n&&n.get){var i=a(n.get);b["$"+e]=i}}}:function(e){var t=new d[e],r=t.slice||t.set;if(r){var n=a(r);b["$"+e]=n}}),e.exports=function(e){if(!e||"object"!==n(e))return!1;if(!f){var t,r,o=p(u(e),8,-1);return y(h,o)>-1?o:"Object"===o&&(r=!1,i(b,function(t,n){if(!r)try{t(e),r=p(n,1)}catch(e){}}),r)}return c?(t=!1,i(b,function(r,n){if(!t)try{"$"+r(e)===n&&(t=p(n,1))}catch(e){}}),t):null}},6601:()=>{},9214:()=>{},2361:()=>{},4616:()=>{},9862:()=>{},964:()=>{},6461:(e,t,r)=>{"use strict";var n=r(7373),i="u"<typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},4029:(e,t,r)=>{"use strict";let n;var i=r(365).Buffer;function o(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function a(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}function s(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function c(e){return"[object Map]"===Object.prototype.toString.call(e)}function l(e){return"[object Date]"===Object.prototype.toString.call(e)}let u=0x8000000000000000-1,f=Object.freeze({double:1,string:2,object:3,array:4,binData:5,undefined:6,objectId:7,bool:8,date:9,null:10,regex:11,dbPointer:12,javascript:13,symbol:14,javascriptWithScope:15,int:16,timestamp:17,long:18,decimal:19,minKey:-1,maxKey:127});class d extends Error{get bsonError(){return!0}get name(){return"BSONError"}constructor(e){super(e)}static isBSONError(e){return null!=e&&"object"==typeof e&&"bsonError"in e&&!0===e.bsonError&&"name"in e&&"message"in e&&"stack"in e}}class h extends d{get name(){return"BSONVersionError"}constructor(){super("Unsupported BSON version, bson types must be from bson 5.x.x")}}class p extends d{get name(){return"BSONRuntimeError"}constructor(e){super(e)}}function y(e){return b.fromNumberArray(Array.from({length:e},()=>Math.floor(256*Math.random())))}let b={toLocalBufferType(e){if(i.isBuffer(e))return e;if(ArrayBuffer.isView(e))return i.from(e.buffer,e.byteOffset,e.byteLength);let t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if("ArrayBuffer"===t||"SharedArrayBuffer"===t||"[object ArrayBuffer]"===t||"[object SharedArrayBuffer]"===t)return i.from(e);throw new d(`Cannot create Buffer from ${String(e)}`)},allocate:e=>i.alloc(e),equals:(e,t)=>b.toLocalBufferType(e).equals(t),fromNumberArray:e=>i.from(e),fromBase64:e=>i.from(e,"base64"),toBase64:e=>b.toLocalBufferType(e).toString("base64"),fromISO88591:e=>i.from(e,"binary"),toISO88591:e=>b.toLocalBufferType(e).toString("binary"),fromHex:e=>i.from(e,"hex"),toHex:e=>b.toLocalBufferType(e).toString("hex"),fromUTF8:e=>i.from(e,"utf8"),toUTF8:(e,t,r)=>b.toLocalBufferType(e).toString("utf8",t,r),utf8ByteLength:e=>i.byteLength(e,"utf8"),encodeUTF8Into:(e,t,r)=>b.toLocalBufferType(e).write(t,r,void 0,"utf8"),randomBytes:(()=>{try{return r(462).O6}catch{return y}})()};function m(e){if(e<0)throw RangeError(`The argument 'byteLength' is invali
2d. Received ${e}`);return x.fromNumberArray(Array.from({length:e},()=>Math.floor(256*Math.random())))}let g=(()=>{let{crypto:e}=globalThis;if(null!=e&&"function"==typeof e.getRandomValues)return t=>e.getRandomValues(x.allocate(t));if(function(){let{navigator:e}=globalThis;return"object"==typeof e&&"ReactNative"===e.product}()){let{console:e}=globalThis;e?.warn?.("BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.")}return m})(),v=/(\d|[a-f])/i,x={toLocalBufferType(e){let t=e?.[Symbol.toStringTag]??Object.prototype.toString.call(e);if("Uint8Array"===t)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));if("ArrayBuffer"===t||"SharedArrayBuffer"===t||"[object ArrayBuffer]"===t||"[object SharedArrayBuffer]"===t)return new Uint8Array(e);throw new d(`Cannot make a Uint8Array from ${String(e)}`)},allocate(e){if("number"!=typeof e)throw TypeError(`The "size" argument must be of type number. Received ${String(e)}`);return new Uint8Array(e)},equals(e,t){if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},fromNumberArray:e=>Uint8Array.from(e),fromBase64:e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0)),toBase64:e=>btoa(x.toISO88591(e)),fromISO88591:e=>Uint8Array.from(e,e=>255&e.charCodeAt(0)),toISO88591:e=>Array.from(Uint16Array.from(e),e=>String.fromCharCode(e)).join(""),fromHex(e){let t=e.length%2==0?e:e.slice(0,e.length-1),r=[];for(let e=0;e<t.length;e+=2){let n=t[e],i=t[e+1];if(!v.test(n)||!v.test(i))break;let o=Number.parseInt(`${n}${i}`,16);r.push(o)}return Uint8Array.from(r)},toHex:e=>Array.from(e,e=>e.toString(16).padStart(2,"0")).join(""),fromUTF8:e=>(new TextEncoder).encode(e),toUTF8:(e,t,r)=>new TextDecoder("utf8",{fatal:!1}).decode(e.slice(t,r)),utf8ByteLength:e=>x.fromUTF8(e).byteLength,encodeUTF8Into(e,t,r){let n=x.fromUTF8(t);return e.set(n,r),n.byteLength},randomBytes:g},w="function"==typeof i&&!0!==i.prototype?._isBuffer?b:x;class _ extends DataView{static fromUint8Array(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}}class S{get[Symbol.for("@@mdb.bson.version")](){return 5}}class j extends S{get _bsontype(){return"Binary"}constructor(e,t){if(super(),!(null==e||"string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Array.isArray(e)))throw new d("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=t??j.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=w.allocate(j.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=w.fromISO88591(e):Array.isArray(e)?this.buffer=w.fromNumberArray(e):this.buffer=w.toLocalBufferType(e),this.position=this.buffer.byteLength)}put(e){let t;if("string"==typeof e&&1!==e.length)throw new d("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new d("only accepts single character Uint8Array or Array");if((t="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||t>255)throw new d("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.byteLength>this.position)this.buffer[this.position++]=t;else{let e=w.allocate(j.BUFFER_SIZE+this.buffer.length);e.set(this.buffer,0),this.buffer=e,this.buffer[this.position++]=t}}write(e,t){if(t="number"==typeof t?t:this.position,this.buffer.byteLength<t+e.length){let t=w.allocate(this.buffer.byteLength+e.length);t.set(this.buffer,0),this.buffer=t}if(ArrayBuffer.isView(e))this.buffer.set(w.toLocalBufferType(e),t),this.position=t+e.byteLength>this.position?t+e.length:this.position;else if("string"==typeof e){let r=w.fromISO88591(e);this.buffer.set(r,t),this.position=t+e.length>this.position?t+e.length:this.position}}read(e,t){return t=t&&t>0?t:this.position,this.buffer.slice(e,e+t)}value(e){return(e=!!e)&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):w.toISO88591(this.buffer.subarray(0,this.position))}length(){return this.position}toJSON(){return w.toBase64(this.buffer)}toString(e){return"hex"===e?w.toHex(this.buffer):"base64"===e?w.toBase64(this.buffer):w.toUTF8(this.buffer,0,this.buffer.byteLength)}toExtendedJSON(e){e=e||{};let t=w.toBase64(this.buffer),r=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===r.length?"0"+r:r}:{$binary:{base64:t,subType:1===r.length?"0"+r:r}}}
2toUUID(){if(this.sub_type===j.SUBTYPE_UUID)return new $(this.buffer.slice(0,this.position));throw new d(`Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${j.SUBTYPE_UUID}" is currently supported.`)}static createFromHexString(e,t){return new j(w.fromHex(e),t)}static createFromBase64(e,t){return new j(w.fromBase64(e),t)}static fromExtendedJSON(e,t){let r,n;if(t=t||{},"$binary"in e?t.legacy&&"string"==typeof e.$binary&&"$type"in e?(n=e.$type?parseInt(e.$type,16):0,r=w.fromBase64(e.$binary)):"string"!=typeof e.$binary&&(n=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=w.fromBase64(e.$binary.base64)):"$uuid"in e&&(n=4,r=$.bytesFromString(e.$uuid)),!r)throw new d(`Unexpected Binary Extended JSON format ${JSON.stringify(e)}`);return 4===n?new $(r):new j(r,n)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`Binary.createFromBase64("${w.toBase64(this.buffer.subarray(0,this.position))}", ${this.sub_type})`}}j.BSON_BINARY_SUBTYPE_DEFAULT=0,j.BUFFER_SIZE=256,j.SUBTYPE_DEFAULT=0,j.SUBTYPE_FUNCTION=1,j.SUBTYPE_BYTE_ARRAY=2,j.SUBTYPE_UUID_OLD=3,j.SUBTYPE_UUID=4,j.SUBTYPE_MD5=5,j.SUBTYPE_ENCRYPTED=6,j.SUBTYPE_COLUMN=7,j.SUBTYPE_USER_DEFINED=128;let k=/^[0-9A-F]{32}$/i,O=/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i;class $ extends j{constructor(e){let t;if(null==e)t=$.generate();else if(e instanceof $)t=w.toLocalBufferType(new Uint8Array(e.buffer));else if(ArrayBuffer.isView(e)&&16===e.byteLength)t=w.toLocalBufferType(e);else{if("string"!=typeof e)throw new d("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");t=$.bytesFromString(e)}super(t,4)}get id(){return this.buffer}set id(e){this.buffer=e}toHexString(e=!0){return e?[w.toHex(this.buffer.subarray(0,4)),w.toHex(this.buffer.subarray(4,6)),w.toHex(this.buffer.subarray(6,8)),w.toHex(this.buffer.subarray(8,10)),w.toHex(this.buffer.subarray(10,16))].join("-"):w.toHex(this.buffer)}toString(e){return"hex"===e?w.toHex(this.id):"base64"===e?w.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}equals(e){if(!e)return!1;if(e instanceof $)return w.equals(e.id,this.id);try{return w.equals(new $(e).id,this.id)}catch{return!1}}toBinary(){return new j(this.id,j.SUBTYPE_UUID)}static generate(){let e=w.randomBytes(16);return e[6]=15&e[6]|64,e[8]=63&e[8]|128,e}static isValid(e){return!!e&&("string"==typeof e?$.isValidUUIDString(e):a(e)?16===e.byteLength:"Binary"===e._bsontype&&e.sub_type===this.SUBTYPE_UUID&&16===e.buffer.byteLength)}static createFromHexString(e){let t=$.bytesFromString(e);return new $(t)}static createFromBase64(e){return new $(w.fromBase64(e))}static bytesFromString(e){if(!$.isValidUUIDString(e))throw new d("UUID string representation must be 32 hex digits or canonical hyphenated representation");return w.fromHex(e.replace(/-/g,""))}static isValidUUIDString(e){return k.test(e)||O.test(e)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new UUID("${this.toHexString()}")`}}$.cacheHexString=!1;class A extends S{get _bsontype(){return"Code"}constructor(e,t){super(),this.code=e.toString(),this.scope=t??null}toJSON(){return null!=this.scope?{code:this.code,scope:this.scope}:{code:this.code}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(e){return new A(e.$code,e.$scope)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){let e=this.toJSON();return`new Code("${String(e.code)}"${null!=e.scope?`, ${JSON.stringify(e.scope)}`:""})`}}function E(e){return null!=e&&"object"==typeof e&&"$id"in e&&null!=e.$id&&"$ref"in e&&"string"==typeof e.$ref&&(!("$db"in e)||"$db"in e&&"string"==typeof e.$db)}class N extends S{get _bsontype(){return"DBRef"}constructor(e,t,r,n){super();const i=e.split(".");2===i.length&&(r=i.shift(),e=i.shift()),this.collection=e,this.oid=t,this.db=r,this.fields=n||{}}get namespace(){return this.collection}set namespace(e){this.collection=e}toJSON(){let e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e}toExtendedJSON(e){e=e||{};let t={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields)),t}static fromExtendedJSON(e){let t=Object.assign({},e);return delete t.$ref,delete t.$id,delete t.$db,new N(e.$ref,e.$id,e.$db,t)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){let e=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return`new DBRef("${this.namespace}", new ObjectId("${String(e)}")${this.db?`, "${this.db}"`:""})`}}try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}let P={},M={},D=/^(\+?0|(\+|-)?[1-9][0-9]*)$/;class I extends S{get _bsontype(){return"Long"}get __isLong__(){return!0}
2constructor(e=0,t,r){super(),"bigint"==typeof e?Object.assign(this,I.fromBigInt(e,!!t)):"string"==typeof e?Object.assign(this,I.fromString(e,!!t)):(this.low=0|e,this.high=0|t,this.unsigned=!!r)}static fromBits(e,t,r){return new I(e,t,r)}static fromInt(e,t){let r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=M[e])?n:(r=I.fromBits(e,(0|e)<0?-1:0,!0),i&&(M[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=P[e])?n:(r=I.fromBits(e,e<0?-1:0,!1),i&&(P[e]=r),r)}static fromNumber(e,t){if(isNaN(e))return t?I.UZERO:I.ZERO;if(t){if(e<0)return I.UZERO;if(e>=0xffffffffffffffff)return I.MAX_UNSIGNED_VALUE}else{if(e<=-0x8000000000000000)return I.MIN_VALUE;if(e+1>=0x8000000000000000)return I.MAX_VALUE}return e<0?I.fromNumber(-e,t).neg():I.fromBits(e%0x100000000|0,e/0x100000000|0,t)}static fromBigInt(e,t){return I.fromString(e.toString(),t)}static fromString(e,t,r){let n;if(0===e.length)throw new d("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return I.ZERO;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw new d("radix");if((n=e.indexOf("-"))>0)throw new d("interior hyphen");if(0===n)return I.fromString(e.substring(1),t,r).neg();let i=I.fromNumber(Math.pow(r,8)),o=I.ZERO;for(let t=0;t<e.length;t+=8){let n=Math.min(8,e.length-t),a=parseInt(e.substring(t,t+n),r);if(n<8){let e=I.fromNumber(Math.pow(r,n));o=o.mul(e).add(I.fromNumber(a))}else o=(o=o.mul(i)).add(I.fromNumber(a))}return o.unsigned=t,o}static fromBytes(e,t,r){return r?I.fromBytesLE(e,t):I.fromBytesBE(e,t)}static fromBytesLE(e,t){return new I(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)}static fromBytesBE(e,t){return new I(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}static isLong(e){return null!=e&&"object"==typeof e&&"__isLong__"in e&&!0===e.__isLong__}static fromValue(e,t){return"number"==typeof e?I.fromNumber(e,t):"string"==typeof e?I.fromString(e,t):I.fromBits(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}add(e){I.isLong(e)||(e=I.fromValue(e));let t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,o=e.high>>>16,a=65535&e.high,s=e.low>>>16,c=0,l=0,u,f;return u=0+((f=0+(i+(65535&e.low)))>>>16),f&=65535,u+=n+s,l+=u>>>16,u&=65535,l+=r+a,c+=l>>>16,l&=65535,c+=t+o,c&=65535,I.fromBits(u<<16|f,c<<16|l,this.unsigned)}and(e){return I.isLong(e)||(e=I.fromValue(e)),I.fromBits(this.low&e.low,this.high&e.high,this.unsigned)}compare(e){if(I.isLong(e)||(e=I.fromValue(e)),this.eq(e))return 0;let t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1}comp(e){return this.compare(e)}divide(e){let t,r,i;if(I.isLong(e)||(e=I.fromValue(e)),e.isZero())throw new d("division by zero");if(n){if(!this.unsigned&&-0x80000000===this.high&&-1===e.low&&-1===e.high)return this;let t=(this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high);return I.fromBits(t,n.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?I.UZERO:I.ZERO;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return I.UZERO;if(e.gt(this.shru(1)))return I.UONE;i=I.UZERO}else{if(this.eq(I.MIN_VALUE))return e.eq(I.ONE)||e.eq(I.NEG_ONE)?I.MIN_VALUE:e.eq(I.MIN_VALUE)?I.ONE:(t=this.shr(1).div(e).shl(1)).eq(I.ZERO)?e.isNegative()?I.ONE:I.NEG_ONE:(r=this.sub(e.mul(t)),i=t.add(r.div(e)));if(e.eq(I.MIN_VALUE))return this.unsigned?I.UZERO:I.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=I.ZERO}for(r=this;r.gte(e);){let n=Math.ceil(Math.log(t=Math.max(1,Math.floor(r.toNumber()/e.toNumber())))/Math.LN2),o=n<=48?1:Math.pow(2,n-48),a=I.fromNumber(t),s=a.mul(e);for(;s.isNegative()||s.gt(r);)t-=o,s=(a=I.fromNumber(t,this.unsigned)).mul(e);a.isZero()&&(a=I.ONE),i=i.add(a),r=r.sub(s)}return i}div(e){return this.divide(e)}equals(e){return I.isLong(e)||(e=I.fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low}eq(e){return this.equals(e)}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){let e;if(this.isNegative())return this.eq(I.MIN_VALUE)?64:this.neg().getNumBitsAbs();let t=0!==this.high?this.high:this.low;for(e=31;e>0&&!(t&1<<e);e--);return 0!==this.high?e+33:e+1}greaterThan(e){return this.comp(e)>0}gt(e){return this.greaterThan(e)}greaterThanOrEqual(e){return this.comp(e)>=0}gte(e){return this.greaterThanOrEqual(e)}ge(e){return this.greaterThanOrEqual(e)}isEven(){return!(1&this.low)}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return!(1&~this.low)}isPositive(){return this.unsigned||this.high>=0}isZero(){return 0===this.high&&0===this.low}lessThan(e){return 0>this.comp(e)}lt(e){return this.lessThan(e)}lessThanOrEqual(e){return 0>=this.comp(e)}lte(e){return this.lessThanOrEqual(e)}modulo(e){if(I.isLong(e)||(e=I.fromValue(e)),n){let t=(this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high);return I.fromBits(t,n.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))}mod(e){return this.modulo(e)}rem(e){return this.modulo(e)}multiply(e){if(this.isZero())return I.ZERO;if(I.isLong(e)||(e=I.fromValue(e)),n){let t=n.mul(this.low,this.high,e.low,e.high);return I.fromBits(t,n.get_high(),this.unsigned)}if(e.isZero())return I.ZERO;if(this.eq(I.MIN_VALUE))return e.isOdd()?I.MIN_VALUE:I.ZERO;if(e.eq(I.MIN_VALUE))return this.isOdd()?I.MIN_VALUE:I.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(I.TWO_PWR_24)&&e.lt(I.TWO_PWR_24))return I.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);let t=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=65535&e.low,u=0,f=0,d,h;return d=0+((h=0+o*l)>>>16),h&=65535,d+=i*l,f+=d>>>16,d&=65535,d+=o*c,f+=d>>>16,d&=65535,f+=r*l,u+=f>>>16,f&=65535,f+=i*c,u+=f>>>16,f&=65535,f+=o*s,u+=f>>>16,f&=65535,u+=t*l+r*c+i*s+o*a,u&=65535,I.fromBits(d<<16|h,u<<16|f,this.unsigned)}mul(e){return this.multiply(e)}negate(){return!this.unsigned&&this.eq(I.MIN_VALUE)?I.MIN_VALUE:this.not().add(I.ONE)}neg(){return this.negate()}not(){return I.fromBits(~this.low,~this.high,this.unsigned)}notEquals(e){return!this.equals(e)}neq(e){return this.notEquals(e)}ne(e){return this.notEquals(e)}or(e){return I.isLong(e)||(e=I.fromValue(e)),I.fromBits(this.low|e.low,this.high|e.high,this.unsigned)}shiftLeft(e){return I.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?I.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):I.fromBits(0,this.low<<e-32,this.unsigned)}shl(e){return this.shiftLeft(e)}shiftRight(e){return I.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?I.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):I.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)}shr(e){return this.shiftRight(e)}shiftRightUnsigned(e){if(I.isLong(e)&&(e=e.toInt()),0==(e&=63))return this;{let t=this.high;if(e<32){let r=this.low;return I.fromBits(r>>>e|t<<32-e,t>>>e,this.unsigned)}return 32===e?I.fromBits(t,0,this.unsigned):I.fromBits(t>>>e-32,0,this.unsigned)}}shr_u(e){return this.shiftRightUnsigned(e)}shru(e){return this.shiftRightUnsigned(e)}subtract(e){return I.isLong(e)||(e=I.fromValue(e)),this.add(e.neg())}sub(e){return this.subtract(e)}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*0x100000000+(this.low>>>0):0x100000000*this.high+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(e){return e?this.toBytesLE():this.toBytesBE()}toBytesLE(){let e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]}toBytesBE(){let e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]}toSigned(){return this.unsigned?I.fromBits(this.low,this.high,!1):this}toString(e){if((e=e||10)<2||36<e)throw new d("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(I.MIN_VALUE)){let t=I.fromNumber(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}let t=I.fromNumber(Math.pow(e,6),this.unsigned),r=this,n="";for(;;){let i=r.div(t),o=(r.sub(i.mul(t)).toInt()>>>0).toString(e);if((r=i).isZero())return o+n;for(;o.length<6;)o="0"+o;n=""+o+n}}toUnsigned(){return this.unsigned?this:I.fromBits(this.low,this.high,!0)}xor(e){return I.isLong(e)||(e=I.fromValue(e)),I.fromBits(this.low^e.low,this.high^e.high,this.unsigned)}eqz(){return this.isZero()}le(e){return this.lessThanOrEqual(e)}toExtendedJSON(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(e,t){let{useBigInt64:r=!1,relaxed:n=!0}={...t};if(e.$numberLong.length>20)throw new d("$numberLong string is too long");if(!D.test(e.$numberLong))throw new d(`$numberLong string "${e.$numberLong}
2" is in an invalid format`);if(r)return BigInt.asIntN(64,BigInt(e.$numberLong));let i=I.fromString(e.$numberLong);return n?i.toNumber():i}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new Long("${this.toString()}"${this.unsigned?", true":""})`}}I.TWO_PWR_24=I.fromInt(0x1000000),I.MAX_UNSIGNED_VALUE=I.fromBits(-1,-1,!0),I.ZERO=I.fromInt(0),I.UZERO=I.fromInt(0,!0),I.ONE=I.fromInt(1),I.UONE=I.fromInt(1,!0),I.NEG_ONE=I.fromInt(-1),I.MAX_VALUE=I.fromBits(-1,0x7fffffff,!1),I.MIN_VALUE=I.fromBits(0,-0x80000000,!1);let T=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,C=/^(\+|-)?(Infinity|inf)$/i,B=/^(\+|-)?NaN$/i,R=w.fromNumberArray([124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),L=w.fromNumberArray([248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),z=w.fromNumberArray([120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse()),F=/^([-+])?(\d+)?$/;function U(e){return!isNaN(parseInt(e,10))}function q(e,t){throw new d(`"${e}" is not a valid Decimal128 string - ${t}`)}class V extends S{get _bsontype(){return"Decimal128"}constructor(e){if(super(),"string"==typeof e)this.bytes=V.fromString(e).bytes;else{if(!a(e))throw new d("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new d("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}static fromString(e){return V._fromString(e,{allowRounding:!1})}static fromStringWithRounding(e){return V._fromString(e,{allowRounding:!0})}static _fromString(e,t){var r,n;let i,o,a=!1,s=!1,c=!1,l=!1,u=0,f=0,h=0,p=0,y=0,b=[0],m=0,g=0,v=0,x=0,_=new I(0,0),S=new I(0,0),j=0,k=0;if(e.length>=7e3)throw new d(e+" not a valid Decimal128 string");let O=e.match(T),$=e.match(C),A=e.match(B);if(!O&&!$&&!A||0===e.length)throw new d(e+" not a valid Decimal128 string");if(O){let t=O[2],r=O[4],n=O[5],i=O[6];r&&void 0===i&&q(e,"missing exponent power"),r&&void 0===t&&q(e,"missing exponent base"),void 0===r&&(n||i)&&q(e,"missing e before exponent")}if("+"!==e[k]&&"-"!==e[k]||(s=!0,a="-"===e[k++]),!U(e[k])&&"."!==e[k]){if("i"===e[k]||"I"===e[k])return new V(a?L:z);if("N"===e[k])return new V(R)}for(;U(e[k])||"."===e[k];)"."!==e[k]?(m<34&&("0"!==e[k]||l)&&(l||(y=f),l=!0,b[g++]=parseInt(e[k],10),m+=1),l&&(h+=1),c&&(p+=1),f+=1):(c&&q(e,"contains multiple periods"),c=!0),k+=1;if(c&&!f)throw new d(e+" not a valid Decimal128 string");if("e"===e[k]||"E"===e[k]){let t=e.substr(++k).match(F);if(!t||!t[2])return new V(R);x=parseInt(t[0],10),k+=t[0].length}if(e[k])return new V(R);if(m){if(v=m-1,1!==(u=h))for(;"0"===e[y+u-1+Number(s)+Number(c)];)u-=1}else b[0]=0,h=1,m=1,u=0;for(x<=p&&p>x+16384?x=-6176:x-=p;x>6111;){if((v+=1)>=34){if(0===u){x=6111;break}q(e,"overflow")}x-=1}if(t.allowRounding){for(;x<-6176||m<h;){if(0===v&&u<m){x=-6176,u=0;break}if(m<h?h-=1:v-=1,x<6111)x+=1;else{if(b.join("").match(/^0+$/)){x=6111;break}q(e,"overflow")}}if(v+1<u){let t=f;c&&(y+=1,t+=1),s&&(y+=1,t+=1);let r=parseInt(e[y+v+1],10),n=0;if(r>=5&&(n=1,5===r)){n=+(b[v]%2==1);for(let r=y+v+2;r<t;r++)if(parseInt(e[r],10)){n=1;break}}if(n){let e=v;for(;e>=0&&++b[e]>9;e--)if(b[e]=0,0===e){if(!(x<6111))return new V(a?L:z);x+=1,b[e]=1}}}}else{for(;x<-6176||m<h;){if(0===v){if(0===u){x=-6176;break}q(e,"exponent underflow")}m<h?("0"!==e[h-1+Number(s)+Number(c)]&&0!==u&&q(e,"inexact rounding"),h-=1):(0!==b[v]&&q(e,"inexact rounding"),v-=1),x<6111?x+=1:q(e,"overflow")}v+1<u&&(c&&(y+=1),s&&(y+=1),0!==parseInt(e[y+v+1],10)&&q(e,"inexact rounding"))}if(_=I.fromNumber(0),S=I.fromNumber(0),0===u)_=I.fromNumber(0),S=I.fromNumber(0);else if(v<17){let e=0;for(S=I.fromNumber(b[e++]),_=new I(0,0);e<=v;e++)S=(S=S.multiply(I.fromNumber(10))).add(I.fromNumber(b[e]))}else{let e=0;for(_=I.fromNumber(b[e++]);e<=v-17;e++)_=(_=_.multiply(I.fromNumber(10))).add(I.fromNumber(b[e]));for(S=I.fromNumber(b[e++]);e<=v;e++)S=(S=S.multiply(I.fromNumber(10))).add(I.fromNumber(b[e]))}let E=function(e,t){if(!e&&!t)return{high:I.fromNumber(0),low:I.fromNumber(0)};let r=e.shiftRightUnsigned(32),n=new I(e.getLowBits(),0),i=t.shiftRightUnsigned(32),o=new I(t.getLowBits(),0),a=r.multiply(i),s=r.multiply(o),c=n.multiply(i),l=n.multiply(o);return a=a.add(s.shiftRightUnsigned(32)),s=new I(s.getLowBits(),0).add(c).add(l.shiftRightUnsigned(32)),{high:a=a.add(s.shiftRightUnsigned(32)),low:l=s.shiftLeft(32).add(new I(l.getLowBits(),0))}}(_,I.fromString("100000000000000000"));E.low=E.low.add(S),r=E.low,n=S,((i=r.high>>>0)<(o=n.high>>>0)||i===o&&r.low>>>0<n.low>>>0)&&(E.high=E.high.add(I.fromNumber(1))),j=x+6176;let N={low:I.fromNumber(0),high:I.fromNumber(0)};E.high.shiftRightUnsigned(49).and(I.fromNumber(1)).equals(I.fromNumber(1))?(N.high=N.high.or(I.fromNumber(3).shiftLeft(61)),N.high=N.high.or(I.fromNumber(j).and(I.fromNumber(16383).shiftLeft(47))),N.high=N.high.or(E.high.and(I.fromNumber(0x7fffffffffff)))):(N.high=N.high.or(I.fromNumber(16383&j).shiftLeft(49)),N.high=N.high.or(E.high.and(I.fromNumber(0x1ffffffffffff)))),N.low=E.low,a&&(N.high=N.high.or(I.fromString("9223372036854775808")));let P=w.allocate(16);return k=0,P[k++]=255&N.low.low,P[k++]=N.low.low>>8&255,P[k++]=N.low.low>>16&255,P[k++]=N.low.low>>24&255,P[k++]=255&N.low.high,P[k++]=N.low.high>>8&255,P[k++]=N.low.high>>16&255,P[k++]=N.low.high>>24&255,P[k++]=255&N.high.low,P[k++]=N.high.low>>8&255,P[k++]=N.high.low>>16&255,P[k++]=N.high.low>>24&255,P[k++]=255&N.high.high,P[k++]=N.high.high>>8&255,P[k++]=N.high.high>>16&255,P[k++]=N.high.high>>24&255,new V(P)}toString(){let e,t=0,r=Array(36);for(let e=0;e<r.length;e++)r[e]=0;let n,i,o,a=0,s=!1,c={parts:[0,0,0,0]},l=[];a=0;let u=this.bytes,f=u[a++]|u[a++]<<8|u[a++]<<16|u[a++]<<24,d=u[a++]|u[a++]<<8|u[a++]<<16|u[a++]<<24,h=u[a++]|u[a++]<<8|u[a++]<<16|u[a++]<<24,p=u[a++]|u[a++]<<8|u[a++]<<16|u[a++]<<24;a=0,(new I(f,d),new I(h,p)).lessThan(I.ZERO)&&l.push("-");let y=p>>26&31;if(y>>3==3){if(30===y)return l.join("")+"Infinity";if(31===y)return"NaN";e=p>>
215&16383,n=8+(p>>14&1)}else n=p>>14&7,e=p>>17&16383;let b=e-6176;if(c.parts[0]=(16383&p)+((15&n)<<14),c.parts[1]=h,c.parts[2]=d,c.parts[3]=f,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])s=!0;else for(o=3;o>=0;o--){let e=0,t=function(e){let t=I.fromNumber(1e9),r=I.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:r};for(let n=0;n<=3;n++)r=(r=r.shiftLeft(32)).add(new I(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}(c);if(c=t.quotient,e=t.rem.low)for(i=8;i>=0;i--)r[9*o+i]=e%10,e=Math.floor(e/10)}if(s)t=1,r[a]=0;else for(t=36;!r[a];)t-=1,a+=1;let m=t-1+b;if(m>=34||m<=-7||b>0){if(t>34)return l.push("0"),b>0?l.push(`E+${b}`):b<0&&l.push(`E${b}`),l.join("");l.push(`${r[a++]}`),(t-=1)&&l.push(".");for(let e=0;e<t;e++)l.push(`${r[a++]}`);l.push("E"),m>0?l.push(`+${m}`):l.push(`${m}`)}else if(b>=0)for(let e=0;e<t;e++)l.push(`${r[a++]}`);else{let e=t+b;if(e>0)for(let t=0;t<e;t++)l.push(`${r[a++]}`);else l.push("0");for(l.push(".");e++<0;)l.push("0");for(let n=0;n<t-Math.max(e-1,0);n++)l.push(`${r[a++]}`)}return l.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(e){return V.fromString(e.$numberDecimal)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new Decimal128("${this.toString()}")`}}class K extends S{get _bsontype(){return"Double"}constructor(e){super(),e instanceof Number&&(e=e.valueOf()),this.value=+e}valueOf(){return this.value}toJSON(){return this.value}toString(e){return this.value.toString(e)}toExtendedJSON(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-0.0"}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}}static fromExtendedJSON(e,t){let r=parseFloat(e.$numberDouble);return t&&t.relaxed?r:new K(r)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new Double(${this.toExtendedJSON().$numberDouble})`}}class H extends S{get _bsontype(){return"Int32"}constructor(e){super(),e instanceof Number&&(e=e.valueOf()),this.value=0|e}valueOf(){return this.value}toString(e){return this.value.toString(e)}toJSON(){return this.value}toExtendedJSON(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(e,t){return t&&t.relaxed?parseInt(e.$numberInt,10):new H(e.$numberInt)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new Int32(${this.valueOf()})`}}class W extends S{get _bsontype(){return"MaxKey"}toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new W}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return"new MaxKey()"}}class J extends S{get _bsontype(){return"MinKey"}toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new J}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return"new MinKey()"}}let G=RegExp("^[0-9a-fA-F]{24}$"),Y=null,X=Symbol("id");class Q extends S{get _bsontype(){return"ObjectId"}constructor(e){let t;if(super(),"object"==typeof e&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new d("Argument passed in must have an id that is of type string or Buffer");t="toHexString"in e&&"function"==typeof e.toHexString?w.fromHex(e.toHexString()):e.id}else t=e;if(null==t||"number"==typeof t)this[X]=Q.generate("number"==typeof t?t:void 0);else if(ArrayBuffer.isView(t)&&12===t.byteLength)this[X]=w.toLocalBufferType(t);else{if("string"!=typeof t)throw new d("Argument passed in does not match the accepted types");if(12===t.length){const e=w.fromUTF8(t);if(12!==e.byteLength)throw new d("Argument passed in must be a string of 12 bytes");this[X]=e}else{if(24!==t.length||!G.test(t))throw new d("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[X]=w.fromHex(t)}}Q.cacheHexString&&(this.__id=w.toHex(this.id))}get id(){return this[X]}set id(e){this[X]=e,Q.cacheHexString&&(this.__id=w.toHex(e))}toHexString(){if(Q.cacheHexString&&this.__id)return this.__id;
2let e=w.toHex(this.id);return Q.cacheHexString&&!this.__id&&(this.__id=e),e}static getInc(){return Q.index=(Q.index+1)%0xffffff}static generate(e){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));let t=Q.getInc(),r=w.allocate(12);return _.fromUint8Array(r).setUint32(0,e,!1),null===Y&&(Y=w.randomBytes(5)),r[4]=Y[0],r[5]=Y[1],r[6]=Y[2],r[7]=Y[3],r[8]=Y[4],r[11]=255&t,r[10]=t>>8&255,r[9]=t>>16&255,r}toString(e){return"base64"===e?w.toBase64(this.id):this.toHexString()}toJSON(){return this.toHexString()}equals(e){if(null==e)return!1;if(e instanceof Q)return this[X][11]===e[X][11]&&w.equals(this[X],e[X]);if("string"==typeof e&&Q.isValid(e)&&12===e.length&&a(this.id))return w.equals(this.id,w.fromISO88591(e));if("string"==typeof e&&Q.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&Q.isValid(e)&&12===e.length)return w.equals(w.fromUTF8(e),this.id);if("object"==typeof e&&"toHexString"in e&&"function"==typeof e.toHexString){let t=e.toHexString(),r=this.toHexString().toLowerCase();return"string"==typeof t&&t.toLowerCase()===r}return!1}getTimestamp(){let e=new Date,t=_.fromUint8Array(this.id).getUint32(0,!1);return e.setTime(1e3*Math.floor(t)),e}static createPk(){return new Q}static createFromTime(e){let t=w.fromNumberArray([0,0,0,0,0,0,0,0,0,0,0,0]);return _.fromUint8Array(t).setUint32(0,e,!1),new Q(t)}static createFromHexString(e){if(24!==e?.length)throw new d("hex string must be 24 characters");return new Q(w.fromHex(e))}static createFromBase64(e){if(16!==e?.length)throw new d("base64 string must be 16 characters");return new Q(w.fromBase64(e))}static isValid(e){if(null==e)return!1;try{return new Q(e),!0}catch{return!1}}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(e){return new Q(e.$oid)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new ObjectId("${this.toHexString()}")`}}function Z(e,t,r){let n=5;if(Array.isArray(e))for(let i=0;i<e.length;i++)n+=ee(i.toString(),e[i],t,!0,r);else for(let i of("function"==typeof e?.toBSON&&(e=e.toBSON()),Object.keys(e)))n+=ee(i,e[i],t,!1,r);return n}function ee(e,t,r=!1,n=!1,i=!1){switch("function"==typeof t?.toBSON&&(t=t.toBSON()),typeof t){case"string":return 1+w.utf8ByteLength(e)+1+4+w.utf8ByteLength(t)+1;case"number":return Math.floor(t)===t&&t>=-0x20000000000000&&t<=0x20000000000000&&t>=-0x80000000&&t<=0x7fffffff?(null!=e?w.utf8ByteLength(e)+1:0)+5:(null!=e?w.utf8ByteLength(e)+1:0)+9;case"undefined":return n||!i?(null!=e?w.utf8ByteLength(e)+1:0)+1:0;case"boolean":return(null!=e?w.utf8ByteLength(e)+1:0)+2;case"object":if(null!=t&&"string"==typeof t._bsontype&&5!==t[Symbol.for("@@mdb.bson.version")])throw new h;if(null==t||"MinKey"===t._bsontype||"MaxKey"===t._bsontype)return(null!=e?w.utf8ByteLength(e)+1:0)+1;if("ObjectId"===t._bsontype)return(null!=e?w.utf8ByteLength(e)+1:0)+13;if(t instanceof Date||l(t))return(null!=e?w.utf8ByteLength(e)+1:0)+9;if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||o(t))return(null!=e?w.utf8ByteLength(e)+1:0)+6+t.byteLength;if("Long"===t._bsontype||"Double"===t._bsontype||"Timestamp"===t._bsontype)return(null!=e?w.utf8ByteLength(e)+1:0)+9;if("Decimal128"===t._bsontype)return(null!=e?w.utf8ByteLength(e)+1:0)+17;if("Code"===t._bsontype)return null!=t.scope&&Object.keys(t.scope).length>0?(null!=e?w.utf8ByteLength(e)+1:0)+1+4+4+w.utf8ByteLength(t.code.toString())+1+Z(t.scope,r,i):(null!=e?w.utf8ByteLength(e)+1:0)+1+4+w.utf8ByteLength(t.code.toString())+1;if("Binary"===t._bsontype){let r=t;return r.sub_type===j.SUBTYPE_BYTE_ARRAY?(null!=e?w.utf8ByteLength(e)+1:0)+(r.position+1+4+1+4):(null!=e?w.utf8ByteLength(e)+1:0)+(r.position+1+4+1)}if("Symbol"===t._bsontype)return(null!=e?w.utf8ByteLength(e)+1:0)+w.utf8ByteLength(t.value)+4+1+1;if("DBRef"===t._bsontype){let n=Object.assign({$ref:t.collection,$id:t.oid},t.fields);return null!=t.db&&(n.$db=t.db),(null!=e?w.utf8ByteLength(e)+1:0)+1+Z(n,r,i)}return t instanceof RegExp||s(t)?(null!=e?w.utf8ByteLength(e)+1:0)+1+w.utf8ByteLength(t.source)+1+ +!!t.global+ +!!t.ignoreCase+ +!!t.multiline+1:"BSONRegExp"===t._bsontype?(null!=e?w.utf8ByteLength(e)+1:0)+1+w.utf8ByteLength(t.pattern)+1+w.utf8ByteLength(t.options)+1:(null!=e?w.utf8ByteLength(e)+1:0)+Z(t,r,i)+1;case"function":if(r)return(null!=e?w.utf8ByteLength(e)+1:0)+1+4+w.utf8ByteLength(t.toString())+1}return 0}Q.index=Math.floor(0xffffff*Math.random());class et extends S{get _bsontype(){return"BSONRegExp"}constructor(e,t){if(super(),this.pattern=e,this.options=(t??"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new d(`BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}`);if(-1!==this.options.indexOf("\0"))throw new d(`BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}`);for(let e=0;e<this.options.length;e++)if("i"!==this.options[e]&&"m"!==this.options[e]&&"x"!==this.options[e]&&"l"!==this.options[e]&&"s"!==this.options[e]&&"u"!==this.options[e])throw new d(`The regular expression o
2ption [${this.options[e]}] is not supported`)}static parseOptions(e){return e?e.split("").sort().join(""):""}toExtendedJSON(e){return(e=e||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(e){if("$regex"in e){if("string"==typeof e.$regex)return new et(e.$regex,et.parseOptions(e.$options));if("BSONRegExp"===e.$regex._bsontype)return e}if("$regularExpression"in e)return new et(e.$regularExpression.pattern,et.parseOptions(e.$regularExpression.options));throw new d(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(e)}`)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new BSONRegExp(${JSON.stringify(this.pattern)}, ${JSON.stringify(this.options)})`}}class er extends S{get _bsontype(){return"BSONSymbol"}constructor(e){super(),this.value=e}valueOf(){return this.value}toString(){return this.value}inspect(){return`new BSONSymbol("${this.value}")`}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(e){return new er(e.$symbol)}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}}let en=I;class ei extends en{get _bsontype(){return"Timestamp"}constructor(e){if(null==e)super(0,0,!0);else if("bigint"==typeof e)super(e,!0);else if(I.isLong(e))super(e.low,e.high,!0);else{if("object"!=typeof e||!("t"in e)||!("i"in e))throw new d("A Timestamp can only be constructed with: bigint, Long, or { t: number; i: number }");{if("number"!=typeof e.t&&("object"!=typeof e.t||"Int32"!==e.t._bsontype))throw new d("Timestamp constructed from { t, i } must provide t as a number");if("number"!=typeof e.i&&("object"!=typeof e.i||"Int32"!==e.i._bsontype))throw new d("Timestamp constructed from { t, i } must provide i as a number");const t=Number(e.t),r=Number(e.i);if(t<0||Number.isNaN(t))throw new d("Timestamp constructed from { t, i } must provide a positive t");if(r<0||Number.isNaN(r))throw new d("Timestamp constructed from { t, i } must provide a positive i");if(t>0xffffffff)throw new d("Timestamp constructed from { t, i } must provide t equal or less than uint32 max");if(r>0xffffffff)throw new d("Timestamp constructed from { t, i } must provide i equal or less than uint32 max");super(r,t,!0)}}}toJSON(){return{$timestamp:this.toString()}}static fromInt(e){return new ei(I.fromInt(e,!0))}static fromNumber(e){return new ei(I.fromNumber(e,!0))}static fromBits(e,t){return new ei({i:e,t:t})}static fromString(e,t){return new ei(I.fromString(e,!0,t))}toExtendedJSON(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}static fromExtendedJSON(e){let t=I.isLong(e.$timestamp.i)?e.$timestamp.i.getLowBitsUnsigned():e.$timestamp.i;return new ei({t:I.isLong(e.$timestamp.t)?e.$timestamp.t.getLowBitsUnsigned():e.$timestamp.t,i:t})}[Symbol.for("nodejs.util.inspect.custom")](){return this.inspect()}inspect(){return`new Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`}}function eo(e,t,r){let n=0;for(let i=t;i<r;i+=1){let t=e[i];if(n){if(128!=(192&t))return!1;n-=1}else if(128&t)if(192==(224&t))n=1;else if(224==(240&t))n=2;else{if(240!=(248&t))return!1;n=3}}return!n}ei.MAX_VALUE=I.MAX_UNSIGNED_VALUE;let ea=I.fromNumber(0x20000000000000),es=I.fromNumber(-0x20000000000000);function ec(e,t,r){let n=(t=t??{})&&t.index?t.index:0,i=e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24;if(i<5)throw new d(`bson size must be >= 5, is ${i}`);if(t.allowObjectSmallerThanBufferSize&&e.length<i)throw new d(`buffer length ${e.length} must be >= bson size ${i}`);if(!t.allowObjectSmallerThanBufferSize&&e.length!==i)throw new d(`buffer length ${e.length} must === bson size ${i}`);if(i+n>e.byteLength)throw new d(`(bson size ${i} + options.index ${n} must be <= buffer length ${e.byteLength})`);if(0!==e[n+i-1])throw new d("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return function e(t,r,n,i=!1){let o=null==n.fieldsAsRaw?null:n.fieldsAsRaw,a=null!=n.raw&&n.raw,s="boolean"==typeof n.bsonRegExp&&n.bsonRegExp,c=n.promoteBuffers??!1,l=n.promoteLongs??!0,u=n.promoteValues??!0,f=n.useBigInt64??!1;if(f&&!u||f&&!l)throw new d("Must either request bigint or Long for int64 deserialization");let h=null==n.validation?{utf8:!0}:n.validation,p,y=!0,b=new Set,m=h.utf8;if("boolean"==typeof m)p=m;else{y=!1;let e=Object.keys(m).map(function(e){return m[e]});if(0===e.length)throw new d("UTF-8 validation setting cannot be empty");if("boolean"!=typeof e[0])throw new d("Invalid UTF-8 validation option, must specify boolean values");if(p=e[0],!e.every(e=>e===p))throw new d("Invalid UTF-8 validation option - keys must be all true or all false")}if(!y)for(let e of Object.keys(m))b.add(e);let g=r;if(t.length<5)throw new d("corrupt bson message < 5 bytes long");let v=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(v<5||v>t.length)throw new d("corrupt bson message");let x=i?[]:{},S=0,k=!i&&null,O=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;;){let m=t[r++];if(0===m)break;let g=r;for(;0!==t[g]&&g<t.length;)g++;if(g>=t.byteLength)throw new d("Bad BSON Document: illegal CString");let v=i?S++:w.toUTF8(t,r,g),E,P=!0;if(P=y||b.has(v)?p:!p,!1!==k&&"$"===v[0]&&(k=el.test(v)),r=g+1,2===m){let e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(e<=0||e>t.length-r||0!==t[r+e-1])throw new d("bad string length in bson");E=eu(t,r,r+e-1,P),r+=e}else if(7===m){let e=w.allocate(12);
2e.set(t.subarray(r,r+12)),E=new Q(e),r+=12}else if(16===m&&!1===u)E=new H(t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24);else if(16===m)E=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;else if(1===m&&!1===u)E=new K(O.getFloat64(r,!0)),r+=8;else if(1===m)E=O.getFloat64(r,!0),r+=8;else if(9===m)E=new Date(new I(t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24,t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24).toNumber());else if(8===m){if(0!==t[r]&&1!==t[r])throw new d("illegal boolean type value");E=1===t[r++]}else if(3===m){let i=r,o=t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24;if(o<=0||o>t.length-r)throw new d("bad embedded document length in bson");if(a)E=t.slice(r,r+o);else{let r=n;y||(r={...n,validation:{utf8:P}}),E=e(t,i,r,!1)}r+=o}else if(4===m){let i=r,a=t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24,s=n,c=r+a;if(o&&o[v]&&(s={...n,raw:!0}),y||(s={...s,validation:{utf8:P}}),E=e(t,i,s,!0),0!==t[(r+=a)-1])throw new d("invalid array terminator byte");if(r!==c)throw new d("corrupted array bson")}else if(6===m)E=void 0;else if(10===m)E=null;else if(18===m){let e=_.fromUint8Array(t.subarray(r,r+8)),n=new I(t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24,t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24);E=f?e.getBigInt64(0,!0):l&&!0===u&&n.lessThanOrEqual(ea)&&n.greaterThanOrEqual(es)?n.toNumber():n}else if(19===m){let e=w.allocate(16);e.set(t.subarray(r,r+16),0),r+=16,E=new V(e)}else if(5===m){let e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24,n=e,i=t[r++];if(e<0)throw new d("Negative binary type element size found");if(e>t.byteLength)throw new d("Binary type size larger than document size");if(null!=t.slice){if(i===j.SUBTYPE_BYTE_ARRAY){if((e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24)<0)throw new d("Negative binary type element size found for subtype 0x02");if(e>n-4)throw new d("Binary type with subtype 0x02 contains too long binary size");if(e<n-4)throw new d("Binary type with subtype 0x02 contains too short binary size")}c&&u?E=w.toLocalBufferType(t.slice(r,r+e)):(E=new j(t.slice(r,r+e),i),4===i&&$.isValid(E)&&(E=E.toUUID()))}else{let o=w.allocate(e);if(i===j.SUBTYPE_BYTE_ARRAY){if((e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24)<0)throw new d("Negative binary type element size found for subtype 0x02");if(e>n-4)throw new d("Binary type with subtype 0x02 contains too long binary size");if(e<n-4)throw new d("Binary type with subtype 0x02 contains too short binary size")}for(g=0;g<e;g++)o[g]=t[r+g];c&&u?E=o:(E=new j(t.slice(r,r+e),i),4===i&&$.isValid(E)&&(E=E.toUUID()))}r+=e}else if(11===m&&!1===s){for(g=r;0!==t[g]&&g<t.length;)g++;if(g>=t.length)throw new d("Bad BSON Document: illegal CString");let e=w.toUTF8(t,r,g);for(g=r=g+1;0!==t[g]&&g<t.length;)g++;if(g>=t.length)throw new d("Bad BSON Document: illegal CString");let n=w.toUTF8(t,r,g);r=g+1;let i=Array(n.length);for(g=0;g<n.length;g++)switch(n[g]){case"m":i[g]="m";break;case"s":i[g]="g";break;case"i":i[g]="i"}E=new RegExp(e,i.join(""))}else if(11===m&&!0===s){for(g=r;0!==t[g]&&g<t.length;)g++;if(g>=t.length)throw new d("Bad BSON Document: illegal CString");let e=w.toUTF8(t,r,g);for(g=r=g+1;0!==t[g]&&g<t.length;)g++;if(g>=t.length)throw new d("Bad BSON Document: illegal CString");let n=w.toUTF8(t,r,g);r=g+1,E=new et(e,n)}else if(14===m){let e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(e<=0||e>t.length-r||0!==t[r+e-1])throw new d("bad string length in bson");let n=eu(t,r,r+e-1,P);E=u?n:new er(n),r+=e}else if(17===m)E=new ei({i:t[r++]+256*t[r++]+65536*t[r++]+0x1000000*t[r++],t:t[r++]+256*t[r++]+65536*t[r++]+0x1000000*t[r++]});else if(255===m)E=new J;else if(127===m)E=new W;else if(13===m){let e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(e<=0||e>t.length-r||0!==t[r+e-1])throw new d("bad string length in bson");E=new A(eu(t,r,r+e-1,P)),r+=e}else if(15===m){let i=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(i<13)throw new d("code_w_scope total size shorter minimum expected length");let o=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(o<=0||o>t.length-r||0!==t[r+o-1])throw new d("bad string length in bson");let a=eu(t,r,r+o-1,P),s=r+=o,c=t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24,l=e(t,s,n,!1);if(r+=c,i<8+c+o)throw new d("code_w_scope total size is too short, truncating scope");if(i>8+c+o)throw new d("code_w_scope total size is too long, clips outer document");E=new A(a,l)}else{if(12!==m)throw new d(`Detected unknown BSON type ${m.toString(16)} for fieldname "${v}"`);{let e=t[r++]|t[r++]<<8|t[r++]<<16|t[r++]<<24;if(e<=0||e>t.length-r||0!==t[r+e-1])throw new d("bad string length in bson");if(null!=h&&h.utf8&&!eo(t,r,r+e-1))throw new d("Invalid UTF-8 string in BSON document");let n=w.toUTF8(t,r,r+e-1);r+=e;let i=w.allocate(12);i.set(t.subarray(r,r+12),0),r+=12,E=new N(n,new Q(i))}}"__proto__"===v?Object.defineProperty(x,v,{value:E,writable:!0,enumerable:!0,configurable:!0}):x[v]=E}if(v!==r-g){if(i)throw new d("corrupt array bson");throw new d("corrupt object bson")}if(!k)return x;if(E(x)){let e=Object.assign({},x);return delete e.$ref,delete e.$id,delete e.$db,new N(x.$ref,x.$id,x.$db,e)}return x}(e,n,t,r)}let el=/^\$ref$|^\$id$|^\$db$/;function eu(e,t,r,n){let i=w.toUTF8(e,t,r);if(n){for(let n=0;n<i.length;n++)if(65533===i.charCodeAt(n)){if(!eo(e,t,r))throw new d("Invalid UTF-8 string in BSON document");break}}return i}let ef=/\x00/,ed=new Set(["$db","$ref","$id","$clusterTime"]);function eh(e,t,r,n){e[n++]=2,e[(n=n+w.encodeUTF8Into(e,t,n)+1)-1]=0;let i=w.encodeUTF8Into(e,r,n+4);return e[n+3]=i+1>>24&255,e[n+2]=i+1>>16&255,e[n+1]=i+1>>8&255,e[n]=i+1&255,n=n+4+i,e[n++]=0,n}let ep=new DataView(new ArrayBuffer(8),0,8),ey=new Uint8Array(ep.buffer,0,4),eb=new Uint8Array(ep.buffer,0,8);function em(e,t,r,n){let i=!Object.is(r,-0)&&Number.isSafeInteger(r)&&r<=0x7fffffff&&r>=-0x80000000?16:1;16===i?ep.setInt32(0,r,!0):ep.setFloat64(0,r,!0);let o=16===i?ey:eb;return e[n++]=i,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,e.set(o,n),n+o.byteLength}function eg(e,t,r,n){return e[n++]=18,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,ep.setBigInt64(0,r,!0),e.set(eb,n),n+eb.byteLength}function ev(e,t,r,n){return e[n++]=10,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,n}function ex(e,t,r,n){return e[n++]=8,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,e[n++]=+!!r,n}function ew(e,t,r,n){e[n++]=9,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=I.fromNumber(r.getTime()),o=i.getLowBits(),a=i.getHighBits();return e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=a>>16&255,e[n++]=a>>24&255,n}function e_(e,t,r,n){if(e[n++]=11,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,r.source&&null!=r.source.match(ef))throw new d("value "+r.source+" must not contain null bytes");return n+=w.encodeUTF8Into(e,r.source,n),e[n++]=0,r.ignoreCase&&(e[n++]=105),r.global&&(e[n++]=115),r.multiline&&(e[n++]=109),e[n++]=0,n}function eS(e,t,r,n){if(e[n++]=11,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,null!=r.pattern.match(ef))throw new d("pattern "+r.pattern+" must not contain null bytes");n+=w.encodeUTF8Into(e,r.pattern,n),e[n++]=0;let i=r.options.split("").sort().join("");return n+=w.encodeUTF8Into(e,i,n),e[n++]=0,n}function ej(e,t,r,n){return null===r?e[n++]=10:"MinKey"===r._bsontype?e[n++]=255:e[n++]=127,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,n}function ek(e,t,r,n){if(e[n++]=7,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,!a(r.id))throw new d("object ["+JSON.stringify(r)+"] is not a valid ObjectId");return e.set(r.id.subarray(0,12),n),n+12}function eO(e,t,r,n){e[n++]=5,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=r.length;return e[n++]=255&i,e[n++]=i>>8&255,e[n++]=i>>16&255,e[n++]=i>>24&255,e[n++]=0,e.set(r,n),n+i}function e$(e,t,r,n,i,o,a,s,c){if(c.has(r))throw new d("Cannot convert circular structure to BSON");c.add(r),e[n++]=Array.isArray(r)?4:3,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let l=eB(e,r,i,n,o+1,a,s,c);return c.delete(r),l}function eA(e,t,r,n){return e[n++]=19,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,e.set(r.bytes.subarray(0,16),n),n+16}function eE(e,t,r,n){e[n++]="Long"===r._bsontype?18:17,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=r.getLowBits(),o=r.getHighBits();return e[n++]=255&i,e[n++]=i>>8&255,e[n++]=i>>16&255,e[n++]=i>>24&255,e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,n}function eN(e,t,r,n){return r=r.valueOf(),e[n++]=16,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255,n}function eP(e,t,r,n){return e[n++]=1,n+=w.encodeUTF8Into(e,t,n),e[n++]=0,ep.setFloat64(0,r.value,!0),e.set(eb,n),n+8}function eM(e,t,r,n){e[n++]=13,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=r.toString(),o=w.encodeUTF8Into(e,i,n+4)+1;return e[n]=255&o,e[n+1]=o>>8&255,e[n+2]=o>>16&255,e[n+3]=o>>24&255,n=n+4+o-1,e[n++]=0,n}function eD(e,t,r,n,i=!1,o=0,a=!1,s=!0,c){if(r.scope&&"object"==typeof r.scope){e[n++]=15,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let l=n,u=r.code;n+=4;let f=w.encodeUTF8Into(e,u,n+4)+1;e[n]=255&f,e[n+1]=f>>8&255,e[n+2]=f>>16&255,e[n+3]=f>>
224&255,e[n+4+f-1]=0,n=n+f+4;let d=eB(e,r.scope,i,n,o+1,a,s,c);n=d-1;let h=d-l;e[l++]=255&h,e[l++]=h>>8&255,e[l++]=h>>16&255,e[l++]=h>>24&255,e[n++]=0}else{e[n++]=13,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=r.code.toString(),o=w.encodeUTF8Into(e,i,n+4)+1;e[n]=255&o,e[n+1]=o>>8&255,e[n+2]=o>>16&255,e[n+3]=o>>24&255,n=n+4+o-1,e[n++]=0}return n}function eI(e,t,r,n){e[n++]=5,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=r.buffer,o=r.position;return r.sub_type===j.SUBTYPE_BYTE_ARRAY&&(o+=4),e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=r.sub_type,r.sub_type===j.SUBTYPE_BYTE_ARRAY&&(o-=4,e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255),e.set(i,n),n+r.position}function eT(e,t,r,n){e[n++]=14,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let i=w.encodeUTF8Into(e,r.value,n+4)+1;return e[n]=255&i,e[n+1]=i>>8&255,e[n+2]=i>>16&255,e[n+3]=i>>24&255,n=n+4+i-1,e[n++]=0,n}function eC(e,t,r,n,i,o,a){e[n++]=3,n+=w.encodeUTF8Into(e,t,n),e[n++]=0;let s=n,c={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(c.$db=r.db);let l=eB(e,c=Object.assign(c,r.fields),!1,n,i+1,o,!0,a),u=l-s;return e[s++]=255&u,e[s++]=u>>8&255,e[s++]=u>>16&255,e[s++]=u>>24&255,l}function eB(e,t,r,n,i,u,f,p){if(null==p){if(null==t)return e[0]=5,e[1]=0,e[2]=0,e[3]=0,e[4]=0,5;if(Array.isArray(t))throw new d("serialize does not support an array as the root input");if("object"!=typeof t)throw new d("serialize does not support non-object as the root input");if("_bsontype"in t&&"string"==typeof t._bsontype)throw new d("BSON types cannot be serialized as a document");if(l(t)||s(t)||a(t)||o(t))throw new d("date, regexp, typedarray, and arraybuffer cannot be BSON documents");p=new Set}p.add(t);let y=n+4;if(Array.isArray(t))for(let n=0;n<t.length;n++){let o=`${n}`,c=t[n];if("function"==typeof c?.toBSON&&(c=c.toBSON()),"string"==typeof c)y=eh(e,o,c,y);else if("number"==typeof c)y=em(e,o,c,y);else if("bigint"==typeof c)y=eg(e,o,c,y);else if("boolean"==typeof c)y=ex(e,o,c,y);else if(c instanceof Date||l(c))y=ew(e,o,c,y);else if(void 0===c)y=ev(e,o,0,y);else if(null===c)y=ev(e,o,0,y);else if(a(c))y=eO(e,o,c,y);else if(c instanceof RegExp||s(c))y=e_(e,o,c,y);else if("object"==typeof c&&null==c._bsontype)y=e$(e,o,c,y,r,i,u,f,p);else{if("object"==typeof c&&5!==c[Symbol.for("@@mdb.bson.version")])throw new h;if("ObjectId"===c._bsontype)y=ek(e,o,c,y);else if("Decimal128"===c._bsontype)y=eA(e,o,c,y);else if("Long"===c._bsontype||"Timestamp"===c._bsontype)y=eE(e,o,c,y);else if("Double"===c._bsontype)y=eP(e,o,c,y);else if("function"==typeof c&&u)y=eM(e,o,c,y);else if("Code"===c._bsontype)y=eD(e,o,c,y,r,i,u,f,p);else if("Binary"===c._bsontype)y=eI(e,o,c,y);else if("BSONSymbol"===c._bsontype)y=eT(e,o,c,y);else if("DBRef"===c._bsontype)y=eC(e,o,c,y,i,u,p);else if("BSONRegExp"===c._bsontype)y=eS(e,o,c,y);else if("Int32"===c._bsontype)y=eN(e,o,c,y);else if("MinKey"===c._bsontype||"MaxKey"===c._bsontype)y=ej(e,o,c,y);else if(void 0!==c._bsontype)throw new d(`Unrecognized or invalid _bsontype: ${String(c._bsontype)}`)}}else if(t instanceof Map||c(t)){let n=t.entries(),o=!1;for(;!o;){let t=n.next();if(o=!!t.done)continue;let c=t.value[0],b=t.value[1];"function"==typeof b?.toBSON&&(b=b.toBSON());let m=typeof b;if("string"==typeof c&&!ed.has(c)){if(null!=c.match(ef))throw new d("key "+c+" must not contain null bytes");if(r){if("$"===c[0])throw new d("key "+c+" must not start with '$'");if(~c.indexOf("."))throw new d("key "+c+" must not contain '.'")}}if("string"===m)y=eh(e,c,b,y);else if("number"===m)y=em(e,c,b,y);else if("bigint"===m)y=eg(e,c,b,y);else if("boolean"===m)y=ex(e,c,b,y);else if(b instanceof Date||l(b))y=ew(e,c,b,y);else if(null===b||void 0===b&&!1===f)y=ev(e,c,0,y);else if(a(b))y=eO(e,c,b,y);else if(b instanceof RegExp||s(b))y=e_(e,c,b,y);else if("object"===m&&null==b._bsontype)y=e$(e,c,b,y,r,i,u,f,p);else{if("object"==typeof b&&5!==b[Symbol.for("@@mdb.bson.version")])throw new h;if("ObjectId"===b._bsontype)y=ek(e,c,b,y);else if("object"===m&&"Decimal128"===b._bsontype)y=eA(e,c,b,y);else if("Long"===b._bsontype||"Timestamp"===b._bsontype)y=eE(e,c,b,y);else if("Double"===b._bsontype)y=eP(e,c,b,y);else if("Code"===b._bsontype)y=eD(e,c,b,y,r,i,u,f,p);else if("function"==typeof b&&u)y=eM(e,c,b,y);else if("Binary"===b._bsontype)y=eI(e,c,b,y);
2else if("BSONSymbol"===b._bsontype)y=eT(e,c,b,y);else if("DBRef"===b._bsontype)y=eC(e,c,b,y,i,u,p);else if("BSONRegExp"===b._bsontype)y=eS(e,c,b,y);else if("Int32"===b._bsontype)y=eN(e,c,b,y);else if("MinKey"===b._bsontype||"MaxKey"===b._bsontype)y=ej(e,c,b,y);else if(void 0!==b._bsontype)throw new d(`Unrecognized or invalid _bsontype: ${String(b._bsontype)}`)}}}else{if("function"==typeof t?.toBSON&&null!=(t=t.toBSON())&&"object"!=typeof t)throw new d("toBSON function did not return an object");for(let n of Object.keys(t)){let o=t[n];"function"==typeof o?.toBSON&&(o=o.toBSON());let c=typeof o;if("string"==typeof n&&!ed.has(n)){if(null!=n.match(ef))throw new d("key "+n+" must not contain null bytes");if(r){if("$"===n[0])throw new d("key "+n+" must not start with '$'");if(~n.indexOf("."))throw new d("key "+n+" must not contain '.'")}}if("string"===c)y=eh(e,n,o,y);else if("number"===c)y=em(e,n,o,y);else if("bigint"===c)y=eg(e,n,o,y);else if("boolean"===c)y=ex(e,n,o,y);else if(o instanceof Date||l(o))y=ew(e,n,o,y);else if(void 0===o)!1===f&&(y=ev(e,n,0,y));else if(null===o)y=ev(e,n,0,y);else if(a(o))y=eO(e,n,o,y);else if(o instanceof RegExp||s(o))y=e_(e,n,o,y);else if("object"===c&&null==o._bsontype)y=e$(e,n,o,y,r,i,u,f,p);else{if("object"==typeof o&&5!==o[Symbol.for("@@mdb.bson.version")])throw new h;if("ObjectId"===o._bsontype)y=ek(e,n,o,y);else if("object"===c&&"Decimal128"===o._bsontype)y=eA(e,n,o,y);else if("Long"===o._bsontype||"Timestamp"===o._bsontype)y=eE(e,n,o,y);else if("Double"===o._bsontype)y=eP(e,n,o,y);else if("Code"===o._bsontype)y=eD(e,n,o,y,r,i,u,f,p);else if("function"==typeof o&&u)y=eM(e,n,o,y);else if("Binary"===o._bsontype)y=eI(e,n,o,y);else if("BSONSymbol"===o._bsontype)y=eT(e,n,o,y);else if("DBRef"===o._bsontype)y=eC(e,n,o,y,i,u,p);else if("BSONRegExp"===o._bsontype)y=eS(e,n,o,y);else if("Int32"===o._bsontype)y=eN(e,n,o,y);else if("MinKey"===o._bsontype||"MaxKey"===o._bsontype)y=ej(e,n,o,y);else if(void 0!==o._bsontype)throw new d(`Unrecognized or invalid _bsontype: ${String(o._bsontype)}`)}}}p.delete(t),e[y++]=0;let b=y-n;return e[n++]=255&b,e[n++]=b>>8&255,e[n++]=b>>16&255,e[n++]=b>>24&255,y}let eR={$oid:Q,$binary:j,$uuid:j,$symbol:er,$numberInt:H,$numberDecimal:V,$numberDouble:K,$numberLong:I,$minKey:J,$maxKey:W,$regex:et,$regularExpression:et,$timestamp:ei};function eL(e){let t=e.toISOString();return 0!==e.getUTCMilliseconds()?t:t.slice(0,-5)+"Z"}let ez={Binary:e=>new j(e.value(),e.sub_type),Code:e=>new A(e.code,e.scope),DBRef:e=>new N(e.collection||e.namespace,e.oid,e.db,e.fields),Decimal128:e=>new V(e.bytes),Double:e=>new K(e.value),Int32:e=>new H(e.value),Long:e=>I.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_),MaxKey:()=>new W,MinKey:()=>new J,ObjectId:e=>new Q(e),BSONRegExp:e=>new et(e.pattern,e.options),BSONSymbol:e=>new er(e.value),Timestamp:e=>ei.fromBits(e.low,e.high)};function eF(e,t){let r={useBigInt64:t?.useBigInt64??!1,relaxed:t?.relaxed??!0,legacy:t?.legacy??!1};return JSON.parse(e,(e,t)=>{if(-1!==e.indexOf("\0"))throw new d(`BSON Document field names cannot contain null bytes, found: ${JSON.stringify(e)}`);return function e(t,r={}){if("number"==typeof t){let e=t<=0x7fffffff&&t>=-0x80000000,n=t<=u&&t>=-0x8000000000000000;if(r.relaxed||r.legacy)return t;if(Number.isInteger(t)&&!Object.is(t,-0)){if(e)return new H(t);if(n)return r.useBigInt64?BigInt(t):I.fromNumber(t)}return new K(t)}if(null==t||"object"!=typeof t)return t;if(t.$undefined)return null;let n=Object.keys(t).filter(e=>e.startsWith("$")&&null!=t[e]);for(let e=0;e<n.length;e++){let i=eR[n[e]];if(i)return i.fromExtendedJSON(t,r)}if(null!=t.$date){let e=t.$date,n=new Date;if(r.legacy)if("number"==typeof e)n.setTime(e);else if("string"==typeof e)n.setTime(Date.parse(e));else{if("bigint"!=typeof e)throw new p("Unrecognized type for EJSON date: "+typeof e);n.setTime(Number(e))}else if("string"==typeof e)n.setTime(Date.parse(e));else if(I.isLong(e))n.setTime(e.toNumber());else if("number"==typeof e&&r.relaxed)n.setTime(e);else{if("bigint"!=typeof e)throw new p("Unrecognized type for EJSON date: "+typeof e);n.setTime(Number(e))}return n}if(null!=t.$code){let r=Object.assign({},t);
2return t.$scope&&(r.$scope=e(t.$scope)),A.fromExtendedJSON(t)}if(E(t)||t.$dbPointer){let e=t.$ref?t:t.$dbPointer;if(e instanceof N)return e;let r=Object.keys(e).filter(e=>e.startsWith("$")),n=!0;if(r.forEach(e=>{-1===["$ref","$id","$db"].indexOf(e)&&(n=!1)}),n)return N.fromExtendedJSON(e)}return t}(t,r)})}function eU(e,t,r,n){return null!=r&&"object"==typeof r&&(n=r,r=0),null==t||"object"!=typeof t||Array.isArray(t)||(n=t,t=void 0,r=0),JSON.stringify(function e(t,r){if(t instanceof Map||c(t)){let n=Object.create(null);for(let[e,r]of t){if("string"!=typeof e)throw new d("Can only serialize maps with string keys");n[e]=r}return e(n,r)}if(("object"==typeof t||"function"==typeof t)&&null!==t){let e=r.seenObjects.findIndex(e=>e.obj===t);if(-1!==e){let t=r.seenObjects.map(e=>e.propertyName),n=t.slice(0,e).map(e=>`${e} -> `).join(""),i=t[e],o=" -> "+t.slice(e+1,t.length-1).map(e=>`${e} -> `).join(""),a=t[t.length-1],s=" ".repeat(n.length+i.length/2),c="-".repeat(o.length+(i.length+a.length)/2-1);throw new d(`Converting circular structure to EJSON: 3 ${n}${i}${o}${a} 4 ${s}\\${c}/`)}r.seenObjects[r.seenObjects.length-1].obj=t}if(Array.isArray(t))return t.map((t,n)=>{r.seenObjects.push({propertyName:`index ${n}`,obj:null});try{return e(t,r)}finally{r.seenObjects.pop()}});if(void 0===t)return null;if(t instanceof Date||l(t)){let e=t.getTime(),n=e>-1&&e<2534023188e5;return r.legacy?r.relaxed&&n?{$date:t.getTime()}:{$date:eL(t)}:r.relaxed&&n?{$date:eL(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(!("number"!=typeof t||r.relaxed&&isFinite(t))){if(Number.isInteger(t)&&!Object.is(t,-0)){if(t>=-0x80000000&&t<=0x7fffffff)return{$numberInt:t.toString()};if(t>=-0x8000000000000000&&t<=u)return{$numberLong:t.toString()}}return{$numberDouble:Object.is(t,-0)?"-0.0":t.toString()}}if("bigint"==typeof t)return r.relaxed?Number(BigInt.asIntN(64,t)):{$numberLong:BigInt.asIntN(64,t).toString()};if(t instanceof RegExp||s(t)){let e=t.flags;if(void 0===e){let r=t.toString().match(/[gimuy]*$/);r&&(e=r[0])}return new et(t.source,e).toExtendedJSON(r)}return null!=t&&"object"==typeof t?function(t,r){if(null==t||"object"!=typeof t)throw new d("not an object instance");let n=t._bsontype;if(void 0===n){let n={};for(let i of Object.keys(t)){r.seenObjects.push({propertyName:i,obj:null});try{let o=e(t[i],r);"__proto__"===i?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{r.seenObjects.pop()}}return n}if(null!=t&&"object"==typeof t&&"string"==typeof t._bsontype&&5!==t[Symbol.for("@@mdb.bson.version")])throw new h;if(null!=t&&"object"==typeof t&&"_bsontype"in t&&"string"==typeof t._bsontype){let i=t;if("function"!=typeof i.toExtendedJSON){let e=ez[t._bsontype];if(!e)throw new d("Unrecognized or invalid _bsontype: "+t._bsontype);i=e(i)}return"Code"===n&&i.scope?i=new A(i.code,e(i.scope,r)):"DBRef"===n&&i.oid&&(i=new N(e(i.collection,r),e(i.oid,r),e(i.db,r),e(i.fields,r))),i.toExtendedJSON(r)}throw new d("_bsontype must be a string, but was: "+typeof n)}(t,r):t}(e,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]})),t,r)}let eq=Object.create(null);eq.parse=eF,eq.stringify=eU,eq.serialize=function(e,t){return JSON.parse(eU(e,t=t||{}))},eq.deserialize=function(e,t){return t=t||{},eF(JSON.stringify(e),t)},Object.freeze(eq);let eV=w.allocate(0x1100000);function eK(e){eV.length<e&&(eV=w.allocate(e))}function eH(e,t={}){let r="boolean"==typeof t.checkKeys&&t.checkKeys,n="boolean"==typeof t.serializeFunctions&&t.serializeFunctions,i="boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined,o="number"==typeof t.minInternalBufferSize?t.minInternalBufferSize:0x1100000;eV.length<o&&(eV=w.allocate(o));let a=eB(eV,e,r,0,0,n,i,null),s=w.allocate(a);return s.set(eV.subarray(0,a),0),s}function eW(e,t,r={}){let n="boolean"==typeof r.checkKeys&&r.checkKeys,i="boolean"==typeof r.serializeFunctions&&r.serializeFunctions,o="boolean"!=typeof r.ignoreUndefined||r.ignoreUndefined,a="number"==typeof r.index?r.index:0,s=eB(eV,e,n,0,0,i,o,null);return t.set(eV.subarray(0,s),a),a+s-1}function eJ(e,t={}){return ec(w.toLocalBufferType(e),t)}function eG(e,t={}){return Z(e,"boolean"==typeof(t=t||{}).serializeFunctions&&t.serializeFunctions,"boolean"!=typeof t.ignoreUndefined||t.ignoreUndefined)}function eY(e,t,r,n,i,o){let a=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},o),s=w.toLocalBufferType(e),c=t;
4for(let e=0;e<r;e++){let t=s[c]|s[c+1]<<8|s[c+2]<<16|s[c+3]<<24;a.index=c,n[i+e]=ec(s,a),c+=t}return c}t.BSON=Object.freeze({__proto__:null,BSONError:d,BSONRegExp:et,BSONRuntimeError:p,BSONSymbol:er,BSONType:f,BSONValue:S,BSONVersionError:h,Binary:j,Code:A,DBRef:N,Decimal128:V,Double:K,EJSON:eq,Int32:H,Long:I,MaxKey:W,MinKey:J,ObjectId:Q,Timestamp:ei,UUID:$,calculateObjectSize:eG,deserialize:eJ,deserializeStream:eY,serialize:eH,serializeWithBufferAndIndex:eW,setInternalBufferSize:eK}),t.BSONError=d,t.BSONRegExp=et,t.BSONRuntimeError=p,t.BSONSymbol=er,t.BSONType=f,t.BSONValue=S,t.BSONVersionError=h,t.Binary=j,t.Code=A,t.DBRef=N,t.Decimal128=V,t.Double=K,t.EJSON=eq,t.Int32=H,t.Long=I,t.MaxKey=W,t.MinKey=J,t.ObjectId=Q,t.Timestamp=ei,t.UUID=$,t.calculateObjectSize=eG,t.deserialize=eJ,t.deserializeStream=eY,t.serialize=eH,t.serializeWithBufferAndIndex=eW,t.setInternalBufferSize=eK},4946:e=>{"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:e=>{"use strict";e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:e=>{"use strict";e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:e=>{"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd4
407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:e=>{"use strict";e.exports={i8:"6.6.1"}},2562:e=>{"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(5507)})()}]);
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.