@multiplayer-app/ai-agent-react 0.4.2-beta.1 → 0.4.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8287,13 +8287,13 @@
|
|
|
8287
8287
|
*/const Yve=Object.freeze(Object.defineProperty({__proto__:null,AArrowDown:h_,AArrowUp:f_,ALargeSmall:y_,Accessibility:k_,Activity:__,AirVent:w_,Airplay:M_,AlarmClock:O_,AlarmClockCheck:N_,AlarmClockMinus:T_,AlarmClockOff:R_,AlarmClockPlus:D_,AlarmSmoke:$_,Album:P_,AlignCenterHorizontal:B_,AlignCenterVertical:H_,AlignEndHorizontal:V_,AlignEndVertical:W_,AlignHorizontalDistributeCenter:Y_,AlignHorizontalDistributeEnd:X_,AlignHorizontalDistributeStart:J_,AlignHorizontalJustifyCenter:tx,AlignHorizontalJustifyEnd:rx,AlignHorizontalJustifyStart:ix,AlignHorizontalSpaceAround:sx,AlignHorizontalSpaceBetween:dx,AlignStartHorizontal:cx,AlignStartVertical:hx,AlignVerticalDistributeCenter:fx,AlignVerticalDistributeEnd:yx,AlignVerticalDistributeStart:_x,AlignVerticalJustifyCenter:kx,AlignVerticalJustifyEnd:wx,AlignVerticalJustifyStart:Mx,AlignVerticalSpaceAround:Nx,AlignVerticalSpaceBetween:Tx,Ambulance:Rx,Ampersand:Ox,Ampersands:Dx,Amphora:$x,Anchor:Px,Angry:Bx,Annoyed:Hx,Antenna:Vx,Anvil:Wx,Aperture:Yx,AppWindow:Jx,AppWindowMac:Xx,Apple:tw,Archive:sw,ArchiveRestore:rw,ArchiveX:iw,Armchair:cw,ArrowBigDown:hw,ArrowBigDownDash:dw,ArrowBigLeft:yw,ArrowBigLeftDash:fw,ArrowBigRight:_w,ArrowBigRightDash:kw,ArrowBigUp:Mw,ArrowBigUpDash:ww,ArrowDown:Xw,ArrowDown01:Nw,ArrowDown10:Tw,ArrowDownAZ:Rw,ArrowDownFromLine:Ow,ArrowDownLeft:Dw,ArrowDownNarrowWide:$w,ArrowDownRight:Pw,ArrowDownToDot:Bw,ArrowDownToLine:Hw,ArrowDownUp:Vw,ArrowDownWideNarrow:Ww,ArrowDownZA:Yw,ArrowLeft:i9,ArrowLeftFromLine:Jw,ArrowLeftRight:t9,ArrowLeftToLine:r9,ArrowRight:h9,ArrowRightFromLine:s9,ArrowRightLeft:c9,ArrowRightToLine:d9,ArrowUp:Vd,ArrowUp01:f9,ArrowUp10:y9,ArrowUpAZ:k9,ArrowUpDown:_9,ArrowUpFromDot:w9,ArrowUpFromLine:M9,ArrowUpLeft:N9,ArrowUpNarrowWide:T9,ArrowUpRight:R9,ArrowUpToLine:O9,ArrowUpWideNarrow:D9,ArrowUpZA:$9,ArrowsUpFromLine:U9,Asterisk:q9,AtSign:j9,Atom:G9,AudioLines:K9,AudioWaveform:Z9,Award:Q9,Axe:eE,Axis3d:aE,Baby:nE,Backpack:oE,Badge:UE,BadgeAlert:lE,BadgeCent:uE,BadgeCheck:pE,BadgeDollarSign:mE,BadgeEuro:gE,BadgeIndianRupee:bE,BadgeInfo:vE,BadgeJapaneseYen:xE,BadgeMinus:EE,BadgePercent:SE,BadgePlus:AE,BadgePoundSterling:CE,BadgeQuestionMark:IE,BadgeRussianRuble:LE,BadgeSwissFranc:zE,BadgeTurkishLira:FE,BadgeX:qE,BaggageClaim:jE,Ban:GE,Banana:KE,Bandage:ZE,Banknote:oM,BanknoteArrowDown:QE,BanknoteArrowUp:eM,BanknoteX:nM,Barcode:aM,Barrel:lM,Baseline:uM,Bath:pM,Battery:SM,BatteryCharging:gM,BatteryFull:mM,BatteryLow:bM,BatteryMedium:vM,BatteryPlus:xM,BatteryWarning:EM,Beaker:AM,Bean:IM,BeanOff:CM,Bed:FM,BedDouble:LM,BedSingle:zM,Beef:qM,Beer:jM,BeerOff:UM,Bell:aS,BellDot:GM,BellElectric:KM,BellMinus:ZM,BellOff:QM,BellPlus:eS,BellRing:nS,BetweenHorizontalEnd:oS,BetweenHorizontalStart:lS,BetweenVerticalEnd:uS,BetweenVerticalStart:pS,BicepsFlexed:mS,Bike:gS,Binary:bS,Binoculars:vS,Biohazard:xS,Bird:ES,Birdhouse:SS,Bitcoin:AS,Blend:CS,Blinds:IS,Blocks:LS,Bluetooth:US,BluetoothConnected:zS,BluetoothOff:FS,BluetoothSearching:qS,Bold:jS,Bolt:GS,Bomb:KS,Bone:ZS,Book:GN,BookA:QS,BookAlert:eN,BookAudio:nN,BookCheck:aN,BookCopy:oN,BookDashed:uN,BookDown:lN,BookHeadphones:pN,BookHeart:mN,BookImage:gN,BookKey:bN,BookLock:vN,BookMarked:xN,BookMinus:EN,BookOpen:AN,BookOpenCheck:SN,BookOpenText:CN,BookPlus:IN,BookText:LN,BookType:zN,BookUp:qN,BookUp2:FN,BookUser:UN,BookX:jN,Bookmark:nA,BookmarkCheck:KN,BookmarkMinus:ZN,BookmarkPlus:QN,BookmarkX:eA,BoomBox:aA,Bot:v5,BotMessageSquare:oA,BotOff:lA,BottleWine:hA,BowArrow:dA,Box:fA,Boxes:yA,Braces:kA,Brackets:_A,Brain:TA,BrainCircuit:wA,BrainCog:MA,BrickWall:OA,BrickWallFire:NA,BrickWallShield:RA,Briefcase:HA,BriefcaseBusiness:DA,BriefcaseConveyorBelt:$A,BriefcaseMedical:PA,BringToFront:BA,Brush:WA,BrushCleaning:VA,Bubbles:YA,Bug:tT,BugOff:XA,BugPlay:JA,Building:iT,Building2:rT,Bus:cT,BusFront:sT,Cable:hT,CableCar:dT,Cake:yT,CakeSlice:fT,Calculator:kT,Calendar:sC,Calendar1:_T,CalendarArrowDown:wT,CalendarArrowUp:MT,CalendarCheck:TT,CalendarCheck2:NT,CalendarClock:OT,CalendarCog:RT,CalendarDays:DT,CalendarFold:$T,CalendarHeart:PT,CalendarMinus:HT,CalendarMinus2:BT,CalendarOff:VT,CalendarPlus:YT,CalendarPlus2:WT,CalendarRange:XT,CalendarSearch:JT,CalendarSync:tC,CalendarX:iC,CalendarX2:rC,Calendars:cC,Camera:hC,CameraOff:dC,Candy:kC,CandyCane:fC,CandyOff:yC,Cannabis:_C,Captions:MC,CaptionsOff:wC,Car:RC,CarFront:NC,CarTaxiFront:TC,Caravan:OC,CardSim:DC,Carrot:$C,CaseLower:PC,CaseSensitive:BC,CaseUpper:HC,CassetteTape:VC,Cast:WC,Castle:YC,Cat:XC,Cctv:JC,ChartArea:tR,ChartBar:dR,ChartBarBig:rR,ChartBarDecreasing:iR,ChartBarIncreasing:sR,ChartBarStacked:cR,ChartCandlestick:hR,ChartColumn:wR,ChartColumnBig:fR,ChartColumnDecreasing:yR,ChartColumnIncreasing:kR,ChartColumnStacked:_R,ChartGantt:MR,ChartLine:NR,ChartNetwork:TR,ChartNoAxesColumn:DR,ChartNoAxesColumnDecreasing:RR,ChartNoAxesColumnIncreasing:OR,ChartNoAxesCombined:PR,ChartNoAxesGantt:$R,ChartPie:BR,ChartScatter:HR,ChartSpline:VR,Check:Gd,CheckCheck:WR,CheckLine:YR,ChefHat:QR,Cherry:eI,ChessBishop:nI,ChessKing:aI,ChessKnight:lI,ChessPawn:oI,ChessQueen:uI,ChessRook:pI,ChevronDown:no,ChevronFirst:fI,ChevronLast:yI,ChevronLeft:_I,ChevronRight:kI,ChevronUp:Wd,ChevronsDown:SI,ChevronsDownUp:EI,ChevronsLeft:II,ChevronsLeftRight:CI,ChevronsLeftRightEllipsis:AI,ChevronsRight:zI,ChevronsRightLeft:LI,ChevronsUp:qI,ChevronsUpDown:FI,Chromium:UI,Church:GI,Cigarette:KI,CigaretteOff:jI,Circle:w5,CircleAlert:ZI,CircleArrowDown:QI,CircleArrowLeft:eO,CircleArrowOutDownLeft:nO,CircleArrowOutDownRight:aO,CircleArrowOutUpLeft:oO,CircleArrowOutUpRight:lO,CircleArrowRight:uO,CircleArrowUp:pO,CircleCheck:_5,CircleCheckBig:mO,CircleChevronDown:yO,CircleChevronLeft:kO,CircleChevronRight:_O,CircleChevronUp:wO,CircleDashed:MO,CircleDivide:NO,CircleDollarSign:TO,CircleDot:OO,CircleDotDashed:RO,CircleEllipsis:DO,CircleEqual:$O,CircleFadingArrowUp:PO,CircleFadingPlus:BO,CircleGauge:HO,CircleMinus:x5,CircleOff:GO,CircleParking:ZO,CircleParkingOff:KO,CirclePause:Kd,CirclePercent:JO,CirclePlay:tL,CirclePlus:rL,CirclePoundSterling:iL,CirclePower:sL,CircleQuestionMark:cL,CircleSlash:hL,CircleSlash2:dL,CircleSmall:fL,CircleStar:yL,CircleStop:kL,CircleUser:wL,CircleUserRound:_L,CircleX:ML,CircuitBoard:AL,Citrus:CL,Clapperboard:IL,Clipboard:nD,ClipboardCheck:LL,ClipboardClock:zL,ClipboardCopy:FL,ClipboardList:qL,ClipboardMinus:UL,ClipboardPaste:jL,ClipboardPen:KL,ClipboardPenLine:GL,ClipboardPlus:ZL,ClipboardType:QL,ClipboardX:eD,Clock:qD,Clock1:aD,Clock10:oD,Clock11:lD,Clock12:uD,Clock2:pD,Clock3:mD,Clock4:gD,Clock5:bD,Clock6:vD,Clock7:xD,Clock8:ED,Clock9:SD,ClockAlert:AD,ClockArrowDown:CD,ClockArrowUp:ID,ClockCheck:LD,ClockFading:zD,ClockPlus:FD,ClosedCaption:UD,Cloud:Ez,CloudAlert:jD,CloudCheck:KD,CloudCog:GD,CloudDownload:ZD,CloudDrizzle:QD,CloudFog:ez,CloudHail:nz,CloudLightning:az,CloudMoon:lz,CloudMoonRain:oz,CloudOff:uz,CloudRain:mz,CloudRainWind:pz,CloudSnow:gz,CloudSun:vz,CloudSunRain:bz,CloudUpload:xz,Cloudy:Sz,Clover:Az,Club:Cz,Code:Lz,CodeXml:Iz,Codepen:zz,Codesandbox:Fz,Coffee:qz,Cog:jz,Coins:Uz,Columns2:Gz,Columns3:Zz,Columns3Cog:Kz,Columns4:Qz,Combine:e$,Command:n$,Compass:a$,Component:o$,Computer:l$,ConciergeBell:u$,Cone:p$,Construction:m$,Contact:b$,ContactRound:g$,Container:v$,Contrast:x$,Cookie:E$,CookingPot:S$,Copy:F$,CopyCheck:A$,CopyMinus:C$,CopyPlus:I$,CopySlash:L$,CopyX:z$,Copyleft:q$,Copyright:U$,CornerDownLeft:j$,CornerDownRight:G$,CornerLeftDown:K$,CornerLeftUp:Z$,CornerRightDown:Q$,CornerRightUp:eF,CornerUpLeft:nF,CornerUpRight:aF,Cpu:oF,CreativeCommons:lF,CreditCard:uF,Croissant:pF,Crop:mF,Cross:gF,Crosshair:bF,Crown:vF,Cuboid:xF,CupSoda:EF,Currency:SF,Cylinder:AF,Dam:CF,Database:zF,DatabaseBackup:IF,DatabaseZap:LF,DecimalsArrowLeft:FF,DecimalsArrowRight:qF,Delete:UF,Dessert:jF,Diameter:GF,Diamond:eP,DiamondMinus:KF,DiamondPercent:ZF,DiamondPlus:QF,Dice1:nP,Dice2:aP,Dice3:oP,Dice4:lP,Dice5:uP,Dice6:pP,Dices:mP,Diff:gP,Disc:EP,Disc2:bP,Disc3:vP,DiscAlbum:xP,Divide:SP,Dna:CP,DnaOff:AP,Dock:IP,Dog:LP,DollarSign:zP,Donut:FP,DoorClosed:UP,DoorClosedLocked:qP,DoorOpen:jP,Dot:GP,Download:E5,DraftingCompass:YP,Drama:XP,Dribbble:JP,Drill:tq,Drone:rq,Droplet:sq,DropletOff:iq,Droplets:cq,Drum:dq,Drumstick:fq,Dumbbell:hq,Ear:kq,EarOff:yq,Earth:wq,EarthLock:_q,Eclipse:Nq,Egg:Rq,EggFried:Mq,EggOff:Tq,Ellipsis:Dq,EllipsisVertical:Oq,Equal:Bq,EqualApproximately:$q,EqualNot:Pq,Eraser:Hq,EthernetPort:Vq,Euro:Wq,EvCharger:Yq,Expand:Qq,ExternalLink:M5,Eye:oB,EyeClosed:eB,EyeOff:nB,Facebook:aB,Factory:lB,Fan:uB,FastForward:pB,Feather:gB,Fence:mB,FerrisWheel:bB,Figma:vB,File:_H,FileArchive:xB,FileAxis3d:EB,FileBadge:SB,FileBox:AB,FileBraces:IB,FileBracesCorner:CB,FileChartColumn:zB,FileChartColumnIncreasing:LB,FileChartLine:FB,FileChartPie:qB,FileCheck:jB,FileCheckCorner:UB,FileClock:KB,FileCode:ZB,FileCodeCorner:GB,FileCog:QB,FileDiff:eU,FileDigit:nU,FileDown:aU,FileExclamationPoint:oU,FileHeadphone:lU,FileHeart:uU,FileImage:pU,FileInput:mU,FileKey:gU,FileLock:bU,FileMinus:xU,FileMinusCorner:vU,FileMusic:EU,FileOutput:SU,FilePen:CU,FilePenLine:AU,FilePlay:IU,FilePlus:zU,FilePlusCorner:LU,FileQuestionMark:FU,FileScan:qU,FileSearch:jU,FileSearchCorner:UU,FileSignal:KU,FileSliders:GU,FileSpreadsheet:QU,FileStack:ZU,FileSymlink:eH,FileTerminal:rH,FileText:S5,FileType:sH,FileTypeCorner:iH,FileUp:cH,FileUser:dH,FileVideoCamera:hH,FileVolume:fH,FileX:kH,FileXCorner:yH,Files:wH,Film:MH,FingerprintPattern:NH,FireExtinguisher:TH,Fish:DH,FishOff:RH,FishSymbol:OH,Flag:HH,FlagOff:$H,FlagTriangleLeft:PH,FlagTriangleRight:BH,Flame:YH,FlameKindling:VH,Flashlight:XH,FlashlightOff:WH,FlaskConical:tj,FlaskConicalOff:JH,FlaskRound:rj,FlipHorizontal:sj,FlipHorizontal2:ij,FlipVertical:dj,FlipVertical2:cj,Flower:fj,Flower2:hj,Focus:yj,FoldHorizontal:kj,FoldVertical:_j,Folder:NV,FolderArchive:wj,FolderCheck:Mj,FolderClock:Nj,FolderClosed:Rj,FolderCode:Tj,FolderCog:Oj,FolderDot:Dj,FolderDown:$j,FolderGit:Bj,FolderGit2:Pj,FolderHeart:Hj,FolderInput:Vj,FolderKanban:Wj,FolderKey:Yj,FolderLock:Xj,FolderMinus:Jj,FolderOpen:tV,FolderOpenDot:rV,FolderOutput:iV,FolderPen:sV,FolderPlus:cV,FolderRoot:dV,FolderSearch:fV,FolderSearch2:hV,FolderSymlink:yV,FolderSync:kV,FolderTree:_V,FolderUp:wV,FolderX:MV,Folders:TV,Footprints:RV,Forklift:OV,Form:N5,Forward:zV,Frame:FV,Framer:qV,Frown:UV,Fuel:jV,Fullscreen:GV,Funnel:QV,FunnelPlus:ZV,FunnelX:KV,GalleryHorizontal:eG,GalleryHorizontalEnd:nG,GalleryThumbnails:aG,GalleryVertical:lG,GalleryVerticalEnd:oG,Gamepad:mG,Gamepad2:uG,GamepadDirectional:pG,Gauge:gG,Gavel:bG,Gem:vG,GeorgianLari:xG,Ghost:EG,Gift:AG,GitBranch:IG,GitBranchMinus:SG,GitBranchPlus:CG,GitCommitHorizontal:LG,GitCommitVertical:zG,GitCompare:qG,GitCompareArrows:FG,GitFork:UG,GitGraph:jG,GitMerge:GG,GitPullRequest:aW,GitPullRequestArrow:KG,GitPullRequestClosed:ZG,GitPullRequestCreate:QG,GitPullRequestCreateArrow:eW,GitPullRequestDraft:nW,Github:lW,Gitlab:oW,GlassWater:pW,Glasses:uW,Globe:Yd,GlobeLock:mW,Goal:yW,Gpu:kW,GraduationCap:_W,Grape:wW,Grid2x2:RW,Grid2x2Check:MW,Grid2x2Plus:NW,Grid2x2X:TW,Grid3x2:OW,Grid3x3:DW,Grip:BW,GripHorizontal:$W,GripVertical:PW,Group:HW,Guitar:VW,Ham:WW,Hamburger:YW,Hammer:XW,Hand:dK,HandCoins:tK,HandFist:JW,HandGrab:rK,HandHeart:iK,HandHelping:sK,HandMetal:hK,HandPlatter:cK,Handbag:yK,Handshake:fK,HardDrive:wK,HardDriveDownload:kK,HardDriveUpload:_K,HardHat:MK,Hash:NK,HatGlasses:TK,Haze:RK,HdmiPort:OK,Heading:WK,Heading1:DK,Heading2:$K,Heading3:BK,Heading4:PK,Heading5:HK,Heading6:VK,HeadphoneOff:YK,Headphones:XK,Headset:JK,Heart:hY,HeartCrack:tY,HeartHandshake:rY,HeartMinus:iY,HeartOff:sY,HeartPlus:cY,HeartPulse:dY,Heater:fY,Helicopter:yY,Hexagon:kY,Highlighter:_Y,History:wY,Hop:NY,HopOff:MY,Hospital:TY,Hotel:RY,Hourglass:OY,House:HY,HouseHeart:DY,HousePlug:$Y,HousePlus:PY,HouseWifi:BY,IceCreamBowl:VY,IceCreamCone:WY,IdCard:XY,IdCardLanyard:YY,Image:ad,ImageDown:JY,ImageMinus:tZ,ImageOff:rZ,ImagePlay:iZ,ImagePlus:sZ,ImageUp:cZ,ImageUpscale:dZ,Images:mZ,Import:gZ,Inbox:bZ,IndianRupee:vZ,Infinity:xZ,Info:EZ,InspectionPanel:SZ,Instagram:AZ,Italic:CZ,IterationCcw:IZ,IterationCw:LZ,JapaneseYen:zZ,Joystick:FZ,Kanban:qZ,Kayak:UZ,Key:KZ,KeyRound:jZ,KeySquare:GZ,Keyboard:eX,KeyboardMusic:ZZ,KeyboardOff:QZ,Lamp:pX,LampCeiling:nX,LampDesk:aX,LampFloor:oX,LampWallDown:lX,LampWallUp:uX,LandPlot:mX,Landmark:gX,Languages:bX,Laptop:EX,LaptopMinimal:xX,LaptopMinimalCheck:vX,Lasso:AX,LassoSelect:SX,Laugh:CX,Layers:LX,Layers2:IX,LayoutDashboard:zX,LayoutGrid:FX,LayoutList:qX,LayoutPanelLeft:UX,LayoutPanelTop:jX,LayoutTemplate:GX,Leaf:KX,LeafyGreen:ZX,Lectern:QX,Library:nQ,LibraryBig:eQ,LifeBuoy:aQ,Ligature:oQ,Lightbulb:lQ,LightbulbOff:uQ,LineSquiggle:pQ,Link:yQ,Link2:A5,Link2Off:mQ,Linkedin:kQ,List:oJ,ListCheck:wQ,ListChecks:_Q,ListChevronsDownUp:NQ,ListChevronsUpDown:MQ,ListCollapse:TQ,ListEnd:RQ,ListFilter:DQ,ListFilterPlus:OQ,ListIndentDecrease:$Q,ListIndentIncrease:PQ,ListMinus:HQ,ListMusic:BQ,ListOrdered:VQ,ListPlus:WQ,ListRestart:YQ,ListStart:XQ,ListTodo:T5,ListTree:eJ,ListVideo:nJ,ListX:aJ,Loader:dJ,LoaderCircle:ma,LoaderPinwheel:cJ,Locate:fJ,LocateFixed:hJ,LocateOff:yJ,Lock:MJ,LockKeyhole:wJ,LockKeyholeOpen:kJ,LockOpen:_J,LogIn:NJ,LogOut:TJ,Logs:RJ,Lollipop:OJ,Luggage:DJ,Magnet:$J,Mail:tee,MailCheck:PJ,MailMinus:BJ,MailOpen:HJ,MailPlus:VJ,MailQuestionMark:WJ,MailSearch:YJ,MailWarning:XJ,MailX:JJ,Mailbox:ree,Mails:iee,Map:$ee,MapMinus:see,MapPin:Oee,MapPinCheck:dee,MapPinCheckInside:cee,MapPinHouse:hee,MapPinMinus:yee,MapPinMinusInside:fee,MapPinOff:kee,MapPinPen:_ee,MapPinPlus:wee,MapPinPlusInside:Mee,MapPinX:Tee,MapPinXInside:Nee,MapPinned:Dee,MapPlus:Ree,Mars:Bee,MarsStroke:Pee,Martini:Hee,Maximize:Wee,Maximize2:Vee,Medal:Yee,Megaphone:Jee,MegaphoneOff:Xee,Meh:tte,MemoryStick:rte,Menu:ite,Merge:ste,MessageCircle:Tte,MessageCircleCode:cte,MessageCircleDashed:dte,MessageCircleHeart:hte,MessageCircleMore:fte,MessageCircleOff:yte,MessageCirclePlus:kte,MessageCircleQuestionMark:_te,MessageCircleReply:wte,MessageCircleWarning:Mte,MessageCircleX:Nte,MessageSquare:sne,MessageSquareCode:Rte,MessageSquareDashed:Ote,MessageSquareDiff:Dte,MessageSquareDot:$te,MessageSquareHeart:Pte,MessageSquareLock:Bte,MessageSquareMore:Hte,MessageSquareOff:Vte,MessageSquarePlus:Wte,MessageSquareQuote:Yte,MessageSquareReply:Xte,MessageSquareShare:Jte,MessageSquareText:tne,MessageSquareWarning:rne,MessageSquareX:ine,MessagesSquare:cne,Mic:fne,MicOff:dne,MicVocal:hne,Microchip:yne,Microscope:kne,Microwave:_ne,Milestone:wne,Milk:Mne,MilkOff:Nne,Minimize:Rne,Minimize2:Tne,Minus:One,Monitor:ire,MonitorCheck:Dne,MonitorCloud:$ne,MonitorCog:Pne,MonitorDot:Bne,MonitorDown:Hne,MonitorOff:Vne,MonitorPause:Yne,MonitorPlay:Wne,MonitorSmartphone:Xne,MonitorSpeaker:Jne,MonitorStop:tre,MonitorUp:rre,MonitorX:sre,Moon:hre,MoonStar:cre,Motorbike:dre,Mountain:yre,MountainSnow:fre,Mouse:Rre,MouseOff:kre,MousePointer:Tre,MousePointer2:wre,MousePointer2Off:_re,MousePointerBan:Mre,MousePointerClick:Nre,Move:iae,Move3d:Ore,MoveDiagonal:$re,MoveDiagonal2:Dre,MoveDown:Hre,MoveDownLeft:Pre,MoveDownRight:Bre,MoveHorizontal:Wre,MoveLeft:Vre,MoveRight:Yre,MoveUp:tae,MoveUpLeft:Xre,MoveUpRight:Jre,MoveVertical:rae,Music:dae,Music2:sae,Music3:cae,Music4:hae,Navigation:_ae,Navigation2:fae,Navigation2Off:yae,NavigationOff:kae,Network:wae,Newspaper:Mae,Nfc:Nae,NonBinary:Tae,Notebook:$ae,NotebookPen:Rae,NotebookTabs:Oae,NotebookText:Dae,NotepadText:Bae,NotepadTextDashed:Pae,Nut:Vae,NutOff:Hae,Octagon:tie,OctagonAlert:Wae,OctagonMinus:Yae,OctagonPause:Xae,OctagonX:Jae,Omega:iie,Option:rie,Orbit:sie,Origami:cie,Package:wie,Package2:die,PackageCheck:hie,PackageMinus:fie,PackageOpen:yie,PackagePlus:kie,PackageSearch:_ie,PackageX:Mie,PaintBucket:Nie,PaintRoller:Tie,Paintbrush:Oie,PaintbrushVertical:Rie,Palette:Die,Panda:$ie,PanelBottom:Vie,PanelBottomClose:Pie,PanelBottomDashed:Bie,PanelBottomOpen:Hie,PanelLeft:toe,PanelLeftClose:Xie,PanelLeftDashed:Wie,PanelLeftOpen:Yie,PanelLeftRightDashed:Jie,PanelRight:coe,PanelRightClose:ioe,PanelRightDashed:roe,PanelRightOpen:soe,PanelTop:koe,PanelTopBottomDashed:doe,PanelTopClose:hoe,PanelTopDashed:foe,PanelTopOpen:yoe,PanelsLeftBottom:_oe,PanelsRightBottom:woe,PanelsTopLeft:Moe,Paperclip:ro,Parentheses:Aoe,ParkingMeter:Coe,PartyPopper:Ioe,Pause:Loe,PawPrint:zoe,PcCase:Foe,Pen:Goe,PenLine:qoe,PenOff:Uoe,PenTool:joe,Pencil:ese,PencilLine:Koe,PencilOff:Zoe,PencilRuler:Qoe,Pentagon:nse,Percent:ase,PersonStanding:ose,PhilippinePeso:lse,Phone:xse,PhoneCall:use,PhoneForwarded:pse,PhoneIncoming:mse,PhoneMissed:gse,PhoneOff:bse,PhoneOutgoing:vse,Pi:Ese,Piano:Sse,Pickaxe:Ase,PictureInPicture:Ise,PictureInPicture2:Cse,PiggyBank:Lse,Pilcrow:qse,PilcrowLeft:zse,PilcrowRight:Fse,Pill:jse,PillBottle:Use,Pin:Zse,PinOff:Gse,Pipette:Kse,Pizza:Qse,Plane:ale,PlaneLanding:ele,PlaneTakeoff:nle,Play:ole,Plug:ple,Plug2:ule,PlugZap:lle,Plus:mle,Pocket:ble,PocketKnife:gle,Podcast:vle,Pointer:Ele,PointerOff:xle,Popcorn:Sle,Popsicle:Ale,PoundSterling:Cle,Power:Lle,PowerOff:Ile,Presentation:zle,Printer:qle,PrinterCheck:Fle,Projector:Ule,Proportions:jle,Puzzle:Gle,Pyramid:Kle,QrCode:Zle,Quote:Qle,Rabbit:ece,Radar:nce,Radiation:ace,Radical:oce,Radio:pce,RadioReceiver:lce,RadioTower:uce,Radius:mce,RailSymbol:gce,Rainbow:bce,Rat:vce,Ratio:xce,Receipt:Uce,ReceiptCent:Ece,ReceiptEuro:Sce,ReceiptIndianRupee:Ace,ReceiptJapaneseYen:Cce,ReceiptPoundSterling:Ice,ReceiptRussianRuble:Lce,ReceiptSwissFranc:zce,ReceiptText:Fce,ReceiptTurkishLira:qce,RectangleCircle:jce,RectangleEllipsis:Gce,RectangleGoggles:Kce,RectangleHorizontal:Zce,RectangleVertical:Qce,Recycle:e1e,Redo:o1e,Redo2:n1e,RedoDot:a1e,RefreshCcw:u1e,RefreshCcwDot:l1e,RefreshCw:m1e,RefreshCwOff:p1e,Refrigerator:g1e,Regex:b1e,RemoveFormatting:v1e,Repeat:S1e,Repeat1:x1e,Repeat2:E1e,Replace:C1e,ReplaceAll:A1e,Reply:z1e,ReplyAll:I1e,Rewind:L1e,Ribbon:F1e,Rocket:q1e,RockingChair:U1e,RollerCoaster:j1e,Rose:G1e,Rotate3d:K1e,RotateCcw:e0e,RotateCcwKey:Z1e,RotateCcwSquare:Q1e,RotateCw:a0e,RotateCwSquare:n0e,Route:p0e,RouteOff:o0e,Router:l0e,Rows2:u0e,Rows3:m0e,Rows4:g0e,Rss:b0e,Ruler:x0e,RulerDimensionLine:v0e,RussianRuble:E0e,Sailboat:S0e,Salad:A0e,Sandwich:C0e,Satellite:L0e,SatelliteDish:I0e,SaudiRiyal:z0e,Save:U0e,SaveAll:F0e,SaveOff:q0e,Scale:K0e,Scale3d:j0e,Scaling:G0e,Scan:due,ScanBarcode:Z0e,ScanEye:Q0e,ScanFace:eue,ScanHeart:nue,ScanLine:aue,ScanQrCode:oue,ScanSearch:lue,ScanText:Zd,School:hue,Scissors:yue,ScissorsLineDashed:fue,ScreenShare:_ue,ScreenShareOff:kue,Scroll:Mue,ScrollText:wue,Search:Due,SearchCheck:Nue,SearchCode:Tue,SearchSlash:Rue,SearchX:Oue,Section:$ue,Send:Hue,SendHorizontal:Pue,SendToBack:Bue,SeparatorHorizontal:Vue,SeparatorVertical:Wue,Server:tde,ServerCog:Yue,ServerCrash:Xue,ServerOff:Jue,Settings:ade,Settings2:C5,Shapes:ode,Share:ude,Share2:lde,Sheet:pde,Shell:mde,Shield:Fde,ShieldAlert:gde,ShieldBan:bde,ShieldCheck:vde,ShieldEllipsis:xde,ShieldHalf:Ede,ShieldMinus:Sde,ShieldOff:Ade,ShieldPlus:Cde,ShieldQuestionMark:Ide,ShieldUser:zde,ShieldX:Lde,Ship:Ude,ShipWheel:qde,Shirt:jde,ShoppingBag:Gde,ShoppingBasket:Kde,ShoppingCart:Qde,Shovel:Zde,ShowerHead:epe,Shredder:npe,Shrimp:ape,Shrink:ope,Shrub:lpe,Shuffle:upe,Sigma:ppe,Signal:vpe,SignalHigh:mpe,SignalLow:gpe,SignalMedium:bpe,SignalZero:Epe,Signature:xpe,Signpost:Cpe,SignpostBig:Spe,Siren:Ape,SkipBack:Ipe,SkipForward:Lpe,Skull:zpe,Slack:Fpe,Slash:qpe,Slice:Upe,SlidersHorizontal:jpe,SlidersVertical:Gpe,Smartphone:Qpe,SmartphoneCharging:Kpe,SmartphoneNfc:Zpe,Smile:nhe,SmilePlus:ehe,Snail:ahe,Snowflake:ohe,SoapDispenserDroplet:lhe,Sofa:uhe,SolarPanel:phe,Soup:mhe,Space:ghe,Spade:bhe,Sparkle:vhe,Sparkles:R5,Speaker:whe,Speech:Mhe,SpellCheck:The,SpellCheck2:Nhe,Spline:Ohe,SplinePointer:Rhe,Split:Dhe,Spool:$he,Spotlight:Phe,SprayCan:Bhe,Sprout:Hhe,Square:I5,SquareActivity:Vhe,SquareArrowDown:Xhe,SquareArrowDownLeft:Whe,SquareArrowDownRight:Yhe,SquareArrowLeft:Jhe,SquareArrowOutDownLeft:t2e,SquareArrowOutDownRight:r2e,SquareArrowOutUpLeft:i2e,SquareArrowOutUpRight:s2e,SquareArrowRight:c2e,SquareArrowUp:f2e,SquareArrowUpLeft:d2e,SquareArrowUpRight:h2e,SquareAsterisk:y2e,SquareBottomDashedScissors:_2e,SquareChartGantt:k2e,SquareCheck:w2e,SquareCheckBig:M2e,SquareChevronDown:T2e,SquareChevronLeft:N2e,SquareChevronRight:R2e,SquareChevronUp:O2e,SquareCode:D2e,SquareDashed:W2e,SquareDashedBottom:P2e,SquareDashedBottomCode:$2e,SquareDashedKanban:B2e,SquareDashedMousePointer:H2e,SquareDashedTopSolid:V2e,SquareDivide:Y2e,SquareDot:X2e,SquareEqual:J2e,SquareFunction:tme,SquareKanban:rme,SquareLibrary:ime,SquareM:sme,SquareMenu:cme,SquareMinus:dme,SquareMousePointer:hme,SquareParking:yme,SquareParkingOff:fme,SquarePause:kme,SquarePen:_me,SquarePercent:wme,SquarePi:Mme,SquarePilcrow:Nme,SquarePlay:Ome,SquarePlus:Tme,SquarePower:Rme,SquareRadical:Dme,SquareRoundCorner:$me,SquareScissors:Pme,SquareSigma:Bme,SquareSlash:Hme,SquareSplitHorizontal:Vme,SquareSplitVertical:Wme,SquareSquare:Xme,SquareStack:Yme,SquareStar:tfe,SquareStop:Jme,SquareTerminal:rfe,SquareUser:sfe,SquareUserRound:ife,SquareX:cfe,SquaresExclude:pfe,SquaresIntersect:mfe,SquaresSubtract:gfe,SquaresUnite:bfe,Squircle:xfe,SquircleDashed:vfe,Squirrel:Efe,Stamp:Sfe,Star:Ife,StarHalf:Afe,StarOff:Cfe,StepBack:Lfe,StepForward:zfe,Stethoscope:Ffe,Sticker:qfe,StickyNote:Ufe,Store:jfe,StretchHorizontal:Gfe,StretchVertical:Kfe,Strikethrough:Zfe,Subscript:Qfe,Sun:lge,SunDim:ege,SunMedium:nge,SunMoon:age,SunSnow:oge,Sunrise:uge,Sunset:pge,Superscript:mge,SwatchBook:gge,SwissFranc:bge,SwitchCamera:vge,Sword:xge,Swords:Ege,Syringe:Sge,Table:Uge,Table2:Cge,TableCellsMerge:Age,TableCellsSplit:Ige,TableColumnsSplit:Lge,TableOfContents:zge,TableProperties:Fge,TableRowsSplit:qge,Tablet:Gge,TabletSmartphone:jge,Tablets:Kge,Tag:Zge,Tags:Qge,Tally1:eye,Tally2:nye,Tally3:aye,Tally4:oye,Tally5:lye,Tangent:uye,Target:pye,Telescope:mye,Tent:bye,TentTree:gye,Terminal:xye,TestTube:Eye,TestTubeDiagonal:vye,TestTubes:Sye,TextAlignCenter:Aye,TextAlignEnd:Cye,TextAlignJustify:Iye,TextAlignStart:Lye,TextCursor:Fye,TextCursorInput:zye,TextInitial:qye,TextQuote:Uye,TextSearch:jye,TextSelect:Gye,TextWrap:Zye,Theater:Kye,Thermometer:n4e,ThermometerSnowflake:Qye,ThermometerSun:e4e,ThumbsDown:a4e,ThumbsUp:o4e,Ticket:v4e,TicketCheck:u4e,TicketMinus:l4e,TicketPercent:p4e,TicketPlus:m4e,TicketSlash:g4e,TicketX:b4e,Tickets:x4e,TicketsPlane:E4e,Timer:C4e,TimerOff:S4e,TimerReset:A4e,ToggleLeft:I4e,ToggleRight:L4e,Toilet:z4e,ToolCase:F4e,Tornado:q4e,Torus:U4e,Touchpad:G4e,TouchpadOff:j4e,TowerControl:K4e,ToyBrick:Z4e,Tractor:Q4e,TrafficCone:nbe,TrainFront:abe,TrainFrontTunnel:ebe,TrainTrack:obe,TramFront:ube,Transgender:lbe,Trash:hbe,Trash2:O5,TreeDeciduous:fbe,TreePalm:kbe,TreePine:ybe,Trees:_be,Trello:Mbe,TrendingDown:wbe,TrendingUp:Tbe,TrendingUpDown:Nbe,Triangle:$be,TriangleAlert:Rbe,TriangleDashed:Obe,TriangleRight:Dbe,Trophy:Pbe,Truck:Hbe,TruckElectric:Bbe,TurkishLira:Vbe,Turntable:Ybe,Turtle:Wbe,Tv:tke,TvMinimal:Jbe,TvMinimalPlay:Xbe,Twitch:rke,Twitter:ike,Type:cke,TypeOutline:ske,Umbrella:hke,UmbrellaOff:dke,Underline:fke,Undo:kke,Undo2:_ke,UndoDot:yke,UnfoldHorizontal:wke,UnfoldVertical:Mke,Ungroup:Nke,University:Rke,Unlink:Oke,Unlink2:Tke,Unplug:Dke,Upload:$ke,Usb:Pke,User:_5e,UserCheck:Bke,UserCog:Hke,UserLock:Vke,UserMinus:Wke,UserPen:Yke,UserPlus:Xke,UserRound:h5e,UserRoundCheck:Jke,UserRoundCog:t5e,UserRoundMinus:r5e,UserRoundPen:i5e,UserRoundPlus:s5e,UserRoundSearch:d5e,UserRoundX:c5e,UserSearch:f5e,UserStar:y5e,UserX:k5e,Users:N5e,UsersRound:w5e,Utensils:T5e,UtensilsCrossed:M5e,UtilityPole:R5e,Variable:O5e,Vault:D5e,VectorSquare:$5e,Vegan:P5e,VenetianMask:B5e,Venus:V5e,VenusAndMars:H5e,Vibrate:Y5e,VibrateOff:W5e,Video:J5e,VideoOff:X5e,Videotape:t3e,View:r3e,Voicemail:i3e,Volleyball:s3e,Volume:y3e,Volume1:c3e,Volume2:d3e,VolumeOff:h3e,VolumeX:f3e,Vote:k3e,Wallet:M3e,WalletCards:_3e,WalletMinimal:w3e,Wallpaper:N3e,Wand:T3e,WandSparkles:R3e,Warehouse:O3e,WashingMachine:D3e,Watch:$3e,Waves:V3e,WavesArrowDown:P3e,WavesArrowUp:B3e,WavesLadder:H3e,Waypoints:W3e,Webcam:Y3e,Webhook:J3e,WebhookOff:X3e,Weight:tve,Wheat:ive,WheatOff:rve,WholeWord:sve,Wifi:Mve,WifiCog:cve,WifiHigh:dve,WifiLow:hve,WifiOff:fve,WifiPen:yve,WifiSync:kve,WifiZero:_ve,Wind:Nve,WindArrowDown:wve,Wine:Tve,WineOff:Rve,Workflow:Ove,Worm:Dve,Wrench:$ve,X:L5,Youtube:Pve,Zap:Gve,ZapOff:Uve,ZoomIn:jve,ZoomOut:Kve},Symbol.toStringTag,{value:"Module"})),Xd="mp:formApplyRequested",Zve=e=>{if(!e)return;if(e instanceof Date)return Number.isFinite(e.getTime())?e:void 0;const t=new Date(e);return Number.isFinite(t.getTime())?t:void 0},Xve=(e,t)=>{const n=e.getTime()-t.getTime(),r=Math.round(n/1e3),a=Math.abs(r),i=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});if(a<45)return i.format(r,"second");const o=Math.round(r/60);if(Math.abs(o)<45)return i.format(o,"minute");const s=Math.round(o/60);if(Math.abs(s)<22)return i.format(s,"hour");const l=Math.round(s/24);if(Math.abs(l)<26)return i.format(l,"day");const u=Math.round(l/30);if(Math.abs(u)<11)return i.format(u,"month");const d=Math.round(l/365);return i.format(d,"year")},Qve=({date:e,refreshMs:t=3e4,emptyText:n=""})=>{const r=j.useMemo(()=>Zve(e),[e]),[a,i]=j.useState(()=>new Date);return j.useEffect(()=>{if(!r)return;const o=window.setInterval(()=>i(new Date),t);return()=>window.clearInterval(o)},[r,t]),r?w.jsx(w.Fragment,{children:Xve(r,a)}):n?w.jsx(w.Fragment,{children:n}):null};function ao(){return typeof window<"u"}function Hr(e){return Qd(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $n(e){var t;return(t=(Qd(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qd(e){return ao()?e instanceof Node||e instanceof Ct(e).Node:!1}function et(e){return ao()?e instanceof Element||e instanceof Ct(e).Element:!1}function $t(e){return ao()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function id(e){return!ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}function io(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=pn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&a!=="inline"&&a!=="contents"}function Jve(e){return/^(table|td|th)$/.test(Hr(e))}function oo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const e6e=/transform|translate|scale|rotate|perspective|filter/,t6e=/paint|layout|strict|content/,sr=e=>!!e&&e!=="none";let Vo;function Jd(e){const t=et(e)?pn(e):e;return sr(t.transform)||sr(t.translate)||sr(t.scale)||sr(t.rotate)||sr(t.perspective)||!so()&&(sr(t.backdropFilter)||sr(t.filter))||e6e.test(t.willChange||"")||t6e.test(t.contain||"")}function n6e(e){let t=Qn(e);for(;$t(t)&&!Yn(t);){if(Jd(t))return t;if(oo(t))return null;t=Qn(t)}return null}function so(){return Vo==null&&(Vo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Vo}function Yn(e){return/^(html|body|#document)$/.test(Hr(e))}function pn(e){return Ct(e).getComputedStyle(e)}function lo(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qn(e){if(Hr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||id(e)&&e.host||$n(e);return id(t)?t.host:t}function D5(e){const t=Qn(e);return Yn(t)?(e.ownerDocument||e).body:$t(t)&&io(t)?t:D5(t)}function Zn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=D5(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=Ct(a);if(i){const s=od(o);return t.concat(o,o.visualViewport||[],io(a)?a:[],s&&n?Zn(s):[])}else return t.concat(a,Zn(a,[],n))}function od(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Ii=Math.min,mr=Math.max,Oi=Math.round,Dr=Math.floor,Rn=e=>({x:e,y:e}),r6e={left:"right",right:"left",bottom:"top",top:"bottom"};function a6e(e,t,n){return mr(e,Ii(t,n))}function co(e,t){return typeof e=="function"?e(t):e}function Pr(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function z5(e){return e==="x"?"y":"x"}function $5(e){return e==="y"?"height":"width"}function Gn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function F5(e){return z5(Gn(e))}function i6e(e,t,n){n===void 0&&(n=!1);const r=uo(e),a=F5(e),i=$5(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Li(o)),[o,Li(o)]}function o6e(e){const t=Li(e);return[sd(e),t,sd(t)]}function sd(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Wh=["left","right"],Kh=["right","left"],s6e=["top","bottom"],l6e=["bottom","top"];function c6e(e,t,n){switch(e){case"top":case"bottom":return n?t?Kh:Wh:t?Wh:Kh;case"left":case"right":return t?s6e:l6e;default:return[]}}function u6e(e,t,n,r){const a=uo(e);let i=c6e(Pr(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(sd)))),i}function Li(e){const t=Pr(e);return r6e[t]+e.slice(t.length)}function d6e(e){var t,n,r,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(a=e.left)!=null?a:0}}function p6e(e){return typeof e!="number"?d6e(e):{top:e,right:e,bottom:e,left:e}}function Di(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}/*!
|
|
8288
8288
|
* tabbable 6.5.0
|
|
8289
8289
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
8290
|
-
*/var h6e=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ld=h6e.join(","),P5=typeof Element>"u",fa=P5?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,zi=!P5&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},$i=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",o=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):$i(t.parentNode));return o},m6e=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},f6e=function(t,n,r){if($i(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(ld));return n&&fa.call(t,ld)&&a.unshift(t),a=a.filter(r),a},cd=function(t,n,r){for(var a=[],i=Array.from(t);i.length;){var o=i.shift();if(!$i(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=cd(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:o,candidates:u})}else{var d=fa.call(o,ld);d&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!$i(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&h){var m=cd(p===!0?o.children:p.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:o,candidates:m})}else i.unshift.apply(i,o.children)}}return a},q5=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},B5=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||m6e(t))&&!q5(t)?0:t.tabIndex},g6e=function(t,n){var r=B5(t);return r<0&&n&&!q5(t)?0:r},y6e=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},U5=function(t){return t.tagName==="INPUT"},b6e=function(t){return U5(t)&&t.type==="hidden"},k6e=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},v6e=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},_6e=function(t){if(!t.name)return!0;var n=t.form||zi(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=v6e(a,t.form);return!i||i===t},x6e=function(t){return U5(t)&&t.type==="radio"},w6e=function(t){return x6e(t)&&!_6e(t)},E6e=function(t){var n,r=t&&zi(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var o,s,l;for(i=!!((o=a)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,d,p;r=zi(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((d=a)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(a))}}return i},Yh=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},M6e=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}var o=getComputedStyle(t),s=o.visibility;if(s==="hidden"||s==="collapse")return!0;var l=fa.call(t,"details>summary:first-of-type"),u=l?t.parentElement:t;if(fa.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var d=t;t;){var p=t.parentElement,h=zi(t);if(p&&!p.shadowRoot&&a(p)===!0)return Yh(t);t.assignedSlot?t=t.assignedSlot:!p&&h!==t.ownerDocument?t=h.host:t=p}t=d}if(E6e(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Yh(t);return!1},S6e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return fa.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},N6e=function(t,n){return!(n.disabled||b6e(n)||M6e(n,t)||k6e(n)||S6e(n))},Zh=function(t,n){return!(w6e(n)||B5(n)<0||!N6e(t,n))},A6e=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},H5=function(t){var n=[],r=[];return t.forEach(function(a,i){var o=!!a.scopeParent,s=o?a.scopeParent:a,l=g6e(s,o),u=o?H5(a.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:i,tabIndex:l,item:a,isScope:o,content:u})}),r.sort(y6e).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},j5=function(t,n){n=n||{};var r;return n.getShadowRoot?r=cd([t],n.includeContainer,{filter:Zh.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:A6e}):r=f6e(t,n.includeContainer,Zh.bind(null,n)),H5(r)};function V5(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function G5(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function W5(){return/apple/i.test(navigator.vendor)}function ud(){const e=/android/i;return e.test(V5())||e.test(G5())}function T6e(){return V5().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function K5(){return G5().includes("jsdom/")}const Xh="data-floating-ui-focusable",C6e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Go="ArrowLeft",Wo="ArrowRight",R6e="ArrowUp",I6e="ArrowDown";function ga(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function yr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&id(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Tr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ko(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function O6e(e){return e.matches("html,body")}function cn(e){return e?.ownerDocument||document}function ep(e){return $t(e)&&e.matches(C6e)}function L6e(e){return e?e.getAttribute("role")==="combobox"&&ep(e):!1}function D6e(e){if(!e||K5())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Y5(e){return e?e.hasAttribute(Xh)?e:e.querySelector("["+Xh+"]")||e:null}function la(e,t,n){return n===void 0&&(n=!0),e.filter(a=>{var i;return a.parentId===t&&(!n||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...la(e,a.id,n)])}function z6e(e,t){let n,r=-1;function a(i,o){o>r&&(n=i,r=o),la(e,i).forEach(l=>{a(l.id,o+1)})}return a(t,0),e.find(i=>i.id===n)}function Xt(e){e.preventDefault(),e.stopPropagation()}function $6e(e){return"nativeEvent"in e}function F6e(e){return e.mozInputSource===0&&e.isTrusted?!0:ud()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function P6e(e){return K5()?!1:!ud()&&e.width===0&&e.height===0||ud()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ya(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var q6e=typeof document<"u",B6e=function(){},yt=q6e?j.useLayoutEffect:B6e;const U6e={...te};function An(e){const t=te.useRef(e);return yt(()=>{t.current=e}),t}const H6e=U6e.useInsertionEffect,j6e=H6e||(e=>e());function Vt(e){const t=te.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return j6e(()=>{t.current=e}),te.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function ja(e,t,n){return Math.floor(e/t)!==n}function ca(e,t){return t<0||t>=e.current.length}function Yo(e,t){return kt(e,{disabledIndices:t})}function Qh(e,t){return kt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function kt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:i=1}=t===void 0?{}:t,o=n;do o+=r?-i:i;while(o>=0&&o<=e.current.length-1&&bi(e,o,a));return o}function V6e(e,t){let{event:n,orientation:r,loop:a,rtl:i,cols:o,disabledIndices:s,minIndex:l,maxIndex:u,prevIndex:d,stopEvent:p=!1}=t,h=d;if(n.key===R6e){if(p&&Xt(n),d===-1)h=u;else if(h=kt(e,{startingIndex:h,amount:o,decrement:!0,disabledIndices:s}),a&&(d-o<l||h<0)){const m=d%o,f=u%o,g=u-(f-m);f===m?h=u:h=f>m?g:g-o}ca(e,h)&&(h=d)}if(n.key===I6e&&(p&&Xt(n),d===-1?h=l:(h=kt(e,{startingIndex:d,amount:o,disabledIndices:s}),a&&d+o>u&&(h=kt(e,{startingIndex:d%o-o,amount:o,disabledIndices:s}))),ca(e,h)&&(h=d)),r==="both"){const m=Dr(d/o);n.key===(i?Go:Wo)&&(p&&Xt(n),d%o!==o-1?(h=kt(e,{startingIndex:d,disabledIndices:s}),a&&ja(h,o,m)&&(h=kt(e,{startingIndex:d-d%o-1,disabledIndices:s}))):a&&(h=kt(e,{startingIndex:d-d%o-1,disabledIndices:s})),ja(h,o,m)&&(h=d)),n.key===(i?Wo:Go)&&(p&&Xt(n),d%o!==0?(h=kt(e,{startingIndex:d,decrement:!0,disabledIndices:s}),a&&ja(h,o,m)&&(h=kt(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s}))):a&&(h=kt(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s})),ja(h,o,m)&&(h=d));const f=Dr(u/o)===m;ca(e,h)&&(a&&f?h=n.key===(i?Wo:Go)?u:kt(e,{startingIndex:d-d%o-1,disabledIndices:s}):h=d)}return h}function G6e(e,t,n){const r=[];let a=0;return e.forEach((i,o)=>{let{width:s,height:l}=i;if(s>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+o+" is greater than grid columns");let u=!1;for(n&&(a=0);!u;){const d=[];for(let p=0;p<s;p++)for(let h=0;h<l;h++)d.push(a+p+h*t);a%t+s<=t&&d.every(p=>r[p]==null)?(d.forEach(p=>{r[p]=o}),u=!0):a++}}),[...r]}function W6e(e,t,n,r,a){if(e===-1)return-1;const i=n.indexOf(e),o=t[e];switch(a){case"tl":return i;case"tr":return o?i+o.width-1:i;case"bl":return o?i+(o.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function K6e(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function bi(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}const Z5=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function X5(e,t){const n=j5(e,Z5()),r=n.length;if(r===0)return;const a=ga(cn(e)),i=n.indexOf(a),o=i===-1?t===1?0:r-1:i+t;return n[o]}function Y6e(e){return X5(cn(e).body,1)||e}function Z6e(e){return X5(cn(e).body,-1)||e}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!yr(n,r)}function X6e(e){j5(e,Z5()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Jh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function e2(e,t,n){let{reference:r,floating:a}=e;const i=Gn(t),o=F5(t),s=$5(o),l=Pr(t),u=i==="y",d=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,h=r[s]/2-a[s]/2;let m;switch(l){case"top":m={x:d,y:r.y-a.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-a.width,y:p};break;default:m={x:r.x,y:r.y}}const f=uo(t);return f&&(m[o]+=h*(f==="end"?1:-1)*(n&&u?-1:1)),m}async function Q6e(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=co(t,e),f=p6e(m),_=s[h?p==="floating"?"reference":"floating":p],k=Di(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(_)))==null||n?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:l})),b=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),M=await(i.isElement==null?void 0:i.isElement(x))&&await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1},N=Di(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(k.top-N.top+f.top)/M.y,bottom:(N.bottom-k.bottom+f.bottom)/M.y,left:(k.left-N.left+f.left)/M.x,right:(N.right-k.right+f.right)/M.x}}const J6e=50,e8e=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Q6e},l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=e2(u,r,l),h=r,m=0;const f={};for(let g=0;g<i.length;g++){const _=i[g];if(!_)continue;const{name:k,fn:b}=_,{x,y:M,data:N,reset:E}=await b({x:d,y:p,initialPlacement:r,placement:h,strategy:a,middlewareData:f,rects:u,platform:s,elements:{reference:e,floating:t}});d=x??d,p=M??p,f[k]={...f[k],...N},E&&m<J6e&&(m++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:d,y:p}=e2(u,h,l)),g=-1)}return{x:d,y:p,placement:h,strategy:a,middlewareData:f}},t8e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,..._}=co(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const k=Pr(a),b=Gn(s),x=Pr(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=h||(x||!g?[Li(s)]:o6e(s)),E=f!=="none";!h&&E&&N.push(...u6e(s,g,f,M));const D=[s,...N],P=await l.detectOverflow(t,_),C=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&C.push(P[k]),p){const K=i6e(a,o,M);C.push(P[K[0]],P[K[1]])}if(I=[...I,{placement:a,overflows:C}],!C.every(K=>K<=0)){var q,Z;const K=(((q=i.flip)==null?void 0:q.index)||0)+1,R=D[K];if(R&&(!(p==="alignment"?b!==Gn(R):!1)||I.every(z=>Gn(z.placement)===b?z.overflows[0]>0:!0)))return{data:{index:K,overflows:I},reset:{placement:R}};let H=(Z=I.filter(G=>G.overflows[0]<=0).sort((G,z)=>G.overflows[1]-z.overflows[1])[0])==null?void 0:Z.placement;if(!H)switch(m){case"bestFit":{var X;const G=(X=I.filter(z=>{if(E){const V=Gn(z.placement);return V===b||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,A)=>V+A,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:X[0];G&&(H=G);break}case"initialPlacement":H=s;break}if(a!==H)return{reset:{placement:H}}}return{}}}},n8e=new Set(["left","top"]);async function r8e(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Pr(n),s=uo(n),l=Gn(n)==="y",u=n8e.has(o)?-1:1,d=i&&l?-1:1,p=co(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof f=="number"&&(m=s==="end"?f*-1:f),l?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const a8e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await r8e(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},i8e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:M}=b;return{x,y:M}}},...u}=co(e,t),d={x:n,y:r},p=await i.detectOverflow(t,u),h=Gn(a),m=z5(h);let f=d[m],g=d[h];const _=(b,x)=>a6e(x+p[b==="y"?"top":"left"],x,x-p[b==="y"?"bottom":"right"]);o&&(f=_(m,f)),s&&(g=_(h,g));const k=l.fn({...t,[m]:f,[h]:g});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[m]:o,[h]:s}}}}}};function Q5(e){const t=pn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=$t(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,s=Oi(n)!==i||Oi(r)!==o;return s&&(n=i,r=o),{width:n,height:r,$:s}}function tp(e){return et(e)?e:e.contextElement}function $r(e){const t=tp(e);if(!$t(t))return Rn(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=Q5(t);let o=(i?Oi(n.width):n.width)/r,s=(i?Oi(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const o8e=Rn(0);function J5(e){const t=Ct(e);return!so()||!t.visualViewport?o8e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s8e(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ct(e)}function br(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=tp(e);let o=Rn(1);t&&(r?et(r)&&(o=$r(r)):o=$r(e));const s=s8e(i,n,r)?J5(i):Rn(0);let l=(a.left+s.x)/o.x,u=(a.top+s.y)/o.y,d=a.width/o.x,p=a.height/o.y;if(i&&r){const h=Ct(i),m=et(r)?Ct(r):r;let f=h,g=od(f);for(;g&&m!==f;){const _=$r(g),k=g.getBoundingClientRect(),b=pn(g),x=k.left+(g.clientLeft+parseFloat(b.paddingLeft))*_.x,M=k.top+(g.clientTop+parseFloat(b.paddingTop))*_.y;l*=_.x,u*=_.y,d*=_.x,p*=_.y,l+=x,u+=M,f=Ct(g),g=od(f)}}return Di({width:d,height:p,x:l,y:u})}function po(e,t){const n=lo(e).scrollLeft;return t?t.left+n:br($n(e)).left+n}function e3(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-po(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function l8e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=$n(r),s=t?oo(t.floating):!1;if(r===o||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Rn(1);const d=Rn(0),p=$t(r);if((p||!i)&&((Hr(r)!=="body"||io(o))&&(l=lo(r)),p)){const m=br(r);u=$r(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=o&&!p&&!i?e3(o,l):Rn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function c8e(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function u8e(e){const t=lo(e),n=e.ownerDocument.body,r=mr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=mr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+po(e);const o=-t.scrollTop;return pn(n).direction==="rtl"&&(i+=mr(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:o}}const d8e=25;function p8e(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=Ct(e),i=$n(e),o=a.visualViewport;let s=i.clientWidth,l=i.clientHeight,u=0,d=0;if(o){const h=!so()||t==="fixed";r?h||(u=-o.offsetLeft,d=-o.offsetTop):(s=o.width,l=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(po(i)<=0){const h=i.ownerDocument,m=h.body,f=getComputedStyle(m),g=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(i.clientWidth-m.clientWidth-g),k=getComputedStyle(i).scrollbarGutter==="stable both-edges"?_/2:_;k<=d8e&&(s-=k)}return{width:s,height:l,x:u,y:d}}function h8e(e,t){const n=br(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=$r(e),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,u=r*i.y;return{width:o,height:s,x:l,y:u}}function t2(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=p8e(e,n,t);else if(t==="document")r=u8e($n(e));else if(et(t))r=h8e(t,n);else{const a=J5(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Di(r)}function m8e(e,t){const n=t.get(e);if(n)return n;let r=Zn(e,[],!1).filter(s=>et(s)&&Hr(s)!=="body"),a=null;const i=pn(e).position==="fixed";let o=i?Qn(e):e;for(;et(o)&&!Yn(o);){const s=pn(o),l=Jd(o),u=a?a.position:i?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?r=r.filter(p=>p!==o):a=s,o=Qn(o)}return t.set(e,r),r}function f8e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?oo(t)?[]:m8e(t,this._c):[].concat(n),r],s=t2(t,o[0],a);let l=s.top,u=s.right,d=s.bottom,p=s.left;for(let h=1;h<o.length;h++){const m=t2(t,o[h],a);l=mr(m.top,l),u=Ii(m.right,u),d=Ii(m.bottom,d),p=mr(m.left,p)}return{width:u-p,height:d-l,x:p,y:l}}function g8e(e){const{width:t,height:n}=Q5(e);return{width:t,height:n}}function y8e(e,t,n){const r=$t(t),a=$n(t),i=n==="fixed",o=br(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Rn(0);if((r||!i)&&((Hr(t)!=="body"||io(a))&&(s=lo(t)),r)){const h=br(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}!r&&a&&(l.x=po(a));const u=a&&!r&&!i?e3(a,s):Rn(0),d=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:d,y:p,width:o.width,height:o.height}}function Xo(e){return pn(e).position==="static"}function n2(e,t){if(!$t(e)||pn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $n(e)===n&&(n=n.ownerDocument.body),n}function t3(e,t){const n=Ct(e);if(oo(e))return n;if(!$t(e)){let a=Qn(e);for(;a&&!Yn(a);){if(et(a)&&!Xo(a))return a;a=Qn(a)}return n}let r=n2(e,t);for(;r&&Jve(r)&&Xo(r);)r=n2(r,t);return r&&Yn(r)&&Xo(r)&&!Jd(r)?n:r||n6e(e)||n}const b8e=async function(e){const t=this.getOffsetParent||t3,n=this.getDimensions,r=await n(e.floating);return{reference:y8e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function k8e(e){return pn(e).direction==="rtl"}const v8e={convertOffsetParentRelativeRectToViewportRelativeRect:l8e,getDocumentElement:$n,getClippingRect:f8e,getOffsetParent:t3,getElementRects:b8e,getClientRects:c8e,getDimensions:g8e,getScale:$r,isElement:et,isRTL:k8e};function n3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _8e(e,t,n){let r=null,a;const i=$n(e);function o(){var d;clearTimeout(a),(d=r)==null||d.disconnect(),r=null}function s(d,p){d===void 0&&(d=!1),p===void 0&&(p=1),o();const h=e.getBoundingClientRect(),{left:m,top:f,width:g,height:_}=h;if(d||t(),!g||!_)return;const k=Dr(f),b=Dr(i.clientWidth-(m+g)),x=Dr(i.clientHeight-(f+_)),M=Dr(m),E={rootMargin:-k+"px "+-b+"px "+-x+"px "+-M+"px",threshold:mr(0,Ii(1,p))||1};let D=!0;function P(C){const I=C[0].intersectionRatio;if(!n3(h,e.getBoundingClientRect()))return s();if(I!==p){if(!D)return s();I?s(!1,I):a=setTimeout(()=>{s(!1,1e-7)},1e3)}D=!1}try{r=new IntersectionObserver(P,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(P,E)}r.observe(e)}const l=Ct(e),u=()=>s(n);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),o()}}function np(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=tp(e),d=a||i?[...u?Zn(u):[],...t?Zn(t):[]]:[];d.forEach(k=>{a&&k.addEventListener("scroll",n),i&&k.addEventListener("resize",n)});const p=u&&s?_8e(u,n,i):null;let h=-1,m=null;o&&(m=new ResizeObserver(k=>{let[b]=k;b&&b.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let f,g=l?br(e):null;l&&_();function _(){const k=br(e);g&&!n3(g,k)&&n(),g=k,f=requestAnimationFrame(_)}return n(),()=>{var k;d.forEach(b=>{a&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),p?.(),(k=m)==null||k.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const x8e=a8e,w8e=i8e,E8e=t8e,M8e=(e,t,n)=>{const r=new Map,a=n??{},i={...v8e,...a.platform,_c:r};return e8e(e,t,{...a,platform:i})};var S8e=typeof document<"u",N8e=function(){},ki=S8e?j.useLayoutEffect:N8e;function Fi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fi(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fi(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function r3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function r2(e,t){const n=r3(e);return Math.round(t*n)/n}function Qo(e){const t=te.useRef(e);return ki(()=>{t.current=e}),t}function A8e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=te.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=te.useState(r);Fi(h,r)||m(r);const[f,g]=te.useState(null),[_,k]=te.useState(null),b=te.useCallback(z=>{z!==E.current&&(E.current=z,g(z))},[]),x=te.useCallback(z=>{z!==D.current&&(D.current=z,k(z))},[]),M=i||f,N=o||_,E=te.useRef(null),D=te.useRef(null),P=te.useRef(d),C=l!=null,I=Qo(l),q=Qo(a),Z=Qo(u),X=te.useCallback(()=>{if(!E.current||!D.current)return;const z={placement:t,strategy:n,middleware:h};q.current&&(z.platform=q.current),M8e(E.current,D.current,z).then(V=>{const A={...V,isPositioned:Z.current!==!1};K.current&&!Fi(P.current,A)&&(P.current=A,h5.flushSync(()=>{p(A)}))})},[h,t,n,q,Z]);ki(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[u]);const K=te.useRef(!1);ki(()=>(K.current=!0,()=>{K.current=!1}),[]),ki(()=>{if(M&&(E.current=M),N&&(D.current=N),M&&N){if(I.current)return I.current(M,N,X);X()}},[M,N,X,I,C]);const R=te.useMemo(()=>({reference:E,floating:D,setReference:b,setFloating:x}),[b,x]),H=te.useMemo(()=>({reference:M,floating:N}),[M,N]),G=te.useMemo(()=>{const z={position:n,left:0,top:0};if(!H.floating)return z;const V=r2(H.floating,d.x),A=r2(H.floating,d.y);return s?{...z,transform:"translate("+V+"px, "+A+"px)",...r3(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:A}},[n,s,H.floating,d.x,d.y]);return te.useMemo(()=>({...d,update:X,refs:R,elements:H,floatingStyles:G}),[d,X,R,H,G])}const rp=(e,t)=>{const n=x8e(e);return{name:n.name,fn:n.fn,options:[e,t]}},ap=(e,t)=>{const n=w8e(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>{const n=E8e(e);return{name:n.name,fn:n.fn,options:[e,t]}},T8e="data-floating-ui-focusable",a2="active",i2="selected",Ta="ArrowLeft",Ca="ArrowRight",a3="ArrowUp",ho="ArrowDown",C8e={...te};let o2=!1,R8e=0;const s2=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+R8e++;function I8e(){const[e,t]=te.useState(()=>o2?s2():void 0);return yt(()=>{e==null&&t(s2())},[]),te.useEffect(()=>{o2=!0},[]),e}const O8e=C8e.useId,op=O8e||I8e;let ba;process.env.NODE_ENV!=="production"&&(ba=new Set);function Jo(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=ba)!=null&&e.has(a))){var i;(i=ba)==null||i.add(a),console.warn(a)}}function L8e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=ba)!=null&&e.has(a))){var i;(i=ba)==null||i.add(a),console.error(a)}}function D8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const z8e=te.createContext(null),$8e=te.createContext(null),mo=()=>{var e;return((e=te.useContext(z8e))==null?void 0:e.id)||null},fo=()=>te.useContext($8e);function Ra(e){return"data-floating-ui-"+e}function Zt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const l2=Ra("safe-polygon");function es(e,t,n){if(n&&!ya(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function ts(e){return typeof e=="function"?e():e}function F8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:i,elements:o}=e,{enabled:s=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:h=!0}=t,m=fo(),f=mo(),g=An(u),_=An(l),k=An(n),b=An(p),x=te.useRef(),M=te.useRef(-1),N=te.useRef(),E=te.useRef(-1),D=te.useRef(!0),P=te.useRef(!1),C=te.useRef(()=>{}),I=te.useRef(!1),q=Vt(()=>{var G;const z=(G=a.current.openEvent)==null?void 0:G.type;return z?.includes("mouse")&&z!=="mousedown"});te.useEffect(()=>{if(!s)return;function G(z){let{open:V}=z;V||(Zt(M),Zt(E),D.current=!0,I.current=!1)}return i.on("openchange",G),()=>{i.off("openchange",G)}},[s,i]),te.useEffect(()=>{if(!s||!g.current||!n)return;function G(V){q()&&r(!1,V,"hover")}const z=cn(o.floating).documentElement;return z.addEventListener("mouseleave",G),()=>{z.removeEventListener("mouseleave",G)}},[o.floating,n,r,s,g,q]);const Z=te.useCallback(function(G,z,V){z===void 0&&(z=!0),V===void 0&&(V="hover");const A=es(_.current,"close",x.current);A&&!N.current?(Zt(M),M.current=window.setTimeout(()=>r(!1,G,V),A)):z&&(Zt(M),r(!1,G,V))},[_,r]),X=Vt(()=>{C.current(),N.current=void 0}),K=Vt(()=>{if(P.current){const G=cn(o.floating).body;G.style.pointerEvents="",G.removeAttribute(l2),P.current=!1}}),R=Vt(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);te.useEffect(()=>{if(!s)return;function G(ee){if(Zt(M),D.current=!1,d&&!ya(x.current)||ts(b.current)>0&&!es(_.current,"open"))return;const L=es(_.current,"open",x.current);L?M.current=window.setTimeout(()=>{k.current||r(!0,ee,"hover")},L):n||r(!0,ee,"hover")}function z(ee){if(R()){K();return}C.current();const L=cn(o.floating);if(Zt(E),I.current=!1,g.current&&a.current.floatingContext){n||Zt(M),N.current=g.current({...a.current.floatingContext,tree:m,x:ee.clientX,y:ee.clientY,onClose(){K(),X(),R()||Z(ee,!0,"safe-polygon")}});const ye=N.current;L.addEventListener("mousemove",ye),C.current=()=>{L.removeEventListener("mousemove",ye)};return}(x.current==="touch"?!yr(o.floating,ee.relatedTarget):!0)&&Z(ee)}function V(ee){R()||a.current.floatingContext&&(g.current==null||g.current({...a.current.floatingContext,tree:m,x:ee.clientX,y:ee.clientY,onClose(){K(),X(),R()||Z(ee)}})(ee))}function A(){Zt(M)}function Y(ee){R()||Z(ee,!1)}if(et(o.domReference)){const ee=o.domReference,L=o.floating;return n&&ee.addEventListener("mouseleave",V),h&&ee.addEventListener("mousemove",G,{once:!0}),ee.addEventListener("mouseenter",G),ee.addEventListener("mouseleave",z),L&&(L.addEventListener("mouseleave",V),L.addEventListener("mouseenter",A),L.addEventListener("mouseleave",Y)),()=>{n&&ee.removeEventListener("mouseleave",V),h&&ee.removeEventListener("mousemove",G),ee.removeEventListener("mouseenter",G),ee.removeEventListener("mouseleave",z),L&&(L.removeEventListener("mouseleave",V),L.removeEventListener("mouseenter",A),L.removeEventListener("mouseleave",Y))}}},[o,s,e,d,h,Z,X,K,r,n,k,m,_,g,a,R,b]),yt(()=>{var G;if(s&&n&&(G=g.current)!=null&&(G=G.__options)!=null&&G.blockPointerEvents&&q()){P.current=!0;const V=o.floating;if(et(o.domReference)&&V){var z;const A=cn(o.floating).body;A.setAttribute(l2,"");const Y=o.domReference,ee=m==null||(z=m.nodesRef.current.find(L=>L.id===f))==null||(z=z.context)==null?void 0:z.elements.floating;return ee&&(ee.style.pointerEvents=""),A.style.pointerEvents="none",Y.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{A.style.pointerEvents="",Y.style.pointerEvents="",V.style.pointerEvents=""}}}},[s,n,f,o,m,g,q]),yt(()=>{n||(x.current=void 0,I.current=!1,X(),K())},[n,X,K]),te.useEffect(()=>()=>{X(),Zt(M),Zt(E),K()},[s,o.domReference,X,K]);const H=te.useMemo(()=>{function G(z){x.current=z.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(z){const{nativeEvent:V}=z;function A(){!D.current&&!k.current&&r(!0,V,"hover")}d&&!ya(x.current)||n||ts(b.current)===0||I.current&&z.movementX**2+z.movementY**2<2||(Zt(E),x.current==="touch"?A():(I.current=!0,E.current=window.setTimeout(A,ts(b.current))))}}},[d,r,n,k,b]);return te.useMemo(()=>s?{reference:H}:{},[s,H])}let c2=0;function P8e(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(c2);const i=()=>e?.focus({preventScroll:n});a?i():c2=requestAnimationFrame(i)}const q8e={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},u2=te.forwardRef(function(t,n){const[r,a]=te.useState();yt(()=>{W5()&&a("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ra("focus-guard")]:"",style:q8e};return w.jsx("span",{...t,...i})}),B8e={clipPath:"inset(50%)",position:"fixed",top:0,left:0},i3=te.createContext(null),d2=Ra("portal");function U8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=op(),a=j8e(),[i,o]=te.useState(null),s=te.useRef(null);return yt(()=>()=>{i?.remove(),queueMicrotask(()=>{s.current=null})},[i]),yt(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(d2,""),l.appendChild(u),s.current=u,o(u)},[t,r]),yt(()=>{if(n===null||!r||s.current)return;let l=n||a?.portalNode;l&&!Qd(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(d2,""),l=u||l,l.appendChild(d),s.current=d,o(d)},[t,n,r,a]),i}function H8e(e){const{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,i=U8e({id:n,root:r}),[o,s]=te.useState(null),l=te.useRef(null),u=te.useRef(null),d=te.useRef(null),p=te.useRef(null),h=o?.modal,m=o?.open,f=!!o&&!o.modal&&o.open&&a&&!!(r||i);return te.useEffect(()=>{if(!i||!a||h)return;function g(_){i&&Zo(_)&&(_.type==="focusin"?Jh:X6e)(i)}return i.addEventListener("focusin",g,!0),i.addEventListener("focusout",g,!0),()=>{i.removeEventListener("focusin",g,!0),i.removeEventListener("focusout",g,!0)}},[i,a,h]),te.useEffect(()=>{i&&(m||Jh(i))},[m,i]),w.jsxs(i3.Provider,{value:te.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:i,setFocusManagerState:s}),[a,i]),children:[f&&i&&w.jsx(u2,{"data-type":"outside",ref:l,onFocus:g=>{if(Zo(g,i)){var _;(_=d.current)==null||_.focus()}else{const k=o?o.domReference:null,b=Z6e(k);b?.focus()}}}),f&&i&&w.jsx("span",{"aria-owns":i.id,style:B8e}),i&&h5.createPortal(t,i),f&&i&&w.jsx(u2,{"data-type":"outside",ref:u,onFocus:g=>{if(Zo(g,i)){var _;(_=p.current)==null||_.focus()}else{const k=o?o.domReference:null,b=Y6e(k);b?.focus(),o?.closeOnFocusOut&&o?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const j8e=()=>te.useContext(i3);function p2(e){return $t(e.target)&&e.target.tagName==="BUTTON"}function V8e(e){return $t(e.target)&&e.target.tagName==="A"}function h2(e){return ep(e)}function o3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:i}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:p=!0}=t,h=te.useRef(),m=te.useRef(!1),f=te.useMemo(()=>({onPointerDown(g){h.current=g.pointerType},onMouseDown(g){const _=h.current;g.button===0&&s!=="click"&&(ya(_,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){const _=h.current;if(s==="mousedown"&&h.current){h.current=void 0;return}ya(_,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){h.current=void 0,!(g.defaultPrevented||!d||p2(g))&&(g.key===" "&&!h2(i)&&(g.preventDefault(),m.current=!0),!V8e(g)&&g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!d||p2(g)||h2(i)||g.key===" "&&m.current&&(m.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[a,i,s,u,d,r,n,p,l]);return te.useMemo(()=>o?{reference:f}:{},[o,f])}const G8e={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},W8e={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},m2=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function sp(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:i}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:f}=t,g=fo(),_=Vt(typeof l=="function"?l:()=>!1),k=typeof l=="function"?_:l,b=te.useRef(!1),{escapeKey:x,outsidePress:M}=m2(m),{escapeKey:N,outsidePress:E}=m2(f),D=te.useRef(!1),P=Vt(K=>{var R;if(!n||!o||!s||K.key!=="Escape"||D.current)return;const H=(R=i.current.floatingContext)==null?void 0:R.nodeId,G=g?la(g.nodesRef.current,H):[];if(!x&&(K.stopPropagation(),G.length>0)){let z=!0;if(G.forEach(V=>{var A;if((A=V.context)!=null&&A.open&&!V.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}r(!1,$6e(K)?K.nativeEvent:K,"escape-key")}),C=Vt(K=>{var R;const H=()=>{var G;P(K),(G=Tr(K))==null||G.removeEventListener("keydown",H)};(R=Tr(K))==null||R.addEventListener("keydown",H)}),I=Vt(K=>{var R;const H=i.current.insideReactTree;i.current.insideReactTree=!1;const G=b.current;if(b.current=!1,u==="click"&&G||H||typeof k=="function"&&!k(K))return;const z=Tr(K),V="["+Ra("inert")+"]",A=cn(a.floating).querySelectorAll(V);let Y=et(z)?z:null;for(;Y&&!Yn(Y);){const ye=Qn(Y);if(Yn(ye)||!et(ye))break;Y=ye}if(A.length&&et(z)&&!O6e(z)&&!yr(z,a.floating)&&Array.from(A).every(ye=>!yr(Y,ye)))return;if($t(z)&&X){const ye=Yn(z),ke=pn(z),Ie=/auto|scroll/,Pe=ye||Ie.test(ke.overflowX),Ke=ye||Ie.test(ke.overflowY),Ge=Pe&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,nt=Ke&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,mt=ke.direction==="rtl",Ye=nt&&(mt?K.offsetX<=z.offsetWidth-z.clientWidth:K.offsetX>z.clientWidth),ie=Ge&&K.offsetY>z.clientHeight;if(Ye||ie)return}const ee=(R=i.current.floatingContext)==null?void 0:R.nodeId,L=g&&la(g.nodesRef.current,ee).some(ye=>{var ke;return Ko(K,(ke=ye.context)==null?void 0:ke.elements.floating)});if(Ko(K,a.floating)||Ko(K,a.domReference)||L)return;const se=g?la(g.nodesRef.current,ee):[];if(se.length>0){let ye=!0;if(se.forEach(ke=>{var Ie;if((Ie=ke.context)!=null&&Ie.open&&!ke.context.dataRef.current.__outsidePressBubbles){ye=!1;return}}),!ye)return}r(!1,K,"outside-press")}),q=Vt(K=>{var R;const H=()=>{var G;I(K),(G=Tr(K))==null||G.removeEventListener(u,H)};(R=Tr(K))==null||R.addEventListener(u,H)});te.useEffect(()=>{if(!n||!o)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=M;let K=-1;function R(A){r(!1,A,"ancestor-scroll")}function H(){window.clearTimeout(K),D.current=!0}function G(){K=window.setTimeout(()=>{D.current=!1},so()?5:0)}const z=cn(a.floating);s&&(z.addEventListener("keydown",N?C:P,N),z.addEventListener("compositionstart",H),z.addEventListener("compositionend",G)),k&&z.addEventListener(u,E?q:I,E);let V=[];return h&&(et(a.domReference)&&(V=Zn(a.domReference)),et(a.floating)&&(V=V.concat(Zn(a.floating))),!et(a.reference)&&a.reference&&a.reference.contextElement&&(V=V.concat(Zn(a.reference.contextElement)))),V=V.filter(A=>{var Y;return A!==((Y=z.defaultView)==null?void 0:Y.visualViewport)}),V.forEach(A=>{A.addEventListener("scroll",R)}),()=>{s&&(z.removeEventListener("keydown",N?C:P,N),z.removeEventListener("compositionstart",H),z.removeEventListener("compositionend",G)),k&&z.removeEventListener(u,E?q:I,E),V.forEach(A=>{A.removeEventListener("scroll",R)}),window.clearTimeout(K)}},[i,a,s,k,u,n,r,h,o,x,M,P,N,C,I,E,q]),te.useEffect(()=>{i.current.insideReactTree=!1},[i,k,u]);const Z=te.useMemo(()=>({onKeyDown:P,...d&&{[G8e[p]]:K=>{r(!1,K.nativeEvent,"reference-press")},...p!=="click"&&{onClick(K){r(!1,K.nativeEvent,"reference-press")}}}}),[P,r,d,p]),X=te.useMemo(()=>{function K(R){R.button===0&&(b.current=!0)}return{onKeyDown:P,onMouseDown:K,onMouseUp:K,[W8e[u]]:()=>{i.current.insideReactTree=!0}}},[P,u,i]);return te.useMemo(()=>o?{reference:Z,floating:X}:{},[o,Z,X])}function K8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=op(),i=te.useRef({}),[o]=te.useState(()=>D8e()),s=mo()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!et(m)&&L8e("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=te.useState(r.reference),d=Vt((m,f,g)=>{i.current.openEvent=m?f:void 0,o.emit("openchange",{open:m,event:f,reason:g,nested:s}),n?.(m,f,g)}),p=te.useMemo(()=>({setPositionReference:u}),[]),h=te.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return te.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:o,floatingId:a,refs:p}),[t,d,h,o,a,p])}function lp(e){var t,n;let{elements:r,...a}=e===void 0?{}:e;const{nodeId:i}=a,o=K8e({...a,elements:{reference:(t=r?.reference)!=null?t:null,floating:(n=r?.floating)!=null?n:null}}),s=a.rootContext||o,l=s.elements,[u,d]=te.useState(null),[p,h]=te.useState(null),f=l?.domReference||u,g=te.useRef(null),_=fo();yt(()=>{f&&(g.current=f)},[f]);const k=A8e({...a,elements:{...l,...p&&{reference:p}}}),b=te.useCallback(D=>{const P=et(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;h(P),k.refs.setReference(P)},[k.refs]),x=te.useCallback(D=>{(et(D)||D===null)&&(g.current=D,d(D)),(et(k.refs.reference.current)||k.refs.reference.current===null||D!==null&&!et(D))&&k.refs.setReference(D)},[k.refs]),M=te.useMemo(()=>({...k.refs,setReference:x,setPositionReference:b,domReference:g}),[k.refs,x,b]),N=te.useMemo(()=>({...k.elements,domReference:f}),[k.elements,f]),E=te.useMemo(()=>({...k,...s,refs:M,elements:N,nodeId:i}),[k,M,N,i,s]);return yt(()=>{s.dataRef.current.floatingContext=E;const D=_?.nodesRef.current.find(P=>P.id===i);D&&(D.context=E)}),te.useMemo(()=>({...k,context:E,refs:M,elements:N}),[k,M,N,E])}function ns(){return T6e()&&W5()}function Y8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:i,elements:o}=e,{enabled:s=!0,visibleOnly:l=!0}=t,u=te.useRef(!1),d=te.useRef(-1),p=te.useRef(!0);te.useEffect(()=>{if(!s)return;const m=Ct(o.domReference);function f(){!n&&$t(o.domReference)&&o.domReference===ga(cn(o.domReference))&&(u.current=!0)}function g(){p.current=!0}function _(){p.current=!1}return m.addEventListener("blur",f),ns()&&(m.addEventListener("keydown",g,!0),m.addEventListener("pointerdown",_,!0)),()=>{m.removeEventListener("blur",f),ns()&&(m.removeEventListener("keydown",g,!0),m.removeEventListener("pointerdown",_,!0))}},[o.domReference,n,s]),te.useEffect(()=>{if(!s)return;function m(f){let{reason:g}=f;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return a.on("openchange",m),()=>{a.off("openchange",m)}},[a,s]),te.useEffect(()=>()=>{Zt(d)},[]);const h=te.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(m){if(u.current)return;const f=Tr(m.nativeEvent);if(l&&et(f)){if(ns()&&!m.relatedTarget){if(!p.current&&!ep(f))return}else if(!D6e(f))return}r(!0,m.nativeEvent,"focus")},onBlur(m){u.current=!1;const f=m.relatedTarget,g=m.nativeEvent,_=et(f)&&f.hasAttribute(Ra("focus-guard"))&&f.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var k;const b=ga(o.domReference?o.domReference.ownerDocument:document);!f&&b===o.domReference||yr((k=i.current.floatingContext)==null?void 0:k.refs.floating.current,b)||yr(o.domReference,b)||_||r(!1,g,"focus")})}}),[i,o.domReference,r,l]);return te.useMemo(()=>s?{reference:h}:{},[s,h])}function rs(e,t,n){const r=new Map,a=n==="item";let i=e;if(a&&e){const{[a2]:o,[i2]:s,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[T8e]:""},...i,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,d]=l;if(!(a&&[a2,i2].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var p;(p=r.get(u))==null||p.push(d),o[u]=function(){for(var h,m=arguments.length,f=new Array(m),g=0;g<m;g++)f[g]=arguments[g];return(h=r.get(u))==null?void 0:h.map(_=>_(...f)).find(_=>_!==void 0)}}}else o[u]=d}),o),{})}}function cp(e){e===void 0&&(e=[]);const t=e.map(s=>s?.reference),n=e.map(s=>s?.floating),r=e.map(s=>s?.item),a=te.useCallback(s=>rs(s,e,"reference"),t),i=te.useCallback(s=>rs(s,e,"floating"),n),o=te.useCallback(s=>rs(s,e,"item"),r);return te.useMemo(()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:o}),[a,i,o])}const Z8e="Escape";function go(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Va(e,t){return go(t,e===a3||e===ho,e===Ta||e===Ca)}function as(e,t,n){return go(t,e===ho,n?e===Ta:e===Ca)||e==="Enter"||e===" "||e===""}function f2(e,t,n){return go(t,n?e===Ta:e===Ca,e===ho)}function g2(e,t,n,r){const a=n?e===Ca:e===Ta,i=e===a3;return t==="both"||t==="horizontal"&&r&&r>1?e===Z8e:go(t,a,i)}function X8e(e,t){const{open:n,onOpenChange:r,elements:a,floatingId:i}=e,{listRef:o,activeIndex:s,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:h=!1,nested:m=!1,rtl:f=!1,virtual:g=!1,focusItemOnOpen:_="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:b=!0,disabledIndices:x=void 0,orientation:M="vertical",parentOrientation:N,cols:E=1,scrollItemIntoView:D=!0,virtualItemRef:P,itemSizes:C,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(p&&(h||Jo("`useListNavigation` looping must be enabled to allow escaping."),g||Jo("`useListNavigation` must be virtual to allow escaping.")),M==="vertical"&&E>1&&Jo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const q=Y5(a.floating),Z=An(q),X=mo(),K=fo();yt(()=>{e.dataRef.current.orientation=M},[e,M]);const R=Vt(()=>{l(z.current===-1?null:z.current)}),H=L6e(a.domReference),G=te.useRef(_),z=te.useRef(d??-1),V=te.useRef(null),A=te.useRef(!0),Y=te.useRef(R),ee=te.useRef(!!a.floating),L=te.useRef(n),se=te.useRef(!1),ye=te.useRef(!1),ke=An(x),Ie=An(n),Pe=An(D),Ke=An(d),[Ge,nt]=te.useState(),[mt,Ye]=te.useState(),ie=Vt(()=>{function ve(B){if(g){var Q;(Q=B.id)!=null&&Q.endsWith("-fui-option")&&(B.id=i+"-"+Math.random().toString(16).slice(2,10)),nt(B.id),K?.events.emit("virtualfocus",B),P&&(P.current=B)}else P8e(B,{sync:se.current,preventScroll:!0})}const pe=o.current[z.current],be=ye.current;pe&&ve(pe),(se.current?B=>B():requestAnimationFrame)(()=>{const B=o.current[z.current]||pe;if(!B)return;pe||ve(B);const Q=Pe.current;Q&&we&&(be||!A.current)&&(B.scrollIntoView==null||B.scrollIntoView(typeof Q=="boolean"?{block:"nearest",inline:"nearest"}:Q))})});yt(()=>{u&&(n&&a.floating?G.current&&d!=null&&(ye.current=!0,z.current=d,R()):ee.current&&(z.current=-1,Y.current()))},[u,n,a.floating,d,R]),yt(()=>{if(u&&n&&a.floating)if(s==null){if(se.current=!1,Ke.current!=null)return;if(ee.current&&(z.current=-1,ie()),(!L.current||!ee.current)&&G.current&&(V.current!=null||G.current===!0&&V.current==null)){let ve=0;const pe=()=>{o.current[0]==null?(ve<2&&(ve?requestAnimationFrame:queueMicrotask)(pe),ve++):(z.current=V.current==null||as(V.current,M,f)||m?Yo(o,ke.current):Qh(o,ke.current),V.current=null,R())};pe()}}else ca(o,s)||(z.current=s,ie(),ye.current=!1)},[u,n,a.floating,s,Ke,m,o,M,f,R,ie,ke]),yt(()=>{var ve;if(!u||a.floating||!K||g||!ee.current)return;const pe=K.nodesRef.current,be=(ve=pe.find(Q=>Q.id===X))==null||(ve=ve.context)==null?void 0:ve.elements.floating,Re=ga(cn(a.floating)),B=pe.some(Q=>Q.context&&yr(Q.context.elements.floating,Re));be&&!B&&A.current&&be.focus({preventScroll:!0})},[u,a.floating,K,X,g]),yt(()=>{if(!u||!K||!g||X)return;function ve(pe){Ye(pe.id),P&&(P.current=pe)}return K.events.on("virtualfocus",ve),()=>{K.events.off("virtualfocus",ve)}},[u,K,g,X,P]),yt(()=>{Y.current=R,L.current=n,ee.current=!!a.floating}),yt(()=>{n||(V.current=null,G.current=_)},[n,_]);const xe=s!=null,we=te.useMemo(()=>{function ve(be){if(!Ie.current)return;const Re=o.current.indexOf(be);Re!==-1&&z.current!==Re&&(z.current=Re,R())}return{onFocus(be){let{currentTarget:Re}=be;se.current=!0,ve(Re)},onClick:be=>{let{currentTarget:Re}=be;return Re.focus({preventScroll:!0})},onMouseMove(be){let{currentTarget:Re}=be;se.current=!0,ye.current=!1,k&&ve(Re)},onPointerLeave(be){let{pointerType:Re}=be;if(!(!A.current||Re==="touch")&&(se.current=!0,!!k&&(z.current=-1,R(),!g))){var B;(B=Z.current)==null||B.focus({preventScroll:!0})}}}},[Ie,Z,k,o,R,g]),Ve=te.useCallback(()=>{var ve;return N??(K==null||(ve=K.nodesRef.current.find(pe=>pe.id===X))==null||(ve=ve.context)==null||(ve=ve.dataRef)==null?void 0:ve.current.orientation)},[X,K,N]),ue=Vt(ve=>{if(A.current=!1,se.current=!0,ve.which===229||!Ie.current&&ve.currentTarget===Z.current)return;if(m&&g2(ve.key,M,f,E)){Va(ve.key,Ve())||Xt(ve),r(!1,ve.nativeEvent,"list-navigation"),$t(a.domReference)&&(g?K?.events.emit("virtualfocus",a.domReference):a.domReference.focus());return}const pe=z.current,be=Yo(o,x),Re=Qh(o,x);if(H||(ve.key==="Home"&&(Xt(ve),z.current=be,R()),ve.key==="End"&&(Xt(ve),z.current=Re,R())),E>1){const B=C||Array.from({length:o.current.length},()=>({width:1,height:1})),Q=G6e(B,E,I),oe=Q.findIndex(qe=>qe!=null&&!bi(o,qe,x)),re=Q.reduce((qe,it,bt)=>it!=null&&!bi(o,it,x)?bt:qe,-1),_e=Q[V6e({current:Q.map(qe=>qe!=null?o.current[qe]:null)},{event:ve,orientation:M,loop:h,rtl:f,cols:E,disabledIndices:K6e([...(typeof x!="function"?x:null)||o.current.map((qe,it)=>bi(o,it,x)?it:void 0),void 0],Q),minIndex:oe,maxIndex:re,prevIndex:W6e(z.current>Re?be:z.current,B,Q,E,ve.key===ho?"bl":ve.key===(f?Ta:Ca)?"tr":"tl"),stopEvent:!0})];if(_e!=null&&(z.current=_e,R()),M==="both")return}if(Va(ve.key,M)){if(Xt(ve),n&&!g&&ga(ve.currentTarget.ownerDocument)===ve.currentTarget){z.current=as(ve.key,M,f)?be:Re,R();return}as(ve.key,M,f)?h?z.current=pe>=Re?p&&pe!==o.current.length?-1:be:kt(o,{startingIndex:pe,disabledIndices:x}):z.current=Math.min(Re,kt(o,{startingIndex:pe,disabledIndices:x})):h?z.current=pe<=be?p&&pe!==-1?o.current.length:Re:kt(o,{startingIndex:pe,decrement:!0,disabledIndices:x}):z.current=Math.max(be,kt(o,{startingIndex:pe,decrement:!0,disabledIndices:x})),ca(o,z.current)&&(z.current=-1),R()}}),Le=te.useMemo(()=>g&&n&&xe&&{"aria-activedescendant":mt||Ge},[g,n,xe,mt,Ge]),Be=te.useMemo(()=>({"aria-orientation":M==="both"?void 0:M,...H?{}:Le,onKeyDown:ue,onPointerMove(){A.current=!0}}),[Le,ue,M,H]),Ce=te.useMemo(()=>{function ve(be){_==="auto"&&F6e(be.nativeEvent)&&(G.current=!0)}function pe(be){G.current=_,_==="auto"&&P6e(be.nativeEvent)&&(G.current=!0)}return{...Le,onKeyDown(be){A.current=!1;const Re=be.key.startsWith("Arrow"),B=["Home","End"].includes(be.key),Q=Re||B,oe=f2(be.key,M,f),re=g2(be.key,M,f,E),_e=f2(be.key,Ve(),f),qe=Va(be.key,M),it=(m?_e:qe)||be.key==="Enter"||be.key.trim()==="";if(g&&n){const ft=K?.nodesRef.current.find(It=>It.parentId==null),Et=K&&ft?z6e(K.nodesRef.current,ft.id):null;if(Q&&Et&&P){const It=new KeyboardEvent("keydown",{key:be.key,bubbles:!0});if(oe||re){var bt,qn;const U7=((bt=Et.context)==null?void 0:bt.elements.domReference)===be.currentTarget,jh=re&&!U7?(qn=Et.context)==null?void 0:qn.elements.domReference:oe?o.current.find(Vh=>Vh?.id===Ge):null;jh&&(Xt(be),jh.dispatchEvent(It),Ye(void 0))}if((qe||B)&&Et.context&&Et.context.open&&Et.parentId&&be.currentTarget!==Et.context.elements.domReference){var Bn;Xt(be),(Bn=Et.context.elements.domReference)==null||Bn.dispatchEvent(It);return}}return ue(be)}if(!(!n&&!b&&Re)){if(it){const ft=Va(be.key,Ve());V.current=m&&ft?null:be.key}if(m){_e&&(Xt(be),n?(z.current=Yo(o,ke.current),R()):r(!0,be.nativeEvent,"list-navigation"));return}qe&&(d!=null&&(z.current=d),Xt(be),!n&&b?r(!0,be.nativeEvent,"list-navigation"):ue(be),n&&R())}},onFocus(){n&&!g&&(z.current=-1,R())},onPointerDown:pe,onPointerEnter:pe,onMouseDown:ve,onClick:ve}},[Ge,Le,E,ue,ke,_,o,m,R,r,n,b,M,Ve,f,d,K,g,P]);return te.useMemo(()=>u?{reference:Ce,floating:Be,item:we}:{},[u,Ce,Be,we])}const Q8e=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function up(e,t){var n,r;t===void 0&&(t={});const{open:a,elements:i,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=op(),d=((n=i.domReference)==null?void 0:n.id)||u,p=te.useMemo(()=>{var b;return((b=Y5(i.floating))==null?void 0:b.id)||o},[i.floating,o]),h=(r=Q8e.get(l))!=null?r:l,f=mo()!=null,g=te.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:a?p:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":a?p:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:d},...h==="menu"&&f&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,p,f,a,d,l]),_=te.useMemo(()=>{const b={id:p,...h&&{role:h}};return h==="tooltip"||l==="label"?b:{...b,...h==="menu"&&{"aria-labelledby":d}}},[h,p,d,l]),k=te.useCallback(b=>{let{active:x,selected:M}=b;const N={role:"option",...x&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...N,"aria-selected":M}}return{}},[p,l]);return te.useMemo(()=>s?{reference:g,floating:_,item:k}:{},[s,g,_,k])}const Tn=({content:e,children:t,placement:n="top",delay:r=300,disabled:a=!1,className:i=""})=>{const[o,s]=j.useState(!1),{refs:l,floatingStyles:u,context:d,isPositioned:p}=lp({open:o,onOpenChange:s,placement:n,strategy:"absolute",whileElementsMounted:np,middleware:[rp(8),ip(),ap({padding:8})]}),h=F8e(d,{delay:{open:r,close:0},enabled:!a}),m=Y8e(d,{enabled:!a}),f=sp(d,{enabled:!0,outsidePress:!0,outsidePressEvent:"mousedown",referencePress:!0,referencePressEvent:"mousedown",escapeKey:!0,ancestorScroll:!0}),g=up(d,{role:"tooltip"}),{getReferenceProps:_,getFloatingProps:k}=cp([h,m,f,g]);return j.useEffect(()=>{if(!o||a)return;const b=()=>{s(!1)};return window.addEventListener("scroll",b,!0),document.addEventListener("scroll",b,!0),()=>{window.removeEventListener("scroll",b,!0),document.removeEventListener("scroll",b,!0)}},[o,a]),a||!e?w.jsx(w.Fragment,{children:t}):w.jsxs(w.Fragment,{children:[w.jsx("span",{ref:l.setReference,..._(),children:t}),o&&w.jsx(H8e,{children:w.jsx("div",{ref:l.setFloating,style:{...u,opacity:p?1:0,pointerEvents:"none",transition:p?"opacity 0.15s ease-out":"none"},className:`mp-agent-tooltip ${i}`.trim(),...k(),children:e})})]})},un=({icon:e,size:t="md",iconSize:n,type:r="button",className:a="",tooltip:i,tooltipPlacement:o,...s})=>{const l=Yve[e],u=n??(t==="sm"?14:20),d=w.jsx("button",{type:r,className:`mp-agent-icon-button mp-agent-icon-button-${t} ${a}`.trim(),...s,children:l&&w.jsx(l,{size:u})});return i?w.jsx(Tn,{content:i,placement:o,children:d}):d},dp=({text:e})=>{const[t,n]=j.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy:",a)}};return w.jsx(Tn,{content:"Copy to clipboard",children:w.jsx(un,{icon:t?"Check":"Copy",onClick:r,"aria-label":"Copy message",size:"sm"})})},Wt=()=>{const e=$e();return{...Ci,...e.config.translations??{}}},y2=300,s3=j.memo(({field:e,isExpanded:t,canApply:n,onToggleExpand:r,onApply:a})=>{const i=Wt(),o=e.value.length>y2,s=o&&!t?`${e.value.slice(0,y2)}...`:e.value,l=j.useCallback(()=>{r(e.name)},[e.name,r]),u=j.useCallback(()=>{a(e)},[e,a]);return w.jsxs("div",{className:"mp-agent-form-proposal-row",children:[w.jsxs("div",{className:"mp-agent-form-proposal-main",children:[w.jsx("div",{className:"mp-agent-form-proposal-label",children:e.label||e.name}),w.jsx("div",{className:"mp-agent-form-proposal-value-container",children:w.jsxs("div",{className:"mp-agent-form-proposal-value",children:[s,o&&w.jsx("button",{type:"button",onClick:l,className:"mp-agent-form-proposal-show-all",children:t?i.formProposalShowLess:i.formProposalShowAll})]})})]}),w.jsxs("div",{className:"mp-agent-form-proposal-actions-row",children:[w.jsx(un,{icon:"Check",onClick:u,tooltip:`${i.formProposalApplyFieldPrefix} ${e.label||e.name}`,size:"sm"}),w.jsx(dp,{text:e.value})]})]})});s3.displayName="FormFieldRow";const Ia=30*1e3,Oa=5*60*1e3,l3=20,Ht={all:["mp-agents","activities"],lists:()=>[...Ht.all,"list"],list:e=>[...Ht.lists(),e],infinites:()=>[...Ht.all,"infinite"],infinite:e=>[...Ht.infinites(),e],sourceTypes:e=>[...Ht.all,"sourceTypes",e],detail:e=>[...Ht.all,"detail",e],summary:e=>[...Ht.all,"summary",e]},J8e=e=>e?.pages.flatMap(t=>t.data)??[],c3=(e,t,n)=>{const r=e.from instanceof Date?e.from.toISOString():e.from,a=e.to instanceof Date?e.to.toISOString():e.to;return{...e.groupId&&{groupId:e.groupId},...e.parentId&&{parentId:e.parentId},...e.sourceType&&{sourceType:e.sourceType},...e.sortField&&e.sortOrder&&{sort:{field:e.sortField,order:e.sortOrder}},...r&&{from:r},...a&&{to:a},...e.tenant&&{tenant:e.tenant},...e.ownerId&&{ownerId:e.ownerId},skip:t,limit:n}},u3=e=>({data:[],cursor:{total:0,skip:0,limit:e}}),e7e=e=>{const t=$e(),{groupId:n,parentId:r,sourceType:a,enabled:i=!0,sortOrder:o=exports.SortOrder.Desc,sortField:s="createdAt",pageSize:l=l3,from:u,to:d,tenant:p,ownerId:h}=e??{};return xt.useInfiniteQuery({queryKey:Ht.infinite({groupId:n,parentId:r,sourceType:a,sortField:s,sortOrder:o,pageSize:l,from:u,to:d,tenant:p,ownerId:h}),queryFn:async({pageParam:m})=>t.transport.listActivities?t.transport.listActivities(c3({groupId:n,parentId:r,sourceType:a,sortField:s,sortOrder:o,from:u,to:d,tenant:p,ownerId:h},m,l)):u3(l),initialPageParam:0,getNextPageParam:m=>{const f=(m.cursor.skip??0)+m.data.length;return f<m.cursor.total?f:void 0},enabled:i&&!!t.transport.listActivities,staleTime:Ia,gcTime:Oa})},t7e=e=>{const t=$e(),{groupId:n,parentId:r,sourceType:a,page:i,enabled:o=!0,sortOrder:s=exports.SortOrder.Desc,sortField:l="createdAt",pageSize:u=l3,from:d,to:p,tenant:h,ownerId:m}=e,f=(i-1)*u,g=xt.useQuery({queryKey:Ht.list({groupId:n,parentId:r,sourceType:a,sortField:l,sortOrder:s,pageSize:u,page:i,from:d,to:p,tenant:h,ownerId:m}),queryFn:async()=>t.transport.listActivities?t.transport.listActivities(c3({groupId:n,parentId:r,sourceType:a,sortField:l,sortOrder:s,from:d,to:p,tenant:h,ownerId:m},f,u)):u3(u),enabled:o&&!!t.transport.listActivities&&i>=1,staleTime:Ia,gcTime:Oa}),_=g.data?.cursor.total??0,k=Math.max(1,Math.ceil(_/u));return{...g,page:i,pageSize:u,totalPages:k,total:_,hasNextPage:i<k,hasPreviousPage:i>1}},n7e=e=>{const t=$e();return xt.useQuery({queryKey:Ht.detail(e),queryFn:async()=>!e||!t.transport.getActivity?null:t.transport.getActivity(e),enabled:!!e&&!!t.transport.getActivity,staleTime:Ia,gcTime:Oa})},r7e=e=>{const t=$e(),{enabled:n=!0,...r}=e??{};return xt.useQuery({queryKey:Ht.summary(r),queryFn:async()=>t.transport.getActivitySummary?t.transport.getActivitySummary(r):[],enabled:n&&!!t.transport.getActivitySummary,staleTime:Ia,gcTime:Oa})},a7e=e=>{const t=$e(),{enabled:n=!0,groupId:r,parentId:a,from:i,to:o,tenant:s,ownerId:l}=e??{},u=i instanceof Date?i.toISOString():i,d=o instanceof Date?o.toISOString():o;return xt.useQuery({queryKey:Ht.sourceTypes({groupId:r,parentId:a,from:u,to:d,tenant:s,ownerId:l}),queryFn:async()=>t.transport.listActivitySourceTypes?t.transport.listActivitySourceTypes({...r&&{groupId:r},...a&&{parentId:a},...u&&{from:u},...d&&{to:d},...s&&{tenant:s},...l&&{ownerId:l}}):[],enabled:n&&!!t.transport.listActivitySourceTypes,staleTime:Ia,gcTime:Oa})},b2="mp-agents-guest-user-id";function jr(){if(typeof window>"u")return`${Ri.DefaultUserId}-${vt.nanoid()}`;const e=localStorage.getItem(b2);if(e)return e;const t=`${Ri.DefaultUserId}-${vt.nanoid()}`;return localStorage.setItem(b2,t),t}const d3=30*1e3,p3=5*60*1e3,pp=20,Vn={all:["mp-agents","chats"],lists:()=>[...Vn.all,"list"],list:e=>[...Vn.lists(),e],infinites:()=>[...Vn.all,"infinite"],infinite:e=>[...Vn.infinites(),e],detail:e=>[...Vn.all,"detail",e]},i7e=e=>e?.pages.flatMap(t=>t.data)??[],h3=e=>{const t=$e(),n=t.config.user?.id??jr(),r=t.config.appId,{pageSize:a=pp,sortOrder:i="desc",sortField:o="updatedAt",multiUser:s,enabled:l=!0}=e??{};return xt.useInfiniteQuery({queryKey:Vn.infinite({userId:n,appId:r,sortField:o,sortOrder:i,pageSize:a,multiUser:s}),queryFn:async({pageParam:u})=>await t.transport.listChats({userId:n,skip:u,limit:a,multiUser:s,sortOrder:i,sortField:o}),initialPageParam:0,getNextPageParam:u=>{const{cursor:d,data:p}=u,h=(d.skip??0)+p.length;return h<d.total?h:void 0},enabled:l&&!!n,staleTime:d3,gcTime:p3})},m3=h3,o7e=e=>{const t=$e(),n=t.config.user?.id??jr(),r=t.config.appId,{page:a,pageSize:i=pp,sortOrder:o="desc",sortField:s="updatedAt",multiUser:l,enabled:u=!0}=e,d=(a-1)*i,p=xt.useQuery({queryKey:Vn.list({userId:n,appId:r,sortField:s,sortOrder:o,pageSize:i,page:a,multiUser:l}),queryFn:async()=>t.transport.listChats({userId:n,skip:d,limit:i,multiUser:l,sortOrder:o,sortField:s}),enabled:u&&!!n&&a>=1,staleTime:d3,gcTime:p3}),h=p.data?.cursor.total??0,m=Math.max(1,Math.ceil(h/i));return{...p,page:a,pageSize:i,totalPages:m,total:h,hasNextPage:a<m,hasPreviousPage:a>1}},hp=e=>{const t=m3(e),n=fe(r=>r.hydrateChats);return j.useEffect(()=>{if(t.data?.pages){const r=t.data.pages.flatMap(a=>a.data);n(r)}},[t.data,n]),t},s7e=(e={},t=[])=>{const{threshold:n=50,scrollOnMount:r=!0,observeMutations:a=!0}=e,i=j.useRef(null),o=j.useRef(null),[s,l]=j.useState(!0),u=j.useRef(!1),d=j.useRef(!1),p=j.useRef(),h=j.useCallback(()=>{const g=i.current;if(!g)return!1;const{scrollTop:_,scrollHeight:k,clientHeight:b}=g;return k-_-b<=n},[n]),m=j.useCallback(()=>{const g=i.current,_=o.current;!g||!_||_.scrollIntoView({behavior:"auto",block:"end"})},[]),f=j.useCallback(()=>{const g=h();l(g),g&&(u.current=!1)},[h]);return j.useEffect(()=>{const g=i.current;if(!g)return;let _=g.scrollTop,k;const b=()=>{const x=g.scrollTop;if(!d.current){const M=x<_,N=x>_;(M||N&&!h())&&(u.current=!0)}_=x,f(),k&&clearTimeout(k),k=window.setTimeout(()=>{d.current=!1},150)};return g.addEventListener("scroll",b,{passive:!0}),()=>{g.removeEventListener("scroll",b),k&&clearTimeout(k)}},[h,f]),j.useEffect(()=>{if(!a)return;const g=i.current;if(!g)return;const _=new MutationObserver(()=>{!u.current&&s&&(p.current&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{d.current=!0,m(),setTimeout(()=>{d.current=!1},50)})),f()});return _.observe(g,{childList:!0,subtree:!0,characterData:!0,attributes:!1}),()=>{_.disconnect(),p.current&&cancelAnimationFrame(p.current)}},[s,a,m,f]),j.useEffect(()=>{t.length!==0&&!u.current&&s&&(p.current&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{d.current=!0,m(),setTimeout(()=>{d.current=!1},50)}))},[...t]),j.useEffect(()=>{if(r&&i.current){const g=window.setTimeout(()=>{d.current=!0,m(),setTimeout(()=>{d.current=!1},50)},100);return()=>{clearTimeout(g)}}},[r,m]),{containerRef:i,sentinelRef:o,isNearBottom:s,scrollToBottom:m,checkIsNearBottom:h}},f3=()=>{const e=$e();return xt.useQuery({queryKey:["mp-agents","models"],queryFn:async()=>e.transport.listModels?await e.transport.listModels():[],staleTime:5*60*1e3,refetchOnWindowFocus:!1})},Ga=e=>e.type===exports.AgentAttachmentType.Context&&e?.metadata?.kind==="pageContext";var st=(e=>(e.Idle="idle",e.Sending="sending",e.Streaming="streaming",e))(st||{});const ka=e=>e===exports.AgentStatus.Streaming||e===exports.AgentStatus.Processing||e===exports.AgentStatus.WaitingForUserAction?"streaming":"idle",g3=()=>({messages:[],reasoning:[],artifacts:[],pendingAssistant:void 0,messageQueue:[],composerDraft:{value:"",attachments:[]},composerError:void 0,pageContextDismissed:!1,status:"idle"}),l7e=Object.freeze(g3()),De=(e,t)=>e.chatState[t]??l7e,c7e=e=>u5.create()((t,n)=>({contextKey:e,activeChatId:void 0,draftChatKey:`draft-${vt.nanoid()}`,chats:{},chatState:{},isChatHistoryOpen:!1,composer:{temperature:.4},setContextKey:r=>t({contextKey:r}),setActiveChat:r=>{t(a=>{let i=a.contextKey,o;if(r){const u=a.chats[r];u?.contextKey&&(i=u.contextKey),o=u?.model}const s=a.activeChatId!==r;return{activeChatId:r,contextKey:i,composer:r&&s?{...a.composer,model:o}:a.composer}})},upsertChat:r=>t(a=>{const i=a.chats[r.id],s=a.activeChatId===r.id&&(!i||i.model!==r.model);return{chats:{...a.chats,[r.id]:r},...s?{composer:{...a.composer,model:r.model}}:{}}}),upsertChatState:(r,a)=>t(i=>{const o=De(i,r),s=typeof a=="function"?a(o):a,l={...o,...s};return{chatState:{...i.chatState,[r]:l}}}),hydrateChats:r=>t(a=>{const i={};r.forEach(u=>{i[u.id]=u});const o=a.activeChatId??r[0]?.id;o&&!i[o]&&a.chats[o]&&(i[o]=a.chats[o]);const l=o?i[o]:void 0;return{chats:i,activeChatId:o,composer:{...a.composer,model:l?.model}}}),removeChat:r=>t(a=>{if(!a.chats[r])return a;const{[r]:i,...o}=a.chats,{[r]:s,...l}=a.chatState,u=a.activeChatId===r;return{chats:o,chatState:l,...u?{activeChatId:void 0}:{}}}),pushReasoning:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,reasoning:[...o.reasoning,a]}}}}),setArtifacts:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,artifacts:a}}}}),setComposerOptions:r=>t(a=>({composer:{...a.composer,...r}})),setComposerDraft:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{value:a.value??"",attachments:a.attachments??[]}}}}}),setComposerValue:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,value:a}}}}}),addComposerAttachments:(r,a)=>t(i=>{const o=De(i,r),s=o.composerDraft.attachments??[];if(!a||a.length===0)return i;const l=s.find(Ga),u=a.find(Ga);if(u){const h=a.filter(k=>!Ga(k)),m=s.filter(k=>!Ga(k)),g=[l?{...u,id:l.id}:u,...h,...m],_=new Map;for(const k of g)_.set(k.id,k);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,attachments:Array.from(_.values())}}}}}const d=[...a,...s],p=new Map;for(const h of d)p.set(h.id,h);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,attachments:Array.from(p.values())}}}}}),removeComposerAttachment:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,attachments:o.composerDraft.attachments.filter(s=>s.id!==a)}}}}}),clearComposerDraft:r=>t(a=>{const i=De(a,r);return{chatState:{...a.chatState,[r]:{...i,composerDraft:{value:"",attachments:[]}}}}}),setComposerError:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerError:a}}}}),setPageContextDismissed:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,pageContextDismissed:a}}}}),setChatStatus:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,status:a}}}}),setPendingAssistant:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,pendingAssistant:a}}}}),commitPendingAssistant:r=>t(a=>{const i=De(a,r),o=i.pendingAssistant;if(!o)return a;if(!a.chats[r])return{chatState:{...a.chatState,[r]:{...i,pendingAssistant:void 0}}};const u=typeof o.content=="string"&&o.content.trim().length>0?(()=>{if(i.messages[i.messages.length-1]?.id===o.id)return i.messages;const p={...o,chat:r};return[...i.messages,p]})():i.messages;return{chatState:{...a.chatState,[r]:{...i,messages:u,pendingAssistant:void 0}}}}),enqueueQueuedMessage:(r,a,i)=>t(o=>{const s=De(o,r),l={id:vt.nanoid(),content:a,...i&&i.length>0?{attachments:i}:{},createdAt:new Date().toISOString()};return{chatState:{...o.chatState,[r]:{...s,messageQueue:[...s.messageQueue,l]}}}}),removeQueuedMessage:(r,a)=>t(i=>{const o=De(i,r);if(o.messageQueue.length===0)return i;const s=o.messageQueue.filter(l=>l.id!==a);return{chatState:{...i.chatState,[r]:{...o,messageQueue:s}}}}),moveChatKeyState:(r,a)=>t(i=>{if(r===a)return i;const o=De(i,r),s=De(i,a);if(!(o.messageQueue.length>0||!!o.pendingAssistant||o.status!=="idle"||o.composerDraft.value.length>0||o.composerDraft.attachments.length>0||!!o.composerError))return i;const u=o.composerDraft.value.length>0||o.composerDraft.attachments.length>0,d=s.composerDraft.value.length>0||s.composerDraft.attachments.length>0,p={messages:s.messages,reasoning:s.reasoning,artifacts:s.artifacts,pendingAssistant:o.pendingAssistant??s.pendingAssistant,messageQueue:[...s.messageQueue,...o.messageQueue],composerDraft:u&&!d?o.composerDraft:s.composerDraft,composerError:o.composerError??s.composerError,pageContextDismissed:i.chatState[a]?s.pageContextDismissed:o.pageContextDismissed,status:o.status??s.status};return{chatState:{...i.chatState,[a]:p,[r]:g3()}}}),appendSystemMessage:(r,a)=>t(i=>{const o=De(i,r),s={id:vt.nanoid(),chat:r,content:a,role:exports.MessageRole.System,createdAt:new Date().toISOString()};return{chatState:{...i.chatState,[r]:{...o,messages:[...o.messages,s]}}}}),upsertToolCall:(r,a)=>t(i=>{const o=De(i,r),s=[...o.messages],l=s.findIndex(u=>u.role===exports.MessageRole.Tool&&u.toolCalls?.some(d=>d.id===a.id));if(l>=0){const u=s[l],d=(u.toolCalls??[]).map(p=>p.id===a.id?a:p);s[l]={...u,toolCalls:d}}else s.push({id:`tool-${a.id}`,content:"",chat:r,toolCalls:[a],role:exports.MessageRole.Tool,createdAt:new Date().toISOString()});return{chatState:{...i.chatState,[r]:{...o,messages:s}}}}),setChatHistoryOpen:r=>t({isChatHistoryOpen:r}),toggleChatHistory:()=>t(r=>({isChatHistoryOpen:!r.isChatHistoryOpen})),setChatMessages:(r,a)=>t(i=>{const o=De(i,r),s=o.messages??[],l=typeof a=="function"?a(s):a;return{chatState:{...i.chatState,[r]:{...o,messages:l}}}}),appendMessagesToChat:(r,a)=>t(i=>{const o=De(i,r);if(a.length===0)return i;const s=new Set(a.map(d=>d.id)),u=[...o.messages.filter(d=>!s.has(d.id)),...a].sort((d,p)=>d.createdAt.localeCompare(p.createdAt));return{chatState:{...i.chatState,[r]:{...o,messages:u}}}})})),y3=()=>{const e=fe(s=>s.activeChatId??s.draftChatKey),t=fe(s=>De(s,e).composerDraft),n=fe(s=>s.setComposerValue),r=fe(s=>s.setComposerDraft),a=fe(s=>s.clearComposerDraft),i=fe(s=>s.addComposerAttachments),o=fe(s=>s.removeComposerAttachment);return{chatKey:e,draft:t,setValue:s=>n(e,s),setDraft:s=>r(e,s),clearDraft:()=>a(e),addAttachments:s=>i(e,s),removeAttachment:s=>o(e,s)}},b3=e=>{const t=$e();return xt.useQuery({queryKey:["mp-agents","configurations",e??"all"],queryFn:async()=>t.transport.listAgentConfigurations?t.transport.listAgentConfigurations(e):[],staleTime:6e4,refetchOnWindowFocus:!1})},u7e=(e,t=[])=>{const n=$e(),r=j.useRef(e),a=j.useCallback(e,t);r.current=a;const i=j.useCallback(o=>r.current(o),[]);j.useEffect(()=>n.registerPageContextProvider(i),[n,i])},d7e=(e,t=[])=>{const n=$e(),r=j.useRef(e),a=j.useCallback(e,t);r.current=a;const i=j.useCallback(o=>r.current(o),[]);j.useEffect(()=>n.registerChatMetadataProvider(i),[n,i])},k3=e=>{const t=$e();return j.useCallback(r=>{t.events.dispatchEvent(new CustomEvent(e,{detail:r}))},[t,e])},v3=(e,t,n=[],r)=>{const a=$e(),i=j.useRef(t),o=j.useCallback(t,n);i.current=o;const s=j.useCallback(u=>{i.current(u)},[]),l=typeof r=="boolean"?r:r?.capture;j.useEffect(()=>(a.events.addEventListener(e,s,r),()=>{a.events.removeEventListener(e,s,l)}),[a,e,s,l])},p7e=({formId:e,onApply:t,enabled:n=!0})=>{v3(Xd,r=>{n&&r.detail.formId===e&&t(r.detail)},[n,e,t])},h7e=["mp-agents","configurations"],_3=()=>{const e=$e(),t=xt.useQueryClient(),n=()=>t.invalidateQueries({queryKey:h7e}),r=xt.useMutation({mutationFn:async({agentName:i,input:o})=>{if(!e.transport.upsertAgentPreferences)throw new Error("upsertAgentPreferences is not supported by this transport");return e.transport.upsertAgentPreferences(i,o)},onSuccess:n}),a=xt.useMutation({mutationFn:async i=>{if(!e.transport.upsertAgentPreferencesBatch)throw new Error("upsertAgentPreferencesBatch is not supported by this transport");return e.transport.upsertAgentPreferencesBatch(i)},onSuccess:n});return{upsertSingle:r,upsertBatch:a}},x3=()=>{const e=$e(),t=fe(s=>s.activeChatId),n=fe(s=>s.upsertChat),r=fe(s=>s.setActiveChat),a=fe(s=>s.setChatStatus),i=!!t,o=xt.useQuery({queryKey:["mp-agents","chat",t],queryFn:()=>e.transport.getChat(t),enabled:i,staleTime:6e4,retry:!1});return j.useEffect(()=>{o.data&&(n(o.data),a(o.data.id,ka(o.data.status)))},[o.data,n,a]),j.useEffect(()=>{o.isError&&t&&r(void 0)},[o.isError,t,r]),o},w3=20,mp=(e,t)=>{const n=t?.requireRegisteredChat??!0,r=$e(),a=r.config.messagesPageSize??w3,i=fe(l=>l.setChatMessages),o=fe(l=>!!(e&&l.chats[e])),s=xt.useInfiniteQuery({queryKey:["mp-agents","messages",e,a],queryFn:async({pageParam:l})=>{if(!e||!r.transport.getMessages)throw new Error("No chat or transport");return await r.transport.getMessages(e,{limit:a,...l?{before:l}:{}})},initialPageParam:void 0,getNextPageParam:l=>l.hasMore&&l.messages.length>0?l.messages[0]?.id:void 0,enabled:(t?.enabled??!0)&&!!e&&!!r.transport.getMessages&&(!n||o),retry:!1});return j.useEffect(()=>{if(!e||!s.data?.pages)return;const u=s.data.pages.slice().reverse().flatMap(p=>p.messages),d=new Set(u.map(p=>p.id));i(e,p=>{const h=p.filter(m=>!d.has(m.id));return[...u,...h]})},[e,s.data,i]),s},E3=()=>{const e=$e(),t=e.config.user?.id??jr(),n=fe(u=>u.activeChatId),r=fe(u=>u.removeChat),a=fe(u=>u.setActiveChat),[i,o]=j.useState(new Set),s=j.useCallback(async u=>{o(d=>new Set(d).add(u));try{await e.transport.deleteChat(u),r(u),n===u&&a(void 0),e.queryClient.invalidateQueries({queryKey:["mp-agents","chats",t]})}finally{o(d=>{const p=new Set(d);return p.delete(u),p})}},[n,r,e.queryClient,e.transport,a,t]),l=j.useCallback(u=>i.has(u),[i]);return{deleteChat:s,isDeleting:l}},m7e=e=>{if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},f7e=e=>{const t=e.output??e.input??{},n=Array.isArray(t.fields)?t.fields.map(r=>({name:typeof r?.name=="string"?r.name:"",label:typeof r?.label=="string"?r.label:void 0,value:m7e(r?.value),inputType:typeof r?.inputType=="string"?r.inputType:void 0,options:Array.isArray(r?.options)?r.options:void 0})).filter(r=>r.name.length>0):[];return{formId:typeof t.formId=="string"?t.formId:void 0,formName:typeof t.formName=="string"?t.formName:void 0,fields:n,notes:typeof t.notes=="string"?t.notes:void 0}},M3=({call:e,chatId:t,applyAllButtonText:n,showStatus:r=!0})=>{const a=$e(),i=k3(Xd),o=Wt(),s=j.useMemo(()=>f7e(e),[e]),[l,u]=j.useState(new Set),d=j.useMemo(()=>{const E=(e.output??{})?._mp?.lastAction,D=typeof E?.action=="string"?E.action:void 0,P=typeof E?.at=="string"?E.at:void 0;return{action:D,at:P}},[e.output]),p=j.useMemo(()=>d.action==="apply",[d.action]),h=j.useMemo(()=>d.action==="reject",[d.action]),m=j.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!s.formId&&s.fields.length>0&&!p,[e.status,s.formId,s.fields.length,p]);j.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!s.formId&&s.fields.length>0&&!p&&!h,[e.status,s.formId,s.fields.length,p,h]);const f=j.useCallback(async M=>{s.formId&&a.transport.recordToolCallAction&&await a.transport.recordToolCallAction(t,{toolCallId:e.id,action:M.action,data:{formId:s.formId,formName:s.formName,fields:M.fields},systemMessage:M.action==="apply"?`Applied ${M.fields.length} field(s) to ${s.formName??s.formId}.`:`Rejected ${s.formName??s.formId} suggestion.`},{excludeSocketId:!1})},[s.formId,s.formName,t,e.id,a.transport]),g=j.useCallback(async M=>{if(s.formId){i({fields:M,chatId:t,toolCallId:e.id,formId:s.formId,...s.formName?{formName:s.formName}:{}});try{await f({action:"apply",fields:M})}catch{return}}},[s.formId,s.formName,t,e.id,i,f]);j.useCallback(async()=>{if(s.formId)try{await f({action:"reject",fields:s.fields})}catch{return}},[s.formId,s.fields,f]);const _=j.useCallback(M=>{u(N=>{if(N.has(M)){if(N.size===1)return new Set;const E=new Set(N);return E.delete(M),E}else{const E=new Set(N);return E.add(M),E}})},[]),k=j.useCallback(M=>{g([M])},[g]),b=j.useCallback(()=>{g(s.fields)},[g,s.fields]),x=s.formName?`${o.formProposalHeaderPrefix} ${s.formName}`:`${o.formProposalHeaderPrefix} ${s.formId}`;return e.status===exports.AgentToolCallStatus.Failed&&e.error?w.jsx("div",{className:"mp-agent-tool-body",children:w.jsx("div",{className:"mp-agent-tool-simple-message",children:o.formProposalFailed})}):e.status!==exports.AgentToolCallStatus.Succeeded?w.jsx("div",{className:"mp-agent-tool-simple-message",children:o.formProposalPreparing}):!s.formId||s.fields.length===0?w.jsx("div",{className:"mp-agent-tool-simple-message",children:o.formProposalNone}):w.jsxs("div",{className:"mp-agent-tool-body",children:[w.jsx("div",{className:"mp-agent-tool-simple-message",children:x}),s.notes?w.jsx("div",{className:"mp-agent-tool-simple-message",children:s.notes}):null,w.jsx("div",{className:"mp-agent-form-proposal-fields",children:s.fields.map(M=>w.jsx(s3,{field:M,isExpanded:l.has(M.name),canApply:m,onToggleExpand:_,onApply:k},M.name))}),w.jsxs("div",{className:"mp-agent-form-proposal-actions",children:[r&&(p||h)&&w.jsxs("div",{className:"mp-agent-form-proposal-status",children:[w.jsx("span",{className:`mp-agent-form-proposal-badge ${p?"is-applied":"is-rejected"}`,children:p?o.formProposalApplied:o.formProposalRejected}),d.at?w.jsx("span",{className:"mp-agent-form-proposal-status-time",children:w.jsx(Qve,{date:d.at})}):null]}),w.jsxs("button",{type:"button",onClick:b,className:"mp-agent-form-proposal-apply-all",children:[w.jsx(R5,{size:14})," ",n||o.formProposalApplyAll]})]})]})},g7e=e=>{const t=e.output??{},n=Array.isArray(t.images)?t.images.map(r=>({attachmentId:typeof r?.attachmentId=="string"?r.attachmentId:"",name:typeof r?.name=="string"?r.name:"generated-image",mimeType:typeof r?.mimeType=="string"?r.mimeType:void 0,url:typeof r?.url=="string"?r.url:void 0,s3Key:typeof r?.s3Key=="string"?r.s3Key:void 0,size:typeof r?.size=="number"?r.size:void 0})).filter(r=>r.attachmentId.length>0):[];return{model:typeof t.model=="string"?t.model:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0,error:typeof t.error=="string"?t.error:void 0,images:n}},S3=({call:e})=>{const t=$e(),n=Wt(),r=j.useMemo(()=>g7e(e),[e]),[a,i]=j.useState({}),o=j.useRef(new Set),s=j.useCallback(async u=>{if(!u.s3Key||o.current.has(u.attachmentId))return;o.current.add(u.attachmentId);const d=t.config.transport;if(d.mode==="proxy")try{const p={"Content-Type":"application/json"};d.headers?Object.assign(p,d.headers):d.apiKey&&(p.Authorization=`Bearer ${d.apiKey}`);const h=await fetch(`${d.baseUrl}/files/download/presigned`,{method:"POST",headers:p,body:JSON.stringify({s3Key:u.s3Key})});if(!h.ok)return;const m=await h.json();typeof m?.url=="string"&&i(f=>({...f,[u.attachmentId]:m.url}))}catch{}},[t.config.transport]);j.useEffect(()=>{r.images.filter(u=>!u.url).forEach(u=>void s(u))},[r.images,s]);const l=j.useCallback(async(u,d)=>{try{const h=await(await fetch(d)).blob(),m=URL.createObjectURL(h),f=document.createElement("a");f.href=m,f.download=u.name,f.click(),URL.revokeObjectURL(m)}catch{window.open(d,"_blank","noreferrer")}},[]);return e.status===exports.AgentToolCallStatus.Failed||r.error?w.jsxs("div",{className:"mp-agent-tool-body",children:[w.jsx("div",{className:"mp-agent-tool-simple-message",children:n.imageGenerationFailed}),r.error?w.jsx("div",{className:"mp-agent-tool-error",children:r.error}):null]}):e.status!==exports.AgentToolCallStatus.Succeeded?w.jsx("div",{className:"mp-agent-tool-body mp-agent-image-tool",children:w.jsxs("div",{className:"mp-agent-image-tool-loading",children:[w.jsx(ad,{size:16}),w.jsx("span",{children:n.imageGenerationGenerating})]})}):r.images.length?w.jsx("div",{className:"mp-agent-tool-body mp-agent-image-tool",children:w.jsx("div",{className:"mp-agent-image-tool-grid",children:r.images.map(u=>{const d=a[u.attachmentId]??u.url;return w.jsxs("figure",{className:"mp-agent-image-tool-item",children:[d?w.jsx("img",{src:d,alt:r.prompt||u.name,title:r.prompt,loading:"lazy",onError:()=>void s(u)}):w.jsx("div",{className:"mp-agent-image-tool-placeholder",children:w.jsx(ad,{size:20})}),d?w.jsxs("figcaption",{className:"mp-agent-image-tool-actions",children:[w.jsx("a",{href:d,target:"_blank",rel:"noreferrer",title:n.imageGenerationOpen,children:w.jsx(M5,{size:14})}),w.jsx("button",{type:"button",onClick:()=>void l(u,d),title:n.imageGenerationDownload,children:w.jsx(E5,{size:14})})]}):null]},u.attachmentId)})})}):w.jsx("div",{className:"mp-agent-tool-simple-message",children:n.imageGenerationNone})},yo=e=>{const{id:t,name:n,url:r,capturedAt:a,source:i,security:o,target:s,kind:l,...u}=e,d=r??i?.url,p=i||d?{...i??{},...d?{url:d}:{}}:void 0,h=l==="webSnippet"||l==="formSnapshot"||l==="formField"?!0:void 0,m=o||(h!==void 0?{containsPII:h,redactionsApplied:[]}:void 0),f=typeof n=="string"&&n.trim().length?n.trim():l==="webSnippet"?u?.title?`Selection: ${String(u.title)}`:"Selection":l==="formField"?"Form field":l==="formSnapshot"?"Form snapshot":"Context";return{id:t??vt.nanoid(),type:exports.AgentAttachmentType.Context,name:f,...d?{url:d}:{},metadata:{schemaVersion:1,kind:l,capturedAt:a??new Date().toISOString(),...p?{source:p}:{},...m?{security:m}:{},...s?{target:s}:{},...u}}},y7e=e=>{try{const t=new URL(e),n=`${t.searchParams.toString()} ${t.hash}`.toLowerCase();return/(token|key|auth|session|code|password|secret|email)/.test(n)}catch{return/(token|key|auth|session|code|password|secret|email)/.test(e.toLowerCase())}},N3=(e={})=>{if(typeof window>"u")return;const t=e.url??window.location?.href;if(!t)return;const n=e.includeTitle!==!1,r=e.includeReferrer!==!1,a=e.includeViewport!==!1,i=e.includeUserAgent===!0,o=n&&typeof document<"u"?document.title:void 0,s=r&&typeof document<"u"?document.referrer:void 0;let l;try{l=new URL(t)}catch{}const u={url:t,...l?{origin:l.origin,pathname:l.pathname,search:l.search,hash:l.hash}:{},...n&&o?{title:o}:{},...r&&s?{referrer:s}:{},...i&&typeof navigator<"u"?{userAgent:navigator.userAgent}:{},...typeof navigator<"u"&&navigator.language?{language:navigator.language}:{},...typeof Intl<"u"?{timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:Intl.DateTimeFormat().resolvedOptions().locale}:{},...a&&typeof window<"u"?{viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}:{},...e.extra?e.extra:{}},d=y7e(t)?!0:void 0;return yo({kind:"pageContext",name:e.name??"Page context",url:t,title:o,data:u,summary:l?`${l.pathname}${l.search}${l.hash}`:void 0,source:{app:"browser",url:t,route:l?`${l.pathname}${l.search}${l.hash}`:void 0},...d?{security:{containsPII:!0,redactionsApplied:[]}}:{}})},A3=()=>{if(typeof window>"u"||typeof document>"u")return;const e=window.getSelection?.();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),n=e.toString().trim();if(!n)return;const r=(t.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement)??void 0,a=r?b7e(r):void 0,i=r?.textContent??"",o=i.indexOf(n),s=o>=0?o:void 0,l=o>=0?o+n.length:void 0,u=o>=0?i.slice(Math.max(0,o-80),o).trim():void 0,d=o>=0?i.slice(o+n.length,o+n.length+80).trim():void 0;return{selectedText:n,target:{type:"text",exact:n,...u?{prefix:u}:{},...d?{suffix:d}:{},...a?{domPath:a}:{},...s!==void 0?{startOffset:s}:{},...l!==void 0?{endOffset:l}:{}}}},b7e=e=>{if(e.id)return`#${k2(e.id)}`;const t=[];let n=e;for(;n&&n.nodeType===1&&t.length<6;){const r=n.tagName.toLowerCase();if(n.id){t.unshift(`#${k2(n.id)}`);break}const a=n.parentElement;if(!a){t.unshift(r);break}const o=Array.from(a.children).filter(s=>s.tagName===n.tagName).indexOf(n)+1;t.unshift(`${r}:nth-of-type(${o})`),n=a}return t.join(" > ")},k2=e=>e.replace(/[^a-zA-Z0-9_-]/g,"\\$&");class T3{constructor(t){this.rawConfig=t,this.events=new EventTarget;const n=rd.parse(t);this.config={...n,tools:t.tools,pageContext:t.pageContext?{...n.pageContext,...t.pageContext}:n.pageContext,chatMetadata:t.chatMetadata?{...n.chatMetadata,...t.chatMetadata}:n.chatMetadata,translations:t.translations?{...Ci,...t.translations}:Ci,transport:t.transport.onError?{...n.transport,onError:t.transport.onError}:n.transport,toolRenderers:t.toolRenderers,planExtractor:t.planExtractor,contextAttachmentIcons:t.contextAttachmentIcons,composerAttachmentActions:t.composerAttachmentActions},this.transport=this.createTransport(this.config.transport),this.tools=new o_(this.config.tools),this.tools.bindInvoke(this.invokeTool.bind(this)),this.configureTransportAfterCreate(this.transport),Object.entries(t.toolRenderers??{}).forEach(([r,a])=>{a&&this.toolRendererMap.set(r,a)}),this.toolRendererMap.has("propose_form_values")||this.toolRendererMap.set("propose_form_values",M3),this.toolRendererMap.has("image_generation")||this.toolRendererMap.set("image_generation",S3),this.queryClient=new xt.QueryClient({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}})}config;transport;tools;queryClient;events;socketClient=null;toolRendererMap=new Map;storeRef;pageContextProviders=new Set;chatMetadataProviders=new Set;createTransport(t){return t.mode==="proxy"?new Lr(t):new jo(t)}configureTransportAfterCreate(t){this.config.transport.mode==="direct"&&t instanceof jo&&(t.setToolRegistry(this.tools),t.setContextKeys(this.config.contextKeys.map(n=>({key:n.key,tools:n.tools}))),this.config.models&&t.setModels(this.config.models),t.setUntitledChatText(this.config.translations.untitledChat))}updateTransportConfig(t){const n=rd.parse({...this.rawConfig,transport:t}),r=this.config.transport,a=this.transport;this.rawConfig={...this.rawConfig,transport:t},this.config.transport=t.onError?{...n.transport,onError:t.onError}:n.transport;const i=this.config.transport.mode;if(r.mode!==i){a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}));return}i==="proxy"&&a instanceof Lr?a.updateConfig(this.config.transport):i==="direct"&&a instanceof jo?(a.updateConfig(this.config.transport),this.configureTransportAfterCreate(a)):(a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport)),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}))}setTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:t})}mergeTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:{...n.headers??{},...t}})}removeTransportHeaders(t){const n=this.config.transport;if(!n.headers||t.length===0)return;const r={...n.headers};for(const a of t)delete r[a];this.updateTransportConfig({...n,headers:Object.keys(r).length?r:void 0})}get defaultContextKey(){return this.config.defaultContextKey??this.config.contextKeys[0]?.key}get store(){if(!this.storeRef)throw new Error("AgentRuntime store has not been attached yet");return this.storeRef}attachStore(t){this.storeRef=t}get socket(){return this.socketClient}setSocketClient(t){this.socketClient!==t&&(this.socketClient=t,this.events.dispatchEvent(new CustomEvent("runtime:socket-changed",{detail:{socket:t}})))}registerTool(t){this.tools.register(t)}registerToolRenderer(t,n){this.toolRendererMap.set(t,n)}registerPageContextProvider(t){return this.pageContextProviders.add(t),()=>{this.pageContextProviders.delete(t)}}registerChatMetadataProvider(t){return this.chatMetadataProviders.add(t),()=>{this.chatMetadataProviders.delete(t)}}getChatMetadata(t){const n={};let r=!1;const a=o=>{o&&typeof o=="object"&&(Object.assign(n,o),r=!0)},i=this.config.chatMetadata?.getMetadata;if(i)try{a(i(t))}catch{}for(const o of this.chatMetadataProviders)try{a(o(t))}catch{}return r?n:void 0}getPageContextInput(){if(typeof window>"u")return{};const t=window.location?.href;let n;if(t)try{const a=new URL(t);n=`${a.pathname}${a.search}${a.hash}`}catch{}const r=typeof document<"u"?document.title:void 0;return{url:t,route:n,title:r}}getPageContextData(t){const n=t??this.getPageContextInput(),r={};let a=!1;const i=this.config.pageContext?.getData;if(i)try{const o=i(n);o&&typeof o=="object"&&(Object.assign(r,o),a=!0)}catch{}for(const o of this.pageContextProviders)try{const s=o(n);s&&typeof s=="object"&&(Object.assign(r,s),a=!0)}catch{}return a?r:void 0}buildPageContextAttachment(){const t=this.config.pageContext,n=this.getPageContextData();return N3({...t?.includeUserAgent!==void 0?{includeUserAgent:t.includeUserAgent}:{},...t?.includeReferrer!==void 0?{includeReferrer:t.includeReferrer}:{},...t?.includeViewport!==void 0?{includeViewport:t.includeViewport}:{},...t?.includeTitle!==void 0?{includeTitle:t.includeTitle}:{},...t?.name?{name:t.name}:{},...n?{extra:n}:{}})}getToolRenderer(t){return this.toolRendererMap.get(t.name)}ensureStore(t){if(!this.storeRef)throw new Error(`Cannot ${t} before AgentRuntime is mounted`);return this.storeRef}resolveChatId(t){const r=this.ensureStore("invoke tools").getState(),a=t?.chatId??r.activeChatId;if(!a||!r.chats[a])throw new Error("Tool invocation requires an active chat. Select or create a chat first.");return a}buildToolContext(t){const n=this.ensureStore("create tool context");return{chatId:t,agentId:this.config.appId,workspaceId:this.config.workspaceId,appendSystemMessage:r=>{n.getState().appendSystemMessage(t,r)}}}writeToolCall(t,n){this.ensureStore("write tool call").getState().upsertToolCall(t,{...n})}async invokeTool(t,n={},r){const a=this.resolveChatId(r),i={id:vt.nanoid(),name:t,input:n,status:exports.AgentToolCallStatus.Running};this.writeToolCall(a,i);const o=this.buildToolContext(a);try{const s=await this.tools.execute(t,n,o,i);return this.writeToolCall(a,s),s}catch(s){const l={...i,status:exports.AgentToolCallStatus.Failed,error:s instanceof Error?s.message:"Unknown tool error"};throw this.writeToolCall(a,l),s}}}const k7e={background:"#050505",surface:"#0f0f11",text:"#f7f7f7",subtext:"#8f9baa",border:"#1f2229",accent:"#6c63ff",accentSoft:"rgba(108, 99, 255, 0.14)",warning:"#ffb347",danger:"#ff5f56",fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',radius:"12px",fontSize:"14px",colorMode:"light"},C3=e=>({...k7e,...e}),R3=j.createContext(C3()),v7e=e=>({"--mp-agents-bg":e.background,"--mp-agents-surface":e.surface,"--mp-agents-text":e.text,"--mp-agents-subtext":e.subtext,"--mp-agents-border":e.border,"--mp-agents-accent":e.accent,"--mp-agents-accent-soft":e.accentSoft,"--mp-agents-warning":e.warning,"--mp-agents-danger":e.danger,"--mp-agents-radius":e.radius,"--mp-agents-font-size":e.fontSize}),I3=({value:e,children:t})=>{const n=j.useMemo(()=>C3(e),[e]);return w.jsxs(R3.Provider,{value:n,children:[w.jsx("style",{children:`:root {
|
|
8290
|
+
*/var h6e=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ld=h6e.join(","),P5=typeof Element>"u",fa=P5?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,zi=!P5&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},$i=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=a===""||a==="true",o=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):$i(t.parentNode));return o},m6e=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},f6e=function(t,n,r){if($i(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(ld));return n&&fa.call(t,ld)&&a.unshift(t),a=a.filter(r),a},cd=function(t,n,r){for(var a=[],i=Array.from(t);i.length;){var o=i.shift();if(!$i(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,u=cd(l,!0,r);r.flatten?a.push.apply(a,u):a.push({scopeParent:o,candidates:u})}else{var d=fa.call(o,ld);d&&r.filter(o)&&(n||!t.includes(o))&&a.push(o);var p=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!$i(p,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(p&&h){var m=cd(p===!0?o.children:p.children,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:o,candidates:m})}else i.unshift.apply(i,o.children)}}return a},q5=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},B5=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||m6e(t))&&!q5(t)?0:t.tabIndex},g6e=function(t,n){var r=B5(t);return r<0&&n&&!q5(t)?0:r},y6e=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},U5=function(t){return t.tagName==="INPUT"},b6e=function(t){return U5(t)&&t.type==="hidden"},k6e=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},v6e=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},_6e=function(t){if(!t.name)return!0;var n=t.form||zi(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=v6e(a,t.form);return!i||i===t},x6e=function(t){return U5(t)&&t.type==="radio"},w6e=function(t){return x6e(t)&&!_6e(t)},E6e=function(t){var n,r=t&&zi(t),a=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var o,s,l;for(i=!!((o=a)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(a)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&a;){var u,d,p;r=zi(a),a=(u=r)===null||u===void 0?void 0:u.host,i=!!((d=a)!==null&&d!==void 0&&(p=d.ownerDocument)!==null&&p!==void 0&&p.contains(a))}}return i},Yh=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},M6e=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}var o=getComputedStyle(t),s=o.visibility;if(s==="hidden"||s==="collapse")return!0;var l=fa.call(t,"details>summary:first-of-type"),u=l?t.parentElement:t;if(fa.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var d=t;t;){var p=t.parentElement,h=zi(t);if(p&&!p.shadowRoot&&a(p)===!0)return Yh(t);t.assignedSlot?t=t.assignedSlot:!p&&h!==t.ownerDocument?t=h.host:t=p}t=d}if(E6e(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Yh(t);return!1},S6e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var a=n.children.item(r);if(a.tagName==="LEGEND")return fa.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},N6e=function(t,n){return!(n.disabled||b6e(n)||M6e(n,t)||k6e(n)||S6e(n))},Zh=function(t,n){return!(w6e(n)||B5(n)<0||!N6e(t,n))},A6e=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},H5=function(t){var n=[],r=[];return t.forEach(function(a,i){var o=!!a.scopeParent,s=o?a.scopeParent:a,l=g6e(s,o),u=o?H5(a.candidates):s;l===0?o?n.push.apply(n,u):n.push(s):r.push({documentOrder:i,tabIndex:l,item:a,isScope:o,content:u})}),r.sort(y6e).reduce(function(a,i){return i.isScope?a.push.apply(a,i.content):a.push(i.content),a},[]).concat(n)},j5=function(t,n){n=n||{};var r;return n.getShadowRoot?r=cd([t],n.includeContainer,{filter:Zh.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:A6e}):r=f6e(t,n.includeContainer,Zh.bind(null,n)),H5(r)};function V5(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function G5(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function W5(){return/apple/i.test(navigator.vendor)}function ud(){const e=/android/i;return e.test(V5())||e.test(G5())}function T6e(){return V5().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function K5(){return G5().includes("jsdom/")}const Xh="data-floating-ui-focusable",C6e="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Go="ArrowLeft",Wo="ArrowRight",R6e="ArrowUp",I6e="ArrowDown";function ga(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function yr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&id(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Tr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ko(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function O6e(e){return e.matches("html,body")}function cn(e){return e?.ownerDocument||document}function ep(e){return $t(e)&&e.matches(C6e)}function L6e(e){return e?e.getAttribute("role")==="combobox"&&ep(e):!1}function D6e(e){if(!e||K5())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Y5(e){return e?e.hasAttribute(Xh)?e:e.querySelector("["+Xh+"]")||e:null}function la(e,t,n){return n===void 0&&(n=!0),e.filter(a=>{var i;return a.parentId===t&&(!n||((i=a.context)==null?void 0:i.open))}).flatMap(a=>[a,...la(e,a.id,n)])}function z6e(e,t){let n,r=-1;function a(i,o){o>r&&(n=i,r=o),la(e,i).forEach(l=>{a(l.id,o+1)})}return a(t,0),e.find(i=>i.id===n)}function Xt(e){e.preventDefault(),e.stopPropagation()}function $6e(e){return"nativeEvent"in e}function F6e(e){return e.mozInputSource===0&&e.isTrusted?!0:ud()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function P6e(e){return K5()?!1:!ud()&&e.width===0&&e.height===0||ud()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ya(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var q6e=typeof document<"u",B6e=function(){},yt=q6e?j.useLayoutEffect:B6e;const U6e={...te};function An(e){const t=te.useRef(e);return yt(()=>{t.current=e}),t}const H6e=U6e.useInsertionEffect,j6e=H6e||(e=>e());function Vt(e){const t=te.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return j6e(()=>{t.current=e}),te.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function ja(e,t,n){return Math.floor(e/t)!==n}function ca(e,t){return t<0||t>=e.current.length}function Yo(e,t){return kt(e,{disabledIndices:t})}function Qh(e,t){return kt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function kt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:i=1}=t===void 0?{}:t,o=n;do o+=r?-i:i;while(o>=0&&o<=e.current.length-1&&bi(e,o,a));return o}function V6e(e,t){let{event:n,orientation:r,loop:a,rtl:i,cols:o,disabledIndices:s,minIndex:l,maxIndex:u,prevIndex:d,stopEvent:p=!1}=t,h=d;if(n.key===R6e){if(p&&Xt(n),d===-1)h=u;else if(h=kt(e,{startingIndex:h,amount:o,decrement:!0,disabledIndices:s}),a&&(d-o<l||h<0)){const m=d%o,f=u%o,g=u-(f-m);f===m?h=u:h=f>m?g:g-o}ca(e,h)&&(h=d)}if(n.key===I6e&&(p&&Xt(n),d===-1?h=l:(h=kt(e,{startingIndex:d,amount:o,disabledIndices:s}),a&&d+o>u&&(h=kt(e,{startingIndex:d%o-o,amount:o,disabledIndices:s}))),ca(e,h)&&(h=d)),r==="both"){const m=Dr(d/o);n.key===(i?Go:Wo)&&(p&&Xt(n),d%o!==o-1?(h=kt(e,{startingIndex:d,disabledIndices:s}),a&&ja(h,o,m)&&(h=kt(e,{startingIndex:d-d%o-1,disabledIndices:s}))):a&&(h=kt(e,{startingIndex:d-d%o-1,disabledIndices:s})),ja(h,o,m)&&(h=d)),n.key===(i?Wo:Go)&&(p&&Xt(n),d%o!==0?(h=kt(e,{startingIndex:d,decrement:!0,disabledIndices:s}),a&&ja(h,o,m)&&(h=kt(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s}))):a&&(h=kt(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:s})),ja(h,o,m)&&(h=d));const f=Dr(u/o)===m;ca(e,h)&&(a&&f?h=n.key===(i?Wo:Go)?u:kt(e,{startingIndex:d-d%o-1,disabledIndices:s}):h=d)}return h}function G6e(e,t,n){const r=[];let a=0;return e.forEach((i,o)=>{let{width:s,height:l}=i;if(s>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+o+" is greater than grid columns");let u=!1;for(n&&(a=0);!u;){const d=[];for(let p=0;p<s;p++)for(let h=0;h<l;h++)d.push(a+p+h*t);a%t+s<=t&&d.every(p=>r[p]==null)?(d.forEach(p=>{r[p]=o}),u=!0):a++}}),[...r]}function W6e(e,t,n,r,a){if(e===-1)return-1;const i=n.indexOf(e),o=t[e];switch(a){case"tl":return i;case"tr":return o?i+o.width-1:i;case"bl":return o?i+(o.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function K6e(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function bi(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}const Z5=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function X5(e,t){const n=j5(e,Z5()),r=n.length;if(r===0)return;const a=ga(cn(e)),i=n.indexOf(a),o=i===-1?t===1?0:r-1:i+t;return n[o]}function Y6e(e){return X5(cn(e).body,1)||e}function Z6e(e){return X5(cn(e).body,-1)||e}function Zo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!yr(n,r)}function X6e(e){j5(e,Z5()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Jh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function e2(e,t,n){let{reference:r,floating:a}=e;const i=Gn(t),o=F5(t),s=$5(o),l=Pr(t),u=i==="y",d=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,h=r[s]/2-a[s]/2;let m;switch(l){case"top":m={x:d,y:r.y-a.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-a.width,y:p};break;default:m={x:r.x,y:r.y}}const f=uo(t);return f&&(m[o]+=h*(f==="end"?1:-1)*(n&&u?-1:1)),m}async function Q6e(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:s,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=co(t,e),f=p6e(m),_=s[h?p==="floating"?"reference":"floating":p],k=Di(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(_)))==null||n?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:l})),b=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),M=await(i.isElement==null?void 0:i.isElement(x))&&await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1},N=Di(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:x,strategy:l}):b);return{top:(k.top-N.top+f.top)/M.y,bottom:(N.bottom-k.bottom+f.bottom)/M.y,left:(k.left-N.left+f.left)/M.x,right:(N.right-k.right+f.right)/M.x}}const J6e=50,e8e=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Q6e},l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=e2(u,r,l),h=r,m=0;const f={};for(let g=0;g<i.length;g++){const _=i[g];if(!_)continue;const{name:k,fn:b}=_,{x,y:M,data:N,reset:E}=await b({x:d,y:p,initialPlacement:r,placement:h,strategy:a,middlewareData:f,rects:u,platform:s,elements:{reference:e,floating:t}});d=x??d,p=M??p,f[k]={...f[k],...N},E&&m<J6e&&(m++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):E.rects),{x:d,y:p}=e2(u,h,l)),g=-1)}return{x:d,y:p,placement:h,strategy:a,middlewareData:f}},t8e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,..._}=co(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const k=Pr(a),b=Gn(s),x=Pr(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(u.floating)),N=h||(x||!g?[Li(s)]:o6e(s)),E=f!=="none";!h&&E&&N.push(...u6e(s,g,f,M));const D=[s,...N],P=await l.detectOverflow(t,_),C=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&C.push(P[k]),p){const K=i6e(a,o,M);C.push(P[K[0]],P[K[1]])}if(I=[...I,{placement:a,overflows:C}],!C.every(K=>K<=0)){var q,Z;const K=(((q=i.flip)==null?void 0:q.index)||0)+1,R=D[K];if(R&&(!(p==="alignment"?b!==Gn(R):!1)||I.every(z=>Gn(z.placement)===b?z.overflows[0]>0:!0)))return{data:{index:K,overflows:I},reset:{placement:R}};let H=(Z=I.filter(G=>G.overflows[0]<=0).sort((G,z)=>G.overflows[1]-z.overflows[1])[0])==null?void 0:Z.placement;if(!H)switch(m){case"bestFit":{var X;const G=(X=I.filter(z=>{if(E){const V=Gn(z.placement);return V===b||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,A)=>V+A,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:X[0];G&&(H=G);break}case"initialPlacement":H=s;break}if(a!==H)return{reset:{placement:H}}}return{}}}},n8e=new Set(["left","top"]);async function r8e(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=Pr(n),s=uo(n),l=Gn(n)==="y",u=n8e.has(o)?-1:1,d=i&&l?-1:1,p=co(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return s&&typeof f=="number"&&(m=s==="end"?f*-1:f),l?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const a8e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await r8e(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},i8e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:M}=b;return{x,y:M}}},...u}=co(e,t),d={x:n,y:r},p=await i.detectOverflow(t,u),h=Gn(a),m=z5(h);let f=d[m],g=d[h];const _=(b,x)=>a6e(x+p[b==="y"?"top":"left"],x,x-p[b==="y"?"bottom":"right"]);o&&(f=_(m,f)),s&&(g=_(h,g));const k=l.fn({...t,[m]:f,[h]:g});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[m]:o,[h]:s}}}}}};function Q5(e){const t=pn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=$t(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,s=Oi(n)!==i||Oi(r)!==o;return s&&(n=i,r=o),{width:n,height:r,$:s}}function tp(e){return et(e)?e:e.contextElement}function $r(e){const t=tp(e);if(!$t(t))return Rn(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=Q5(t);let o=(i?Oi(n.width):n.width)/r,s=(i?Oi(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const o8e=Rn(0);function J5(e){const t=Ct(e);return!so()||!t.visualViewport?o8e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s8e(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ct(e)}function br(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=tp(e);let o=Rn(1);t&&(r?et(r)&&(o=$r(r)):o=$r(e));const s=s8e(i,n,r)?J5(i):Rn(0);let l=(a.left+s.x)/o.x,u=(a.top+s.y)/o.y,d=a.width/o.x,p=a.height/o.y;if(i&&r){const h=Ct(i),m=et(r)?Ct(r):r;let f=h,g=od(f);for(;g&&m!==f;){const _=$r(g),k=g.getBoundingClientRect(),b=pn(g),x=k.left+(g.clientLeft+parseFloat(b.paddingLeft))*_.x,M=k.top+(g.clientTop+parseFloat(b.paddingTop))*_.y;l*=_.x,u*=_.y,d*=_.x,p*=_.y,l+=x,u+=M,f=Ct(g),g=od(f)}}return Di({width:d,height:p,x:l,y:u})}function po(e,t){const n=lo(e).scrollLeft;return t?t.left+n:br($n(e)).left+n}function e3(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-po(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function l8e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=$n(r),s=t?oo(t.floating):!1;if(r===o||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Rn(1);const d=Rn(0),p=$t(r);if((p||!i)&&((Hr(r)!=="body"||io(o))&&(l=lo(r)),p)){const m=br(r);u=$r(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=o&&!p&&!i?e3(o,l):Rn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-l.scrollTop*u.y+d.y+h.y}}function c8e(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function u8e(e){const t=lo(e),n=e.ownerDocument.body,r=mr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=mr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+po(e);const o=-t.scrollTop;return pn(n).direction==="rtl"&&(i+=mr(e.clientWidth,n.clientWidth)-r),{width:r,height:a,x:i,y:o}}const d8e=25;function p8e(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",a=Ct(e),i=$n(e),o=a.visualViewport;let s=i.clientWidth,l=i.clientHeight,u=0,d=0;if(o){const h=!so()||t==="fixed";r?h||(u=-o.offsetLeft,d=-o.offsetTop):(s=o.width,l=o.height,h&&(u=o.offsetLeft,d=o.offsetTop))}if(po(i)<=0){const h=i.ownerDocument,m=h.body,f=getComputedStyle(m),g=h.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,_=Math.abs(i.clientWidth-m.clientWidth-g),k=getComputedStyle(i).scrollbarGutter==="stable both-edges"?_/2:_;k<=d8e&&(s-=k)}return{width:s,height:l,x:u,y:d}}function h8e(e,t){const n=br(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=$r(e),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,u=r*i.y;return{width:o,height:s,x:l,y:u}}function t2(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=p8e(e,n,t);else if(t==="document")r=u8e($n(e));else if(et(t))r=h8e(t,n);else{const a=J5(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Di(r)}function m8e(e,t){const n=t.get(e);if(n)return n;let r=Zn(e,[],!1).filter(s=>et(s)&&Hr(s)!=="body"),a=null;const i=pn(e).position==="fixed";let o=i?Qn(e):e;for(;et(o)&&!Yn(o);){const s=pn(o),l=Jd(o),u=a?a.position:i?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&s.position==="static")?r=r.filter(p=>p!==o):a=s,o=Qn(o)}return t.set(e,r),r}function f8e(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?oo(t)?[]:m8e(t,this._c):[].concat(n),r],s=t2(t,o[0],a);let l=s.top,u=s.right,d=s.bottom,p=s.left;for(let h=1;h<o.length;h++){const m=t2(t,o[h],a);l=mr(m.top,l),u=Ii(m.right,u),d=Ii(m.bottom,d),p=mr(m.left,p)}return{width:u-p,height:d-l,x:p,y:l}}function g8e(e){const{width:t,height:n}=Q5(e);return{width:t,height:n}}function y8e(e,t,n){const r=$t(t),a=$n(t),i=n==="fixed",o=br(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Rn(0);if((r||!i)&&((Hr(t)!=="body"||io(a))&&(s=lo(t)),r)){const h=br(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}!r&&a&&(l.x=po(a));const u=a&&!r&&!i?e3(a,s):Rn(0),d=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:d,y:p,width:o.width,height:o.height}}function Xo(e){return pn(e).position==="static"}function n2(e,t){if(!$t(e)||pn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $n(e)===n&&(n=n.ownerDocument.body),n}function t3(e,t){const n=Ct(e);if(oo(e))return n;if(!$t(e)){let a=Qn(e);for(;a&&!Yn(a);){if(et(a)&&!Xo(a))return a;a=Qn(a)}return n}let r=n2(e,t);for(;r&&Jve(r)&&Xo(r);)r=n2(r,t);return r&&Yn(r)&&Xo(r)&&!Jd(r)?n:r||n6e(e)||n}const b8e=async function(e){const t=this.getOffsetParent||t3,n=this.getDimensions,r=await n(e.floating);return{reference:y8e(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function k8e(e){return pn(e).direction==="rtl"}const v8e={convertOffsetParentRelativeRectToViewportRelativeRect:l8e,getDocumentElement:$n,getClippingRect:f8e,getOffsetParent:t3,getElementRects:b8e,getClientRects:c8e,getDimensions:g8e,getScale:$r,isElement:et,isRTL:k8e};function n3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _8e(e,t,n){let r=null,a;const i=$n(e);function o(){var d;clearTimeout(a),(d=r)==null||d.disconnect(),r=null}function s(d,p){d===void 0&&(d=!1),p===void 0&&(p=1),o();const h=e.getBoundingClientRect(),{left:m,top:f,width:g,height:_}=h;if(d||t(),!g||!_)return;const k=Dr(f),b=Dr(i.clientWidth-(m+g)),x=Dr(i.clientHeight-(f+_)),M=Dr(m),E={rootMargin:-k+"px "+-b+"px "+-x+"px "+-M+"px",threshold:mr(0,Ii(1,p))||1};let D=!0;function P(C){const I=C[0].intersectionRatio;if(!n3(h,e.getBoundingClientRect()))return s();if(I!==p){if(!D)return s();I?s(!1,I):a=setTimeout(()=>{s(!1,1e-7)},1e3)}D=!1}try{r=new IntersectionObserver(P,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(P,E)}r.observe(e)}const l=Ct(e),u=()=>s(n);return l.addEventListener("resize",u),s(!0),()=>{l.removeEventListener("resize",u),o()}}function np(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=tp(e),d=a||i?[...u?Zn(u):[],...t?Zn(t):[]]:[];d.forEach(k=>{a&&k.addEventListener("scroll",n),i&&k.addEventListener("resize",n)});const p=u&&s?_8e(u,n,i):null;let h=-1,m=null;o&&(m=new ResizeObserver(k=>{let[b]=k;b&&b.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!l&&m.observe(u),t&&m.observe(t));let f,g=l?br(e):null;l&&_();function _(){const k=br(e);g&&!n3(g,k)&&n(),g=k,f=requestAnimationFrame(_)}return n(),()=>{var k;d.forEach(b=>{a&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),p?.(),(k=m)==null||k.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const x8e=a8e,w8e=i8e,E8e=t8e,M8e=(e,t,n)=>{const r=new Map,a=n??{},i={...v8e,...a.platform,_c:r};return e8e(e,t,{...a,platform:i})};var S8e=typeof document<"u",N8e=function(){},ki=S8e?j.useLayoutEffect:N8e;function Fi(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fi(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!Fi(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function r3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function r2(e,t){const n=r3(e);return Math.round(t*n)/n}function Qo(e){const t=te.useRef(e);return ki(()=>{t.current=e}),t}function A8e(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,p]=te.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=te.useState(r);Fi(h,r)||m(r);const[f,g]=te.useState(null),[_,k]=te.useState(null),b=te.useCallback(z=>{z!==E.current&&(E.current=z,g(z))},[]),x=te.useCallback(z=>{z!==D.current&&(D.current=z,k(z))},[]),M=i||f,N=o||_,E=te.useRef(null),D=te.useRef(null),P=te.useRef(d),C=l!=null,I=Qo(l),q=Qo(a),Z=Qo(u),X=te.useCallback(()=>{if(!E.current||!D.current)return;const z={placement:t,strategy:n,middleware:h};q.current&&(z.platform=q.current),M8e(E.current,D.current,z).then(V=>{const A={...V,isPositioned:Z.current!==!1};K.current&&!Fi(P.current,A)&&(P.current=A,h5.flushSync(()=>{p(A)}))})},[h,t,n,q,Z]);ki(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[u]);const K=te.useRef(!1);ki(()=>(K.current=!0,()=>{K.current=!1}),[]),ki(()=>{if(M&&(E.current=M),N&&(D.current=N),M&&N){if(I.current)return I.current(M,N,X);X()}},[M,N,X,I,C]);const R=te.useMemo(()=>({reference:E,floating:D,setReference:b,setFloating:x}),[b,x]),H=te.useMemo(()=>({reference:M,floating:N}),[M,N]),G=te.useMemo(()=>{const z={position:n,left:0,top:0};if(!H.floating)return z;const V=r2(H.floating,d.x),A=r2(H.floating,d.y);return s?{...z,transform:"translate("+V+"px, "+A+"px)",...r3(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:A}},[n,s,H.floating,d.x,d.y]);return te.useMemo(()=>({...d,update:X,refs:R,elements:H,floatingStyles:G}),[d,X,R,H,G])}const rp=(e,t)=>{const n=x8e(e);return{name:n.name,fn:n.fn,options:[e,t]}},ap=(e,t)=>{const n=w8e(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>{const n=E8e(e);return{name:n.name,fn:n.fn,options:[e,t]}},T8e="data-floating-ui-focusable",a2="active",i2="selected",Ta="ArrowLeft",Ca="ArrowRight",a3="ArrowUp",ho="ArrowDown",C8e={...te};let o2=!1,R8e=0;const s2=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+R8e++;function I8e(){const[e,t]=te.useState(()=>o2?s2():void 0);return yt(()=>{e==null&&t(s2())},[]),te.useEffect(()=>{o2=!0},[]),e}const O8e=C8e.useId,op=O8e||I8e;let ba;process.env.NODE_ENV!=="production"&&(ba=new Set);function Jo(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=ba)!=null&&e.has(a))){var i;(i=ba)==null||i.add(a),console.warn(a)}}function L8e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const a="Floating UI: "+n.join(" ");if(!((e=ba)!=null&&e.has(a))){var i;(i=ba)==null||i.add(a),console.error(a)}}function D8e(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const z8e=te.createContext(null),$8e=te.createContext(null),mo=()=>{var e;return((e=te.useContext(z8e))==null?void 0:e.id)||null},fo=()=>te.useContext($8e);function Ra(e){return"data-floating-ui-"+e}function Zt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const l2=Ra("safe-polygon");function es(e,t,n){if(n&&!ya(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function ts(e){return typeof e=="function"?e():e}function F8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:i,elements:o}=e,{enabled:s=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:p=0,move:h=!0}=t,m=fo(),f=mo(),g=An(u),_=An(l),k=An(n),b=An(p),x=te.useRef(),M=te.useRef(-1),N=te.useRef(),E=te.useRef(-1),D=te.useRef(!0),P=te.useRef(!1),C=te.useRef(()=>{}),I=te.useRef(!1),q=Vt(()=>{var G;const z=(G=a.current.openEvent)==null?void 0:G.type;return z?.includes("mouse")&&z!=="mousedown"});te.useEffect(()=>{if(!s)return;function G(z){let{open:V}=z;V||(Zt(M),Zt(E),D.current=!0,I.current=!1)}return i.on("openchange",G),()=>{i.off("openchange",G)}},[s,i]),te.useEffect(()=>{if(!s||!g.current||!n)return;function G(V){q()&&r(!1,V,"hover")}const z=cn(o.floating).documentElement;return z.addEventListener("mouseleave",G),()=>{z.removeEventListener("mouseleave",G)}},[o.floating,n,r,s,g,q]);const Z=te.useCallback(function(G,z,V){z===void 0&&(z=!0),V===void 0&&(V="hover");const A=es(_.current,"close",x.current);A&&!N.current?(Zt(M),M.current=window.setTimeout(()=>r(!1,G,V),A)):z&&(Zt(M),r(!1,G,V))},[_,r]),X=Vt(()=>{C.current(),N.current=void 0}),K=Vt(()=>{if(P.current){const G=cn(o.floating).body;G.style.pointerEvents="",G.removeAttribute(l2),P.current=!1}}),R=Vt(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);te.useEffect(()=>{if(!s)return;function G(ee){if(Zt(M),D.current=!1,d&&!ya(x.current)||ts(b.current)>0&&!es(_.current,"open"))return;const L=es(_.current,"open",x.current);L?M.current=window.setTimeout(()=>{k.current||r(!0,ee,"hover")},L):n||r(!0,ee,"hover")}function z(ee){if(R()){K();return}C.current();const L=cn(o.floating);if(Zt(E),I.current=!1,g.current&&a.current.floatingContext){n||Zt(M),N.current=g.current({...a.current.floatingContext,tree:m,x:ee.clientX,y:ee.clientY,onClose(){K(),X(),R()||Z(ee,!0,"safe-polygon")}});const ye=N.current;L.addEventListener("mousemove",ye),C.current=()=>{L.removeEventListener("mousemove",ye)};return}(x.current==="touch"?!yr(o.floating,ee.relatedTarget):!0)&&Z(ee)}function V(ee){R()||a.current.floatingContext&&(g.current==null||g.current({...a.current.floatingContext,tree:m,x:ee.clientX,y:ee.clientY,onClose(){K(),X(),R()||Z(ee)}})(ee))}function A(){Zt(M)}function Y(ee){R()||Z(ee,!1)}if(et(o.domReference)){const ee=o.domReference,L=o.floating;return n&&ee.addEventListener("mouseleave",V),h&&ee.addEventListener("mousemove",G,{once:!0}),ee.addEventListener("mouseenter",G),ee.addEventListener("mouseleave",z),L&&(L.addEventListener("mouseleave",V),L.addEventListener("mouseenter",A),L.addEventListener("mouseleave",Y)),()=>{n&&ee.removeEventListener("mouseleave",V),h&&ee.removeEventListener("mousemove",G),ee.removeEventListener("mouseenter",G),ee.removeEventListener("mouseleave",z),L&&(L.removeEventListener("mouseleave",V),L.removeEventListener("mouseenter",A),L.removeEventListener("mouseleave",Y))}}},[o,s,e,d,h,Z,X,K,r,n,k,m,_,g,a,R,b]),yt(()=>{var G;if(s&&n&&(G=g.current)!=null&&(G=G.__options)!=null&&G.blockPointerEvents&&q()){P.current=!0;const V=o.floating;if(et(o.domReference)&&V){var z;const A=cn(o.floating).body;A.setAttribute(l2,"");const Y=o.domReference,ee=m==null||(z=m.nodesRef.current.find(L=>L.id===f))==null||(z=z.context)==null?void 0:z.elements.floating;return ee&&(ee.style.pointerEvents=""),A.style.pointerEvents="none",Y.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{A.style.pointerEvents="",Y.style.pointerEvents="",V.style.pointerEvents=""}}}},[s,n,f,o,m,g,q]),yt(()=>{n||(x.current=void 0,I.current=!1,X(),K())},[n,X,K]),te.useEffect(()=>()=>{X(),Zt(M),Zt(E),K()},[s,o.domReference,X,K]);const H=te.useMemo(()=>{function G(z){x.current=z.pointerType}return{onPointerDown:G,onPointerEnter:G,onMouseMove(z){const{nativeEvent:V}=z;function A(){!D.current&&!k.current&&r(!0,V,"hover")}d&&!ya(x.current)||n||ts(b.current)===0||I.current&&z.movementX**2+z.movementY**2<2||(Zt(E),x.current==="touch"?A():(I.current=!0,E.current=window.setTimeout(A,ts(b.current))))}}},[d,r,n,k,b]);return te.useMemo(()=>s?{reference:H}:{},[s,H])}let c2=0;function P8e(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(c2);const i=()=>e?.focus({preventScroll:n});a?i():c2=requestAnimationFrame(i)}const q8e={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},u2=te.forwardRef(function(t,n){const[r,a]=te.useState();yt(()=>{W5()&&a("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ra("focus-guard")]:"",style:q8e};return w.jsx("span",{...t,...i})}),B8e={clipPath:"inset(50%)",position:"fixed",top:0,left:0},i3=te.createContext(null),d2=Ra("portal");function U8e(e){e===void 0&&(e={});const{id:t,root:n}=e,r=op(),a=j8e(),[i,o]=te.useState(null),s=te.useRef(null);return yt(()=>()=>{i?.remove(),queueMicrotask(()=>{s.current=null})},[i]),yt(()=>{if(!r||s.current)return;const l=t?document.getElementById(t):null;if(!l)return;const u=document.createElement("div");u.id=r,u.setAttribute(d2,""),l.appendChild(u),s.current=u,o(u)},[t,r]),yt(()=>{if(n===null||!r||s.current)return;let l=n||a?.portalNode;l&&!Qd(l)&&(l=l.current),l=l||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,l.appendChild(u));const d=document.createElement("div");d.id=r,d.setAttribute(d2,""),l=u||l,l.appendChild(d),s.current=d,o(d)},[t,n,r,a]),i}function H8e(e){const{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,i=U8e({id:n,root:r}),[o,s]=te.useState(null),l=te.useRef(null),u=te.useRef(null),d=te.useRef(null),p=te.useRef(null),h=o?.modal,m=o?.open,f=!!o&&!o.modal&&o.open&&a&&!!(r||i);return te.useEffect(()=>{if(!i||!a||h)return;function g(_){i&&Zo(_)&&(_.type==="focusin"?Jh:X6e)(i)}return i.addEventListener("focusin",g,!0),i.addEventListener("focusout",g,!0),()=>{i.removeEventListener("focusin",g,!0),i.removeEventListener("focusout",g,!0)}},[i,a,h]),te.useEffect(()=>{i&&(m||Jh(i))},[m,i]),w.jsxs(i3.Provider,{value:te.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:p,portalNode:i,setFocusManagerState:s}),[a,i]),children:[f&&i&&w.jsx(u2,{"data-type":"outside",ref:l,onFocus:g=>{if(Zo(g,i)){var _;(_=d.current)==null||_.focus()}else{const k=o?o.domReference:null,b=Z6e(k);b?.focus()}}}),f&&i&&w.jsx("span",{"aria-owns":i.id,style:B8e}),i&&h5.createPortal(t,i),f&&i&&w.jsx(u2,{"data-type":"outside",ref:u,onFocus:g=>{if(Zo(g,i)){var _;(_=p.current)==null||_.focus()}else{const k=o?o.domReference:null,b=Y6e(k);b?.focus(),o?.closeOnFocusOut&&o?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const j8e=()=>te.useContext(i3);function p2(e){return $t(e.target)&&e.target.tagName==="BUTTON"}function V8e(e){return $t(e.target)&&e.target.tagName==="A"}function h2(e){return ep(e)}function o3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:i}}=e,{enabled:o=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:p=!0}=t,h=te.useRef(),m=te.useRef(!1),f=te.useMemo(()=>({onPointerDown(g){h.current=g.pointerType},onMouseDown(g){const _=h.current;g.button===0&&s!=="click"&&(ya(_,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){const _=h.current;if(s==="mousedown"&&h.current){h.current=void 0;return}ya(_,!0)&&u||(n&&l&&(!(a.current.openEvent&&p)||a.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){h.current=void 0,!(g.defaultPrevented||!d||p2(g))&&(g.key===" "&&!h2(i)&&(g.preventDefault(),m.current=!0),!V8e(g)&&g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!d||p2(g)||h2(i)||g.key===" "&&m.current&&(m.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[a,i,s,u,d,r,n,p,l]);return te.useMemo(()=>o?{reference:f}:{},[o,f])}const G8e={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},W8e={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},m2=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function sp(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:i}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:p="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:f}=t,g=fo(),_=Vt(typeof l=="function"?l:()=>!1),k=typeof l=="function"?_:l,b=te.useRef(!1),{escapeKey:x,outsidePress:M}=m2(m),{escapeKey:N,outsidePress:E}=m2(f),D=te.useRef(!1),P=Vt(K=>{var R;if(!n||!o||!s||K.key!=="Escape"||D.current)return;const H=(R=i.current.floatingContext)==null?void 0:R.nodeId,G=g?la(g.nodesRef.current,H):[];if(!x&&(K.stopPropagation(),G.length>0)){let z=!0;if(G.forEach(V=>{var A;if((A=V.context)!=null&&A.open&&!V.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}r(!1,$6e(K)?K.nativeEvent:K,"escape-key")}),C=Vt(K=>{var R;const H=()=>{var G;P(K),(G=Tr(K))==null||G.removeEventListener("keydown",H)};(R=Tr(K))==null||R.addEventListener("keydown",H)}),I=Vt(K=>{var R;const H=i.current.insideReactTree;i.current.insideReactTree=!1;const G=b.current;if(b.current=!1,u==="click"&&G||H||typeof k=="function"&&!k(K))return;const z=Tr(K),V="["+Ra("inert")+"]",A=cn(a.floating).querySelectorAll(V);let Y=et(z)?z:null;for(;Y&&!Yn(Y);){const ye=Qn(Y);if(Yn(ye)||!et(ye))break;Y=ye}if(A.length&&et(z)&&!O6e(z)&&!yr(z,a.floating)&&Array.from(A).every(ye=>!yr(Y,ye)))return;if($t(z)&&X){const ye=Yn(z),ke=pn(z),Ie=/auto|scroll/,Pe=ye||Ie.test(ke.overflowX),Ke=ye||Ie.test(ke.overflowY),Ge=Pe&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,nt=Ke&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,mt=ke.direction==="rtl",Ye=nt&&(mt?K.offsetX<=z.offsetWidth-z.clientWidth:K.offsetX>z.clientWidth),ie=Ge&&K.offsetY>z.clientHeight;if(Ye||ie)return}const ee=(R=i.current.floatingContext)==null?void 0:R.nodeId,L=g&&la(g.nodesRef.current,ee).some(ye=>{var ke;return Ko(K,(ke=ye.context)==null?void 0:ke.elements.floating)});if(Ko(K,a.floating)||Ko(K,a.domReference)||L)return;const se=g?la(g.nodesRef.current,ee):[];if(se.length>0){let ye=!0;if(se.forEach(ke=>{var Ie;if((Ie=ke.context)!=null&&Ie.open&&!ke.context.dataRef.current.__outsidePressBubbles){ye=!1;return}}),!ye)return}r(!1,K,"outside-press")}),q=Vt(K=>{var R;const H=()=>{var G;I(K),(G=Tr(K))==null||G.removeEventListener(u,H)};(R=Tr(K))==null||R.addEventListener(u,H)});te.useEffect(()=>{if(!n||!o)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=M;let K=-1;function R(A){r(!1,A,"ancestor-scroll")}function H(){window.clearTimeout(K),D.current=!0}function G(){K=window.setTimeout(()=>{D.current=!1},so()?5:0)}const z=cn(a.floating);s&&(z.addEventListener("keydown",N?C:P,N),z.addEventListener("compositionstart",H),z.addEventListener("compositionend",G)),k&&z.addEventListener(u,E?q:I,E);let V=[];return h&&(et(a.domReference)&&(V=Zn(a.domReference)),et(a.floating)&&(V=V.concat(Zn(a.floating))),!et(a.reference)&&a.reference&&a.reference.contextElement&&(V=V.concat(Zn(a.reference.contextElement)))),V=V.filter(A=>{var Y;return A!==((Y=z.defaultView)==null?void 0:Y.visualViewport)}),V.forEach(A=>{A.addEventListener("scroll",R)}),()=>{s&&(z.removeEventListener("keydown",N?C:P,N),z.removeEventListener("compositionstart",H),z.removeEventListener("compositionend",G)),k&&z.removeEventListener(u,E?q:I,E),V.forEach(A=>{A.removeEventListener("scroll",R)}),window.clearTimeout(K)}},[i,a,s,k,u,n,r,h,o,x,M,P,N,C,I,E,q]),te.useEffect(()=>{i.current.insideReactTree=!1},[i,k,u]);const Z=te.useMemo(()=>({onKeyDown:P,...d&&{[G8e[p]]:K=>{r(!1,K.nativeEvent,"reference-press")},...p!=="click"&&{onClick(K){r(!1,K.nativeEvent,"reference-press")}}}}),[P,r,d,p]),X=te.useMemo(()=>{function K(R){R.button===0&&(b.current=!0)}return{onKeyDown:P,onMouseDown:K,onMouseUp:K,[W8e[u]]:()=>{i.current.insideReactTree=!0}}},[P,u,i]);return te.useMemo(()=>o?{reference:Z,floating:X}:{},[o,Z,X])}function K8e(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=op(),i=te.useRef({}),[o]=te.useState(()=>D8e()),s=mo()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!et(m)&&L8e("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=te.useState(r.reference),d=Vt((m,f,g)=>{i.current.openEvent=m?f:void 0,o.emit("openchange",{open:m,event:f,reason:g,nested:s}),n?.(m,f,g)}),p=te.useMemo(()=>({setPositionReference:u}),[]),h=te.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return te.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:o,floatingId:a,refs:p}),[t,d,h,o,a,p])}function lp(e){var t,n;let{elements:r,...a}=e===void 0?{}:e;const{nodeId:i}=a,o=K8e({...a,elements:{reference:(t=r?.reference)!=null?t:null,floating:(n=r?.floating)!=null?n:null}}),s=a.rootContext||o,l=s.elements,[u,d]=te.useState(null),[p,h]=te.useState(null),f=l?.domReference||u,g=te.useRef(null),_=fo();yt(()=>{f&&(g.current=f)},[f]);const k=A8e({...a,elements:{...l,...p&&{reference:p}}}),b=te.useCallback(D=>{const P=et(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;h(P),k.refs.setReference(P)},[k.refs]),x=te.useCallback(D=>{(et(D)||D===null)&&(g.current=D,d(D)),(et(k.refs.reference.current)||k.refs.reference.current===null||D!==null&&!et(D))&&k.refs.setReference(D)},[k.refs]),M=te.useMemo(()=>({...k.refs,setReference:x,setPositionReference:b,domReference:g}),[k.refs,x,b]),N=te.useMemo(()=>({...k.elements,domReference:f}),[k.elements,f]),E=te.useMemo(()=>({...k,...s,refs:M,elements:N,nodeId:i}),[k,M,N,i,s]);return yt(()=>{s.dataRef.current.floatingContext=E;const D=_?.nodesRef.current.find(P=>P.id===i);D&&(D.context=E)}),te.useMemo(()=>({...k,context:E,refs:M,elements:N}),[k,M,N,E])}function ns(){return T6e()&&W5()}function Y8e(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:i,elements:o}=e,{enabled:s=!0,visibleOnly:l=!0}=t,u=te.useRef(!1),d=te.useRef(-1),p=te.useRef(!0);te.useEffect(()=>{if(!s)return;const m=Ct(o.domReference);function f(){!n&&$t(o.domReference)&&o.domReference===ga(cn(o.domReference))&&(u.current=!0)}function g(){p.current=!0}function _(){p.current=!1}return m.addEventListener("blur",f),ns()&&(m.addEventListener("keydown",g,!0),m.addEventListener("pointerdown",_,!0)),()=>{m.removeEventListener("blur",f),ns()&&(m.removeEventListener("keydown",g,!0),m.removeEventListener("pointerdown",_,!0))}},[o.domReference,n,s]),te.useEffect(()=>{if(!s)return;function m(f){let{reason:g}=f;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return a.on("openchange",m),()=>{a.off("openchange",m)}},[a,s]),te.useEffect(()=>()=>{Zt(d)},[]);const h=te.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(m){if(u.current)return;const f=Tr(m.nativeEvent);if(l&&et(f)){if(ns()&&!m.relatedTarget){if(!p.current&&!ep(f))return}else if(!D6e(f))return}r(!0,m.nativeEvent,"focus")},onBlur(m){u.current=!1;const f=m.relatedTarget,g=m.nativeEvent,_=et(f)&&f.hasAttribute(Ra("focus-guard"))&&f.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var k;const b=ga(o.domReference?o.domReference.ownerDocument:document);!f&&b===o.domReference||yr((k=i.current.floatingContext)==null?void 0:k.refs.floating.current,b)||yr(o.domReference,b)||_||r(!1,g,"focus")})}}),[i,o.domReference,r,l]);return te.useMemo(()=>s?{reference:h}:{},[s,h])}function rs(e,t,n){const r=new Map,a=n==="item";let i=e;if(a&&e){const{[a2]:o,[i2]:s,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[T8e]:""},...i,...t.map(o=>{const s=o?o[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((o,s)=>(s&&Object.entries(s).forEach(l=>{let[u,d]=l;if(!(a&&[a2,i2].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var p;(p=r.get(u))==null||p.push(d),o[u]=function(){for(var h,m=arguments.length,f=new Array(m),g=0;g<m;g++)f[g]=arguments[g];return(h=r.get(u))==null?void 0:h.map(_=>_(...f)).find(_=>_!==void 0)}}}else o[u]=d}),o),{})}}function cp(e){e===void 0&&(e=[]);const t=e.map(s=>s?.reference),n=e.map(s=>s?.floating),r=e.map(s=>s?.item),a=te.useCallback(s=>rs(s,e,"reference"),t),i=te.useCallback(s=>rs(s,e,"floating"),n),o=te.useCallback(s=>rs(s,e,"item"),r);return te.useMemo(()=>({getReferenceProps:a,getFloatingProps:i,getItemProps:o}),[a,i,o])}const Z8e="Escape";function go(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Va(e,t){return go(t,e===a3||e===ho,e===Ta||e===Ca)}function as(e,t,n){return go(t,e===ho,n?e===Ta:e===Ca)||e==="Enter"||e===" "||e===""}function f2(e,t,n){return go(t,n?e===Ta:e===Ca,e===ho)}function g2(e,t,n,r){const a=n?e===Ca:e===Ta,i=e===a3;return t==="both"||t==="horizontal"&&r&&r>1?e===Z8e:go(t,a,i)}function X8e(e,t){const{open:n,onOpenChange:r,elements:a,floatingId:i}=e,{listRef:o,activeIndex:s,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:p=!1,loop:h=!1,nested:m=!1,rtl:f=!1,virtual:g=!1,focusItemOnOpen:_="auto",focusItemOnHover:k=!0,openOnArrowKeyDown:b=!0,disabledIndices:x=void 0,orientation:M="vertical",parentOrientation:N,cols:E=1,scrollItemIntoView:D=!0,virtualItemRef:P,itemSizes:C,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(p&&(h||Jo("`useListNavigation` looping must be enabled to allow escaping."),g||Jo("`useListNavigation` must be virtual to allow escaping.")),M==="vertical"&&E>1&&Jo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const q=Y5(a.floating),Z=An(q),X=mo(),K=fo();yt(()=>{e.dataRef.current.orientation=M},[e,M]);const R=Vt(()=>{l(z.current===-1?null:z.current)}),H=L6e(a.domReference),G=te.useRef(_),z=te.useRef(d??-1),V=te.useRef(null),A=te.useRef(!0),Y=te.useRef(R),ee=te.useRef(!!a.floating),L=te.useRef(n),se=te.useRef(!1),ye=te.useRef(!1),ke=An(x),Ie=An(n),Pe=An(D),Ke=An(d),[Ge,nt]=te.useState(),[mt,Ye]=te.useState(),ie=Vt(()=>{function ve(B){if(g){var Q;(Q=B.id)!=null&&Q.endsWith("-fui-option")&&(B.id=i+"-"+Math.random().toString(16).slice(2,10)),nt(B.id),K?.events.emit("virtualfocus",B),P&&(P.current=B)}else P8e(B,{sync:se.current,preventScroll:!0})}const pe=o.current[z.current],be=ye.current;pe&&ve(pe),(se.current?B=>B():requestAnimationFrame)(()=>{const B=o.current[z.current]||pe;if(!B)return;pe||ve(B);const Q=Pe.current;Q&&we&&(be||!A.current)&&(B.scrollIntoView==null||B.scrollIntoView(typeof Q=="boolean"?{block:"nearest",inline:"nearest"}:Q))})});yt(()=>{u&&(n&&a.floating?G.current&&d!=null&&(ye.current=!0,z.current=d,R()):ee.current&&(z.current=-1,Y.current()))},[u,n,a.floating,d,R]),yt(()=>{if(u&&n&&a.floating)if(s==null){if(se.current=!1,Ke.current!=null)return;if(ee.current&&(z.current=-1,ie()),(!L.current||!ee.current)&&G.current&&(V.current!=null||G.current===!0&&V.current==null)){let ve=0;const pe=()=>{o.current[0]==null?(ve<2&&(ve?requestAnimationFrame:queueMicrotask)(pe),ve++):(z.current=V.current==null||as(V.current,M,f)||m?Yo(o,ke.current):Qh(o,ke.current),V.current=null,R())};pe()}}else ca(o,s)||(z.current=s,ie(),ye.current=!1)},[u,n,a.floating,s,Ke,m,o,M,f,R,ie,ke]),yt(()=>{var ve;if(!u||a.floating||!K||g||!ee.current)return;const pe=K.nodesRef.current,be=(ve=pe.find(Q=>Q.id===X))==null||(ve=ve.context)==null?void 0:ve.elements.floating,Re=ga(cn(a.floating)),B=pe.some(Q=>Q.context&&yr(Q.context.elements.floating,Re));be&&!B&&A.current&&be.focus({preventScroll:!0})},[u,a.floating,K,X,g]),yt(()=>{if(!u||!K||!g||X)return;function ve(pe){Ye(pe.id),P&&(P.current=pe)}return K.events.on("virtualfocus",ve),()=>{K.events.off("virtualfocus",ve)}},[u,K,g,X,P]),yt(()=>{Y.current=R,L.current=n,ee.current=!!a.floating}),yt(()=>{n||(V.current=null,G.current=_)},[n,_]);const xe=s!=null,we=te.useMemo(()=>{function ve(be){if(!Ie.current)return;const Re=o.current.indexOf(be);Re!==-1&&z.current!==Re&&(z.current=Re,R())}return{onFocus(be){let{currentTarget:Re}=be;se.current=!0,ve(Re)},onClick:be=>{let{currentTarget:Re}=be;return Re.focus({preventScroll:!0})},onMouseMove(be){let{currentTarget:Re}=be;se.current=!0,ye.current=!1,k&&ve(Re)},onPointerLeave(be){let{pointerType:Re}=be;if(!(!A.current||Re==="touch")&&(se.current=!0,!!k&&(z.current=-1,R(),!g))){var B;(B=Z.current)==null||B.focus({preventScroll:!0})}}}},[Ie,Z,k,o,R,g]),Ve=te.useCallback(()=>{var ve;return N??(K==null||(ve=K.nodesRef.current.find(pe=>pe.id===X))==null||(ve=ve.context)==null||(ve=ve.dataRef)==null?void 0:ve.current.orientation)},[X,K,N]),ue=Vt(ve=>{if(A.current=!1,se.current=!0,ve.which===229||!Ie.current&&ve.currentTarget===Z.current)return;if(m&&g2(ve.key,M,f,E)){Va(ve.key,Ve())||Xt(ve),r(!1,ve.nativeEvent,"list-navigation"),$t(a.domReference)&&(g?K?.events.emit("virtualfocus",a.domReference):a.domReference.focus());return}const pe=z.current,be=Yo(o,x),Re=Qh(o,x);if(H||(ve.key==="Home"&&(Xt(ve),z.current=be,R()),ve.key==="End"&&(Xt(ve),z.current=Re,R())),E>1){const B=C||Array.from({length:o.current.length},()=>({width:1,height:1})),Q=G6e(B,E,I),oe=Q.findIndex(qe=>qe!=null&&!bi(o,qe,x)),re=Q.reduce((qe,it,bt)=>it!=null&&!bi(o,it,x)?bt:qe,-1),_e=Q[V6e({current:Q.map(qe=>qe!=null?o.current[qe]:null)},{event:ve,orientation:M,loop:h,rtl:f,cols:E,disabledIndices:K6e([...(typeof x!="function"?x:null)||o.current.map((qe,it)=>bi(o,it,x)?it:void 0),void 0],Q),minIndex:oe,maxIndex:re,prevIndex:W6e(z.current>Re?be:z.current,B,Q,E,ve.key===ho?"bl":ve.key===(f?Ta:Ca)?"tr":"tl"),stopEvent:!0})];if(_e!=null&&(z.current=_e,R()),M==="both")return}if(Va(ve.key,M)){if(Xt(ve),n&&!g&&ga(ve.currentTarget.ownerDocument)===ve.currentTarget){z.current=as(ve.key,M,f)?be:Re,R();return}as(ve.key,M,f)?h?z.current=pe>=Re?p&&pe!==o.current.length?-1:be:kt(o,{startingIndex:pe,disabledIndices:x}):z.current=Math.min(Re,kt(o,{startingIndex:pe,disabledIndices:x})):h?z.current=pe<=be?p&&pe!==-1?o.current.length:Re:kt(o,{startingIndex:pe,decrement:!0,disabledIndices:x}):z.current=Math.max(be,kt(o,{startingIndex:pe,decrement:!0,disabledIndices:x})),ca(o,z.current)&&(z.current=-1),R()}}),Le=te.useMemo(()=>g&&n&&xe&&{"aria-activedescendant":mt||Ge},[g,n,xe,mt,Ge]),Be=te.useMemo(()=>({"aria-orientation":M==="both"?void 0:M,...H?{}:Le,onKeyDown:ue,onPointerMove(){A.current=!0}}),[Le,ue,M,H]),Ce=te.useMemo(()=>{function ve(be){_==="auto"&&F6e(be.nativeEvent)&&(G.current=!0)}function pe(be){G.current=_,_==="auto"&&P6e(be.nativeEvent)&&(G.current=!0)}return{...Le,onKeyDown(be){A.current=!1;const Re=be.key.startsWith("Arrow"),B=["Home","End"].includes(be.key),Q=Re||B,oe=f2(be.key,M,f),re=g2(be.key,M,f,E),_e=f2(be.key,Ve(),f),qe=Va(be.key,M),it=(m?_e:qe)||be.key==="Enter"||be.key.trim()==="";if(g&&n){const ft=K?.nodesRef.current.find(It=>It.parentId==null),Et=K&&ft?z6e(K.nodesRef.current,ft.id):null;if(Q&&Et&&P){const It=new KeyboardEvent("keydown",{key:be.key,bubbles:!0});if(oe||re){var bt,qn;const U7=((bt=Et.context)==null?void 0:bt.elements.domReference)===be.currentTarget,jh=re&&!U7?(qn=Et.context)==null?void 0:qn.elements.domReference:oe?o.current.find(Vh=>Vh?.id===Ge):null;jh&&(Xt(be),jh.dispatchEvent(It),Ye(void 0))}if((qe||B)&&Et.context&&Et.context.open&&Et.parentId&&be.currentTarget!==Et.context.elements.domReference){var Bn;Xt(be),(Bn=Et.context.elements.domReference)==null||Bn.dispatchEvent(It);return}}return ue(be)}if(!(!n&&!b&&Re)){if(it){const ft=Va(be.key,Ve());V.current=m&&ft?null:be.key}if(m){_e&&(Xt(be),n?(z.current=Yo(o,ke.current),R()):r(!0,be.nativeEvent,"list-navigation"));return}qe&&(d!=null&&(z.current=d),Xt(be),!n&&b?r(!0,be.nativeEvent,"list-navigation"):ue(be),n&&R())}},onFocus(){n&&!g&&(z.current=-1,R())},onPointerDown:pe,onPointerEnter:pe,onMouseDown:ve,onClick:ve}},[Ge,Le,E,ue,ke,_,o,m,R,r,n,b,M,Ve,f,d,K,g,P]);return te.useMemo(()=>u?{reference:Ce,floating:Be,item:we}:{},[u,Ce,Be,we])}const Q8e=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function up(e,t){var n,r;t===void 0&&(t={});const{open:a,elements:i,floatingId:o}=e,{enabled:s=!0,role:l="dialog"}=t,u=op(),d=((n=i.domReference)==null?void 0:n.id)||u,p=te.useMemo(()=>{var b;return((b=Y5(i.floating))==null?void 0:b.id)||o},[i.floating,o]),h=(r=Q8e.get(l))!=null?r:l,f=mo()!=null,g=te.useMemo(()=>h==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:a?p:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":a?p:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:d},...h==="menu"&&f&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[h,p,f,a,d,l]),_=te.useMemo(()=>{const b={id:p,...h&&{role:h}};return h==="tooltip"||l==="label"?b:{...b,...h==="menu"&&{"aria-labelledby":d}}},[h,p,d,l]),k=te.useCallback(b=>{let{active:x,selected:M}=b;const N={role:"option",...x&&{id:p+"-fui-option"}};switch(l){case"select":case"combobox":return{...N,"aria-selected":M}}return{}},[p,l]);return te.useMemo(()=>s?{reference:g,floating:_,item:k}:{},[s,g,_,k])}const Tn=({content:e,children:t,placement:n="top",delay:r=300,disabled:a=!1,className:i=""})=>{const[o,s]=j.useState(!1),{refs:l,floatingStyles:u,context:d,isPositioned:p}=lp({open:o,onOpenChange:s,placement:n,strategy:"absolute",whileElementsMounted:np,middleware:[rp(8),ip(),ap({padding:8})]}),h=F8e(d,{delay:{open:r,close:0},enabled:!a}),m=Y8e(d,{enabled:!a}),f=sp(d,{enabled:!0,outsidePress:!0,outsidePressEvent:"mousedown",referencePress:!0,referencePressEvent:"mousedown",escapeKey:!0,ancestorScroll:!0}),g=up(d,{role:"tooltip"}),{getReferenceProps:_,getFloatingProps:k}=cp([h,m,f,g]);return j.useEffect(()=>{if(!o||a)return;const b=()=>{s(!1)};return window.addEventListener("scroll",b,!0),document.addEventListener("scroll",b,!0),()=>{window.removeEventListener("scroll",b,!0),document.removeEventListener("scroll",b,!0)}},[o,a]),a||!e?w.jsx(w.Fragment,{children:t}):w.jsxs(w.Fragment,{children:[w.jsx("span",{ref:l.setReference,..._(),children:t}),o&&w.jsx(H8e,{children:w.jsx("div",{ref:l.setFloating,style:{...u,opacity:p?1:0,pointerEvents:"none",transition:p?"opacity 0.15s ease-out":"none"},className:`mp-agent-tooltip ${i}`.trim(),...k(),children:e})})]})},un=({icon:e,size:t="md",iconSize:n,type:r="button",className:a="",tooltip:i,tooltipPlacement:o,...s})=>{const l=Yve[e],u=n??(t==="sm"?14:20),d=w.jsx("button",{type:r,className:`mp-agent-icon-button mp-agent-icon-button-${t} ${a}`.trim(),...s,children:l&&w.jsx(l,{size:u})});return i?w.jsx(Tn,{content:i,placement:o,children:d}):d},dp=({text:e})=>{const[t,n]=j.useState(!1),r=async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}catch(a){console.error("Failed to copy:",a)}};return w.jsx(Tn,{content:"Copy to clipboard",children:w.jsx(un,{icon:t?"Check":"Copy",onClick:r,"aria-label":"Copy message",size:"sm"})})},Wt=()=>{const e=$e();return{...Ci,...e.config.translations??{}}},y2=300,s3=j.memo(({field:e,isExpanded:t,canApply:n,onToggleExpand:r,onApply:a})=>{const i=Wt(),o=e.value.length>y2,s=o&&!t?`${e.value.slice(0,y2)}...`:e.value,l=j.useCallback(()=>{r(e.name)},[e.name,r]),u=j.useCallback(()=>{a(e)},[e,a]);return w.jsxs("div",{className:"mp-agent-form-proposal-row",children:[w.jsxs("div",{className:"mp-agent-form-proposal-main",children:[w.jsx("div",{className:"mp-agent-form-proposal-label",children:e.label||e.name}),w.jsx("div",{className:"mp-agent-form-proposal-value-container",children:w.jsxs("div",{className:"mp-agent-form-proposal-value",children:[s,o&&w.jsx("button",{type:"button",onClick:l,className:"mp-agent-form-proposal-show-all",children:t?i.formProposalShowLess:i.formProposalShowAll})]})})]}),w.jsxs("div",{className:"mp-agent-form-proposal-actions-row",children:[w.jsx(un,{icon:"Check",onClick:u,tooltip:`${i.formProposalApplyFieldPrefix} ${e.label||e.name}`,size:"sm"}),w.jsx(dp,{text:e.value})]})]})});s3.displayName="FormFieldRow";const Ia=30*1e3,Oa=5*60*1e3,l3=20,Ht={all:["mp-agents","activities"],lists:()=>[...Ht.all,"list"],list:e=>[...Ht.lists(),e],infinites:()=>[...Ht.all,"infinite"],infinite:e=>[...Ht.infinites(),e],sourceTypes:e=>[...Ht.all,"sourceTypes",e],detail:e=>[...Ht.all,"detail",e],summary:e=>[...Ht.all,"summary",e]},J8e=e=>e?.pages.flatMap(t=>t.data)??[],c3=(e,t,n)=>{const r=e.from instanceof Date?e.from.toISOString():e.from,a=e.to instanceof Date?e.to.toISOString():e.to;return{...e.groupId&&{groupId:e.groupId},...e.parentId&&{parentId:e.parentId},...e.sourceType&&{sourceType:e.sourceType},...e.sortField&&e.sortOrder&&{sort:{field:e.sortField,order:e.sortOrder}},...r&&{from:r},...a&&{to:a},...e.tenant&&{tenant:e.tenant},...e.ownerId&&{ownerId:e.ownerId},skip:t,limit:n}},u3=e=>({data:[],cursor:{total:0,skip:0,limit:e}}),e7e=e=>{const t=$e(),{groupId:n,parentId:r,sourceType:a,enabled:i=!0,sortOrder:o=exports.SortOrder.Desc,sortField:s="createdAt",pageSize:l=l3,from:u,to:d,tenant:p,ownerId:h}=e??{};return xt.useInfiniteQuery({queryKey:Ht.infinite({groupId:n,parentId:r,sourceType:a,sortField:s,sortOrder:o,pageSize:l,from:u,to:d,tenant:p,ownerId:h}),queryFn:async({pageParam:m})=>t.transport.listActivities?t.transport.listActivities(c3({groupId:n,parentId:r,sourceType:a,sortField:s,sortOrder:o,from:u,to:d,tenant:p,ownerId:h},m,l)):u3(l),initialPageParam:0,getNextPageParam:m=>{const f=(m.cursor.skip??0)+m.data.length;return f<m.cursor.total?f:void 0},enabled:i&&!!t.transport.listActivities,staleTime:Ia,gcTime:Oa})},t7e=e=>{const t=$e(),{groupId:n,parentId:r,sourceType:a,page:i,enabled:o=!0,sortOrder:s=exports.SortOrder.Desc,sortField:l="createdAt",pageSize:u=l3,from:d,to:p,tenant:h,ownerId:m}=e,f=(i-1)*u,g=xt.useQuery({queryKey:Ht.list({groupId:n,parentId:r,sourceType:a,sortField:l,sortOrder:s,pageSize:u,page:i,from:d,to:p,tenant:h,ownerId:m}),queryFn:async()=>t.transport.listActivities?t.transport.listActivities(c3({groupId:n,parentId:r,sourceType:a,sortField:l,sortOrder:s,from:d,to:p,tenant:h,ownerId:m},f,u)):u3(u),enabled:o&&!!t.transport.listActivities&&i>=1,staleTime:Ia,gcTime:Oa}),_=g.data?.cursor.total??0,k=Math.max(1,Math.ceil(_/u));return{...g,page:i,pageSize:u,totalPages:k,total:_,hasNextPage:i<k,hasPreviousPage:i>1}},n7e=e=>{const t=$e();return xt.useQuery({queryKey:Ht.detail(e),queryFn:async()=>!e||!t.transport.getActivity?null:t.transport.getActivity(e),enabled:!!e&&!!t.transport.getActivity,staleTime:Ia,gcTime:Oa})},r7e=e=>{const t=$e(),{enabled:n=!0,...r}=e??{};return xt.useQuery({queryKey:Ht.summary(r),queryFn:async()=>t.transport.getActivitySummary?t.transport.getActivitySummary(r):[],enabled:n&&!!t.transport.getActivitySummary,staleTime:Ia,gcTime:Oa})},a7e=e=>{const t=$e(),{enabled:n=!0,groupId:r,parentId:a,from:i,to:o,tenant:s,ownerId:l}=e??{},u=i instanceof Date?i.toISOString():i,d=o instanceof Date?o.toISOString():o;return xt.useQuery({queryKey:Ht.sourceTypes({groupId:r,parentId:a,from:u,to:d,tenant:s,ownerId:l}),queryFn:async()=>t.transport.listActivitySourceTypes?t.transport.listActivitySourceTypes({...r&&{groupId:r},...a&&{parentId:a},...u&&{from:u},...d&&{to:d},...s&&{tenant:s},...l&&{ownerId:l}}):[],enabled:n&&!!t.transport.listActivitySourceTypes,staleTime:Ia,gcTime:Oa})},b2="mp-agents-guest-user-id";function jr(){if(typeof window>"u")return`${Ri.DefaultUserId}-${vt.nanoid()}`;const e=localStorage.getItem(b2);if(e)return e;const t=`${Ri.DefaultUserId}-${vt.nanoid()}`;return localStorage.setItem(b2,t),t}const d3=30*1e3,p3=5*60*1e3,pp=20,Vn={all:["mp-agents","chats"],lists:()=>[...Vn.all,"list"],list:e=>[...Vn.lists(),e],infinites:()=>[...Vn.all,"infinite"],infinite:e=>[...Vn.infinites(),e],detail:e=>[...Vn.all,"detail",e]},i7e=e=>e?.pages.flatMap(t=>t.data)??[],h3=e=>{const t=$e(),n=t.config.user?.id??jr(),r=t.config.appId,{pageSize:a=pp,sortOrder:i="desc",sortField:o="updatedAt",multiUser:s,enabled:l=!0}=e??{};return xt.useInfiniteQuery({queryKey:Vn.infinite({userId:n,appId:r,sortField:o,sortOrder:i,pageSize:a,multiUser:s}),queryFn:async({pageParam:u})=>await t.transport.listChats({userId:n,skip:u,limit:a,multiUser:s,sortOrder:i,sortField:o}),initialPageParam:0,getNextPageParam:u=>{const{cursor:d,data:p}=u,h=(d.skip??0)+p.length;return h<d.total?h:void 0},enabled:l&&!!n,staleTime:d3,gcTime:p3})},m3=h3,o7e=e=>{const t=$e(),n=t.config.user?.id??jr(),r=t.config.appId,{page:a,pageSize:i=pp,sortOrder:o="desc",sortField:s="updatedAt",multiUser:l,enabled:u=!0}=e,d=(a-1)*i,p=xt.useQuery({queryKey:Vn.list({userId:n,appId:r,sortField:s,sortOrder:o,pageSize:i,page:a,multiUser:l}),queryFn:async()=>t.transport.listChats({userId:n,skip:d,limit:i,multiUser:l,sortOrder:o,sortField:s}),enabled:u&&!!n&&a>=1,staleTime:d3,gcTime:p3}),h=p.data?.cursor.total??0,m=Math.max(1,Math.ceil(h/i));return{...p,page:a,pageSize:i,totalPages:m,total:h,hasNextPage:a<m,hasPreviousPage:a>1}},hp=e=>{const t=m3(e),n=fe(r=>r.hydrateChats);return j.useEffect(()=>{if(t.data?.pages){const r=t.data.pages.flatMap(a=>a.data);n(r)}},[t.data,n]),t},s7e=(e={},t=[])=>{const{threshold:n=50,scrollOnMount:r=!0,observeMutations:a=!0}=e,i=j.useRef(null),o=j.useRef(null),[s,l]=j.useState(!0),u=j.useRef(!1),d=j.useRef(!1),p=j.useRef(),h=j.useCallback(()=>{const g=i.current;if(!g)return!1;const{scrollTop:_,scrollHeight:k,clientHeight:b}=g;return k-_-b<=n},[n]),m=j.useCallback(()=>{const g=i.current,_=o.current;!g||!_||_.scrollIntoView({behavior:"auto",block:"end"})},[]),f=j.useCallback(()=>{const g=h();l(g),g&&(u.current=!1)},[h]);return j.useEffect(()=>{const g=i.current;if(!g)return;let _=g.scrollTop,k;const b=()=>{const x=g.scrollTop;if(!d.current){const M=x<_,N=x>_;(M||N&&!h())&&(u.current=!0)}_=x,f(),k&&clearTimeout(k),k=window.setTimeout(()=>{d.current=!1},150)};return g.addEventListener("scroll",b,{passive:!0}),()=>{g.removeEventListener("scroll",b),k&&clearTimeout(k)}},[h,f]),j.useEffect(()=>{if(!a)return;const g=i.current;if(!g)return;const _=new MutationObserver(()=>{!u.current&&s&&(p.current&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{d.current=!0,m(),setTimeout(()=>{d.current=!1},50)})),f()});return _.observe(g,{childList:!0,subtree:!0,characterData:!0,attributes:!1}),()=>{_.disconnect(),p.current&&cancelAnimationFrame(p.current)}},[s,a,m,f]),j.useEffect(()=>{t.length!==0&&!u.current&&s&&(p.current&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{d.current=!0,m(),setTimeout(()=>{d.current=!1},50)}))},[...t]),j.useEffect(()=>{if(r&&i.current){const g=window.setTimeout(()=>{d.current=!0,m(),setTimeout(()=>{d.current=!1},50)},100);return()=>{clearTimeout(g)}}},[r,m]),{containerRef:i,sentinelRef:o,isNearBottom:s,scrollToBottom:m,checkIsNearBottom:h}},f3=()=>{const e=$e();return xt.useQuery({queryKey:["mp-agents","models"],queryFn:async()=>e.transport.listModels?await e.transport.listModels():[],staleTime:5*60*1e3,refetchOnWindowFocus:!1})},Ga=e=>e.type===exports.AgentAttachmentType.Context&&e?.metadata?.kind==="pageContext";var ct=(e=>(e.Idle="idle",e.Sending="sending",e.Streaming="streaming",e))(ct||{});const ka=e=>e===exports.AgentStatus.Streaming||e===exports.AgentStatus.Processing||e===exports.AgentStatus.WaitingForUserAction?"streaming":"idle",g3=()=>({messages:[],reasoning:[],artifacts:[],pendingAssistant:void 0,messageQueue:[],composerDraft:{value:"",attachments:[]},composerError:void 0,pageContextDismissed:!1,status:"idle"}),l7e=Object.freeze(g3()),De=(e,t)=>e.chatState[t]??l7e,c7e=e=>u5.create()((t,n)=>({contextKey:e,activeChatId:void 0,draftChatKey:`draft-${vt.nanoid()}`,chats:{},chatState:{},isChatHistoryOpen:!1,composer:{temperature:.4},setContextKey:r=>t({contextKey:r}),setActiveChat:r=>{t(a=>{let i=a.contextKey,o;if(r){const u=a.chats[r];u?.contextKey&&(i=u.contextKey),o=u?.model}const s=a.activeChatId!==r;return{activeChatId:r,contextKey:i,composer:r&&s?{...a.composer,model:o}:a.composer}})},upsertChat:r=>t(a=>{const i=a.chats[r.id],s=a.activeChatId===r.id&&(!i||i.model!==r.model);return{chats:{...a.chats,[r.id]:r},...s?{composer:{...a.composer,model:r.model}}:{}}}),upsertChatState:(r,a)=>t(i=>{const o=De(i,r),s=typeof a=="function"?a(o):a,l={...o,...s};return{chatState:{...i.chatState,[r]:l}}}),hydrateChats:r=>t(a=>{const i={};r.forEach(u=>{i[u.id]=u});const o=a.activeChatId??r[0]?.id;o&&!i[o]&&a.chats[o]&&(i[o]=a.chats[o]);const l=o?i[o]:void 0;return{chats:i,activeChatId:o,composer:{...a.composer,model:l?.model}}}),removeChat:r=>t(a=>{if(!a.chats[r])return a;const{[r]:i,...o}=a.chats,{[r]:s,...l}=a.chatState,u=a.activeChatId===r;return{chats:o,chatState:l,...u?{activeChatId:void 0}:{}}}),pushReasoning:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,reasoning:[...o.reasoning,a]}}}}),setArtifacts:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,artifacts:a}}}}),setComposerOptions:r=>t(a=>({composer:{...a.composer,...r}})),setComposerDraft:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{value:a.value??"",attachments:a.attachments??[]}}}}}),setComposerValue:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,value:a}}}}}),addComposerAttachments:(r,a)=>t(i=>{const o=De(i,r),s=o.composerDraft.attachments??[];if(!a||a.length===0)return i;const l=s.find(Ga),u=a.find(Ga);if(u){const h=a.filter(k=>!Ga(k)),m=s.filter(k=>!Ga(k)),g=[l?{...u,id:l.id}:u,...h,...m],_=new Map;for(const k of g)_.set(k.id,k);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,attachments:Array.from(_.values())}}}}}const d=[...a,...s],p=new Map;for(const h of d)p.set(h.id,h);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,attachments:Array.from(p.values())}}}}}),removeComposerAttachment:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerDraft:{...o.composerDraft,attachments:o.composerDraft.attachments.filter(s=>s.id!==a)}}}}}),clearComposerDraft:r=>t(a=>{const i=De(a,r);return{chatState:{...a.chatState,[r]:{...i,composerDraft:{value:"",attachments:[]}}}}}),setComposerError:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,composerError:a}}}}),setPageContextDismissed:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,pageContextDismissed:a}}}}),setChatStatus:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,status:a}}}}),setPendingAssistant:(r,a)=>t(i=>{const o=De(i,r);return{chatState:{...i.chatState,[r]:{...o,pendingAssistant:a}}}}),commitPendingAssistant:r=>t(a=>{const i=De(a,r),o=i.pendingAssistant;if(!o)return a;if(!a.chats[r])return{chatState:{...a.chatState,[r]:{...i,pendingAssistant:void 0}}};const u=typeof o.content=="string"&&o.content.trim().length>0?(()=>{if(i.messages[i.messages.length-1]?.id===o.id)return i.messages;const p={...o,chat:r};return[...i.messages,p]})():i.messages;return{chatState:{...a.chatState,[r]:{...i,messages:u,pendingAssistant:void 0}}}}),enqueueQueuedMessage:(r,a,i)=>t(o=>{const s=De(o,r),l={id:vt.nanoid(),content:a,...i&&i.length>0?{attachments:i}:{},createdAt:new Date().toISOString()};return{chatState:{...o.chatState,[r]:{...s,messageQueue:[...s.messageQueue,l]}}}}),removeQueuedMessage:(r,a)=>t(i=>{const o=De(i,r);if(o.messageQueue.length===0)return i;const s=o.messageQueue.filter(l=>l.id!==a);return{chatState:{...i.chatState,[r]:{...o,messageQueue:s}}}}),moveChatKeyState:(r,a)=>t(i=>{if(r===a)return i;const o=De(i,r),s=De(i,a);if(!(o.messageQueue.length>0||!!o.pendingAssistant||o.status!=="idle"||o.composerDraft.value.length>0||o.composerDraft.attachments.length>0||!!o.composerError))return i;const u=o.composerDraft.value.length>0||o.composerDraft.attachments.length>0,d=s.composerDraft.value.length>0||s.composerDraft.attachments.length>0,p={messages:s.messages,reasoning:s.reasoning,artifacts:s.artifacts,pendingAssistant:o.pendingAssistant??s.pendingAssistant,messageQueue:[...s.messageQueue,...o.messageQueue],composerDraft:u&&!d?o.composerDraft:s.composerDraft,composerError:o.composerError??s.composerError,pageContextDismissed:i.chatState[a]?s.pageContextDismissed:o.pageContextDismissed,status:o.status??s.status};return{chatState:{...i.chatState,[a]:p,[r]:g3()}}}),appendSystemMessage:(r,a)=>t(i=>{const o=De(i,r),s={id:vt.nanoid(),chat:r,content:a,role:exports.MessageRole.System,createdAt:new Date().toISOString()};return{chatState:{...i.chatState,[r]:{...o,messages:[...o.messages,s]}}}}),upsertToolCall:(r,a)=>t(i=>{const o=De(i,r),s=[...o.messages],l=s.findIndex(u=>u.role===exports.MessageRole.Tool&&u.toolCalls?.some(d=>d.id===a.id));if(l>=0){const u=s[l],d=(u.toolCalls??[]).map(p=>p.id===a.id?a:p);s[l]={...u,toolCalls:d}}else s.push({id:`tool-${a.id}`,content:"",chat:r,toolCalls:[a],role:exports.MessageRole.Tool,createdAt:new Date().toISOString()});return{chatState:{...i.chatState,[r]:{...o,messages:s}}}}),setChatHistoryOpen:r=>t({isChatHistoryOpen:r}),toggleChatHistory:()=>t(r=>({isChatHistoryOpen:!r.isChatHistoryOpen})),setChatMessages:(r,a)=>t(i=>{const o=De(i,r),s=o.messages??[],l=typeof a=="function"?a(s):a;return{chatState:{...i.chatState,[r]:{...o,messages:l}}}}),appendMessagesToChat:(r,a)=>t(i=>{const o=De(i,r);if(a.length===0)return i;const s=new Set(a.map(d=>d.id)),u=[...o.messages.filter(d=>!s.has(d.id)),...a].sort((d,p)=>d.createdAt.localeCompare(p.createdAt));return{chatState:{...i.chatState,[r]:{...o,messages:u}}}})})),y3=()=>{const e=fe(s=>s.activeChatId??s.draftChatKey),t=fe(s=>De(s,e).composerDraft),n=fe(s=>s.setComposerValue),r=fe(s=>s.setComposerDraft),a=fe(s=>s.clearComposerDraft),i=fe(s=>s.addComposerAttachments),o=fe(s=>s.removeComposerAttachment);return{chatKey:e,draft:t,setValue:s=>n(e,s),setDraft:s=>r(e,s),clearDraft:()=>a(e),addAttachments:s=>i(e,s),removeAttachment:s=>o(e,s)}},b3=e=>{const t=$e();return xt.useQuery({queryKey:["mp-agents","configurations",e??"all"],queryFn:async()=>t.transport.listAgentConfigurations?t.transport.listAgentConfigurations(e):[],staleTime:6e4,refetchOnWindowFocus:!1})},u7e=(e,t=[])=>{const n=$e(),r=j.useRef(e),a=j.useCallback(e,t);r.current=a;const i=j.useCallback(o=>r.current(o),[]);j.useEffect(()=>n.registerPageContextProvider(i),[n,i])},d7e=(e,t=[])=>{const n=$e(),r=j.useRef(e),a=j.useCallback(e,t);r.current=a;const i=j.useCallback(o=>r.current(o),[]);j.useEffect(()=>n.registerChatMetadataProvider(i),[n,i])},k3=e=>{const t=$e();return j.useCallback(r=>{t.events.dispatchEvent(new CustomEvent(e,{detail:r}))},[t,e])},v3=(e,t,n=[],r)=>{const a=$e(),i=j.useRef(t),o=j.useCallback(t,n);i.current=o;const s=j.useCallback(u=>{i.current(u)},[]),l=typeof r=="boolean"?r:r?.capture;j.useEffect(()=>(a.events.addEventListener(e,s,r),()=>{a.events.removeEventListener(e,s,l)}),[a,e,s,l])},p7e=({formId:e,onApply:t,enabled:n=!0})=>{v3(Xd,r=>{n&&r.detail.formId===e&&t(r.detail)},[n,e,t])},h7e=["mp-agents","configurations"],_3=()=>{const e=$e(),t=xt.useQueryClient(),n=()=>t.invalidateQueries({queryKey:h7e}),r=xt.useMutation({mutationFn:async({agentName:i,input:o})=>{if(!e.transport.upsertAgentPreferences)throw new Error("upsertAgentPreferences is not supported by this transport");return e.transport.upsertAgentPreferences(i,o)},onSuccess:n}),a=xt.useMutation({mutationFn:async i=>{if(!e.transport.upsertAgentPreferencesBatch)throw new Error("upsertAgentPreferencesBatch is not supported by this transport");return e.transport.upsertAgentPreferencesBatch(i)},onSuccess:n});return{upsertSingle:r,upsertBatch:a}},x3=()=>{const e=$e(),t=fe(s=>s.activeChatId),n=fe(s=>s.upsertChat),r=fe(s=>s.setActiveChat),a=fe(s=>s.setChatStatus),i=!!t,o=xt.useQuery({queryKey:["mp-agents","chat",t],queryFn:()=>e.transport.getChat(t),enabled:i,staleTime:6e4,retry:!1});return j.useEffect(()=>{o.data&&(n(o.data),a(o.data.id,ka(o.data.status)))},[o.data,n,a]),j.useEffect(()=>{o.isError&&t&&r(void 0)},[o.isError,t,r]),o},w3=20,mp=(e,t)=>{const n=t?.requireRegisteredChat??!0,r=$e(),a=r.config.messagesPageSize??w3,i=fe(l=>l.setChatMessages),o=fe(l=>!!(e&&l.chats[e])),s=xt.useInfiniteQuery({queryKey:["mp-agents","messages",e,a],queryFn:async({pageParam:l})=>{if(!e||!r.transport.getMessages)throw new Error("No chat or transport");return await r.transport.getMessages(e,{limit:a,...l?{before:l}:{}})},initialPageParam:void 0,getNextPageParam:l=>l.hasMore&&l.messages.length>0?l.messages[0]?.id:void 0,enabled:(t?.enabled??!0)&&!!e&&!!r.transport.getMessages&&(!n||o),retry:!1});return j.useEffect(()=>{if(!e||!s.data?.pages)return;const u=s.data.pages.slice().reverse().flatMap(p=>p.messages),d=new Set(u.map(p=>p.id));i(e,p=>{const h=p.filter(m=>!d.has(m.id));return[...u,...h]})},[e,s.data,i]),s},E3=()=>{const e=$e(),t=e.config.user?.id??jr(),n=fe(u=>u.activeChatId),r=fe(u=>u.removeChat),a=fe(u=>u.setActiveChat),[i,o]=j.useState(new Set),s=j.useCallback(async u=>{o(d=>new Set(d).add(u));try{await e.transport.deleteChat(u),r(u),n===u&&a(void 0),e.queryClient.invalidateQueries({queryKey:["mp-agents","chats",t]})}finally{o(d=>{const p=new Set(d);return p.delete(u),p})}},[n,r,e.queryClient,e.transport,a,t]),l=j.useCallback(u=>i.has(u),[i]);return{deleteChat:s,isDeleting:l}},m7e=e=>{if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)},f7e=e=>{const t=e.output??e.input??{},n=Array.isArray(t.fields)?t.fields.map(r=>({name:typeof r?.name=="string"?r.name:"",label:typeof r?.label=="string"?r.label:void 0,value:m7e(r?.value),inputType:typeof r?.inputType=="string"?r.inputType:void 0,options:Array.isArray(r?.options)?r.options:void 0})).filter(r=>r.name.length>0):[];return{formId:typeof t.formId=="string"?t.formId:void 0,formName:typeof t.formName=="string"?t.formName:void 0,fields:n,notes:typeof t.notes=="string"?t.notes:void 0}},M3=({call:e,chatId:t,applyAllButtonText:n,showStatus:r=!0})=>{const a=$e(),i=k3(Xd),o=Wt(),s=j.useMemo(()=>f7e(e),[e]),[l,u]=j.useState(new Set),d=j.useMemo(()=>{const E=(e.output??{})?._mp?.lastAction,D=typeof E?.action=="string"?E.action:void 0,P=typeof E?.at=="string"?E.at:void 0;return{action:D,at:P}},[e.output]),p=j.useMemo(()=>d.action==="apply",[d.action]),h=j.useMemo(()=>d.action==="reject",[d.action]),m=j.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!s.formId&&s.fields.length>0&&!p,[e.status,s.formId,s.fields.length,p]);j.useMemo(()=>e.status===exports.AgentToolCallStatus.Succeeded&&!!s.formId&&s.fields.length>0&&!p&&!h,[e.status,s.formId,s.fields.length,p,h]);const f=j.useCallback(async M=>{s.formId&&a.transport.recordToolCallAction&&await a.transport.recordToolCallAction(t,{toolCallId:e.id,action:M.action,data:{formId:s.formId,formName:s.formName,fields:M.fields},systemMessage:M.action==="apply"?`Applied ${M.fields.length} field(s) to ${s.formName??s.formId}.`:`Rejected ${s.formName??s.formId} suggestion.`},{excludeSocketId:!1})},[s.formId,s.formName,t,e.id,a.transport]),g=j.useCallback(async M=>{if(s.formId){i({fields:M,chatId:t,toolCallId:e.id,formId:s.formId,...s.formName?{formName:s.formName}:{}});try{await f({action:"apply",fields:M})}catch{return}}},[s.formId,s.formName,t,e.id,i,f]);j.useCallback(async()=>{if(s.formId)try{await f({action:"reject",fields:s.fields})}catch{return}},[s.formId,s.fields,f]);const _=j.useCallback(M=>{u(N=>{if(N.has(M)){if(N.size===1)return new Set;const E=new Set(N);return E.delete(M),E}else{const E=new Set(N);return E.add(M),E}})},[]),k=j.useCallback(M=>{g([M])},[g]),b=j.useCallback(()=>{g(s.fields)},[g,s.fields]),x=s.formName?`${o.formProposalHeaderPrefix} ${s.formName}`:`${o.formProposalHeaderPrefix} ${s.formId}`;return e.status===exports.AgentToolCallStatus.Failed&&e.error?w.jsx("div",{className:"mp-agent-tool-body",children:w.jsx("div",{className:"mp-agent-tool-simple-message",children:o.formProposalFailed})}):e.status!==exports.AgentToolCallStatus.Succeeded?w.jsx("div",{className:"mp-agent-tool-simple-message",children:o.formProposalPreparing}):!s.formId||s.fields.length===0?w.jsx("div",{className:"mp-agent-tool-simple-message",children:o.formProposalNone}):w.jsxs("div",{className:"mp-agent-tool-body",children:[w.jsx("div",{className:"mp-agent-tool-simple-message",children:x}),s.notes?w.jsx("div",{className:"mp-agent-tool-simple-message",children:s.notes}):null,w.jsx("div",{className:"mp-agent-form-proposal-fields",children:s.fields.map(M=>w.jsx(s3,{field:M,isExpanded:l.has(M.name),canApply:m,onToggleExpand:_,onApply:k},M.name))}),w.jsxs("div",{className:"mp-agent-form-proposal-actions",children:[r&&(p||h)&&w.jsxs("div",{className:"mp-agent-form-proposal-status",children:[w.jsx("span",{className:`mp-agent-form-proposal-badge ${p?"is-applied":"is-rejected"}`,children:p?o.formProposalApplied:o.formProposalRejected}),d.at?w.jsx("span",{className:"mp-agent-form-proposal-status-time",children:w.jsx(Qve,{date:d.at})}):null]}),w.jsxs("button",{type:"button",onClick:b,className:"mp-agent-form-proposal-apply-all",children:[w.jsx(R5,{size:14})," ",n||o.formProposalApplyAll]})]})]})},g7e=e=>{const t=e.output??{},n=Array.isArray(t.images)?t.images.map(r=>({attachmentId:typeof r?.attachmentId=="string"?r.attachmentId:"",name:typeof r?.name=="string"?r.name:"generated-image",mimeType:typeof r?.mimeType=="string"?r.mimeType:void 0,url:typeof r?.url=="string"?r.url:void 0,s3Key:typeof r?.s3Key=="string"?r.s3Key:void 0,size:typeof r?.size=="number"?r.size:void 0})).filter(r=>r.attachmentId.length>0):[];return{model:typeof t.model=="string"?t.model:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0,error:typeof t.error=="string"?t.error:void 0,images:n}},S3=({call:e})=>{const t=$e(),n=Wt(),r=j.useMemo(()=>g7e(e),[e]),[a,i]=j.useState({}),o=j.useRef(new Set),s=j.useCallback(async u=>{if(!u.s3Key||o.current.has(u.attachmentId))return;o.current.add(u.attachmentId);const d=t.config.transport;if(d.mode==="proxy")try{const p={"Content-Type":"application/json"};d.headers?Object.assign(p,d.headers):d.apiKey&&(p.Authorization=`Bearer ${d.apiKey}`);const h=await fetch(`${d.baseUrl}/files/download/presigned`,{method:"POST",headers:p,body:JSON.stringify({s3Key:u.s3Key})});if(!h.ok)return;const m=await h.json();typeof m?.url=="string"&&i(f=>({...f,[u.attachmentId]:m.url}))}catch{}},[t.config.transport]);j.useEffect(()=>{r.images.filter(u=>!u.url).forEach(u=>void s(u))},[r.images,s]);const l=j.useCallback(async(u,d)=>{try{const h=await(await fetch(d)).blob(),m=URL.createObjectURL(h),f=document.createElement("a");f.href=m,f.download=u.name,f.click(),URL.revokeObjectURL(m)}catch{window.open(d,"_blank","noreferrer")}},[]);return e.status===exports.AgentToolCallStatus.Failed||r.error?w.jsxs("div",{className:"mp-agent-tool-body",children:[w.jsx("div",{className:"mp-agent-tool-simple-message",children:n.imageGenerationFailed}),r.error?w.jsx("div",{className:"mp-agent-tool-error",children:r.error}):null]}):e.status!==exports.AgentToolCallStatus.Succeeded?w.jsx("div",{className:"mp-agent-tool-body mp-agent-image-tool",children:w.jsxs("div",{className:"mp-agent-image-tool-loading",children:[w.jsx(ad,{size:16}),w.jsx("span",{children:n.imageGenerationGenerating})]})}):r.images.length?w.jsx("div",{className:"mp-agent-tool-body mp-agent-image-tool",children:w.jsx("div",{className:"mp-agent-image-tool-grid",children:r.images.map(u=>{const d=a[u.attachmentId]??u.url;return w.jsxs("figure",{className:"mp-agent-image-tool-item",children:[d?w.jsx("img",{src:d,alt:r.prompt||u.name,title:r.prompt,loading:"lazy",onError:()=>void s(u)}):w.jsx("div",{className:"mp-agent-image-tool-placeholder",children:w.jsx(ad,{size:20})}),d?w.jsxs("figcaption",{className:"mp-agent-image-tool-actions",children:[w.jsx("a",{href:d,target:"_blank",rel:"noreferrer",title:n.imageGenerationOpen,children:w.jsx(M5,{size:14})}),w.jsx("button",{type:"button",onClick:()=>void l(u,d),title:n.imageGenerationDownload,children:w.jsx(E5,{size:14})})]}):null]},u.attachmentId)})})}):w.jsx("div",{className:"mp-agent-tool-simple-message",children:n.imageGenerationNone})},yo=e=>{const{id:t,name:n,url:r,capturedAt:a,source:i,security:o,target:s,kind:l,...u}=e,d=r??i?.url,p=i||d?{...i??{},...d?{url:d}:{}}:void 0,h=l==="webSnippet"||l==="formSnapshot"||l==="formField"?!0:void 0,m=o||(h!==void 0?{containsPII:h,redactionsApplied:[]}:void 0),f=typeof n=="string"&&n.trim().length?n.trim():l==="webSnippet"?u?.title?`Selection: ${String(u.title)}`:"Selection":l==="formField"?"Form field":l==="formSnapshot"?"Form snapshot":"Context";return{id:t??vt.nanoid(),type:exports.AgentAttachmentType.Context,name:f,...d?{url:d}:{},metadata:{schemaVersion:1,kind:l,capturedAt:a??new Date().toISOString(),...p?{source:p}:{},...m?{security:m}:{},...s?{target:s}:{},...u}}},y7e=e=>{try{const t=new URL(e),n=`${t.searchParams.toString()} ${t.hash}`.toLowerCase();return/(token|key|auth|session|code|password|secret|email)/.test(n)}catch{return/(token|key|auth|session|code|password|secret|email)/.test(e.toLowerCase())}},N3=(e={})=>{if(typeof window>"u")return;const t=e.url??window.location?.href;if(!t)return;const n=e.includeTitle!==!1,r=e.includeReferrer!==!1,a=e.includeViewport!==!1,i=e.includeUserAgent===!0,o=n&&typeof document<"u"?document.title:void 0,s=r&&typeof document<"u"?document.referrer:void 0;let l;try{l=new URL(t)}catch{}const u={url:t,...l?{origin:l.origin,pathname:l.pathname,search:l.search,hash:l.hash}:{},...n&&o?{title:o}:{},...r&&s?{referrer:s}:{},...i&&typeof navigator<"u"?{userAgent:navigator.userAgent}:{},...typeof navigator<"u"&&navigator.language?{language:navigator.language}:{},...typeof Intl<"u"?{timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,locale:Intl.DateTimeFormat().resolvedOptions().locale}:{},...a&&typeof window<"u"?{viewport:{width:window.innerWidth,height:window.innerHeight,devicePixelRatio:window.devicePixelRatio}}:{},...e.extra?e.extra:{}},d=y7e(t)?!0:void 0;return yo({kind:"pageContext",name:e.name??"Page context",url:t,title:o,data:u,summary:l?`${l.pathname}${l.search}${l.hash}`:void 0,source:{app:"browser",url:t,route:l?`${l.pathname}${l.search}${l.hash}`:void 0},...d?{security:{containsPII:!0,redactionsApplied:[]}}:{}})},A3=()=>{if(typeof window>"u"||typeof document>"u")return;const e=window.getSelection?.();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),n=e.toString().trim();if(!n)return;const r=(t.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement)??void 0,a=r?b7e(r):void 0,i=r?.textContent??"",o=i.indexOf(n),s=o>=0?o:void 0,l=o>=0?o+n.length:void 0,u=o>=0?i.slice(Math.max(0,o-80),o).trim():void 0,d=o>=0?i.slice(o+n.length,o+n.length+80).trim():void 0;return{selectedText:n,target:{type:"text",exact:n,...u?{prefix:u}:{},...d?{suffix:d}:{},...a?{domPath:a}:{},...s!==void 0?{startOffset:s}:{},...l!==void 0?{endOffset:l}:{}}}},b7e=e=>{if(e.id)return`#${k2(e.id)}`;const t=[];let n=e;for(;n&&n.nodeType===1&&t.length<6;){const r=n.tagName.toLowerCase();if(n.id){t.unshift(`#${k2(n.id)}`);break}const a=n.parentElement;if(!a){t.unshift(r);break}const o=Array.from(a.children).filter(s=>s.tagName===n.tagName).indexOf(n)+1;t.unshift(`${r}:nth-of-type(${o})`),n=a}return t.join(" > ")},k2=e=>e.replace(/[^a-zA-Z0-9_-]/g,"\\$&");class T3{constructor(t){this.rawConfig=t,this.events=new EventTarget;const n=rd.parse(t);this.config={...n,tools:t.tools,pageContext:t.pageContext?{...n.pageContext,...t.pageContext}:n.pageContext,chatMetadata:t.chatMetadata?{...n.chatMetadata,...t.chatMetadata}:n.chatMetadata,translations:t.translations?{...Ci,...t.translations}:Ci,transport:t.transport.onError?{...n.transport,onError:t.transport.onError}:n.transport,toolRenderers:t.toolRenderers,planExtractor:t.planExtractor,contextAttachmentIcons:t.contextAttachmentIcons,composerAttachmentActions:t.composerAttachmentActions},this.transport=this.createTransport(this.config.transport),this.tools=new o_(this.config.tools),this.tools.bindInvoke(this.invokeTool.bind(this)),this.configureTransportAfterCreate(this.transport),Object.entries(t.toolRenderers??{}).forEach(([r,a])=>{a&&this.toolRendererMap.set(r,a)}),this.toolRendererMap.has("propose_form_values")||this.toolRendererMap.set("propose_form_values",M3),this.toolRendererMap.has("image_generation")||this.toolRendererMap.set("image_generation",S3),this.queryClient=new xt.QueryClient({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}})}config;transport;tools;queryClient;events;socketClient=null;toolRendererMap=new Map;storeRef;pageContextProviders=new Set;chatMetadataProviders=new Set;createTransport(t){return t.mode==="proxy"?new Lr(t):new jo(t)}configureTransportAfterCreate(t){this.config.transport.mode==="direct"&&t instanceof jo&&(t.setToolRegistry(this.tools),t.setContextKeys(this.config.contextKeys.map(n=>({key:n.key,tools:n.tools}))),this.config.models&&t.setModels(this.config.models),t.setUntitledChatText(this.config.translations.untitledChat))}updateTransportConfig(t){const n=rd.parse({...this.rawConfig,transport:t}),r=this.config.transport,a=this.transport;this.rawConfig={...this.rawConfig,transport:t},this.config.transport=t.onError?{...n.transport,onError:t.onError}:n.transport;const i=this.config.transport.mode;if(r.mode!==i){a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}));return}i==="proxy"&&a instanceof Lr?a.updateConfig(this.config.transport):i==="direct"&&a instanceof jo?(a.updateConfig(this.config.transport),this.configureTransportAfterCreate(a)):(a.cancelStream?.(),this.transport=this.createTransport(this.config.transport),this.configureTransportAfterCreate(this.transport)),this.events.dispatchEvent(new CustomEvent("runtime:transport-config-changed",{detail:{previous:r,next:this.config.transport}}))}setTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:t})}mergeTransportHeaders(t){const n=this.config.transport;this.updateTransportConfig({...n,headers:{...n.headers??{},...t}})}removeTransportHeaders(t){const n=this.config.transport;if(!n.headers||t.length===0)return;const r={...n.headers};for(const a of t)delete r[a];this.updateTransportConfig({...n,headers:Object.keys(r).length?r:void 0})}get defaultContextKey(){return this.config.defaultContextKey??this.config.contextKeys[0]?.key}get store(){if(!this.storeRef)throw new Error("AgentRuntime store has not been attached yet");return this.storeRef}attachStore(t){this.storeRef=t}get socket(){return this.socketClient}setSocketClient(t){this.socketClient!==t&&(this.socketClient=t,this.events.dispatchEvent(new CustomEvent("runtime:socket-changed",{detail:{socket:t}})))}registerTool(t){this.tools.register(t)}registerToolRenderer(t,n){this.toolRendererMap.set(t,n)}registerPageContextProvider(t){return this.pageContextProviders.add(t),()=>{this.pageContextProviders.delete(t)}}registerChatMetadataProvider(t){return this.chatMetadataProviders.add(t),()=>{this.chatMetadataProviders.delete(t)}}getChatMetadata(t){const n={};let r=!1;const a=o=>{o&&typeof o=="object"&&(Object.assign(n,o),r=!0)},i=this.config.chatMetadata?.getMetadata;if(i)try{a(i(t))}catch{}for(const o of this.chatMetadataProviders)try{a(o(t))}catch{}return r?n:void 0}getPageContextInput(){if(typeof window>"u")return{};const t=window.location?.href;let n;if(t)try{const a=new URL(t);n=`${a.pathname}${a.search}${a.hash}`}catch{}const r=typeof document<"u"?document.title:void 0;return{url:t,route:n,title:r}}getPageContextData(t){const n=t??this.getPageContextInput(),r={};let a=!1;const i=this.config.pageContext?.getData;if(i)try{const o=i(n);o&&typeof o=="object"&&(Object.assign(r,o),a=!0)}catch{}for(const o of this.pageContextProviders)try{const s=o(n);s&&typeof s=="object"&&(Object.assign(r,s),a=!0)}catch{}return a?r:void 0}buildPageContextAttachment(){const t=this.config.pageContext,n=this.getPageContextData();return N3({...t?.includeUserAgent!==void 0?{includeUserAgent:t.includeUserAgent}:{},...t?.includeReferrer!==void 0?{includeReferrer:t.includeReferrer}:{},...t?.includeViewport!==void 0?{includeViewport:t.includeViewport}:{},...t?.includeTitle!==void 0?{includeTitle:t.includeTitle}:{},...t?.name?{name:t.name}:{},...n?{extra:n}:{}})}getToolRenderer(t){return this.toolRendererMap.get(t.name)}ensureStore(t){if(!this.storeRef)throw new Error(`Cannot ${t} before AgentRuntime is mounted`);return this.storeRef}resolveChatId(t){const r=this.ensureStore("invoke tools").getState(),a=t?.chatId??r.activeChatId;if(!a||!r.chats[a])throw new Error("Tool invocation requires an active chat. Select or create a chat first.");return a}buildToolContext(t){const n=this.ensureStore("create tool context");return{chatId:t,agentId:this.config.appId,workspaceId:this.config.workspaceId,appendSystemMessage:r=>{n.getState().appendSystemMessage(t,r)}}}writeToolCall(t,n){this.ensureStore("write tool call").getState().upsertToolCall(t,{...n})}async invokeTool(t,n={},r){const a=this.resolveChatId(r),i={id:vt.nanoid(),name:t,input:n,status:exports.AgentToolCallStatus.Running};this.writeToolCall(a,i);const o=this.buildToolContext(a);try{const s=await this.tools.execute(t,n,o,i);return this.writeToolCall(a,s),s}catch(s){const l={...i,status:exports.AgentToolCallStatus.Failed,error:s instanceof Error?s.message:"Unknown tool error"};throw this.writeToolCall(a,l),s}}}const k7e={background:"#050505",surface:"#0f0f11",text:"#f7f7f7",subtext:"#8f9baa",border:"#1f2229",accent:"#6c63ff",accentSoft:"rgba(108, 99, 255, 0.14)",warning:"#ffb347",danger:"#ff5f56",fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',radius:"12px",fontSize:"14px",colorMode:"light"},C3=e=>({...k7e,...e}),R3=j.createContext(C3()),v7e=e=>({"--mp-agents-bg":e.background,"--mp-agents-surface":e.surface,"--mp-agents-text":e.text,"--mp-agents-subtext":e.subtext,"--mp-agents-border":e.border,"--mp-agents-accent":e.accent,"--mp-agents-accent-soft":e.accentSoft,"--mp-agents-warning":e.warning,"--mp-agents-danger":e.danger,"--mp-agents-radius":e.radius,"--mp-agents-font-size":e.fontSize}),I3=({value:e,children:t})=>{const n=j.useMemo(()=>C3(e),[e]);return w.jsxs(R3.Provider,{value:n,children:[w.jsx("style",{children:`:root {
|
|
8291
8291
|
${Object.entries(v7e(n)).map(([r,a])=>`${r}: ${a};`).join(`
|
|
8292
8292
|
`)}
|
|
8293
|
-
}`}),t]})},O3=()=>j.useContext(R3),v2="mp-agent-selected-model",ra="__auto__";function L3(e){return e.mode==="direct"?`${v2}-${e.mode}-${e.provider}`:`${v2}-${e.mode}`}function _2(e,t){try{const n=L3(e);localStorage.setItem(n,t)}catch(n){console.warn("Failed to save selected model to localStorage:",n)}}function _7e(e){try{const t=L3(e);return localStorage.getItem(t)}catch(t){return console.warn("Failed to load selected model from localStorage:",t),null}}function D3(e,t){return!e||e.length===0?[]:t.mode==="direct"&&t.provider!=="custom"?e.filter(n=>n.provider?n.provider===t.provider:!0):e}function x7e(e,t,n){const r=_7e(t);if(r){if(r===ra)return;if(D3(e,t).some(i=>i.id===r))return r}}const w7e="mp-agents-last-active-chat";function z3(e){return`${w7e}-${e}`}function $3(e){return typeof e=="string"&&e.length>0&&e.length<256}function E7e(e){if(typeof window>"u")return null;try{const t=localStorage.getItem(z3(e));return t&&$3(t)?t:null}catch{return null}}function M7e(e,t){if(!(typeof window>"u"))try{const n=z3(e);t&&$3(t)?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}}const vn=Object.create(null);vn.open="0";vn.close="1";vn.ping="2";vn.pong="3";vn.message="4";vn.upgrade="5";vn.noop="6";const vi=Object.create(null);Object.keys(vn).forEach(e=>{vi[vn[e]]=e});const dd={type:"error",data:"parser error"},F3=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",P3=typeof ArrayBuffer=="function",q3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,fp=({type:e,data:t},n,r)=>F3&&t instanceof Blob?n?r(t):x2(t,r):P3&&(t instanceof ArrayBuffer||q3(t))?n?r(t):x2(new Blob([t]),r):r(vn[e]+(t||"")),x2=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function w2(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let is;function S7e(e,t){if(F3&&e.data instanceof Blob)return e.data.arrayBuffer().then(w2).then(t);if(P3&&(e.data instanceof ArrayBuffer||q3(e.data)))return t(w2(e.data));fp(e,!1,n=>{is||(is=new TextEncoder),t(is.encode(n))})}const E2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<E2.length;e++)aa[E2.charCodeAt(e)]=e;const N7e=e=>{let t=e.length*.75,n=e.length,r,a=0,i,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)i=aa[e.charCodeAt(r)],o=aa[e.charCodeAt(r+1)],s=aa[e.charCodeAt(r+2)],l=aa[e.charCodeAt(r+3)],d[a++]=i<<2|o>>4,d[a++]=(o&15)<<4|s>>2,d[a++]=(s&3)<<6|l&63;return u},A7e=typeof ArrayBuffer=="function",gp=(e,t)=>{if(typeof e!="string")return{type:"message",data:B3(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:T7e(e.substring(1),t)}:vi[n]?e.length>1?{type:vi[n],data:e.substring(1)}:{type:vi[n]}:dd},T7e=(e,t)=>{if(A7e){const n=N7e(e);return B3(n,t)}else return{base64:!0,data:e}},B3=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},U3="",C7e=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((i,o)=>{fp(i,!1,s=>{r[o]=s,++a===n&&t(r.join(U3))})})},R7e=(e,t)=>{const n=e.split(U3),r=[];for(let a=0;a<n.length;a++){const i=gp(n[a],t);if(r.push(i),i.type==="error")break}return r};function I7e(){return new TransformStream({transform(e,t){S7e(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const i=new DataView(a.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{a=new Uint8Array(9);const i=new DataView(a.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let os;function Wa(e){return e.reduce((t,n)=>t+n.length,0)}function Ka(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function O7e(e,t){os||(os=new TextDecoder);const n=[];let r=0,a=-1,i=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(Wa(n)<1)break;const l=Ka(n,1);i=(l[0]&128)===128,a=l[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(Wa(n)<2)break;const l=Ka(n,2);a=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Wa(n)<8)break;const l=Ka(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){s.enqueue(dd);break}a=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Wa(n)<a)break;const l=Ka(n,a);s.enqueue(gp(i?l:os.decode(l),t)),r=0}if(a===0||a>e){s.enqueue(dd);break}}}})}const H3=4;function ut(e){if(e)return L7e(e)}function L7e(e){for(var t in ut.prototype)e[t]=ut.prototype[t];return e}ut.prototype.on=ut.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ut.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ut.prototype.off=ut.prototype.removeListener=ut.prototype.removeAllListeners=ut.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};ut.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};ut.prototype.emitReserved=ut.prototype.emit;ut.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ut.prototype.hasListeners=function(e){return!!this.listeners(e).length};const bo=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Qt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),D7e="arraybuffer";function j3(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const z7e=Qt.setTimeout,$7e=Qt.clearTimeout;function ko(e,t){t.useNativeTimers?(e.setTimeoutFn=z7e.bind(Qt),e.clearTimeoutFn=$7e.bind(Qt)):(e.setTimeoutFn=Qt.setTimeout.bind(Qt),e.clearTimeoutFn=Qt.clearTimeout.bind(Qt))}const F7e=1.33;function P7e(e){return typeof e=="string"?q7e(e):Math.ceil((e.byteLength||e.size)*F7e)}function q7e(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function V3(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function B7e(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function U7e(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class H7e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class yp extends ut{constructor(t){super(),this.writable=!1,ko(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new H7e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=gp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=B7e(t);return n.length?"?"+n:""}}class j7e extends yp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};R7e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,C7e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=V3()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let G3=!1;try{G3=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const V7e=G3;function G7e(){}class W7e extends j7e{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,i)=>{this.onError("xhr post error",a,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class kn extends ut{constructor(t,n,r){super(),this.createRequest=t,ko(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=j3(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=kn.requestsCount++,kn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=G7e,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete kn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}kn.requestsCount=0;kn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",M2);else if(typeof addEventListener=="function"){const e="onpagehide"in Qt?"pagehide":"unload";addEventListener(e,M2,!1)}}function M2(){for(let e in kn.requests)kn.requests.hasOwnProperty(e)&&kn.requests[e].abort()}const K7e=function(){const e=W3({xdomain:!1});return e&&e.responseType!==null}();class Y7e extends W7e{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=K7e&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new kn(W3,this.uri(),t)}}function W3(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||V7e))return new XMLHttpRequest}catch{}if(!t)try{return new Qt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const K3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Z7e extends yp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=K3?{}:j3(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;fp(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}a&&bo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=V3()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ss=Qt.WebSocket||Qt.MozWebSocket;class X7e extends Z7e{createSocket(t,n,r){return K3?new ss(t,n,r):n?new ss(t,n):new ss(t)}doWrite(t,n){this.ws.send(n)}}class Q7e extends yp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=O7e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=I7e();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const i=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),i())}).catch(s=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&bo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const J7e={websocket:X7e,webtransport:Q7e,polling:Y7e},e_e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,t_e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function pd(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=e_e.exec(e||""),i={},o=14;for(;o--;)i[t_e[o]]=a[o]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=n_e(i,i.path),i.queryKey=r_e(i,i.query),i}function n_e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function r_e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,i){a&&(n[a]=i)}),n}const hd=typeof addEventListener=="function"&&typeof removeEventListener=="function",_i=[];hd&&addEventListener("offline",()=>{_i.forEach(e=>e())},!1);class Xn extends ut{constructor(t,n){if(super(),this.binaryType=D7e,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=pd(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=pd(n.host).host);ko(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=U7e(this.opts.query)),hd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_i.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=H3,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Xn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Xn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=P7e(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,bo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Xn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),hd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=_i.indexOf(this._offlineEventListener);r!==-1&&_i.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Xn.protocol=H3;class a_e extends Xn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Xn.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const o=p=>{const h=new Error("probe error: "+p);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function s(){o("transport closed")}function l(){o("socket closed")}function u(p){n&&p.name!==n.name&&i()}const d=()=>{n.removeListener("open",a),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",a),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let i_e=class extends a_e{constructor(t,n={}){const r=typeof t=="object",a=r?{...t}:{...n};(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(i=>J7e[i]).filter(i=>!!i)),super(r?a:t,a)}};function o_e(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=pd(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const s_e=typeof ArrayBuffer=="function",l_e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Y3=Object.prototype.toString,c_e=typeof Blob=="function"||typeof Blob<"u"&&Y3.call(Blob)==="[object BlobConstructor]",u_e=typeof File=="function"||typeof File<"u"&&Y3.call(File)==="[object FileConstructor]";function bp(e){return s_e&&(e instanceof ArrayBuffer||l_e(e))||c_e&&e instanceof Blob||u_e&&e instanceof File}function xi(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(xi(e[n]))return!0;return!1}if(bp(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return xi(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&xi(e[n]))return!0;return!1}function d_e(e){const t=[],n=e.data,r=e;return r.data=wi(n,t),r.attachments=t.length,{packet:r,buffers:t}}function wi(e,t,n){if(!e)return e;if(bp(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let a=0;a<e.length;a++)r[a]=wi(e[a],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON=="function"&&!n)return wi(e.toJSON(),t,!0);const r={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=wi(e[a],t));return r}return e}function p_e(e,t){return e.data=md(e.data,t),delete e.attachments,e}function md(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=md(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=md(e[n],t));return e}const h_e=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ue||(Ue={}));class m_e{constructor(t){this.replacer=t}encode(t){return(t.type===Ue.EVENT||t.type===Ue.ACK)&&xi(t)?this.encodeAsBinary({type:t.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ue.BINARY_EVENT||t.type===Ue.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=d_e(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}class kp extends ut{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ue.BINARY_EVENT;r||n.type===Ue.BINARY_ACK?(n.type=r?Ue.EVENT:Ue.ACK,this.reconstructor=new f_e(n)):super.emitReserved("decoded",n)}else if(bp(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ue.BINARY_EVENT||r.type===Ue.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(i,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const s=Number(o);if(!g_e(s)||s<1)throw new Error("Illegal attachments");if(s>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=s}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const i=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(kp.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ue.CONNECT:return S2(n);case Ue.DISCONNECT:return n===void 0;case Ue.CONNECT_ERROR:return typeof n=="string"||S2(n);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&h_e.indexOf(n[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class f_e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=p_e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g_e=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function S2(e){return Object.prototype.toString.call(e)==="[object Object]"}const y_e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:kp,Encoder:m_e,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function sn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const b_e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Z3 extends ut{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[sn(t,"open",this.onopen.bind(this)),sn(t,"packet",this.onpacket.bind(this)),sn(t,"error",this.onerror.bind(this)),sn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,i;if(b_e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ue.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const s=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},a),o=(...s)=>{this.io.clearTimeoutFn(i),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,a)=>{const i=(o,s)=>o?a(o):r(s);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...i)=>(this._queue[0],a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ue.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(t);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(t);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:Ue.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Vr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Vr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Vr.prototype.reset=function(){this.attempts=0};Vr.prototype.setMin=function(e){this.ms=e};Vr.prototype.setMax=function(e){this.max=e};Vr.prototype.setJitter=function(e){this.jitter=e};class fd extends ut{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ko(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Vr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||y_e;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new i_e(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=sn(n,"open",function(){r.onopen(),t&&t()}),i=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=sn(n,"error",i);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{a(),i(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(a),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(sn(t,"ping",this.onping.bind(this)),sn(t,"data",this.ondata.bind(this)),sn(t,"error",this.onerror.bind(this)),sn(t,"close",this.onclose.bind(this)),sn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){bo(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Z3(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xr={};function Ei(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=o_e(e,t.path||"/socket.io"),r=n.source,a=n.id,i=n.path,o=Xr[a]&&i in Xr[a].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new fd(r,t):(Xr[a]||(Xr[a]=new fd(r,t)),l=Xr[a]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ei,{Manager:fd,Socket:Z3,io:Ei,connect:Ei});const k_e=j.createContext(null),v_e=({children:e})=>{const t=$e(),n=fe(k=>k.upsertChat),r=fe(k=>k.upsertChatState),a=fe(k=>k.contextKey),i=fe(k=>k.activeChatId),o=j.useMemo(()=>t.config.user?.id??jr(),[t.config.user?.id]),s=t.config.transport,[l,u]=j.useState(null),[d,p]=j.useState(void 0),h=j.useRef(a),m=j.useRef(n),f=j.useRef(r),g=j.useRef(void 0);j.useEffect(()=>{h.current=a,m.current=n,f.current=r},[a,n,r]),j.useEffect(()=>{if(s.mode!=="proxy"){u(null),p(void 0),t.setSocketClient(null),t.transport instanceof Lr&&t.transport.setSocketId(void 0);return}const k=s.baseUrl,b=new URL(k,window.location.origin),x=`${b.protocol}//${b.host}`,M=s.socketNamespace,N=M?`${x}${M}`:x,E={},D=s;D.headers&&Object.assign(E,D.headers);const P={},C=D.apiKey&&`Bearer ${D.apiKey}`||D.headers?.Authorization;C&&(P.authorization=C,E.Authorization=C);const I=s.socketPath??Ri.Path,q=Ei(N,{path:I,auth:P,transports:["websocket","polling"],withCredentials:!0,...Object.keys(E).length>0&&{extraHeaders:E}});t.setSocketClient(q),u(q);const Z=()=>{p(q.id),t.transport instanceof Lr&&t.transport.setSocketId(q.id)},X=()=>{p(void 0),t.transport instanceof Lr&&t.transport.setSocketId(void 0)},K=G=>{if(G.contextKey===h.current){m.current(G);const z=t.store.getState(),V=De(z,G.id);f.current(G.id,{...V,status:ka(G.status)})}},R=G=>{const z=t.store.getState(),V=De(z,G.chat),A=V.messages.findIndex(Y=>Y.id===G.id);if(A>=0){const Y=[...V.messages];Y[A]=G,f.current(G.chat,{...V,messages:Y});return}f.current(G.chat,{...V,messages:[...V.messages,G]})},H=G=>{m.current(G);const z=t.store.getState(),V=De(z,G.id);f.current(G.id,{...V,status:ka(G.status)})};return q.on("connect",Z),q.on("disconnect",X),q.on("connect_error",G=>{console.error("Socket.IO connection error:",G.message)}),q.on(yi.ChatNew,K),q.on(yi.MessageNew,R),q.on(yi.ChatUpdate,H),()=>{t.transport instanceof Lr&&t.transport.setSocketId(void 0),t.setSocketClient(null),p(void 0),u(null),q.disconnect()}},[t,t.transport,s.mode,s.mode==="proxy"?s.baseUrl:void 0,s.mode==="proxy"?s.apiKey:void 0,s.mode==="proxy"?s.socketPath:void 0,s.mode==="proxy"?s.socketNamespace:void 0,s.mode==="proxy"?JSON.stringify(s.headers??{}):"",o]),j.useEffect(()=>{if(!l)return;const k=g.current;k&&k!==i&&l.emit("chat:unsubscribe",{chatId:k}),i&&i!==k&&(l.emit("chat:subscribe",{chatId:i}),g.current=i),i||(g.current=void 0)},[l,i]);const _=j.useMemo(()=>({socket:l,socketId:d}),[l,d]);return w.jsx(k_e.Provider,{value:_,children:e})},vp=j.createContext(null),__e=({config:e,children:t})=>{const n=j.useRef();n.current||(n.current=new T3(e));const[,r]=j.useState(0);j.useEffect(()=>{const o=n.current,s=()=>r(l=>l+1);return o.events.addEventListener("runtime:transport-config-changed",s),()=>{o.events.removeEventListener("runtime:transport-config-changed",s)}},[]);const a=j.useRef();if(!a.current){const o=n.current.defaultContextKey??n.current.config.contextKeys[0]?.key??"default";a.current=c7e(o),n.current.attachStore(a.current);const s=x7e(n.current.config.models,n.current.config.transport);a.current.getState().setComposerOptions({model:s})}const i=j.useMemo(()=>({runtime:n.current,store:a.current}),[]);return j.useEffect(()=>{const o=a.current;if(!o)return;let s=o.getState().activeChatId;return o.subscribe(()=>{const l=o.getState().activeChatId;if(l===s)return;s=l;const u=n.current?.config.user?.id??jr();M7e(u,l)})},[]),w.jsx(vp.Provider,{value:i,children:w.jsx(xt.QueryClientProvider,{client:i.runtime.queryClient,children:w.jsx(I3,{value:i.runtime.config.theme,children:w.jsx(v_e,{children:t})})})})},$e=()=>{const e=j.useContext(vp);if(!e)throw new Error("useAgentRuntime must be used inside <AgentProvider />");return e.runtime},fe=e=>{const t=j.useContext(vp);if(!t)throw new Error("useAgentStore must be used inside <AgentProvider />");return u5.useStore(t.store,e)},x_e=({initialSystemPrompt:e,composerFormRef:t,multiUser:n=!1,participantIds:r=[]})=>{const a=$e(),{composer:i,contextKey:o,activeChatId:s,draftChatKey:l,queuedMessages:u,activeChatStatus:d,upsertChat:p,setChatStatus:h,setActiveChat:m,setComposerError:f,moveChatKeyState:g,removeQueuedMessage:_,setPendingAssistant:k,enqueueQueuedMessage:b,appendMessagesToChat:x,commitPendingAssistant:M,setPageContextDismissed:N}=fe(V=>{const A=V.activeChatId??V.draftChatKey,Y=De(V,A);return{composer:V.composer,contextKey:V.contextKey,activeChatId:V.activeChatId,draftChatKey:V.draftChatKey,queuedMessages:Y.messageQueue,activeChatStatus:Y.status,upsertChat:V.upsertChat,setActiveChat:V.setActiveChat,setChatStatus:V.setChatStatus,setComposerError:V.setComposerError,moveChatKeyState:V.moveChatKeyState,setPendingAssistant:V.setPendingAssistant,removeQueuedMessage:V.removeQueuedMessage,enqueueQueuedMessage:V.enqueueQueuedMessage,appendMessagesToChat:V.appendMessagesToChat,commitPendingAssistant:V.commitPendingAssistant,setPageContextDismissed:V.setPageContextDismissed}}),E=j.useCallback(V=>!V||V.length===0?!1:V.some(A=>A.type===exports.AgentAttachmentType.Context&&A?.metadata?.kind==="pageContext"),[]),D=j.useRef(!1),P=j.useRef(!1),C=j.useRef(void 0),I=j.useRef(new Set),q=s??l,Z=j.useCallback(async(V,A)=>{if(!a.transport.generateTitle)return;const Y=a.config.features?.titleGeneration==="llm"?"llm":"local";let ee;try{ee=await a.transport.generateTitle({userId:A,content:V,strategy:Y,contextKey:o})}catch{}return ee},[a.transport,a.config.features?.titleGeneration,o]),X=j.useCallback(async(V,A=[])=>{const Y=a.config.user?.id??"guest",ee=!s,L=s??l,se={current:L};C.current=L;const ye={value:V,attachments:A};f(se.current,void 0);let ke;if(ee){const pe=await Z(V,Y);pe&&pe.trim().length>0&&(ke={...ke??{},title:pe})}const Ie=a.getChatMetadata({contextKey:o});Ie&&(ke={...ke??{},...Ie});const Pe=a.store.getState(),Ke=s?Pe.chats[s]:void 0,nt=(s?Pe.chatState[s]:void 0)?.messages??[],mt=A.filter(pe=>X3(pe)?!w_e(nt,pe):!0),Ye=Ke?.model,ie=i.model!==Ye;let xe,we=!1;ie?(xe=i.model,we=!0):Ye?(xe=Ye,we=!1):(xe=void 0,we=!1);const Ve=E_e(V),ue={userId:Y,content:V,metadata:ke,contextKey:o,...ee?{}:{chatId:s},...we?{model:xe??""}:{},...mt.length>0?{attachments:mt}:{},...n?{mentions:Ve,participantIds:Array.from(new Set([Y,...r])),senderDisplayName:a.config.user?.displayName,senderAvatarUrl:a.config.user?.avatarUrl}:{}},Le=()=>{k(se.current,void 0)},Be=pe=>{if(pe?.name==="AbortError"){const be=C.current??se.current;return I.current.has(be)?(M(se.current),I.current.delete(be)):(Le(),t.current?.setDraft(ye)),{type:"aborted"}}throw pe},Ce=async()=>{h(se.current,st.Sending);try{if(!a.transport.sendMultiUserMessage)throw new Error("Multi-user chat requires a transport that supports sendMultiUserMessage");const pe=await a.transport.sendMultiUserMessage(ue);return p(pe.chat),ee&&(g(se.current,pe.chat.id),se.current=pe.chat.id,C.current=pe.chat.id,m(pe.chat.id)),x(pe.chat.id,[pe.message]),h(pe.chat.id,ka(pe.chat.status)),Le(),{type:"success"}}catch(pe){return Be(pe)}},ve=async()=>{let pe=`pending-${Date.now()}`,be="",Re;h(se.current,st.Streaming),k(se.current,{id:pe,content:"",reasoning:"",toolCalls:[],attachments:[],chat:s||"",role:exports.MessageRole.Assistant,createdAt:new Date().toISOString()});try{let B=s;const Q=re=>{if(re.type===exports.StreamChunkType.Chat&&re.chat){p(re.chat),B=re.chat.id,ee&&(C.current=re.chat.id,g(se.current,re.chat.id),se.current=re.chat.id,m(re.chat.id));return}if(re.type===exports.StreamChunkType.Reasoning&&re.reasoning){be+=re.reasoning,Re={...Re??{id:pe,chat:B,role:exports.MessageRole.Assistant,content:"",createdAt:new Date().toISOString()},reasoning:be},k(se.current,Re);return}if(re.type===exports.StreamChunkType.Error&&re.error){const _e=typeof re.error=="string"?re.error:String(re.error),qe=Re??{id:pe,chat:B||se.current,role:exports.MessageRole.Assistant,content:_e,createdAt:new Date().toISOString()};x(se.current,[{...qe,content:_e}]),h(se.current,st.Idle),Le();return}if(re.message&&re.message.role===exports.MessageRole.User){x(re.message.chat,[re.message]);return}re.message&&(pe=re.message.id,Re={...re.message,reasoning:be||re.message.reasoning},k(se.current,Re)),re.done&&(Re&&x(se.current,[Re]),h(se.current,st.Idle),Le())},oe=await a.transport.streamMessage(ue,Q,{streamKey:C.current});if(oe){const re=oe.messages.map(it=>Re&&it.id===Re.id&&it.role===exports.MessageRole.Assistant?{...it,reasoning:be}:it);x(oe.id,re);const _e=a.store.getState();return(_e.activeChatId??_e.draftChatKey)===se.current&&m(oe.id),Le(),{type:"success"}}return Le(),{type:"success"}}catch(B){return Be(B)}};try{const pe=await(n?Ce():ve());return pe.type==="success"&&(D.current=!1),pe}catch(pe){Le();const be=pe?.chat;be&&(p(be),m(be.id));const Re=pe instanceof Error?pe:new Error("Failed to send message");return f(se.current,Re.message||"Failed to send message"),h(se.current,st.Idle),t.current?.setDraft(ye),D.current=!1,{type:"error",error:Re}}finally{P.current=!1,n||h(se.current,st.Idle),C.current=void 0}},[s,o,i.model,n,r,a.transport,a.config.user?.displayName,a.config.user?.avatarUrl,a.config.user?.id,p,m,k,h,Z,e,g,t,f]),K=j.useCallback(async()=>{if(d!==st.Idle||P.current||!u.length||D.current)return;const V=u[0];P.current=!0,_(q,V.id);try{await X(V.content,V.attachments)}finally{P.current=!1}},[d,u,q,X,_]);j.useEffect(()=>{K()},[K]);const R=j.useCallback(async V=>{if(P.current)return;const A=u.find(Y=>Y.id===V);if(A){D.current=!1,P.current=!0,_(q,V);try{await X(A.content,A.attachments)}finally{P.current=!1}}},[u,q,_,X]),H=j.useCallback(async V=>{const Y=t.current.getDraft().attachments;if(!n&&d!==st.Idle){b(q,V,Y),t.current?.clearDraft();return}D.current=!1,t.current?.clearDraft(),await X(V,Y)},[d,n,b,q,X,t,E,N]),G=j.useCallback(()=>{D.current=!0;const V=C.current??q;I.current.add(V),a.transport.cancelStream?.(V),M(V),h(V,st.Idle)},[q,a.transport,M,h]),z=j.useCallback(async V=>{d===st.Streaming&&G(),await R(V)},[d,G,R]);return{pendingKey:q,queuedMessages:u,activeChatStatus:n?st.Idle:d,activeChatId:s,removeQueuedMessage:_,handleSubmit:H,handleStop:G,handleQueuedClick:z}},w_e=(e,t)=>{const n=JSON.stringify(t.metadata?.data);let r;for(let a=e.length-1;a>=0;a--){const o=e[a].attachments?.find(X3);if(o){r=o;break}}return!r||r.url!==t.url?!1:JSON.stringify(r.metadata?.data)===n},X3=e=>e.type===exports.AgentAttachmentType.Context&&e.metadata?.kind==="pageContext",E_e=e=>{const t=e.matchAll(/(^|[\s([{])@([a-zA-Z0-9_.-]+)/g),n=new Set,r=[];for(const a of t){const i=a[2],o=i.toLowerCase();n.has(o)||(n.add(o),r.push({type:o==="agent"?"agent":"user",name:i}))}return r.length>0?r:void 0},M_e=({queuedMessages:e,onSendQueued:t,onRemoveQueued:n})=>e.length?w.jsxs("div",{className:"mp-agent-composer-queue",children:[w.jsx("div",{className:"mp-agent-composer-queue-header",children:w.jsxs("span",{children:[e.length," message",e.length>1?"s":""," queued"]})}),w.jsx("div",{className:"mp-agent-composer-queue-items",children:e.map(r=>w.jsxs("div",{className:"mp-agent-composer-queue-item",children:[w.jsxs("span",{className:"mp-agent-composer-queue-item-text",children:[r.content,r.attachments?.length?w.jsxs("span",{style:{marginLeft:8,opacity:.7,display:"inline-flex",alignItems:"center",gap:4},children:[w.jsx(ro,{size:12}),r.attachments.length]}):null]}),w.jsxs("div",{className:"mp-agent-composer-queue-item-actions",children:[w.jsx("button",{type:"button",className:"mp-agent-composer-queue-button",onClick:()=>t(r.id),"aria-label":"Send queued message",children:w.jsx(Vd,{size:12})}),w.jsx("button",{type:"button",className:"mp-agent-composer-queue-button",onClick:()=>n(r.id),"aria-label":"Remove queued message",children:w.jsx(O5,{size:12})})]})]},r.id))})]}):null;function S_e(e,t){return e.size>t.maxFileSize?{type:"size",message:`File "${e.name}" exceeds maximum size of ${_p(t.maxFileSize)}`,fileName:e.name}:null}function N_e(e,t,n){if(e.length+t.filter(s=>s.type==="file").length>n.maxFilesPerMessage)return{type:"count",message:`Maximum ${n.maxFilesPerMessage} files per message allowed`};for(const s of e){const l=S_e(s,n);if(l)return l}const a=t.filter(s=>s.type==="file").reduce((s,l)=>{const u=l.metadata?.size||l.size||0;return s+u},0),i=e.reduce((s,l)=>s+l.size,0);return a+i>n.maxTotalAttachmentsSize?{type:"totalSize",message:`Total attachment size exceeds maximum of ${_p(n.maxTotalAttachmentsSize)}`}:null}function _p(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+n[r]}function A_e(){return{maxFileSize:10*1024*1024,maxTotalAttachmentsSize:50*1024*1024,maxFilesPerMessage:10,allowedMimeTypes:void 0}}const Q3=(e,t)=>{switch(e.type){case exports.AgentAttachmentType.Link:return w.jsx(A5,{size:12});case exports.AgentAttachmentType.Artifact:return w.jsx(ro,{size:12});case exports.AgentAttachmentType.Context:{const n=e?.metadata?.kind;if(n&&t?.[n])return t[n];switch(n){case"pageContext":return w.jsx(Yd,{size:12});case"formSnapshot":case"formField":return w.jsx(N5,{size:12});default:return w.jsx(Zd,{size:12})}}case exports.AgentAttachmentType.File:default:return w.jsx(S5,{size:12})}},T_e=({attachments:e})=>{const{config:t}=$e();return!e||e.length===0?null:w.jsx("div",{className:"mp-agent-message-attachments","aria-label":"Message attachments",children:e.map((n,r)=>{const a=w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"mp-agent-message-attachment-icon",children:Q3(n,t.contextAttachmentIcons)}),w.jsx("span",{className:"mp-agent-message-attachment-name",children:n.name})]});return n.url?w.jsx("a",{className:"mp-agent-message-attachment",href:n.url,target:"_blank",rel:"noreferrer",title:n.url,children:a},n.id||r):w.jsx("span",{className:"mp-agent-message-attachment",title:n.mimeType??n.name,children:a},n.id||r)})})},C_e=({attachments:e,onRemove:t,uploadProgress:n,uploadErrors:r})=>{const a=Wt(),{config:i}=$e();return!e||e.length===0?null:w.jsx("div",{className:"mp-agent-composer-attachments","aria-label":a.attachments,children:e.map(o=>{const s=n?.get(o.id),l=r?.get(o.name),u=o.metadata?.size||o.size,d=u?` (${_p(u)})`:"";return w.jsxs("span",{className:`mp-agent-attachment-chip ${l?"mp-agent-attachment-chip-error":""} ${s?.status==="uploading"?"mp-agent-attachment-chip-uploading":""}`,title:l||o.name,children:[w.jsx("span",{className:"mp-agent-attachment-chip-icon",children:Q3(o,i.contextAttachmentIcons)}),w.jsxs("span",{className:"mp-agent-attachment-chip-name",title:o.name,children:[o.name,d]}),s?.status==="uploading"&&w.jsxs("span",{className:"mp-agent-attachment-chip-progress",children:[s.progress,"%"]}),l&&w.jsx("span",{className:"mp-agent-attachment-chip-error-text",title:l,children:"⚠"}),t?w.jsx(un,{size:"sm",icon:"X",type:"button",onClick:p=>{p.preventDefault(),p.stopPropagation(),t(o.id)},"aria-label":`Remove attachment ${o.name}`}):null]},o.id)})})},R_e=e=>{const t=e.trim();if(!t||/\s/.test(t))return;const n=i=>i.replace(/[)\].,;:!?]+$/,"");if(!/^https?:\/\//i.test(t))return;const r=i=>{try{const o=new URL(i);return o.protocol!=="http:"&&o.protocol!=="https:"?void 0:o.toString()}catch{return}},a=n(t);return r(a)},I_e=e=>{try{const t=new URL(e);return t.hostname+(t.pathname&&t.pathname!=="/"?t.pathname:"")}catch{return e}},gd="mp-agent:locationchange",N2="__mp_agent_history_patched__",A2=()=>{try{window.dispatchEvent(new Event(gd))}catch{}},O_e=()=>{if(typeof window>"u")return;const e=window;if(!e[N2]){e[N2]=!0;try{const t=history.pushState;history.pushState=function(...n){const r=t.apply(this,n);return A2(),r}}catch{}try{const t=history.replaceState;history.replaceState=function(...n){const r=t.apply(this,n);return A2(),r}}catch{}}},L_e=e=>{if(typeof window>"u")return()=>{};O_e();const t=()=>e();return window.addEventListener("popstate",t),window.addEventListener("hashchange",t),window.addEventListener(gd,t),()=>{window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),window.removeEventListener(gd,t)}};async function D_e(e,t,n,r){const a=await fetch(r.presignedUrlEndpoint,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...r.getAuthHeaders?.()||{}},body:JSON.stringify({filename:e.name,mimeType:e.type||"application/octet-stream",size:e.size,chatId:t,userId:n})});if(!a.ok){const o=await a.text();throw new Error(`Failed to get presigned URL: ${a.status} ${o}`)}const i=await a.json();return{url:i.url,key:i.key}}async function z_e(e,t,n){return new Promise((r,a)=>{const i=new XMLHttpRequest;i.upload.addEventListener("progress",o=>{if(o.lengthComputable&&n){const s=Math.round(o.loaded/o.total*100);n(s)}}),i.addEventListener("load",()=>{i.status>=200&&i.status<300?r():a(new Error(`Upload failed: ${i.status} ${i.statusText}`))}),i.addEventListener("error",()=>{a(new Error("Upload failed: network error"))}),i.addEventListener("abort",()=>{a(new Error("Upload aborted"))}),i.open("PUT",t),i.setRequestHeader("Content-Type",e.type||"application/octet-stream"),i.send(e)})}async function $_e(e,t,n){const r=vt.nanoid(),a={fileId:r,fileName:e.name,progress:0,status:"pending"};try{n.onProgress?.({...a,status:"uploading",progress:0});const{url:i,key:o}=await D_e(e,n.chatId,n.userId,t);return await z_e(e,i,s=>{n.onProgress?.({...a,status:"uploading",progress:s})}),n.onProgress?.({...a,status:"completed",progress:100}),{id:r,type:exports.AgentAttachmentType.File,name:e.name,mimeType:e.type||void 0,size:e.size,metadata:{uploadedAt:new Date().toISOString(),s3Key:o,processingStatus:"pending",size:e.size,lastModified:e.lastModified}}}catch(i){const o=i instanceof Error?i.message:"Unknown error";throw n.onProgress?.({...a,status:"error",error:o}),i}}async function F_e(e,t,n){const r=await Promise.allSettled(e.map(o=>$_e(o,t,n))),a=[],i=[];if(r.forEach((o,s)=>{o.status==="fulfilled"?a.push(o.value):i.push(new Error(`Failed to process ${e[s].name}: ${o.reason}`))}),i.length>0&&a.length===0)throw i[0];return i.length>0&&console.warn("Some files failed to upload:",i),a}const P_e=({options:e,value:t,onChange:n,placeholder:r="Select...",disabled:a=!1,className:i="",triggerClassName:o="",placement:s="bottom-start",searchable:l=!1,searchPlaceholder:u="Search...",searchFilter:d})=>{const[p,h]=j.useState(!1),[m,f]=j.useState(null),[g,_]=j.useState(""),k=j.useRef([]),b=j.useRef(null),{refs:x,floatingStyles:M,context:N,isPositioned:E}=lp({open:p,onOpenChange:h,placement:s,strategy:"absolute",whileElementsMounted:np,middleware:[rp(8),ip({fallbackPlacements:["top-start","bottom-start","top-end","bottom-end"]}),ap({padding:8})]}),D=o3(N,{enabled:!a}),P=sp(N),C=up(N),q=X8e(N,{listRef:k,activeIndex:m,onNavigate:f,enabled:p&&!l,virtual:!1}),{getReferenceProps:Z,getFloatingProps:X,getItemProps:K}=cp(l?[D,P,C]:[D,P,C,q]),R=e.findIndex(Y=>Y.value===t),H=R>=0?e[R]:void 0,G=j.useMemo(()=>{const Y=g.trim().toLowerCase();if(!l||!Y)return e;const L=d?se=>d(se,Y):se=>`${se.label} ${se.description??""}`.toLowerCase().includes(Y);return e.filter(L)},[e,g,l,d]);j.useEffect(()=>{if(!p){f(null),_("");return}l&&setTimeout(()=>b.current?.focus(),0);const Y=G.findIndex(ee=>ee.value===t);f(Y>=0?Y:0)},[p,l,t,G]),j.useEffect(()=>{p&&f(G.length>0?0:null)},[g,G.length,p]);const z=Y=>G.length===0?null:Y<0?G.length-1:Y>=G.length?0:Y,V=Y=>{Y!=null&&k.current[Y]?.scrollIntoView({block:"nearest"})},A=Y=>{n(Y),h(!1),f(null),_("")};return w.jsxs("div",{className:`mp-agent-dropdown ${i}`,children:[w.jsxs("button",{ref:x.setReference,type:"button",className:`mp-agent-dropdown-trigger ${o}`,disabled:a,"aria-expanded":p,"aria-haspopup":"listbox",...Z(),children:[w.jsx("span",{className:"mp-agent-dropdown-trigger-content",children:H?w.jsxs(w.Fragment,{children:[H.icon&&w.jsx("span",{className:"mp-agent-dropdown-trigger-icon",children:H.icon}),w.jsx("span",{className:"mp-agent-dropdown-trigger-label",children:H.label})]}):w.jsx("span",{className:"mp-agent-dropdown-trigger-placeholder",children:r})}),w.jsx(no,{size:16,className:`mp-agent-dropdown-chevron ${p?"open":""}`})]}),p&&w.jsxs("div",{role:"listbox",ref:x.setFloating,style:{...M,opacity:E?1:0,pointerEvents:E?"auto":"none",transition:E?"opacity 0.15s ease-out":"none"},className:"mp-agent-dropdown-menu",...X(),children:[l&&w.jsx("div",{className:"mp-agent-dropdown-search",onKeyDown:Y=>Y.stopPropagation(),children:w.jsx("input",{ref:b,className:"mp-agent-dropdown-search-input",value:g,placeholder:u,onChange:Y=>_(Y.target.value),onKeyDown:Y=>{if(Y.key==="Escape"){Y.preventDefault(),h(!1),_("");return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault();const ee=Y.key==="ArrowDown"?1:-1,L=m??(ee>0?-1:0),se=z(L+ee);f(se),V(se);return}if(Y.key==="Enter"){if(m==null)return;const ee=G[m];if(!ee)return;Y.preventDefault(),A(ee.value)}}})}),w.jsxs("div",{className:"mp-agent-dropdown-list",children:[G.map((Y,ee)=>w.jsxs("button",{ref:L=>{k.current[ee]=L},type:"button",className:`mp-agent-dropdown-item ${t===Y.value?"selected":""} ${m===ee?"active":""}`,role:"option","aria-selected":t===Y.value,...K({onClick:()=>A(Y.value),onMouseEnter:()=>{f(ee)},onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),A(Y.value))}}),children:[Y.icon&&w.jsx("span",{className:"mp-agent-dropdown-item-icon",children:Y.icon}),w.jsxs("span",{className:"mp-agent-dropdown-item-content",children:[w.jsx("span",{className:"mp-agent-dropdown-item-label",children:Y.label}),Y.description&&w.jsx("span",{className:"mp-agent-dropdown-item-description",children:Y.description})]})]},Y.value)),l&&G.length===0&&w.jsx("div",{className:"mp-agent-dropdown-empty","aria-label":"No results",children:"No results"})]})]})]})},q_e=j.memo(()=>{const e=$e(),t=fe(p=>p.composer),n=fe(p=>p.contextKey),r=fe(p=>p.setComposerOptions),a=e.config.models,{data:i,isLoading:o}=f3(),s=j.useMemo(()=>{const p=i&&i.length>0?i:a;return D3(p,e.config.transport).filter(m=>!m.contexts?.length||m.contexts.includes(n))},[i,a,e.config.transport,n]),l=j.useMemo(()=>{const p=s.slice().sort((h,m)=>h.label.localeCompare(m.label,void 0,{sensitivity:"base"})).map(h=>({value:h.id,label:h.label}));return[{value:ra,label:"Auto"},...p]},[s]),u=j.useMemo(()=>t.model!==void 0?t.model:ra,[t.model]),d=j.useCallback(p=>{p===ra?(r({model:void 0}),_2(e.config.transport,ra)):(r({model:p}),_2(e.config.transport,p))},[r,e.config.transport]);return o&&!a?.length||l.length===0?null:w.jsx(P_e,{options:l,value:u,onChange:d,placeholder:"Select model...",searchable:!0,searchPlaceholder:"Search models...",placement:"top-start",triggerClassName:"mp-agent-model-selector-trigger"})}),B_e=e=>{if(!e)return"";let t=e.replace(/[_-]+/g," ");return t=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),t=t.trim().replace(/\s+/g," "),t?t.charAt(0).toUpperCase()+t.slice(1):""},U_e=({checked:e,disabled:t,onChange:n,className:r="",...a})=>{const i=o=>{o.preventDefault(),!t&&n(!e)};return w.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:t,className:`mp-agent-switch ${e?"on":"off"} ${r}`.trim(),onClick:i,...a,children:w.jsx("span",{className:"mp-agent-switch-thumb"})})},T2=e=>e.reduce((t,n)=>(t[n.agentName]={...n.tools},t),{}),J3=({preferences:e,disabled:t})=>{const n=Wt(),{upsertSingle:r}=_3(),[a,i]=j.useState(()=>T2(e)),[o,s]=j.useState({});j.useEffect(()=>{i(T2(e))},[e]);const l=r.error?.message,u=j.useMemo(()=>e.some(p=>Object.keys(p.tools).length>0),[e]),d=(p,h,m)=>{i(f=>{const g=f[p]??{},_=g,k={...g,[h]:m},b={...f,[p]:k};return s(x=>({...x,[p]:{...x[p]??{},[h]:!0}})),r.mutate({agentName:p,input:{tools:k}},{onError:()=>{i(x=>({...x,[p]:_}))},onSettled:()=>{s(x=>{const M={...x[p]??{}};if(delete M[h],Object.keys(M).length===0){const{[p]:N,...E}=x;return E}return{...x,[p]:M}})}}),b})};return w.jsxs("div",{className:"mp-agent-preferences-panel",children:[!u&&w.jsx("div",{className:"mp-agent-preferences-empty",children:n.agentSettingsNoConfigurableTools}),e.map(p=>{const h=a[p.agentName]??{},m=Object.entries(h);return w.jsxs("div",{className:"mp-agent-preferences-agent",children:[w.jsx("div",{className:"mp-agent-preferences-agent-header",children:w.jsx("strong",{children:p.agentName})}),m.length===0?w.jsx("div",{className:"mp-agent-preferences-empty",children:n.agentSettingsNoToolsForAgent}):w.jsx("div",{className:"mp-agent-preferences-tools",children:m.map(([f,g])=>{const _=!!o[p.agentName]?.[f];return w.jsxs("label",{className:"mp-agent-preferences-tool",children:[w.jsx("span",{className:"mp-agent-preferences-tool-label",children:B_e(f)}),w.jsx(U_e,{checked:g,onChange:k=>d(p.agentName,f,k),disabled:!!t||_})]},`${p.agentName}:${f}`)})})]},p.agentName)}),l&&w.jsx("div",{className:"mp-agent-preferences-error",children:l})]})};function H_e(e){return e.map(t=>{const n=(t.tools??[]).reduce((r,a)=>(a.userConfigurable&&(r[a.title]=!a.disabledByDefault),r),{});return{agentName:t.name,tools:n}})}const j_e=()=>{const e=Wt(),t=$e(),n=fe(l=>l.contextKey),{data:r,isLoading:a,isError:i}=b3(n),o=j.useMemo(()=>H_e(r??[]),[r]),s=!!t.transport.upsertAgentPreferences&&!!t.transport.upsertAgentPreferencesBatch;return a?w.jsx(w.Fragment,{children:e.agentSettingsLoading}):i?w.jsx(w.Fragment,{children:e.agentSettingsError}):w.jsx(J3,{preferences:o,disabled:!s})},V_e=()=>{const[e,t]=j.useState(!1),n=Wt(),{refs:r,floatingStyles:a,context:i,isPositioned:o}=lp({open:e,onOpenChange:t,placement:"top-start",strategy:"absolute",whileElementsMounted:np,middleware:[rp(8),ip({fallbackPlacements:["bottom-start","top-end","bottom-end"]}),ap({padding:8})]}),s=o3(i),l=sp(i),u=up(i),{getReferenceProps:d,getFloatingProps:p}=cp([s,l,u]);return w.jsxs("div",{className:"mp-agent-tool-config-dropdown",children:[w.jsx(Tn,{content:n.agentSettingsTooltip,children:w.jsx("button",{ref:r.setReference,type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button","aria-label":n.agentSettingsTooltip,...d(),children:w.jsx(C5,{size:16})})}),e&&w.jsx("div",{ref:r.setFloating,style:{...a,opacity:o?1:0,pointerEvents:o?"auto":"none",transition:o?"opacity 0.15s ease-out":"none"},className:"mp-agent-tool-config-panel",...p(),children:w.jsx(j_e,{})})]})},G_e=j.forwardRef(({autoFocus:e,activeChatId:t,status:n,onStop:r,onSubmit:a},i)=>{const o=Wt(),s=$e(),l=j.useRef(null),u=j.useRef(null),d=fe(ie=>ie.activeChatId??ie.draftChatKey),p=fe(ie=>De(ie,d).composerDraft),h=fe(ie=>De(ie,d).composerError),m=fe(ie=>De(ie,d).pageContextDismissed),f=fe(ie=>ie.setComposerValue),g=fe(ie=>ie.setComposerDraft),_=fe(ie=>ie.clearComposerDraft),k=fe(ie=>ie.setComposerError),b=fe(ie=>ie.addComposerAttachments),x=fe(ie=>ie.removeComposerAttachment),M=fe(ie=>ie.setPageContextDismissed),N=p.value,E=p.attachments,[D,P]=j.useState(new Map),[C,I]=j.useState(new Map),q=j.useRef(N),Z=j.useRef(E),X=j.useRef(m),K=s.config.features?.pageContextAttachments!==!1,R=s.config.composerAttachmentActions,G=`Attach ${s.config.pageContext?.name?.trim()||"Page context"}`,z=s.config.contextAttachmentIcons?.pageContext??w.jsx(Yd,{size:16}),V=ie=>ie.type===exports.AgentAttachmentType.Context&&ie?.metadata?.kind==="pageContext",A=E.some(V),Y=()=>{if(K)return s.buildPageContextAttachment()};j.useEffect(()=>{Z.current=E},[E]),j.useEffect(()=>{q.current=N},[N]),j.useEffect(()=>{X.current=m},[m]),j.useEffect(()=>{if(!K||m||A)return;const ie=Y();ie&&b(d,[ie])},[K,m,A,d,b]),j.useEffect(()=>{if(K&&!(typeof window>"u"))return L_e(()=>{if(X.current)return;const ie=Z.current,xe=ie.find(V);if(!xe)return;const we=Y();if(!we)return;const Ve={...we,id:xe.id},ue=ie.map(Le=>Le.id===xe.id?Ve:Le);g(d,{value:q.current,attachments:ue})})},[K,d,g]),j.useImperativeHandle(i,()=>({setValue:ie=>{f(d,ie)},getDraft:()=>({value:N,attachments:E}),setDraft:ie=>{g(d,{value:ie.value,attachments:ie.attachments??[]})},clearDraft:()=>{_(d)},buildPageContextAttachment:()=>Y()})),j.useEffect(()=>{const ie=l.current;ie&&(ie.style.height="auto",ie.style.height=`${Math.min(ie.scrollHeight,200)}px`)},[N]);const ee=async ie=>{if(!ie||ie.length===0)return;const xe=Array.from(ie),we=A_e(),Ve=N_e(xe,E,we);if(Ve){I(ue=>{const Le=new Map(ue);return xe.forEach(Be=>{Le.set(Be.name,Ve.message)}),Le});return}I(ue=>{const Le=new Map(ue);return xe.forEach(Be=>Le.delete(Be.name)),Le});try{const ue=s.config.transport;if(ue.mode!=="proxy")throw new Error("File uploads are only supported with proxy transport");const Le={presignedUrlEndpoint:`${ue.baseUrl}/files/upload/presigned`,getAuthHeaders:()=>{const Ce={};return ue.headers?ue.headers:(ue.apiKey&&(Ce.Authorization=`Bearer ${ue.apiKey}`),Ce)}},Be=await F_e(xe,Le,{chatId:t,userId:s.config.user?.id,onProgress:Ce=>{P(ve=>{const pe=new Map(ve);return pe.set(Ce.fileId,Ce),pe})}});b(d,Be),setTimeout(()=>{P(Ce=>{const ve=new Map(Ce);return Be.forEach(pe=>ve.delete(pe.id)),ve})},2e3)}catch(ue){const Le=ue instanceof Error?ue.message:"Failed to upload files";I(Be=>{const Ce=new Map(Be);return xe.forEach(ve=>{Ce.set(ve.name,Le)}),Ce})}},L=()=>{u.current?.click()},se=ie=>{const xe=R_e(ie);if(!xe)return!1;if(E.some(ue=>ue.type===exports.AgentAttachmentType.Link&&ue.url===xe))return!0;const we=I_e(xe),Ve={id:vt.nanoid(),url:xe,name:we,type:exports.AgentAttachmentType.Link};return b(d,[Ve]),!0},ye=async ie=>{await ee(ie.target.files),ie.target.value=""},ke=ie=>{const xe=E.find(we=>we.id===ie);xe&&V(xe)&&M(d,!0),x(d,ie)},Ie=()=>{if(typeof window>"u"||typeof document>"u")return!1;const ie=A3(),xe=ie?.selectedText??window.getSelection?.()?.toString()?.trim()??"";if(!xe)return!1;const we=window.location?.href,Ve=xe.slice(0,20),ue=xe.length>20?Ve+"...":xe,Le=yo({kind:"webSnippet",url:we,title:ue,selectedText:xe,source:{app:"browser",url:we},...ie?.target?{target:ie.target}:{}});return b(d,[Le]),!0},Pe=ie=>{ie.preventDefault();const xe=N.trim();xe&&(k(d,void 0),a(xe))},Ke=ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),Pe(ie))},Ge=ie=>{h&&k(d,void 0),f(d,ie.target.value)},nt=ie=>{if(ie.nativeEvent.shiftKey)return;const xe=ie.clipboardData?.getData("text/plain")??"";if(!xe)return;se(xe)&&ie.preventDefault()},Ye=!!N.trim();return w.jsxs(w.Fragment,{children:[w.jsxs("form",{onSubmit:Pe,className:"mp-agent-composer-input-wrapper",id:"composer-form",children:[w.jsx("input",{ref:u,type:"file",multiple:!0,style:{display:"none"},onChange:ye}),w.jsx(C_e,{attachments:E,onRemove:ke,uploadProgress:D,uploadErrors:C}),w.jsx("textarea",{rows:2,name:"message",ref:l,value:N,autoFocus:e,className:"mp-agent-composer-textarea",placeholder:t?o.followUp:o.newChat,onChange:Ge,onKeyDown:Ke,onPaste:nt})]}),w.jsxs("div",{className:"mp-agent-composer-actions",children:[w.jsxs("div",{className:"mp-agent-composer-actions-left",children:[s.config.features?.modelSwitching&&w.jsx(q_e,{}),s.config.features?.toolConfiguration&&w.jsx(V_e,{}),s.config.features?.fileAttachments&&w.jsx(Tn,{content:o.attachFiles,children:w.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:L,"aria-label":o.attachFiles,children:w.jsx(ro,{size:16})})}),s.config.features?.selectionAttachments&&w.jsx(Tn,{content:o.attachSelectionToContext,children:w.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:()=>{Ie()},"aria-label":o.attachSelectionToContext,children:w.jsx(Zd,{size:16})})}),K&&!A&&w.jsx(Tn,{content:G,children:w.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:()=>{M(d,!1);const ie=Y();ie&&b(d,[ie])},"aria-label":G,children:z})}),R&&w.jsx(R,{chatKey:d,activeChatId:t,attachments:E,addAttachments:ie=>b(d,ie),removeAttachment:ke})]}),w.jsx("div",{className:"mp-agent-composer-actions-right",children:n===st.Streaming&&!Ye?w.jsx(Tn,{content:o.stopStreaming,children:w.jsx("button",{type:"button",onClick:r,"aria-label":o.stopStreaming,className:"mp-agent-composer-button mp-agent-composer-send-button",children:w.jsx(I5,{size:12})})}):w.jsx(Tn,{content:Ye?o.sendMessage:o.typeMessageToSend,children:w.jsx("button",{type:"submit",form:"composer-form",disabled:!Ye,"aria-label":o.sendMessage,className:"mp-agent-composer-button mp-agent-composer-send-button",children:w.jsx(Vd,{size:16})})})})]})]})}),ev=({autoFocus:e,multiUser:t=!1,participantIds:n})=>{const r=j.useRef({setValue:()=>{},getDraft:()=>({value:"",attachments:[]}),setDraft:()=>{},clearDraft:()=>{}}),{pendingKey:a,queuedMessages:i,activeChatStatus:o,activeChatId:s,handleSubmit:l,handleStop:u,handleQueuedClick:d,removeQueuedMessage:p}=x_e({composerFormRef:r,multiUser:t,participantIds:n});return w.jsx("div",{className:"mp-agent-composer-wrapper",children:w.jsxs("div",{className:"mp-agent-composer",children:[w.jsx(M_e,{queuedMessages:i,onSendQueued:d,onRemoveQueued:h=>p(a,h)}),w.jsx(G_e,{status:o,ref:r,autoFocus:e,activeChatId:s,onStop:u,onSubmit:l})]})})};function W_e(e,t,n){const r=new Array(e);return new Proxy(r,{get(a,i,o){if(typeof i=="string"){const s=i.charCodeAt(0);if(s>=48&&s<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let u=a[l];if(!u){const d=t[l*2];u=a[l]={index:l,key:n(l),start:d,size:t[l*2+1],end:d+t[l*2+1],lane:0}}return u}}if(i==="length")return e}return Reflect.get(a,i,o)}})}function Mr(e,t,n){let r=n.initialDeps??[],a,i=!0;function o(){var s;const l=process.env.NODE_ENV!=="production"&&!!n.key&&!!((s=n.debug)!=null&&s.call(n));let u=0;l&&(u=Date.now());const d=e();if(!(d.length!==r.length||d.some((m,f)=>r[f]!==m)))return a;r=d;let h=0;if(l&&(h=Date.now()),a=t(...d),l){const m=Math.round((Date.now()-u)*100)/100,f=Math.round((Date.now()-h)*100)/100,g=f/16,_=(k,b)=>{for(k=String(k);k.length<b;)k=" "+k;return k};console.info(`%c⏱ ${_(f,5)} /${_(m,5)} ms`,`
|
|
8293
|
+
}`}),t]})},O3=()=>j.useContext(R3),v2="mp-agent-selected-model",ra="__auto__";function L3(e){return e.mode==="direct"?`${v2}-${e.mode}-${e.provider}`:`${v2}-${e.mode}`}function _2(e,t){try{const n=L3(e);localStorage.setItem(n,t)}catch(n){console.warn("Failed to save selected model to localStorage:",n)}}function _7e(e){try{const t=L3(e);return localStorage.getItem(t)}catch(t){return console.warn("Failed to load selected model from localStorage:",t),null}}function D3(e,t){return!e||e.length===0?[]:t.mode==="direct"&&t.provider!=="custom"?e.filter(n=>n.provider?n.provider===t.provider:!0):e}function x7e(e,t,n){const r=_7e(t);if(r){if(r===ra)return;if(D3(e,t).some(i=>i.id===r))return r}}const w7e="mp-agents-last-active-chat";function z3(e){return`${w7e}-${e}`}function $3(e){return typeof e=="string"&&e.length>0&&e.length<256}function E7e(e){if(typeof window>"u")return null;try{const t=localStorage.getItem(z3(e));return t&&$3(t)?t:null}catch{return null}}function M7e(e,t){if(!(typeof window>"u"))try{const n=z3(e);t&&$3(t)?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}}const vn=Object.create(null);vn.open="0";vn.close="1";vn.ping="2";vn.pong="3";vn.message="4";vn.upgrade="5";vn.noop="6";const vi=Object.create(null);Object.keys(vn).forEach(e=>{vi[vn[e]]=e});const dd={type:"error",data:"parser error"},F3=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",P3=typeof ArrayBuffer=="function",q3=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,fp=({type:e,data:t},n,r)=>F3&&t instanceof Blob?n?r(t):x2(t,r):P3&&(t instanceof ArrayBuffer||q3(t))?n?r(t):x2(new Blob([t]),r):r(vn[e]+(t||"")),x2=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function w2(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let is;function S7e(e,t){if(F3&&e.data instanceof Blob)return e.data.arrayBuffer().then(w2).then(t);if(P3&&(e.data instanceof ArrayBuffer||q3(e.data)))return t(w2(e.data));fp(e,!1,n=>{is||(is=new TextEncoder),t(is.encode(n))})}const E2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",aa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<E2.length;e++)aa[E2.charCodeAt(e)]=e;const N7e=e=>{let t=e.length*.75,n=e.length,r,a=0,i,o,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r<n;r+=4)i=aa[e.charCodeAt(r)],o=aa[e.charCodeAt(r+1)],s=aa[e.charCodeAt(r+2)],l=aa[e.charCodeAt(r+3)],d[a++]=i<<2|o>>4,d[a++]=(o&15)<<4|s>>2,d[a++]=(s&3)<<6|l&63;return u},A7e=typeof ArrayBuffer=="function",gp=(e,t)=>{if(typeof e!="string")return{type:"message",data:B3(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:T7e(e.substring(1),t)}:vi[n]?e.length>1?{type:vi[n],data:e.substring(1)}:{type:vi[n]}:dd},T7e=(e,t)=>{if(A7e){const n=N7e(e);return B3(n,t)}else return{base64:!0,data:e}},B3=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},U3="",C7e=(e,t)=>{const n=e.length,r=new Array(n);let a=0;e.forEach((i,o)=>{fp(i,!1,s=>{r[o]=s,++a===n&&t(r.join(U3))})})},R7e=(e,t)=>{const n=e.split(U3),r=[];for(let a=0;a<n.length;a++){const i=gp(n[a],t);if(r.push(i),i.type==="error")break}return r};function I7e(){return new TransformStream({transform(e,t){S7e(e,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const i=new DataView(a.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{a=new Uint8Array(9);const i=new DataView(a.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let os;function Wa(e){return e.reduce((t,n)=>t+n.length,0)}function Ka(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let a=0;a<t;a++)n[a]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function O7e(e,t){os||(os=new TextDecoder);const n=[];let r=0,a=-1,i=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(Wa(n)<1)break;const l=Ka(n,1);i=(l[0]&128)===128,a=l[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(Wa(n)<2)break;const l=Ka(n,2);a=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Wa(n)<8)break;const l=Ka(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),d=u.getUint32(0);if(d>Math.pow(2,21)-1){s.enqueue(dd);break}a=d*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Wa(n)<a)break;const l=Ka(n,a);s.enqueue(gp(i?l:os.decode(l),t)),r=0}if(a===0||a>e){s.enqueue(dd);break}}}})}const H3=4;function ut(e){if(e)return L7e(e)}function L7e(e){for(var t in ut.prototype)e[t]=ut.prototype[t];return e}ut.prototype.on=ut.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ut.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ut.prototype.off=ut.prototype.removeListener=ut.prototype.removeAllListeners=ut.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,a=0;a<n.length;a++)if(r=n[a],r===t||r.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};ut.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,a=n.length;r<a;++r)n[r].apply(this,t)}return this};ut.prototype.emitReserved=ut.prototype.emit;ut.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};ut.prototype.hasListeners=function(e){return!!this.listeners(e).length};const bo=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Qt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),D7e="arraybuffer";function j3(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const z7e=Qt.setTimeout,$7e=Qt.clearTimeout;function ko(e,t){t.useNativeTimers?(e.setTimeoutFn=z7e.bind(Qt),e.clearTimeoutFn=$7e.bind(Qt)):(e.setTimeoutFn=Qt.setTimeout.bind(Qt),e.clearTimeoutFn=Qt.clearTimeout.bind(Qt))}const F7e=1.33;function P7e(e){return typeof e=="string"?q7e(e):Math.ceil((e.byteLength||e.size)*F7e)}function q7e(e){let t=0,n=0;for(let r=0,a=e.length;r<a;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function V3(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function B7e(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function U7e(e){let t={},n=e.split("&");for(let r=0,a=n.length;r<a;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class H7e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class yp extends ut{constructor(t){super(),this.writable=!1,ko(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new H7e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=gp(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=B7e(t);return n.length?"?"+n:""}}class j7e extends yp{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};R7e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,C7e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=V3()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let G3=!1;try{G3=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const V7e=G3;function G7e(){}class W7e extends j7e{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(a,i)=>{this.onError("xhr post error",a,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class kn extends ut{constructor(t,n,r){super(),this.createRequest=t,ko(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=j3(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=kn.requestsCount++,kn.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=G7e,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete kn.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}kn.requestsCount=0;kn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",M2);else if(typeof addEventListener=="function"){const e="onpagehide"in Qt?"pagehide":"unload";addEventListener(e,M2,!1)}}function M2(){for(let e in kn.requests)kn.requests.hasOwnProperty(e)&&kn.requests[e].abort()}const K7e=function(){const e=W3({xdomain:!1});return e&&e.responseType!==null}();class Y7e extends W7e{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=K7e&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new kn(W3,this.uri(),t)}}function W3(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||V7e))return new XMLHttpRequest}catch{}if(!t)try{return new Qt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const K3=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Z7e extends yp{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=K3?{}:j3(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;fp(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}a&&bo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=V3()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ss=Qt.WebSocket||Qt.MozWebSocket;class X7e extends Z7e{createSocket(t,n,r){return K3?new ss(t,n,r):n?new ss(t,n):new ss(t)}doWrite(t,n){this.ws.send(n)}}class Q7e extends yp{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=O7e(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),a=I7e();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const i=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),i())}).catch(s=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],a=n===t.length-1;this._writer.write(r).then(()=>{a&&bo(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const J7e={websocket:X7e,webtransport:Q7e,polling:Y7e},e_e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,t_e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function pd(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let a=e_e.exec(e||""),i={},o=14;for(;o--;)i[t_e[o]]=a[o]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=n_e(i,i.path),i.queryKey=r_e(i,i.query),i}function n_e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function r_e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,i){a&&(n[a]=i)}),n}const hd=typeof addEventListener=="function"&&typeof removeEventListener=="function",_i=[];hd&&addEventListener("offline",()=>{_i.forEach(e=>e())},!1);class Xn extends ut{constructor(t,n){if(super(),this.binaryType=D7e,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=pd(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=pd(n.host).host);ko(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=U7e(this.opts.query)),hd&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_i.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=H3,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Xn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",Xn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const a=this.writeBuffer[r].data;if(a&&(n+=P7e(a)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,bo(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(Xn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),hd&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=_i.indexOf(this._offlineEventListener);r!==-1&&_i.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Xn.protocol=H3;class a_e extends Xn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;Xn.priorWebsocketSuccess=!1;const a=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const o=p=>{const h=new Error("probe error: "+p);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function s(){o("transport closed")}function l(){o("socket closed")}function u(p){n&&p.name!==n.name&&i()}const d=()=>{n.removeListener("open",a),n.removeListener("error",o),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",a),n.once("error",o),n.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let i_e=class extends a_e{constructor(t,n={}){const r=typeof t=="object",a=r?{...t}:{...n};(!a.transports||a.transports&&typeof a.transports[0]=="string")&&(a.transports=(a.transports||["polling","websocket","webtransport"]).map(i=>J7e[i]).filter(i=>!!i)),super(r?a:t,a)}};function o_e(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=pd(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const s_e=typeof ArrayBuffer=="function",l_e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Y3=Object.prototype.toString,c_e=typeof Blob=="function"||typeof Blob<"u"&&Y3.call(Blob)==="[object BlobConstructor]",u_e=typeof File=="function"||typeof File<"u"&&Y3.call(File)==="[object FileConstructor]";function bp(e){return s_e&&(e instanceof ArrayBuffer||l_e(e))||c_e&&e instanceof Blob||u_e&&e instanceof File}function xi(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(xi(e[n]))return!0;return!1}if(bp(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return xi(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&xi(e[n]))return!0;return!1}function d_e(e){const t=[],n=e.data,r=e;return r.data=wi(n,t),r.attachments=t.length,{packet:r,buffers:t}}function wi(e,t,n){if(!e)return e;if(bp(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}else if(Array.isArray(e)){const r=new Array(e.length);for(let a=0;a<e.length;a++)r[a]=wi(e[a],t);return r}else if(typeof e=="object"&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON=="function"&&!n)return wi(e.toJSON(),t,!0);const r={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=wi(e[a],t));return r}return e}function p_e(e,t){return e.data=md(e.data,t),delete e.attachments,e}function md(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=md(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=md(e[n],t));return e}const h_e=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ue;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ue||(Ue={}));class m_e{constructor(t){this.replacer=t}encode(t){return(t.type===Ue.EVENT||t.type===Ue.ACK)&&xi(t)?this.encodeAsBinary({type:t.type===Ue.EVENT?Ue.BINARY_EVENT:Ue.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ue.BINARY_EVENT||t.type===Ue.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=d_e(t),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}class kp extends ut{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ue.BINARY_EVENT;r||n.type===Ue.BINARY_ACK?(n.type=r?Ue.EVENT:Ue.ACK,this.reconstructor=new f_e(n)):super.emitReserved("decoded",n)}else if(bp(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ue[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ue.BINARY_EVENT||r.type===Ue.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(i,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");const s=Number(o);if(!g_e(s)||s<1)throw new Error("Illegal attachments");if(s>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=s}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const i=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(kp.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ue.CONNECT:return S2(n);case Ue.DISCONNECT:return n===void 0;case Ue.CONNECT_ERROR:return typeof n=="string"||S2(n);case Ue.EVENT:case Ue.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&h_e.indexOf(n[0])===-1);case Ue.ACK:case Ue.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class f_e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=p_e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g_e=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function S2(e){return Object.prototype.toString.call(e)==="[object Object]"}const y_e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:kp,Encoder:m_e,get PacketType(){return Ue}},Symbol.toStringTag,{value:"Module"}));function sn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const b_e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Z3 extends ut{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[sn(t,"open",this.onopen.bind(this)),sn(t,"packet",this.onpacket.bind(this)),sn(t,"error",this.onerror.bind(this)),sn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,a,i;if(b_e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ue.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,p=n.pop();this._registerAckCallback(d,p),o.id=d}const s=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!s||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},a),o=(...s)=>{this.io.clearTimeoutFn(i),n.apply(this,s)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,a)=>{const i=(o,s)=>o?a(o):r(s);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...i)=>(this._queue[0],a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ue.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ue.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ue.EVENT:case Ue.BINARY_EVENT:this.onevent(t);break;case Ue.ACK:case Ue.BINARY_ACK:this.onack(t);break;case Ue.DISCONNECT:this.ondisconnect();break;case Ue.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...a){r||(r=!0,n.packet({type:Ue.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ue.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Vr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Vr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Vr.prototype.reset=function(){this.attempts=0};Vr.prototype.setMin=function(e){this.ms=e};Vr.prototype.setMax=function(e){this.max=e};Vr.prototype.setJitter=function(e){this.jitter=e};class fd extends ut{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ko(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Vr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||y_e;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new i_e(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=sn(n,"open",function(){r.onopen(),t&&t()}),i=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},o=sn(n,"error",i);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{a(),i(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(a),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(sn(t,"ping",this.onping.bind(this)),sn(t,"data",this.ondata.bind(this)),sn(t,"error",this.onerror.bind(this)),sn(t,"close",this.onclose.bind(this)),sn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){bo(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Z3(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xr={};function Ei(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=o_e(e,t.path||"/socket.io"),r=n.source,a=n.id,i=n.path,o=Xr[a]&&i in Xr[a].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return s?l=new fd(r,t):(Xr[a]||(Xr[a]=new fd(r,t)),l=Xr[a]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Ei,{Manager:fd,Socket:Z3,io:Ei,connect:Ei});const k_e=j.createContext(null),v_e=({children:e})=>{const t=$e(),n=fe(k=>k.upsertChat),r=fe(k=>k.upsertChatState),a=fe(k=>k.contextKey),i=fe(k=>k.activeChatId),o=j.useMemo(()=>t.config.user?.id??jr(),[t.config.user?.id]),s=t.config.transport,[l,u]=j.useState(null),[d,p]=j.useState(void 0),h=j.useRef(a),m=j.useRef(n),f=j.useRef(r),g=j.useRef(void 0);j.useEffect(()=>{h.current=a,m.current=n,f.current=r},[a,n,r]),j.useEffect(()=>{if(s.mode!=="proxy"){u(null),p(void 0),t.setSocketClient(null),t.transport instanceof Lr&&t.transport.setSocketId(void 0);return}const k=s.baseUrl,b=new URL(k,window.location.origin),x=`${b.protocol}//${b.host}`,M=s.socketNamespace,N=M?`${x}${M}`:x,E={},D=s;D.headers&&Object.assign(E,D.headers);const P={},C=D.apiKey&&`Bearer ${D.apiKey}`||D.headers?.Authorization;C&&(P.authorization=C,E.Authorization=C);const I=s.socketPath??Ri.Path,q=Ei(N,{path:I,auth:P,transports:["websocket","polling"],withCredentials:!0,...Object.keys(E).length>0&&{extraHeaders:E}});t.setSocketClient(q),u(q);const Z=()=>{p(q.id),t.transport instanceof Lr&&t.transport.setSocketId(q.id)},X=()=>{p(void 0),t.transport instanceof Lr&&t.transport.setSocketId(void 0)},K=G=>{if(G.contextKey===h.current){m.current(G);const z=t.store.getState(),V=De(z,G.id);f.current(G.id,{...V,status:ka(G.status)})}},R=G=>{const z=t.store.getState(),V=De(z,G.chat),A=V.messages.findIndex(Y=>Y.id===G.id);if(A>=0){const Y=[...V.messages];Y[A]=G,f.current(G.chat,{...V,messages:Y});return}f.current(G.chat,{...V,messages:[...V.messages,G]})},H=G=>{m.current(G);const z=t.store.getState(),V=De(z,G.id);f.current(G.id,{...V,status:ka(G.status)})};return q.on("connect",Z),q.on("disconnect",X),q.on("connect_error",G=>{console.error("Socket.IO connection error:",G.message)}),q.on(yi.ChatNew,K),q.on(yi.MessageNew,R),q.on(yi.ChatUpdate,H),()=>{t.transport instanceof Lr&&t.transport.setSocketId(void 0),t.setSocketClient(null),p(void 0),u(null),q.disconnect()}},[t,t.transport,s.mode,s.mode==="proxy"?s.baseUrl:void 0,s.mode==="proxy"?s.apiKey:void 0,s.mode==="proxy"?s.socketPath:void 0,s.mode==="proxy"?s.socketNamespace:void 0,s.mode==="proxy"?JSON.stringify(s.headers??{}):"",o]),j.useEffect(()=>{if(!l)return;const k=g.current;k&&k!==i&&l.emit("chat:unsubscribe",{chatId:k}),i&&i!==k&&(l.emit("chat:subscribe",{chatId:i}),g.current=i),i||(g.current=void 0)},[l,i]);const _=j.useMemo(()=>({socket:l,socketId:d}),[l,d]);return w.jsx(k_e.Provider,{value:_,children:e})},vp=j.createContext(null),__e=({config:e,children:t})=>{const n=j.useRef();n.current||(n.current=new T3(e));const[,r]=j.useState(0);j.useEffect(()=>{const o=n.current,s=()=>r(l=>l+1);return o.events.addEventListener("runtime:transport-config-changed",s),()=>{o.events.removeEventListener("runtime:transport-config-changed",s)}},[]);const a=j.useRef();if(!a.current){const o=n.current.defaultContextKey??n.current.config.contextKeys[0]?.key??"default";a.current=c7e(o),n.current.attachStore(a.current);const s=x7e(n.current.config.models,n.current.config.transport);a.current.getState().setComposerOptions({model:s})}const i=j.useMemo(()=>({runtime:n.current,store:a.current}),[]);return j.useEffect(()=>{const o=a.current;if(!o)return;let s=o.getState().activeChatId;return o.subscribe(()=>{const l=o.getState().activeChatId;if(l===s)return;s=l;const u=n.current?.config.user?.id??jr();M7e(u,l)})},[]),w.jsx(vp.Provider,{value:i,children:w.jsx(xt.QueryClientProvider,{client:i.runtime.queryClient,children:w.jsx(I3,{value:i.runtime.config.theme,children:w.jsx(v_e,{children:t})})})})},$e=()=>{const e=j.useContext(vp);if(!e)throw new Error("useAgentRuntime must be used inside <AgentProvider />");return e.runtime},fe=e=>{const t=j.useContext(vp);if(!t)throw new Error("useAgentStore must be used inside <AgentProvider />");return u5.useStore(t.store,e)},x_e=({initialSystemPrompt:e,composerFormRef:t,multiUser:n=!1,participantIds:r=[]})=>{const a=$e(),{composer:i,contextKey:o,activeChatId:s,draftChatKey:l,queuedMessages:u,activeChatStatus:d,upsertChat:p,setChatStatus:h,setActiveChat:m,setComposerError:f,moveChatKeyState:g,removeQueuedMessage:_,setPendingAssistant:k,enqueueQueuedMessage:b,appendMessagesToChat:x,commitPendingAssistant:M,setPageContextDismissed:N}=fe(V=>{const A=V.activeChatId??V.draftChatKey,Y=De(V,A);return{composer:V.composer,contextKey:V.contextKey,activeChatId:V.activeChatId,draftChatKey:V.draftChatKey,queuedMessages:Y.messageQueue,activeChatStatus:Y.status,upsertChat:V.upsertChat,setActiveChat:V.setActiveChat,setChatStatus:V.setChatStatus,setComposerError:V.setComposerError,moveChatKeyState:V.moveChatKeyState,setPendingAssistant:V.setPendingAssistant,removeQueuedMessage:V.removeQueuedMessage,enqueueQueuedMessage:V.enqueueQueuedMessage,appendMessagesToChat:V.appendMessagesToChat,commitPendingAssistant:V.commitPendingAssistant,setPageContextDismissed:V.setPageContextDismissed}}),E=j.useCallback(V=>!V||V.length===0?!1:V.some(A=>A.type===exports.AgentAttachmentType.Context&&A?.metadata?.kind==="pageContext"),[]),D=j.useRef(!1),P=j.useRef(!1),C=j.useRef(void 0),I=j.useRef(new Set),q=s??l,Z=j.useCallback(async(V,A)=>{if(!a.transport.generateTitle)return;const Y=a.config.features?.titleGeneration==="llm"?"llm":"local";let ee;try{ee=await a.transport.generateTitle({userId:A,content:V,strategy:Y,contextKey:o})}catch{}return ee},[a.transport,a.config.features?.titleGeneration,o]),X=j.useCallback(async(V,A=[])=>{const Y=a.config.user?.id??"guest",ee=!s,L=s??l,se={current:L};C.current=L;const ye={value:V,attachments:A};f(se.current,void 0);let ke;if(ee){const pe=await Z(V,Y);pe&&pe.trim().length>0&&(ke={...ke??{},title:pe})}const Ie=a.getChatMetadata({contextKey:o});Ie&&(ke={...ke??{},...Ie});const Pe=a.store.getState(),Ke=s?Pe.chats[s]:void 0,nt=(s?Pe.chatState[s]:void 0)?.messages??[],mt=A.filter(pe=>X3(pe)?!w_e(nt,pe):!0),Ye=Ke?.model,ie=i.model!==Ye;let xe,we=!1;ie?(xe=i.model,we=!0):Ye?(xe=Ye,we=!1):(xe=void 0,we=!1);const Ve=E_e(V),ue={userId:Y,content:V,metadata:ke,contextKey:o,...ee?{}:{chatId:s},...we?{model:xe??""}:{},...mt.length>0?{attachments:mt}:{},...n?{mentions:Ve,participantIds:Array.from(new Set([Y,...r])),senderDisplayName:a.config.user?.displayName,senderAvatarUrl:a.config.user?.avatarUrl}:{}},Le=()=>{k(se.current,void 0)},Be=pe=>{if(pe?.name==="AbortError"){const be=C.current??se.current;return I.current.has(be)?(M(se.current),I.current.delete(be)):(Le(),t.current?.setDraft(ye)),{type:"aborted"}}throw pe},Ce=async()=>{h(se.current,ct.Sending);try{if(!a.transport.sendMultiUserMessage)throw new Error("Multi-user chat requires a transport that supports sendMultiUserMessage");const pe=await a.transport.sendMultiUserMessage(ue);return p(pe.chat),ee&&(g(se.current,pe.chat.id),se.current=pe.chat.id,C.current=pe.chat.id,m(pe.chat.id)),x(pe.chat.id,[pe.message]),h(pe.chat.id,ka(pe.chat.status)),Le(),{type:"success"}}catch(pe){return Be(pe)}},ve=async()=>{let pe=`pending-${Date.now()}`,be="",Re;h(se.current,ct.Streaming),k(se.current,{id:pe,content:"",reasoning:"",toolCalls:[],attachments:[],chat:s||"",role:exports.MessageRole.Assistant,createdAt:new Date().toISOString()});try{let B=s;const Q=re=>{if(re.type===exports.StreamChunkType.Chat&&re.chat){p(re.chat),B=re.chat.id,ee&&(C.current=re.chat.id,g(se.current,re.chat.id),se.current=re.chat.id,m(re.chat.id));return}if(re.type===exports.StreamChunkType.Reasoning&&re.reasoning){be+=re.reasoning,Re={...Re??{id:pe,chat:B,role:exports.MessageRole.Assistant,content:"",createdAt:new Date().toISOString()},reasoning:be},k(se.current,Re);return}if(re.type===exports.StreamChunkType.Error&&re.error){const _e=typeof re.error=="string"?re.error:String(re.error),qe=Re??{id:pe,chat:B||se.current,role:exports.MessageRole.Assistant,content:_e,createdAt:new Date().toISOString()};x(se.current,[{...qe,content:_e}]),h(se.current,ct.Idle),Le();return}if(re.message&&re.message.role===exports.MessageRole.User){x(re.message.chat,[re.message]);return}re.message&&(pe=re.message.id,Re={...re.message,reasoning:be||re.message.reasoning},k(se.current,Re)),re.done&&(Re&&x(se.current,[Re]),h(se.current,ct.Idle),Le())},oe=await a.transport.streamMessage(ue,Q,{streamKey:C.current});if(oe){const re=oe.messages.map(it=>Re&&it.id===Re.id&&it.role===exports.MessageRole.Assistant?{...it,reasoning:be}:it);x(oe.id,re);const _e=a.store.getState();return(_e.activeChatId??_e.draftChatKey)===se.current&&m(oe.id),Le(),{type:"success"}}return Le(),{type:"success"}}catch(B){return Be(B)}};try{const pe=await(n?Ce():ve());return pe.type==="success"&&(D.current=!1),pe}catch(pe){Le();const be=pe?.chat;be&&(p(be),m(be.id));const Re=pe instanceof Error?pe:new Error("Failed to send message");return f(se.current,Re.message||"Failed to send message"),h(se.current,ct.Idle),t.current?.setDraft(ye),D.current=!1,{type:"error",error:Re}}finally{P.current=!1,n||h(se.current,ct.Idle),C.current=void 0}},[s,o,i.model,n,r,a.transport,a.config.user?.displayName,a.config.user?.avatarUrl,a.config.user?.id,p,m,k,h,Z,e,g,t,f]),K=j.useCallback(async()=>{if(d!==ct.Idle||P.current||!u.length||D.current)return;const V=u[0];P.current=!0,_(q,V.id);try{await X(V.content,V.attachments)}finally{P.current=!1}},[d,u,q,X,_]);j.useEffect(()=>{K()},[K]);const R=j.useCallback(async V=>{if(P.current)return;const A=u.find(Y=>Y.id===V);if(A){D.current=!1,P.current=!0,_(q,V);try{await X(A.content,A.attachments)}finally{P.current=!1}}},[u,q,_,X]),H=j.useCallback(async V=>{const Y=t.current.getDraft().attachments;if(!n&&d!==ct.Idle){b(q,V,Y),t.current?.clearDraft();return}D.current=!1,t.current?.clearDraft(),await X(V,Y)},[d,n,b,q,X,t,E,N]),G=j.useCallback(()=>{D.current=!0;const V=C.current??q;I.current.add(V),a.transport.cancelStream?.(V),M(V),h(V,ct.Idle)},[q,a.transport,M,h]),z=j.useCallback(async V=>{d===ct.Streaming&&G(),await R(V)},[d,G,R]);return{pendingKey:q,queuedMessages:u,activeChatStatus:d,activeChatId:s,removeQueuedMessage:_,handleSubmit:H,handleStop:G,handleQueuedClick:z}},w_e=(e,t)=>{const n=JSON.stringify(t.metadata?.data);let r;for(let a=e.length-1;a>=0;a--){const o=e[a].attachments?.find(X3);if(o){r=o;break}}return!r||r.url!==t.url?!1:JSON.stringify(r.metadata?.data)===n},X3=e=>e.type===exports.AgentAttachmentType.Context&&e.metadata?.kind==="pageContext",E_e=e=>{const t=e.matchAll(/(^|[\s([{])@([a-zA-Z0-9_.-]+)/g),n=new Set,r=[];for(const a of t){const i=a[2],o=i.toLowerCase();n.has(o)||(n.add(o),r.push({type:o==="agent"?"agent":"user",name:i}))}return r.length>0?r:void 0},M_e=({queuedMessages:e,onSendQueued:t,onRemoveQueued:n})=>e.length?w.jsxs("div",{className:"mp-agent-composer-queue",children:[w.jsx("div",{className:"mp-agent-composer-queue-header",children:w.jsxs("span",{children:[e.length," message",e.length>1?"s":""," queued"]})}),w.jsx("div",{className:"mp-agent-composer-queue-items",children:e.map(r=>w.jsxs("div",{className:"mp-agent-composer-queue-item",children:[w.jsxs("span",{className:"mp-agent-composer-queue-item-text",children:[r.content,r.attachments?.length?w.jsxs("span",{style:{marginLeft:8,opacity:.7,display:"inline-flex",alignItems:"center",gap:4},children:[w.jsx(ro,{size:12}),r.attachments.length]}):null]}),w.jsxs("div",{className:"mp-agent-composer-queue-item-actions",children:[w.jsx("button",{type:"button",className:"mp-agent-composer-queue-button",onClick:()=>t(r.id),"aria-label":"Send queued message",children:w.jsx(Vd,{size:12})}),w.jsx("button",{type:"button",className:"mp-agent-composer-queue-button",onClick:()=>n(r.id),"aria-label":"Remove queued message",children:w.jsx(O5,{size:12})})]})]},r.id))})]}):null;function S_e(e,t){return e.size>t.maxFileSize?{type:"size",message:`File "${e.name}" exceeds maximum size of ${_p(t.maxFileSize)}`,fileName:e.name}:null}function N_e(e,t,n){if(e.length+t.filter(s=>s.type==="file").length>n.maxFilesPerMessage)return{type:"count",message:`Maximum ${n.maxFilesPerMessage} files per message allowed`};for(const s of e){const l=S_e(s,n);if(l)return l}const a=t.filter(s=>s.type==="file").reduce((s,l)=>{const u=l.metadata?.size||l.size||0;return s+u},0),i=e.reduce((s,l)=>s+l.size,0);return a+i>n.maxTotalAttachmentsSize?{type:"totalSize",message:`Total attachment size exceeds maximum of ${_p(n.maxTotalAttachmentsSize)}`}:null}function _p(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/Math.pow(t,r)*100)/100+" "+n[r]}function A_e(){return{maxFileSize:10*1024*1024,maxTotalAttachmentsSize:50*1024*1024,maxFilesPerMessage:10,allowedMimeTypes:void 0}}const Q3=(e,t)=>{switch(e.type){case exports.AgentAttachmentType.Link:return w.jsx(A5,{size:12});case exports.AgentAttachmentType.Artifact:return w.jsx(ro,{size:12});case exports.AgentAttachmentType.Context:{const n=e?.metadata?.kind;if(n&&t?.[n])return t[n];switch(n){case"pageContext":return w.jsx(Yd,{size:12});case"formSnapshot":case"formField":return w.jsx(N5,{size:12});default:return w.jsx(Zd,{size:12})}}case exports.AgentAttachmentType.File:default:return w.jsx(S5,{size:12})}},T_e=({attachments:e})=>{const{config:t}=$e();return!e||e.length===0?null:w.jsx("div",{className:"mp-agent-message-attachments","aria-label":"Message attachments",children:e.map((n,r)=>{const a=w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"mp-agent-message-attachment-icon",children:Q3(n,t.contextAttachmentIcons)}),w.jsx("span",{className:"mp-agent-message-attachment-name",children:n.name})]});return n.url?w.jsx("a",{className:"mp-agent-message-attachment",href:n.url,target:"_blank",rel:"noreferrer",title:n.url,children:a},n.id||r):w.jsx("span",{className:"mp-agent-message-attachment",title:n.mimeType??n.name,children:a},n.id||r)})})},C_e=({attachments:e,onRemove:t,uploadProgress:n,uploadErrors:r})=>{const a=Wt(),{config:i}=$e();return!e||e.length===0?null:w.jsx("div",{className:"mp-agent-composer-attachments","aria-label":a.attachments,children:e.map(o=>{const s=n?.get(o.id),l=r?.get(o.name),u=o.metadata?.size||o.size,d=u?` (${_p(u)})`:"";return w.jsxs("span",{className:`mp-agent-attachment-chip ${l?"mp-agent-attachment-chip-error":""} ${s?.status==="uploading"?"mp-agent-attachment-chip-uploading":""}`,title:l||o.name,children:[w.jsx("span",{className:"mp-agent-attachment-chip-icon",children:Q3(o,i.contextAttachmentIcons)}),w.jsxs("span",{className:"mp-agent-attachment-chip-name",title:o.name,children:[o.name,d]}),s?.status==="uploading"&&w.jsxs("span",{className:"mp-agent-attachment-chip-progress",children:[s.progress,"%"]}),l&&w.jsx("span",{className:"mp-agent-attachment-chip-error-text",title:l,children:"⚠"}),t?w.jsx(un,{size:"sm",icon:"X",type:"button",onClick:p=>{p.preventDefault(),p.stopPropagation(),t(o.id)},"aria-label":`Remove attachment ${o.name}`}):null]},o.id)})})},R_e=e=>{const t=e.trim();if(!t||/\s/.test(t))return;const n=i=>i.replace(/[)\].,;:!?]+$/,"");if(!/^https?:\/\//i.test(t))return;const r=i=>{try{const o=new URL(i);return o.protocol!=="http:"&&o.protocol!=="https:"?void 0:o.toString()}catch{return}},a=n(t);return r(a)},I_e=e=>{try{const t=new URL(e);return t.hostname+(t.pathname&&t.pathname!=="/"?t.pathname:"")}catch{return e}},gd="mp-agent:locationchange",N2="__mp_agent_history_patched__",A2=()=>{try{window.dispatchEvent(new Event(gd))}catch{}},O_e=()=>{if(typeof window>"u")return;const e=window;if(!e[N2]){e[N2]=!0;try{const t=history.pushState;history.pushState=function(...n){const r=t.apply(this,n);return A2(),r}}catch{}try{const t=history.replaceState;history.replaceState=function(...n){const r=t.apply(this,n);return A2(),r}}catch{}}},L_e=e=>{if(typeof window>"u")return()=>{};O_e();const t=()=>e();return window.addEventListener("popstate",t),window.addEventListener("hashchange",t),window.addEventListener(gd,t),()=>{window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),window.removeEventListener(gd,t)}};async function D_e(e,t,n,r){const a=await fetch(r.presignedUrlEndpoint,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",...r.getAuthHeaders?.()||{}},body:JSON.stringify({filename:e.name,mimeType:e.type||"application/octet-stream",size:e.size,chatId:t,userId:n})});if(!a.ok){const o=await a.text();throw new Error(`Failed to get presigned URL: ${a.status} ${o}`)}const i=await a.json();return{url:i.url,key:i.key}}async function z_e(e,t,n){return new Promise((r,a)=>{const i=new XMLHttpRequest;i.upload.addEventListener("progress",o=>{if(o.lengthComputable&&n){const s=Math.round(o.loaded/o.total*100);n(s)}}),i.addEventListener("load",()=>{i.status>=200&&i.status<300?r():a(new Error(`Upload failed: ${i.status} ${i.statusText}`))}),i.addEventListener("error",()=>{a(new Error("Upload failed: network error"))}),i.addEventListener("abort",()=>{a(new Error("Upload aborted"))}),i.open("PUT",t),i.setRequestHeader("Content-Type",e.type||"application/octet-stream"),i.send(e)})}async function $_e(e,t,n){const r=vt.nanoid(),a={fileId:r,fileName:e.name,progress:0,status:"pending"};try{n.onProgress?.({...a,status:"uploading",progress:0});const{url:i,key:o}=await D_e(e,n.chatId,n.userId,t);return await z_e(e,i,s=>{n.onProgress?.({...a,status:"uploading",progress:s})}),n.onProgress?.({...a,status:"completed",progress:100}),{id:r,type:exports.AgentAttachmentType.File,name:e.name,mimeType:e.type||void 0,size:e.size,metadata:{uploadedAt:new Date().toISOString(),s3Key:o,processingStatus:"pending",size:e.size,lastModified:e.lastModified}}}catch(i){const o=i instanceof Error?i.message:"Unknown error";throw n.onProgress?.({...a,status:"error",error:o}),i}}async function F_e(e,t,n){const r=await Promise.allSettled(e.map(o=>$_e(o,t,n))),a=[],i=[];if(r.forEach((o,s)=>{o.status==="fulfilled"?a.push(o.value):i.push(new Error(`Failed to process ${e[s].name}: ${o.reason}`))}),i.length>0&&a.length===0)throw i[0];return i.length>0&&console.warn("Some files failed to upload:",i),a}const P_e=({options:e,value:t,onChange:n,placeholder:r="Select...",disabled:a=!1,className:i="",triggerClassName:o="",placement:s="bottom-start",searchable:l=!1,searchPlaceholder:u="Search...",searchFilter:d})=>{const[p,h]=j.useState(!1),[m,f]=j.useState(null),[g,_]=j.useState(""),k=j.useRef([]),b=j.useRef(null),{refs:x,floatingStyles:M,context:N,isPositioned:E}=lp({open:p,onOpenChange:h,placement:s,strategy:"absolute",whileElementsMounted:np,middleware:[rp(8),ip({fallbackPlacements:["top-start","bottom-start","top-end","bottom-end"]}),ap({padding:8})]}),D=o3(N,{enabled:!a}),P=sp(N),C=up(N),q=X8e(N,{listRef:k,activeIndex:m,onNavigate:f,enabled:p&&!l,virtual:!1}),{getReferenceProps:Z,getFloatingProps:X,getItemProps:K}=cp(l?[D,P,C]:[D,P,C,q]),R=e.findIndex(Y=>Y.value===t),H=R>=0?e[R]:void 0,G=j.useMemo(()=>{const Y=g.trim().toLowerCase();if(!l||!Y)return e;const L=d?se=>d(se,Y):se=>`${se.label} ${se.description??""}`.toLowerCase().includes(Y);return e.filter(L)},[e,g,l,d]);j.useEffect(()=>{if(!p){f(null),_("");return}l&&setTimeout(()=>b.current?.focus(),0);const Y=G.findIndex(ee=>ee.value===t);f(Y>=0?Y:0)},[p,l,t,G]),j.useEffect(()=>{p&&f(G.length>0?0:null)},[g,G.length,p]);const z=Y=>G.length===0?null:Y<0?G.length-1:Y>=G.length?0:Y,V=Y=>{Y!=null&&k.current[Y]?.scrollIntoView({block:"nearest"})},A=Y=>{n(Y),h(!1),f(null),_("")};return w.jsxs("div",{className:`mp-agent-dropdown ${i}`,children:[w.jsxs("button",{ref:x.setReference,type:"button",className:`mp-agent-dropdown-trigger ${o}`,disabled:a,"aria-expanded":p,"aria-haspopup":"listbox",...Z(),children:[w.jsx("span",{className:"mp-agent-dropdown-trigger-content",children:H?w.jsxs(w.Fragment,{children:[H.icon&&w.jsx("span",{className:"mp-agent-dropdown-trigger-icon",children:H.icon}),w.jsx("span",{className:"mp-agent-dropdown-trigger-label",children:H.label})]}):w.jsx("span",{className:"mp-agent-dropdown-trigger-placeholder",children:r})}),w.jsx(no,{size:16,className:`mp-agent-dropdown-chevron ${p?"open":""}`})]}),p&&w.jsxs("div",{role:"listbox",ref:x.setFloating,style:{...M,opacity:E?1:0,pointerEvents:E?"auto":"none",transition:E?"opacity 0.15s ease-out":"none"},className:"mp-agent-dropdown-menu",...X(),children:[l&&w.jsx("div",{className:"mp-agent-dropdown-search",onKeyDown:Y=>Y.stopPropagation(),children:w.jsx("input",{ref:b,className:"mp-agent-dropdown-search-input",value:g,placeholder:u,onChange:Y=>_(Y.target.value),onKeyDown:Y=>{if(Y.key==="Escape"){Y.preventDefault(),h(!1),_("");return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault();const ee=Y.key==="ArrowDown"?1:-1,L=m??(ee>0?-1:0),se=z(L+ee);f(se),V(se);return}if(Y.key==="Enter"){if(m==null)return;const ee=G[m];if(!ee)return;Y.preventDefault(),A(ee.value)}}})}),w.jsxs("div",{className:"mp-agent-dropdown-list",children:[G.map((Y,ee)=>w.jsxs("button",{ref:L=>{k.current[ee]=L},type:"button",className:`mp-agent-dropdown-item ${t===Y.value?"selected":""} ${m===ee?"active":""}`,role:"option","aria-selected":t===Y.value,...K({onClick:()=>A(Y.value),onMouseEnter:()=>{f(ee)},onKeyDown:L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),A(Y.value))}}),children:[Y.icon&&w.jsx("span",{className:"mp-agent-dropdown-item-icon",children:Y.icon}),w.jsxs("span",{className:"mp-agent-dropdown-item-content",children:[w.jsx("span",{className:"mp-agent-dropdown-item-label",children:Y.label}),Y.description&&w.jsx("span",{className:"mp-agent-dropdown-item-description",children:Y.description})]})]},Y.value)),l&&G.length===0&&w.jsx("div",{className:"mp-agent-dropdown-empty","aria-label":"No results",children:"No results"})]})]})]})},q_e=j.memo(()=>{const e=$e(),t=fe(p=>p.composer),n=fe(p=>p.contextKey),r=fe(p=>p.setComposerOptions),a=e.config.models,{data:i,isLoading:o}=f3(),s=j.useMemo(()=>{const p=i&&i.length>0?i:a;return D3(p,e.config.transport).filter(m=>!m.contexts?.length||m.contexts.includes(n))},[i,a,e.config.transport,n]),l=j.useMemo(()=>{const p=s.slice().sort((h,m)=>h.label.localeCompare(m.label,void 0,{sensitivity:"base"})).map(h=>({value:h.id,label:h.label}));return[{value:ra,label:"Auto"},...p]},[s]),u=j.useMemo(()=>t.model!==void 0?t.model:ra,[t.model]),d=j.useCallback(p=>{p===ra?(r({model:void 0}),_2(e.config.transport,ra)):(r({model:p}),_2(e.config.transport,p))},[r,e.config.transport]);return o&&!a?.length||l.length===0?null:w.jsx(P_e,{options:l,value:u,onChange:d,placeholder:"Select model...",searchable:!0,searchPlaceholder:"Search models...",placement:"top-start",triggerClassName:"mp-agent-model-selector-trigger"})}),B_e=e=>{if(!e)return"";let t=e.replace(/[_-]+/g," ");return t=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),t=t.trim().replace(/\s+/g," "),t?t.charAt(0).toUpperCase()+t.slice(1):""},U_e=({checked:e,disabled:t,onChange:n,className:r="",...a})=>{const i=o=>{o.preventDefault(),!t&&n(!e)};return w.jsx("button",{type:"button",role:"switch","aria-checked":e,disabled:t,className:`mp-agent-switch ${e?"on":"off"} ${r}`.trim(),onClick:i,...a,children:w.jsx("span",{className:"mp-agent-switch-thumb"})})},T2=e=>e.reduce((t,n)=>(t[n.agentName]={...n.tools},t),{}),J3=({preferences:e,disabled:t})=>{const n=Wt(),{upsertSingle:r}=_3(),[a,i]=j.useState(()=>T2(e)),[o,s]=j.useState({});j.useEffect(()=>{i(T2(e))},[e]);const l=r.error?.message,u=j.useMemo(()=>e.some(p=>Object.keys(p.tools).length>0),[e]),d=(p,h,m)=>{i(f=>{const g=f[p]??{},_=g,k={...g,[h]:m},b={...f,[p]:k};return s(x=>({...x,[p]:{...x[p]??{},[h]:!0}})),r.mutate({agentName:p,input:{tools:k}},{onError:()=>{i(x=>({...x,[p]:_}))},onSettled:()=>{s(x=>{const M={...x[p]??{}};if(delete M[h],Object.keys(M).length===0){const{[p]:N,...E}=x;return E}return{...x,[p]:M}})}}),b})};return w.jsxs("div",{className:"mp-agent-preferences-panel",children:[!u&&w.jsx("div",{className:"mp-agent-preferences-empty",children:n.agentSettingsNoConfigurableTools}),e.map(p=>{const h=a[p.agentName]??{},m=Object.entries(h);return w.jsxs("div",{className:"mp-agent-preferences-agent",children:[w.jsx("div",{className:"mp-agent-preferences-agent-header",children:w.jsx("strong",{children:p.agentName})}),m.length===0?w.jsx("div",{className:"mp-agent-preferences-empty",children:n.agentSettingsNoToolsForAgent}):w.jsx("div",{className:"mp-agent-preferences-tools",children:m.map(([f,g])=>{const _=!!o[p.agentName]?.[f];return w.jsxs("label",{className:"mp-agent-preferences-tool",children:[w.jsx("span",{className:"mp-agent-preferences-tool-label",children:B_e(f)}),w.jsx(U_e,{checked:g,onChange:k=>d(p.agentName,f,k),disabled:!!t||_})]},`${p.agentName}:${f}`)})})]},p.agentName)}),l&&w.jsx("div",{className:"mp-agent-preferences-error",children:l})]})};function H_e(e){return e.map(t=>{const n=(t.tools??[]).reduce((r,a)=>(a.userConfigurable&&(r[a.title]=!a.disabledByDefault),r),{});return{agentName:t.name,tools:n}})}const j_e=()=>{const e=Wt(),t=$e(),n=fe(l=>l.contextKey),{data:r,isLoading:a,isError:i}=b3(n),o=j.useMemo(()=>H_e(r??[]),[r]),s=!!t.transport.upsertAgentPreferences&&!!t.transport.upsertAgentPreferencesBatch;return a?w.jsx(w.Fragment,{children:e.agentSettingsLoading}):i?w.jsx(w.Fragment,{children:e.agentSettingsError}):w.jsx(J3,{preferences:o,disabled:!s})},V_e=()=>{const[e,t]=j.useState(!1),n=Wt(),{refs:r,floatingStyles:a,context:i,isPositioned:o}=lp({open:e,onOpenChange:t,placement:"top-start",strategy:"absolute",whileElementsMounted:np,middleware:[rp(8),ip({fallbackPlacements:["bottom-start","top-end","bottom-end"]}),ap({padding:8})]}),s=o3(i),l=sp(i),u=up(i),{getReferenceProps:d,getFloatingProps:p}=cp([s,l,u]);return w.jsxs("div",{className:"mp-agent-tool-config-dropdown",children:[w.jsx(Tn,{content:n.agentSettingsTooltip,children:w.jsx("button",{ref:r.setReference,type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button","aria-label":n.agentSettingsTooltip,...d(),children:w.jsx(C5,{size:16})})}),e&&w.jsx("div",{ref:r.setFloating,style:{...a,opacity:o?1:0,pointerEvents:o?"auto":"none",transition:o?"opacity 0.15s ease-out":"none"},className:"mp-agent-tool-config-panel",...p(),children:w.jsx(j_e,{})})]})},G_e=j.forwardRef(({autoFocus:e,activeChatId:t,status:n,onStop:r,onSubmit:a},i)=>{const o=Wt(),s=$e(),l=j.useRef(null),u=j.useRef(null),d=fe(ie=>ie.activeChatId??ie.draftChatKey),p=fe(ie=>De(ie,d).composerDraft),h=fe(ie=>De(ie,d).composerError),m=fe(ie=>De(ie,d).pageContextDismissed),f=fe(ie=>ie.setComposerValue),g=fe(ie=>ie.setComposerDraft),_=fe(ie=>ie.clearComposerDraft),k=fe(ie=>ie.setComposerError),b=fe(ie=>ie.addComposerAttachments),x=fe(ie=>ie.removeComposerAttachment),M=fe(ie=>ie.setPageContextDismissed),N=p.value,E=p.attachments,[D,P]=j.useState(new Map),[C,I]=j.useState(new Map),q=j.useRef(N),Z=j.useRef(E),X=j.useRef(m),K=s.config.features?.pageContextAttachments!==!1,R=s.config.composerAttachmentActions,G=`Attach ${s.config.pageContext?.name?.trim()||"Page context"}`,z=s.config.contextAttachmentIcons?.pageContext??w.jsx(Yd,{size:16}),V=ie=>ie.type===exports.AgentAttachmentType.Context&&ie?.metadata?.kind==="pageContext",A=E.some(V),Y=()=>{if(K)return s.buildPageContextAttachment()};j.useEffect(()=>{Z.current=E},[E]),j.useEffect(()=>{q.current=N},[N]),j.useEffect(()=>{X.current=m},[m]),j.useEffect(()=>{if(!K||m||A)return;const ie=Y();ie&&b(d,[ie])},[K,m,A,d,b]),j.useEffect(()=>{if(K&&!(typeof window>"u"))return L_e(()=>{if(X.current)return;const ie=Z.current,xe=ie.find(V);if(!xe)return;const we=Y();if(!we)return;const Ve={...we,id:xe.id},ue=ie.map(Le=>Le.id===xe.id?Ve:Le);g(d,{value:q.current,attachments:ue})})},[K,d,g]),j.useImperativeHandle(i,()=>({setValue:ie=>{f(d,ie)},getDraft:()=>({value:N,attachments:E}),setDraft:ie=>{g(d,{value:ie.value,attachments:ie.attachments??[]})},clearDraft:()=>{_(d)},buildPageContextAttachment:()=>Y()})),j.useEffect(()=>{const ie=l.current;ie&&(ie.style.height="auto",ie.style.height=`${Math.min(ie.scrollHeight,200)}px`)},[N]);const ee=async ie=>{if(!ie||ie.length===0)return;const xe=Array.from(ie),we=A_e(),Ve=N_e(xe,E,we);if(Ve){I(ue=>{const Le=new Map(ue);return xe.forEach(Be=>{Le.set(Be.name,Ve.message)}),Le});return}I(ue=>{const Le=new Map(ue);return xe.forEach(Be=>Le.delete(Be.name)),Le});try{const ue=s.config.transport;if(ue.mode!=="proxy")throw new Error("File uploads are only supported with proxy transport");const Le={presignedUrlEndpoint:`${ue.baseUrl}/files/upload/presigned`,getAuthHeaders:()=>{const Ce={};return ue.headers?ue.headers:(ue.apiKey&&(Ce.Authorization=`Bearer ${ue.apiKey}`),Ce)}},Be=await F_e(xe,Le,{chatId:t,userId:s.config.user?.id,onProgress:Ce=>{P(ve=>{const pe=new Map(ve);return pe.set(Ce.fileId,Ce),pe})}});b(d,Be),setTimeout(()=>{P(Ce=>{const ve=new Map(Ce);return Be.forEach(pe=>ve.delete(pe.id)),ve})},2e3)}catch(ue){const Le=ue instanceof Error?ue.message:"Failed to upload files";I(Be=>{const Ce=new Map(Be);return xe.forEach(ve=>{Ce.set(ve.name,Le)}),Ce})}},L=()=>{u.current?.click()},se=ie=>{const xe=R_e(ie);if(!xe)return!1;if(E.some(ue=>ue.type===exports.AgentAttachmentType.Link&&ue.url===xe))return!0;const we=I_e(xe),Ve={id:vt.nanoid(),url:xe,name:we,type:exports.AgentAttachmentType.Link};return b(d,[Ve]),!0},ye=async ie=>{await ee(ie.target.files),ie.target.value=""},ke=ie=>{const xe=E.find(we=>we.id===ie);xe&&V(xe)&&M(d,!0),x(d,ie)},Ie=()=>{if(typeof window>"u"||typeof document>"u")return!1;const ie=A3(),xe=ie?.selectedText??window.getSelection?.()?.toString()?.trim()??"";if(!xe)return!1;const we=window.location?.href,Ve=xe.slice(0,20),ue=xe.length>20?Ve+"...":xe,Le=yo({kind:"webSnippet",url:we,title:ue,selectedText:xe,source:{app:"browser",url:we},...ie?.target?{target:ie.target}:{}});return b(d,[Le]),!0},Pe=ie=>{ie.preventDefault();const xe=N.trim();xe&&(k(d,void 0),a(xe))},Ke=ie=>{ie.key==="Enter"&&!ie.shiftKey&&(ie.preventDefault(),Pe(ie))},Ge=ie=>{h&&k(d,void 0),f(d,ie.target.value)},nt=ie=>{if(ie.nativeEvent.shiftKey)return;const xe=ie.clipboardData?.getData("text/plain")??"";if(!xe)return;se(xe)&&ie.preventDefault()},Ye=!!N.trim();return w.jsxs(w.Fragment,{children:[w.jsxs("form",{onSubmit:Pe,className:"mp-agent-composer-input-wrapper",id:"composer-form",children:[w.jsx("input",{ref:u,type:"file",multiple:!0,style:{display:"none"},onChange:ye}),w.jsx(C_e,{attachments:E,onRemove:ke,uploadProgress:D,uploadErrors:C}),w.jsx("textarea",{rows:2,name:"message",ref:l,value:N,autoFocus:e,className:"mp-agent-composer-textarea",placeholder:t?o.followUp:o.newChat,onChange:Ge,onKeyDown:Ke,onPaste:nt})]}),w.jsxs("div",{className:"mp-agent-composer-actions",children:[w.jsxs("div",{className:"mp-agent-composer-actions-left",children:[s.config.features?.modelSwitching&&w.jsx(q_e,{}),s.config.features?.toolConfiguration&&w.jsx(V_e,{}),s.config.features?.fileAttachments&&w.jsx(Tn,{content:o.attachFiles,children:w.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:L,"aria-label":o.attachFiles,children:w.jsx(ro,{size:16})})}),s.config.features?.selectionAttachments&&w.jsx(Tn,{content:o.attachSelectionToContext,children:w.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:()=>{Ie()},"aria-label":o.attachSelectionToContext,children:w.jsx(Zd,{size:16})})}),K&&!A&&w.jsx(Tn,{content:G,children:w.jsx("button",{type:"button",className:"mp-agent-composer-button mp-agent-composer-tool-button",onClick:()=>{M(d,!1);const ie=Y();ie&&b(d,[ie])},"aria-label":G,children:z})}),R&&w.jsx(R,{chatKey:d,activeChatId:t,attachments:E,addAttachments:ie=>b(d,ie),removeAttachment:ke})]}),w.jsx("div",{className:"mp-agent-composer-actions-right",children:n===ct.Streaming&&!Ye?w.jsx(Tn,{content:o.stopStreaming,children:w.jsx("button",{type:"button",onClick:r,"aria-label":o.stopStreaming,className:"mp-agent-composer-button mp-agent-composer-send-button",children:w.jsx(I5,{size:12})})}):w.jsx(Tn,{content:Ye?o.sendMessage:o.typeMessageToSend,children:w.jsx("button",{type:"submit",form:"composer-form",disabled:!Ye,"aria-label":o.sendMessage,className:"mp-agent-composer-button mp-agent-composer-send-button",children:w.jsx(Vd,{size:16})})})})]})]})}),ev=({autoFocus:e,multiUser:t=!1,participantIds:n})=>{const r=j.useRef({setValue:()=>{},getDraft:()=>({value:"",attachments:[]}),setDraft:()=>{},clearDraft:()=>{}}),{pendingKey:a,queuedMessages:i,activeChatStatus:o,activeChatId:s,handleSubmit:l,handleStop:u,handleQueuedClick:d,removeQueuedMessage:p}=x_e({composerFormRef:r,multiUser:t,participantIds:n});return w.jsx("div",{className:"mp-agent-composer-wrapper",children:w.jsxs("div",{className:"mp-agent-composer",children:[w.jsx(M_e,{queuedMessages:i,onSendQueued:d,onRemoveQueued:h=>p(a,h)}),w.jsx(G_e,{status:o,ref:r,autoFocus:e,activeChatId:s,onStop:u,onSubmit:l})]})})};function W_e(e,t,n){const r=new Array(e);return new Proxy(r,{get(a,i,o){if(typeof i=="string"){const s=i.charCodeAt(0);if(s>=48&&s<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&l<e){let u=a[l];if(!u){const d=t[l*2];u=a[l]={index:l,key:n(l),start:d,size:t[l*2+1],end:d+t[l*2+1],lane:0}}return u}}if(i==="length")return e}return Reflect.get(a,i,o)}})}function Mr(e,t,n){let r=n.initialDeps??[],a,i=!0;function o(){var s;const l=process.env.NODE_ENV!=="production"&&!!n.key&&!!((s=n.debug)!=null&&s.call(n));let u=0;l&&(u=Date.now());const d=e();if(!(d.length!==r.length||d.some((m,f)=>r[f]!==m)))return a;r=d;let h=0;if(l&&(h=Date.now()),a=t(...d),l){const m=Math.round((Date.now()-u)*100)/100,f=Math.round((Date.now()-h)*100)/100,g=f/16,_=(k,b)=>{for(k=String(k);k.length<b;)k=" "+k;return k};console.info(`%c⏱ ${_(f,5)} /${_(m,5)} ms`,`
|
|
8294
8294
|
font-size: .6rem;
|
|
8295
8295
|
font-weight: bold;
|
|
8296
|
-
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(a),i=!1,a}return o.updateDeps=s=>{r=s},o}function C2(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const K_e=(e,t)=>Math.abs(e-t)<1.01,Y_e=(e,t,n)=>{let r;return function(...a){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,a),n)}};let Qr;const ls=()=>{if(Qr!==void 0)return Qr;if(typeof navigator>"u")return Qr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Qr=!0;const e=navigator.maxTouchPoints;return Qr=navigator.platform==="MacIntel"&&e!==void 0&&e>0},R2=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Z_e=e=>e,X_e=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,a=new Array(r);for(let i=0;i<r;i++)a[i]=t+i;return a},Q_e=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const a=o=>{const{width:s,height:l}=o;t({width:Math.round(s),height:Math.round(l)})};if(a(R2(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(o=>{const s=()=>{const l=o[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){a({width:u.inlineSize,height:u.blockSize});return}}a(R2(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Pi={passive:!0},J_e=typeof window>"u"?!0:"onscrollend"in window,exe=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const a=e.targetWindow;if(!a)return;const i=e.options.useScrollendEvent&&J_e;let o=0;const s=i?null:Y_e(a,()=>t(o,!1),e.options.isScrollingResetDelay),l=p=>()=>{o=n(r),s?.(),t(o,p)},u=l(!0),d=l(!1);return r.addEventListener("scroll",u,Pi),i&&r.addEventListener("scrollend",d,Pi),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",d)}},txe=(e,t)=>exe(e,t,n=>{const{horizontal:r,isRtl:a}=e.options;return r?n.scrollLeft*(a&&-1||1):n.scrollTop}),nxe=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),a=n.options.getItemKey(r);return n.itemSizeCache.get(a)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),a=n.options.getItemKey(r),i=n.itemSizeCache.get(a);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},rxe=(e,{adjustments:t=0,behavior:n},r)=>{var a,i;(i=(a=r.scrollElement)==null?void 0:a.scrollTo)==null||i.call(a,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},axe=rxe;class ixe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,a;return((a=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:a.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(i=>{const o=()=>{const s=i.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);for(const[u,d]of this.elementsCache)if(d===s){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(s,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var a;(a=r())==null||a.disconnect(),n=null},observe:a=>{var i;return(i=r())==null?void 0:i.observe(a,{box:"border-box"})},unobserve:a=>{var i;return(i=r())==null?void 0:i.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{var r,a;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Z_e,rangeExtractor:X_e,onChange:()=>{},measureElement:nxe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in n){const m=n[h];m!==void 0&&(i[h]=m)}const o=this.options;let s=null,l=null,u=!1;if(o!==void 0&&o.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const h=o.count,m=i.count,f=this.getMeasurements(),g=h>0?((r=f[0])==null?void 0:r.key)??o.getItemKey(0):null,_=h>0?((a=f[h-1])==null?void 0:a.key)??o.getItemKey(h-1):null;if(m!==h||h>0&&m>0&&(i.getItemKey(0)!==g||i.getItemKey(m-1)!==_)){u=!0;const x=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;x&&(s=[x.key,this.getScrollOffset()-x.start]);const M=i.followOnAppend===!0?"auto":i.followOnAppend||null;M&&m>h&&this.isAtEnd(o.scrollEndThreshold)&&(h===0||i.getItemKey(m-1)!==_)&&(l=M)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,p=0;if(s&&this.scrollOffset!==null){const[h,m]=s,f=this.getMeasurements(),{count:g,getItemKey:_}=this.options;let k=0;for(;k<g&&_(k)!==h;)k++;if(k<g){const b=f[k];if(b){const x=Math.max(0,b.start+m);x!==this.scrollOffset&&(p=x-this.scrollOffset,this.scrollOffset=x,d=!0)}}}(d||l)&&(this.pendingScrollAnchor=[d?s[0]:null,d?s[1]:0,l,p])},this.notify=n=>{var r,a;(a=(r=this.options).onChange)==null||a.call(r,this,n)},this.maybeNotify=Mr(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{if(o&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const s=this.getScrollOffset();this.scrollDirection=o?s===i?this.scrollDirection:s<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,o=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},s=()=>{this._iosTouching=!1,!(!ls()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",o,Pi),i.addEventListener("touchend",s,Pi),this.unsubs.push(()=>{i.removeEventListener("touchstart",o),i.removeEventListener("touchend",s),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const a=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,a&&this.scrollElement&&this.options.enabled){const[i,o,s,l]=a;i!==null&&!s&&(ls()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),s&&this.scrollToEnd({behavior:s})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const a=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=a,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Mr(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,a,i,o,s,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:a,getItemKey:i,enabled:o,lanes:s,laneAssignmentMode:l,gap:u}),{key:!1}),this.getMeasurements=Mr(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:a,getItemKey:i,enabled:o,lanes:s,laneAssignmentMode:l,gap:u},d)=>{const p=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const k of this.laneAssignments.keys())k>=n&&this.laneAssignments.delete(k);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),s===1){const k=n*2;let b=this._flatMeasurements;if(!b||b.length<k){const N=new Float64Array(k);b&&h>0&&N.set(b.subarray(0,h*2)),b=N,this._flatMeasurements=b}let x;if(h===0)x=r+a;else{const N=h-1;x=b[N*2]+b[N*2+1]+u}for(let N=h;N<n;N++){const E=i(N),D=p.get(E),P=typeof D=="number"?D:this.options.estimateSize(N);b[N*2]=x,b[N*2+1]=P,x+=P+u}const M=W_e(n,b,i);return this.measurementsCache=M,M}const m=this.measurementsCache.slice(0,h),f=new Array(s).fill(void 0),g=new Float64Array(s);let _=0;for(let k=0;k<h;k++){const b=m[k];b&&(f[b.lane]===void 0&&_++,f[b.lane]=k,g[b.lane]=b.end)}for(let k=h;k<n;k++){const b=i(k),x=this.laneAssignments.get(k);let M,N;const E=l==="estimate"||p.has(b);if(x!==void 0&&this.options.lanes>1){M=x;const I=f[M],q=I!==void 0?m[I]:void 0;N=q?q.end+u:r+a}else if(_===s){let I=0,q=g[0],Z=f[0];for(let X=1;X<s;X++){const K=g[X];(K<q||K===q&&f[X]<Z)&&(I=X,q=K,Z=f[X])}M=I,N=q+u,E&&this.laneAssignments.set(k,M)}else M=k%this.options.lanes,N=r+a,E&&this.laneAssignments.set(k,M);const D=p.get(b),P=typeof D=="number"?D:this.options.estimateSize(k),C=N+P;m[k]={index:k,start:N,size:P,end:C,key:b,lane:M},f[M]===void 0&&_++,f[M]=k,g[M]=C}return this.measurementsCache=m,m},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Mr(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,a,i)=>n.length===0||r===0?(this.range=null,null):(this.range=sxe(n,r,a,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Mr(()=>{let n=null,r=null;const a=this.calculateRange();return a&&(n=a.startIndex,r=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,a,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:r,count:a}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,a=n.getAttribute(r);return a?parseInt(a,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const a=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(a!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,a-i),s=Math.min(this.options.count-1,a+i);return n>=o&&n<=s}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,s)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(s))});return}const r=this.indexFromElement(n),a=this.options.getItemKey(r),i=this.elementsCache.get(a);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(a,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var a,i;if(n<0||n>=this.options.count)return;let o,s,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(n),s=u[n*2],o=u[n*2+1];else{const h=this.measurementsCache[n];if(!h)return;l=h.key,s=h.start,o=h.size}const d=this.itemSizeCache.get(l)??o,p=r-d;if(p!==0){const h=this.options.anchorTo==="end"&&((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=h?this.getTotalSize():0,f=this.getScrollOffset()+this.scrollAdjustments,_=!this.itemSizeCache.has(l)?s<f:s+d<=f&&this.scrollDirection!=="backward",k=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:s,size:o,end:s+o,lane:0},p,this):_);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++;let b=!1;h?b=this.applyScrollAdjustment(this.getTotalSize()-m):k&&(b=this.applyScrollAdjustment(p)),this.notify(b)}},this.getVirtualItems=Mr(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const a=[];for(let i=0,o=n.length;i<o;i++){const s=n[i],l=r[s];a.push(l)}return a},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const a=this._flatMeasurements,i=this.options.lanes===1&&a!=null,o=tv(0,r.length-1,i?s=>a[s*2]:s=>C2(r[s]).start,n);return C2(r[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,a=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+i?"end":"start"),r==="center"?n+=(a-i)/2:r==="end"&&(n-=i);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[n];if(!o)return;if(r==="auto")if(o.end>=i+a-this.options.scrollPaddingEnd)r="end";else if(o.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const s=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,o.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:a="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(n,r),o=this.now();this.scrollState={index:null,align:r,behavior:a,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:a="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getOffsetForIndex(n,r);if(!i)return;const[o,s]=i,l=this.now();this.scrollState={index:n,align:s,behavior:a,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const a=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let a;if(r.length===0)a=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,o=this._flatMeasurements;o!=null?a=o[i*2]+o[i*2+1]:a=((n=r[i])==null?void 0:n.end)??0}else{const i=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&i.some(s=>s===null);){const s=r[o];i[s.lane]===null&&(i[s.lane]=s.end),o--}a=Math.max(...i.filter(s=>s!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const a of r)a&&this.itemSizeCache.has(a.key)&&n.push({index:a.index,key:a.key,start:a.start,size:a.size,end:a.end,lane:a.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:a})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:a,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",t),ls()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,a=r?r[0]:this.scrollState.lastTargetOffset,i=1,o=a!==this.scrollState.lastTargetOffset;if(!o&&K_e(a,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==a&&this._scrollToOffset(a,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const s=this.getSize()||600,l=Math.abs(a-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>s;this.scrollState.lastTargetOffset=a,u||(this.scrollState.behavior="auto"),this._scrollToOffset(a,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const tv=(e,t,n,r)=>{for(;e<=t;){const a=(e+t)/2|0,i=n(a);if(i<r)e=a+1;else if(i>r)t=a-1;else return a}return e>0?e-1:0};function oxe(e,t,n){let r=0;for(;r<=t;){const a=(r+t)/2|0,i=e[a*2];if(i<n)r=a+1;else if(i>n)t=a-1;else return a}return r>0?r-1:0}function sxe(e,t,n,r,a){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&a!==null){const u=oxe(a,i,n);let d=u;const p=n+t;for(;d<i&&a[d*2]+a[d*2+1]<p;)d++;return{startIndex:u,endIndex:d}}let s=tv(0,i,u=>e[u].start,n),l=s;if(r===1)for(;l<i&&e[l].end<n+t;)l++;else if(r>1){const u=Array(r).fill(0);for(;l<i&&u.some(p=>p<n+t);){const p=e[l];u[p.lane]=p.end,l++}const d=Array(r).fill(n+t);for(;s>=0&&d.some(p=>p>=n);){const p=e[s];d[p.lane]=p.start,s--}s=Math.max(0,s-s%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:s,endIndex:l}}const cs=typeof document<"u"?te.useLayoutEffect:te.useEffect;function lxe({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const a=te.useReducer(d=>d+1,0)[1],i=te.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const o=d=>{const p=i.current;if(!p.enabled||!p.container)return;const h=d.getTotalSize();if(h!==p.lastSize){p.lastSize=h;const m=d.options.horizontal?"width":"height";p.container.style[m]=`${h}px`}},s=d=>{const p=i.current;if(!p.enabled||!p.container)return;o(d);const h=!!d.options.horizontal,m=p.mode==="transform",f=h?"left":"top",g=d.options.scrollMargin,_=d.getVirtualItems();for(const k of _){const b=k.start-g,x=d.elementsCache.get(k.key);x&&p.lastPositions.get(x)!==b&&(p.lastPositions.set(x,b),m?x.style.transform=h?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:x.style[f]=`${b}px`)}},l={...r,onChange:(d,p)=>{var h;const m=i.current;let f=!0;if(m.enabled){s(d);const g=d.range,_=m.prevRange;f=!_||_.isScrolling!==d.isScrolling||_.startIndex!==g?.startIndex||_.endIndex!==g?.endIndex,f&&(m.prevRange=g?{startIndex:g.startIndex,endIndex:g.endIndex,isScrolling:d.isScrolling}:null)}f&&(e&&p?d5.flushSync(a):a()),(h=r.onChange)==null||h.call(r,d,p)}},[u]=te.useState(()=>{const d=new ixe(l);return Object.assign(d,{containerRef:p=>{const h=i.current;if(h.container=p,h.lastSize=null,p&&h.enabled){const m=d.getTotalSize();h.lastSize=m;const f=d.options.horizontal?"width":"height";p.style[f]=`${m}px`}}})});return u.setOptions(l),cs(()=>u._didMount(),[]),cs(()=>(o(u),u._willUpdate())),cs(()=>{s(u)}),u}function cxe(e){return lxe({observeElementRect:Q_e,observeElementOffset:txe,scrollToFn:axe,...e})}const nv=j.memo(()=>{const e=fe(n=>n.activeChatId??n.draftChatKey),t=fe(n=>De(n,e).composerError);return t?w.jsx("div",{className:"mp-agent-composer-error",children:t}):null});nv.displayName="ComposerError";const uxe=(e,t)=>{switch(e.status){case exports.AgentToolCallStatus.Running:return`Running ${t}...`;case exports.AgentToolCallStatus.Succeeded:return`Completed ${t}`;case exports.AgentToolCallStatus.Failed:return`Failed to run ${t}`;case exports.AgentToolCallStatus.Pending:return`Preparing ${t}...`;default:return`Running ${t}...`}},us=e=>{if(e===void 0)return"undefined";try{return JSON.stringify(e,null,2)??"undefined"}catch{try{return String(e)}catch{return"[unserializable]"}}},I2=({call:e})=>$e().config.debug?w.jsxs("details",{className:"mp-agent-tool-debug-details",children:[w.jsx("summary",{className:"mp-agent-tool-debug-summary",children:"Details"}),w.jsxs("div",{className:"mp-agent-tool-debug-body",children:[w.jsxs("div",{className:"mp-agent-tool-debug-row",children:[w.jsx("div",{className:"mp-agent-tool-debug-label",children:"Tool"}),w.jsx("div",{className:"mp-agent-tool-debug-value",children:e.name})]}),w.jsxs("div",{className:"mp-agent-tool-debug-row",children:[w.jsx("div",{className:"mp-agent-tool-debug-label",children:"Status"}),w.jsx("div",{className:"mp-agent-tool-debug-value",children:e.status})]}),w.jsxs("details",{className:"mp-agent-tool-debug-section",children:[w.jsx("summary",{className:"mp-agent-tool-debug-section-summary",children:"Input"}),w.jsx("pre",{className:"mp-agent-tool-debug-code",children:w.jsx("code",{children:us(e.input)})})]}),w.jsxs("details",{className:"mp-agent-tool-debug-section",children:[w.jsx("summary",{className:"mp-agent-tool-debug-section-summary",children:"Output"}),w.jsx("pre",{className:"mp-agent-tool-debug-code",children:w.jsx("code",{children:us(e.output)})})]}),e.error&&w.jsxs("details",{className:"mp-agent-tool-debug-section",children:[w.jsx("summary",{className:"mp-agent-tool-debug-section-summary",children:"Error"}),w.jsx("pre",{className:"mp-agent-tool-debug-code",children:w.jsx("code",{children:us(e.error)})})]})]})]}):null,rv=j.memo(({call:e})=>{const t=$e(),n=e.status===exports.AgentToolCallStatus.Succeeded||e.status===exports.AgentToolCallStatus.Failed;if(!t.config.debug||n)return null;const a=t.tools.get(e.name)?.label??e.name;return w.jsx("div",{className:"mp-agent-tool-header",children:w.jsx("div",{className:"mp-agent-tool-simple-message",children:uxe(e,a)})})});rv.displayName="ToolCallHeader";function dxe(e){try{const t=JSON.parse(e);return{question:typeof t.question=="string"?t.question:void 0,selectedOptions:Array.isArray(t.selectedOptions)?t.selectedOptions:void 0,freeText:typeof t.freeText=="string"?t.freeText:void 0}}catch{return e}}const av=({call:e})=>{if(e.approved===void 0)return null;const t=e.userResponse?dxe(e.userResponse):null,n=()=>{if(!t)return null;if(typeof t=="string")return w.jsx("span",{className:"mp-agent-tool-approval-response",children:t});const r=t.freeText??t.selectedOptions?.map(a=>a.label).join(", ");return!t.question&&!r?null:w.jsxs("div",{className:"mp-agent-tool-approval-result",children:[t.question&&w.jsx("span",{className:"mp-agent-tool-approval-question",children:t.question}),r&&w.jsx("span",{className:"mp-agent-tool-approval-response",children:r})]})};return w.jsxs("div",{className:"mp-agent-tool-approval-status-inline",children:[e.approved&&n(),e.approved?w.jsx("div",{className:"mp-agent-tool-approved",children:w.jsx("span",{children:"✓ Approved"})}):w.jsx("span",{className:"mp-agent-tool-denied",children:"✗ Denied"})]})},pxe=e=>{if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e.question,n=e.selectionMode,r=e.options,a=e.allowFreeText;if(typeof t!="string"||t.trim().length<1||n!=="single"&&n!=="multiple"||!Array.isArray(r)||r.length<2||r.length>6)return null;const i=r.map(o=>{if(!o||typeof o!="object"||Array.isArray(o))return null;const s=o.id,l=o.label,u=o.description;return typeof s!="string"||s.trim().length<1||typeof l!="string"||l.trim().length<1||u!==void 0&&typeof u!="string"?null:{id:s,label:l,...typeof u=="string"?{description:u}:{}}}).filter(o=>o!==null);return i.length!==r.length?null:{question:t,selectionMode:n,options:i,allowFreeText:typeof a=="boolean"?a:!1}},hxe=({callId:e,input:t,isSubmitting:n,onSubmit:r})=>{const[a,i]=j.useState([]),[o,s]=j.useState(""),[l,u]=j.useState(void 0),d=j.useMemo(()=>pxe(t),[t]);j.useEffect(()=>{i([]),s(""),u(void 0)},[e,t]);const p=m=>{if(d){if(u(void 0),d.selectionMode==="single"){i([m]);return}i(f=>f.includes(m)?f.filter(g=>g!==m):[...f,m])}},h=async()=>{if(!d)return;const m=o.trim(),f=a.length>0,g=d.allowFreeText&&m.length>0;if(!f&&!g){u(d.allowFreeText?"Select at least one option or provide a custom response.":"Select at least one option before submitting.");return}const _=d.options.filter(b=>a.includes(b.id)).map(({id:b,label:x,description:M})=>({id:b,label:x,...M?{description:M}:{}})),k={question:d.question,selectionMode:d.selectionMode,selectedOptionIds:a,selectedOptions:_,...m?{freeText:m}:{}};await r(JSON.stringify(k))};return d?w.jsxs("div",{className:"mp-agent-tool-user-action-form",children:[w.jsx("div",{className:"mp-agent-tool-user-action-question",children:d.question}),w.jsx("div",{className:"mp-agent-tool-user-action-options",children:d.options.map(m=>{const f=`${e}-${m.id}`,g=a.includes(m.id);return w.jsxs("label",{htmlFor:f,className:"mp-agent-tool-user-action-option",children:[w.jsx("input",{id:f,type:d.selectionMode==="single"?"radio":"checkbox",name:`mp-agent-tool-user-action-${e}`,checked:g,onChange:()=>p(m.id),disabled:n}),w.jsxs("span",{className:"mp-agent-tool-user-action-option-content",children:[w.jsx("span",{className:"mp-agent-tool-user-action-option-label",children:m.label}),m.description?w.jsx("span",{className:"mp-agent-tool-user-action-option-description",children:m.description}):null]})]},m.id)})}),d.allowFreeText?w.jsx("textarea",{className:"mp-agent-tool-user-action-free-text",value:o,onChange:m=>{s(m.target.value),l&&u(void 0)},placeholder:"Optional custom response",rows:3,disabled:n}):null,l?w.jsx("div",{className:"mp-agent-tool-input-error",children:l}):null,w.jsx("div",{className:"mp-agent-tool-approval-actions",children:w.jsx("button",{className:"mp-agent-tool-approve-button",onClick:h,disabled:n,children:n?"Submitting...":"Submit response"})})]}):w.jsx("div",{className:"mp-agent-tool-user-action-form",children:w.jsx("div",{className:"mp-agent-tool-input-error",children:"Invalid user action input schema in tool call."})})},mxe=({call:e,messageId:t,chatId:n,onApprovalSent:r})=>{const a=$e(),i=a.tools.get(e.name)?.label??e.name,o=fe(q=>q.appendMessagesToChat),s=fe(q=>q.setChatMessages),l=fe(q=>q.setChatStatus),u=fe(q=>q.setPendingAssistant),[d,p]=j.useState(!1),[h,m]=j.useState(!1),[f,g]=j.useState(!1),[_,k]=j.useState(JSON.stringify(e.input??{},null,2)),[b,x]=j.useState(void 0),M=a.config.user?.id??"guest",N=e.requiresUserAction;j.useEffect(()=>{h||(k(JSON.stringify(e.input??{},null,2)),x(void 0))},[e.id,e.input,h]);const E=()=>{k(JSON.stringify(e.input??{},null,2)),x(void 0),m(!0)},D=()=>{k(JSON.stringify(e.input??{},null,2)),x(void 0),m(!1)},P=async()=>{if(!(!a.transport.updateToolCall||f||d)){x(void 0),g(!0);try{const q=JSON.parse(_);if(!q||typeof q!="object"||Array.isArray(q))throw new Error("Tool input must be a JSON object.");const Z=await a.transport.updateToolCall({chatId:n,messageId:t,toolCallId:e.id,input:q});o(n,[Z]),m(!1)}catch(q){x(q instanceof Error?q.message:"Failed to update tool input.")}finally{g(!1)}}},C=q=>{s(n,Z=>Z.map(X=>X.id===t?{...X,toolCalls:(X.toolCalls??[]).map(K=>K.id===e.id?{...K,...q}:K)}:X))},I=async(q,Z)=>{if(!(!e.approvalId||d||f||h)){p(!0),C({approved:q,...Z?{userResponse:Z}:{}}),l(n,st.Streaming),u(n,{id:`pending-approval-${e.id}`,chat:n,role:exports.MessageRole.Assistant,content:"",reasoning:"",toolCalls:[],attachments:[],createdAt:new Date().toISOString()});try{const X={chatId:n,messageId:t,approvalId:e.approvalId,approved:q,...Z?{userResponse:Z}:{},userId:M},K=await a.transport.streamMessage(X,R=>{R.type===exports.StreamChunkType.Message&&R.message&&(R.message.id!==t&&u(n,void 0),o(n,[R.message]))},{streamKey:n});K&&o(K.id,K.messages),await r()}catch(X){console.error("Failed to send approval:",X),C({approved:void 0,userResponse:void 0}),l(n,st.Idle)}finally{u(n,void 0),p(!1)}}};return e.approved!==void 0?w.jsx(av,{call:e}):N?w.jsx(hxe,{callId:e.id,input:e.input,isSubmitting:d,onSubmit:q=>I(!0,q)}):w.jsxs("div",{className:"mp-agent-tool-approval-buttons",children:[w.jsxs("div",{className:"mp-agent-tool-approval-request-message",children:["Agent wants to execute tool ",i,"."]}),w.jsxs("div",{className:"mp-agent-tool-input-card",children:[w.jsxs("div",{className:"mp-agent-tool-input-card-header",children:[w.jsx("span",{className:"mp-agent-tool-input-card-title",children:"Tool input"}),h?w.jsxs("div",{className:"mp-agent-tool-input-actions",children:[w.jsx(un,{icon:"Check",size:"sm",tooltip:"Save tool input",onClick:P,disabled:f||d,"aria-label":"Save tool input"}),w.jsx(un,{icon:"X",size:"sm",tooltip:"Cancel input edit",onClick:D,disabled:f||d,"aria-label":"Cancel tool input edit"})]}):w.jsx(un,{icon:"Pencil",size:"sm",tooltip:"Edit tool input",onClick:E,disabled:d||f,"aria-label":"Edit tool input"})]}),h?w.jsx("textarea",{className:"mp-agent-tool-input-editor",value:_,onChange:q=>{k(q.target.value),b&&x(void 0)},rows:8,spellCheck:!1,disabled:f||d}):w.jsx("pre",{className:"mp-agent-tool-input-preview",children:JSON.stringify(e.input??{},null,2)}),b&&w.jsx("div",{className:"mp-agent-tool-input-error",children:b})]}),w.jsxs("div",{className:"mp-agent-tool-approval-actions",children:[w.jsx("button",{className:"mp-agent-tool-approve-button",onClick:()=>I(!0),disabled:d||h||f,children:d?"Processing...":"Approve"}),w.jsx("button",{className:"mp-agent-tool-deny-button",onClick:()=>I(!1),disabled:d||f,children:d?"Processing...":"Deny"})]})]})},O2=({call:e,messageId:t,chatId:n})=>{const r=$e(),a=fe(p=>p.upsertChat),i=fe(p=>p.setChatStatus),o=r.config.debug&&!!e.approvalId,s=e.requiresConfirmation&&e.approvalId||o,l=s&&e.approved===void 0,u=s&&e.approved!==void 0,d=async()=>{try{const p=await r.transport.getChat(n);a(p),i(n,ka(p.status))}catch(p){console.error("Failed to refresh chat after approval:",p),i(n,st.Idle)}};return!l&&!u?null:w.jsxs("div",{className:"mp-agent-tool-approval",children:[l&&w.jsx(mxe,{call:e,messageId:t,chatId:n,onApprovalSent:d}),u&&w.jsx(av,{call:e})]})},iv=j.memo(({chatId:e,isExpanded:t})=>{const n=$e(),r=fe(d=>De(d,e).messages),a=fe(d=>De(d,e).pendingAssistant),i=fe(d=>d.chats[e]?.contextKey??d.contextKey),[o,s]=j.useState(t);t&&!o&&s(!0);const l=mp(e,{requireRegisteredChat:!1,enabled:o}),u=j.useMemo(()=>{const d=[...r].sort((h,m)=>h.createdAt.localeCompare(m.createdAt));if(n.config.debug)return d;const p=d.findIndex(h=>h.role===exports.MessageRole.User);return p===-1?d:d.filter((h,m)=>m!==p)},[r,n.config.debug]);return t?w.jsx("div",{className:"mp-agent-subagent-preview",children:w.jsx("div",{className:"mp-agent-subagent-preview-body",children:u.length===0&&!a?w.jsx("div",{className:"mp-agent-subagent-preview-empty",children:l.isLoading?"Loading subagent chat...":"Subagent chat started."}):w.jsxs(w.Fragment,{children:[u.map(d=>w.jsx(eo,{message:d,contextKey:i,showParticipantChrome:!0},d.id)),a&&w.jsx(eo,{message:a,contextKey:i,isStreaming:!0,showParticipantChrome:!0})]})})}):null});iv.displayName="SubagentChatPreview";const fxe=e=>{switch(e){case exports.AgentToolCallStatus.Succeeded:return{key:"succeeded",label:"Done",icon:w.jsx(Gd,{size:12})};case exports.AgentToolCallStatus.Failed:return{key:"failed",label:"Failed",icon:w.jsx(L5,{size:12})};case exports.AgentToolCallStatus.Pending:return{key:"running",label:"Preparing",icon:w.jsx(ma,{size:12,className:"mp-agent-subagent-spinner"})};default:return{key:"running",label:"Running",icon:w.jsx(ma,{size:12,className:"mp-agent-subagent-spinner"})}}},ov=j.memo(({call:e,subagentChatId:t})=>{const[n,r]=j.useState(()=>e.status===exports.AgentToolCallStatus.Running||e.status===exports.AgentToolCallStatus.Pending),a=fe(o=>{const{messages:s,pendingAssistant:l}=De(o,t),u=s.find(d=>d.agentName||d.sender?.type==="agent")??l;return u?.agentName||u?.sender?.displayName||void 0}),i=fxe(e.status);return w.jsxs("div",{className:"mp-agent-subagent",children:[w.jsxs("button",{className:"mp-agent-subagent-row",type:"button",onClick:()=>r(o=>!o),"aria-expanded":n,children:[w.jsx("span",{className:"mp-agent-subagent-row-icon",children:w.jsx(v5,{size:14})}),w.jsx("span",{className:"mp-agent-subagent-row-title",children:a?w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"mp-agent-subagent-row-label",children:"Subagent:"})," ",a]}):"Subagent"}),w.jsxs("span",{className:`mp-agent-subagent-row-status is-${i.key}`,children:[i.icon,i.label]}),w.jsx("span",{className:"mp-agent-subagent-row-chevron",children:n?w.jsx(Wd,{size:14}):w.jsx(no,{size:14})})]}),w.jsx(iv,{chatId:t,isExpanded:n})]})});ov.displayName="SubagentToolCall";const xp=j.memo(({call:e,contextKey:t,messageId:n,chatId:r})=>{const a=$e(),i=e.subagentChatId||(typeof e.input?.subagentChatId=="string"?e.input.subagentChatId:void 0),o=j.useMemo(()=>a.getToolRenderer(e),[a,e.name]),s=i?w.jsx(ov,{call:e,subagentChatId:i}):null;if(!o){const l=!!(e.requiresConfirmation&&e.approvalId);return!!i||a.config.debug||l?w.jsxs("div",{className:"mp-agent-tool-panel",children:[w.jsx(rv,{call:e}),w.jsx(O2,{call:e,messageId:n,chatId:r}),w.jsx(I2,{call:e}),s]}):null}return w.jsxs("div",{className:"mp-agent-tool-panel",children:[w.jsx(o,{call:e,contextKey:t,chatId:r}),w.jsx(O2,{call:e,messageId:n,chatId:r}),w.jsx(I2,{call:e}),s]})});xp.displayName="ToolCallCard";const gxe=e=>{const t=e.sender?.displayName||e.sender?.id||e.agentName;if(!t)return e.role===exports.MessageRole.User?"You":"AI";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?`${n[0][0]}${n[1][0]}`.toUpperCase():t.slice(0,2).toUpperCase()},wp=j.memo(({message:e})=>{const t=e.role===exports.MessageRole.User;return w.jsx("div",{className:`mp-agent-message-avatar ${t?"mp-agent-message-avatar-user":""}`,children:e.sender?.avatarUrl?w.jsx("img",{className:"mp-agent-message-avatar-image",src:e.sender.avatarUrl,alt:""}):w.jsx("div",{className:"mp-agent-message-avatar-icon",children:gxe(e)})})});wp.displayName="MessageAvatar";const yxe=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):"",bxe=e=>e.sender?.displayName?e.sender.displayName:e.sender?.id&&e.sender.id!=="guest"?e.sender.id:e.agentName?e.agentName:e.role===exports.MessageRole.User?"You":"Assistant",Ep=j.memo(({message:e})=>{const t=bxe(e);return w.jsxs("div",{className:"mp-agent-message-header",children:[w.jsx("span",{className:"mp-agent-message-role",children:t}),w.jsx("span",{className:"mp-agent-message-time",children:yxe(e.createdAt)})]})});Ep.displayName="MessageHeader";function L2(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const o=n.slice(a,r).trim();(o||!i)&&t.push(o),a=r+1,r=n.indexOf(",",a)}return t}function kxe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vxe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_xe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xxe={};function D2(e,t){return(xxe.jsx?_xe:vxe).test(e)}const wxe=/[ \t\n\f\r]/g;function Exe(e){return typeof e=="object"?e.type==="text"?z2(e.value):!1:z2(e)}function z2(e){return e.replace(wxe,"")===""}let La=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};La.prototype.normal={};La.prototype.property={};La.prototype.space=void 0;function sv(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new La(n,r,t)}function va(e){return e.toLowerCase()}let Ft=class{constructor(t,n){this.attribute=n,this.property=t}};Ft.prototype.attribute="";Ft.prototype.booleanish=!1;Ft.prototype.boolean=!1;Ft.prototype.commaOrSpaceSeparated=!1;Ft.prototype.commaSeparated=!1;Ft.prototype.defined=!1;Ft.prototype.mustUseProperty=!1;Ft.prototype.number=!1;Ft.prototype.overloadedBoolean=!1;Ft.prototype.property="";Ft.prototype.spaceSeparated=!1;Ft.prototype.space=void 0;let Mxe=0;const Te=kr(),ct=kr(),yd=kr(),le=kr(),Ze=kr(),fr=kr(),Ut=kr();function kr(){return 2**++Mxe}const bd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:ct,commaOrSpaceSeparated:Ut,commaSeparated:fr,number:le,overloadedBoolean:yd,spaceSeparated:Ze},Symbol.toStringTag,{value:"Module"})),ds=Object.keys(bd);let Mp=class extends Ft{constructor(t,n,r,a){let i=-1;if(super(t,n),$2(this,"space",a),typeof r=="number")for(;++i<ds.length;){const o=ds[i];$2(this,ds[i],(r&bd[o])===bd[o])}}};Mp.prototype.defined=!0;function $2(e,t,n){n&&(e[t]=n)}function Gr(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new Mp(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[va(r)]=r,n[va(i.attribute)]=r}return new La(t,n,e.space)}const lv=Gr({properties:{ariaActiveDescendant:null,ariaAtomic:ct,ariaAutoComplete:null,ariaBusy:ct,ariaChecked:ct,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:Ze,ariaCurrent:null,ariaDescribedBy:Ze,ariaDetails:null,ariaDisabled:ct,ariaDropEffect:Ze,ariaErrorMessage:null,ariaExpanded:ct,ariaFlowTo:Ze,ariaGrabbed:ct,ariaHasPopup:null,ariaHidden:ct,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ze,ariaLevel:le,ariaLive:null,ariaModal:ct,ariaMultiLine:ct,ariaMultiSelectable:ct,ariaOrientation:null,ariaOwns:Ze,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:ct,ariaReadOnly:ct,ariaRelevant:null,ariaRequired:ct,ariaRoleDescription:Ze,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:ct,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cv(e,t){return t in e?e[t]:t}function uv(e,t){return cv(e,t.toLowerCase())}const Sxe=Gr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fr,acceptCharset:Ze,accessKey:Ze,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alpha:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Ze,autoFocus:Te,autoPlay:Te,blocking:Ze,capture:null,charSet:null,checked:Te,cite:null,className:Ze,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:ct,controls:Te,controlsList:Ze,coords:le|fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:yd,draggable:ct,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Ze,height:le,hidden:yd,high:le,href:null,hrefLang:null,htmlFor:Ze,httpEquiv:Ze,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Ze,itemRef:Ze,itemScope:Te,itemType:Ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:le,pattern:null,ping:Ze,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Ze,required:Te,reversed:Te,rows:le,rowSpan:le,sandbox:Ze,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootCustomElementRegistry:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shadowRootSerializable:Te,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:ct,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:ct,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ze,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:ct,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Te,disablePictureInPicture:Te,disableRemotePlayback:Te,exportParts:fr,part:Ze,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:uv}),Nxe=Gr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ut,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:Ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fr,g2:fr,glyphName:fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Ut,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ut,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ut,rev:Ut,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ut,requiredFeatures:Ut,requiredFonts:Ut,requiredFormats:Ut,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Ut,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ut,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ut,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cv}),dv=Gr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),pv=Gr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uv}),hv=Gr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Axe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Txe=/[A-Z]/g,F2=/-[a-z]/g,Cxe=/^data[-\w.:]+$/i;function mv(e,t){const n=va(t);let r=t,a=Ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Cxe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(F2,Ixe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!F2.test(i)){let o=i.replace(Txe,Rxe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=Mp}return new a(r,t)}function Rxe(e){return"-"+e.toLowerCase()}function Ixe(e){return e.charAt(1).toUpperCase()}const fv=sv([lv,Sxe,dv,pv,hv],"html"),vo=sv([lv,Nxe,dv,pv,hv],"svg");function P2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Oxe(e){return e.join(" ").trim()}var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sp={},q2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Lxe=/\n/g,Dxe=/^\s*/,zxe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$xe=/^:\s*/,Fxe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Pxe=/^[;\s]*/,qxe=/^\s+|\s+$/g,Bxe=`
|
|
8296
|
+
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(a),i=!1,a}return o.updateDeps=s=>{r=s},o}function C2(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const K_e=(e,t)=>Math.abs(e-t)<1.01,Y_e=(e,t,n)=>{let r;return function(...a){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,a),n)}};let Qr;const ls=()=>{if(Qr!==void 0)return Qr;if(typeof navigator>"u")return Qr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Qr=!0;const e=navigator.maxTouchPoints;return Qr=navigator.platform==="MacIntel"&&e!==void 0&&e>0},R2=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Z_e=e=>e,X_e=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,a=new Array(r);for(let i=0;i<r;i++)a[i]=t+i;return a},Q_e=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const a=o=>{const{width:s,height:l}=o;t({width:Math.round(s),height:Math.round(l)})};if(a(R2(n)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(o=>{const s=()=>{const l=o[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){a({width:u.inlineSize,height:u.blockSize});return}}a(R2(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Pi={passive:!0},J_e=typeof window>"u"?!0:"onscrollend"in window,exe=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const a=e.targetWindow;if(!a)return;const i=e.options.useScrollendEvent&&J_e;let o=0;const s=i?null:Y_e(a,()=>t(o,!1),e.options.isScrollingResetDelay),l=p=>()=>{o=n(r),s?.(),t(o,p)},u=l(!0),d=l(!1);return r.addEventListener("scroll",u,Pi),i&&r.addEventListener("scrollend",d,Pi),()=>{r.removeEventListener("scroll",u),i&&r.removeEventListener("scrollend",d)}},txe=(e,t)=>exe(e,t,n=>{const{horizontal:r,isRtl:a}=e.options;return r?n.scrollLeft*(a&&-1||1):n.scrollTop}),nxe=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),a=n.options.getItemKey(r);return n.itemSizeCache.get(a)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),a=n.options.getItemKey(r),i=n.itemSizeCache.get(a);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},rxe=(e,{adjustments:t=0,behavior:n},r)=>{var a,i;(i=(a=r.scrollElement)==null?void 0:a.scrollTo)==null||i.call(a,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},axe=rxe;class ixe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,a;return((a=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:a.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(i=>{const o=()=>{const s=i.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);for(const[u,d]of this.elementsCache)if(d===s){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(s,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var a;(a=r())==null||a.disconnect(),n=null},observe:a=>{var i;return(i=r())==null?void 0:i.observe(a,{box:"border-box"})},unobserve:a=>{var i;return(i=r())==null?void 0:i.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{var r,a;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Z_e,rangeExtractor:X_e,onChange:()=>{},measureElement:nxe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in n){const m=n[h];m!==void 0&&(i[h]=m)}const o=this.options;let s=null,l=null,u=!1;if(o!==void 0&&o.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const h=o.count,m=i.count,f=this.getMeasurements(),g=h>0?((r=f[0])==null?void 0:r.key)??o.getItemKey(0):null,_=h>0?((a=f[h-1])==null?void 0:a.key)??o.getItemKey(h-1):null;if(m!==h||h>0&&m>0&&(i.getItemKey(0)!==g||i.getItemKey(m-1)!==_)){u=!0;const x=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;x&&(s=[x.key,this.getScrollOffset()-x.start]);const M=i.followOnAppend===!0?"auto":i.followOnAppend||null;M&&m>h&&this.isAtEnd(o.scrollEndThreshold)&&(h===0||i.getItemKey(m-1)!==_)&&(l=M)}}this.options=i,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,p=0;if(s&&this.scrollOffset!==null){const[h,m]=s,f=this.getMeasurements(),{count:g,getItemKey:_}=this.options;let k=0;for(;k<g&&_(k)!==h;)k++;if(k<g){const b=f[k];if(b){const x=Math.max(0,b.start+m);x!==this.scrollOffset&&(p=x-this.scrollOffset,this.scrollOffset=x,d=!0)}}}(d||l)&&(this.pendingScrollAnchor=[d?s[0]:null,d?s[1]:0,l,p])},this.notify=n=>{var r,a;(a=(r=this.options).onChange)==null||a.call(r,this,n)},this.maybeNotify=Mr(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{if(o&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const s=this.getScrollOffset();this.scrollDirection=o?s===i?this.scrollDirection:s<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,o=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},s=()=>{this._iosTouching=!1,!(!ls()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",o,Pi),i.addEventListener("touchend",s,Pi),this.unsubs.push(()=>{i.removeEventListener("touchstart",o),i.removeEventListener("touchend",s),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const a=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,a&&this.scrollElement&&this.options.enabled){const[i,o,s,l]=a;i!==null&&!s&&(ls()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),s&&this.scrollToEnd({behavior:s})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}const a=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=a,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Mr(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,a,i,o,s,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:a,getItemKey:i,enabled:o,lanes:s,laneAssignmentMode:l,gap:u}),{key:!1}),this.getMeasurements=Mr(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:a,getItemKey:i,enabled:o,lanes:s,laneAssignmentMode:l,gap:u},d)=>{const p=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const k of this.laneAssignments.keys())k>=n&&this.laneAssignments.delete(k);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),s===1){const k=n*2;let b=this._flatMeasurements;if(!b||b.length<k){const N=new Float64Array(k);b&&h>0&&N.set(b.subarray(0,h*2)),b=N,this._flatMeasurements=b}let x;if(h===0)x=r+a;else{const N=h-1;x=b[N*2]+b[N*2+1]+u}for(let N=h;N<n;N++){const E=i(N),D=p.get(E),P=typeof D=="number"?D:this.options.estimateSize(N);b[N*2]=x,b[N*2+1]=P,x+=P+u}const M=W_e(n,b,i);return this.measurementsCache=M,M}const m=this.measurementsCache.slice(0,h),f=new Array(s).fill(void 0),g=new Float64Array(s);let _=0;for(let k=0;k<h;k++){const b=m[k];b&&(f[b.lane]===void 0&&_++,f[b.lane]=k,g[b.lane]=b.end)}for(let k=h;k<n;k++){const b=i(k),x=this.laneAssignments.get(k);let M,N;const E=l==="estimate"||p.has(b);if(x!==void 0&&this.options.lanes>1){M=x;const I=f[M],q=I!==void 0?m[I]:void 0;N=q?q.end+u:r+a}else if(_===s){let I=0,q=g[0],Z=f[0];for(let X=1;X<s;X++){const K=g[X];(K<q||K===q&&f[X]<Z)&&(I=X,q=K,Z=f[X])}M=I,N=q+u,E&&this.laneAssignments.set(k,M)}else M=k%this.options.lanes,N=r+a,E&&this.laneAssignments.set(k,M);const D=p.get(b),P=typeof D=="number"?D:this.options.estimateSize(k),C=N+P;m[k]={index:k,start:N,size:P,end:C,key:b,lane:M},f[M]===void 0&&_++,f[M]=k,g[M]=C}return this.measurementsCache=m,m},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Mr(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,a,i)=>n.length===0||r===0?(this.range=null,null):(this.range=sxe(n,r,a,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Mr(()=>{let n=null,r=null;const a=this.calculateRange();return a&&(n=a.startIndex,r=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,a,i,o)=>i===null||o===null?[]:n({startIndex:i,endIndex:o,overscan:r,count:a}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,a=n.getAttribute(r);return a?parseInt(a,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const a=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(a!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,a-i),s=Math.min(this.options.count-1,a+i);return n>=o&&n<=s}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,s)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(s))});return}const r=this.indexFromElement(n),a=this.options.getItemKey(r),i=this.elementsCache.get(a);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(a,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var a,i;if(n<0||n>=this.options.count)return;let o,s,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(n),s=u[n*2],o=u[n*2+1];else{const h=this.measurementsCache[n];if(!h)return;l=h.key,s=h.start,o=h.size}const d=this.itemSizeCache.get(l)??o,p=r-d;if(p!==0){const h=this.options.anchorTo==="end"&&((a=this.scrollState)==null?void 0:a.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,m=h?this.getTotalSize():0,f=this.getScrollOffset()+this.scrollAdjustments,_=!this.itemSizeCache.has(l)?s<f:s+d<=f&&this.scrollDirection!=="backward",k=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:s,size:o,end:s+o,lane:0},p,this):_);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(l,r),this.itemSizeCacheVersion++;let b=!1;h?b=this.applyScrollAdjustment(this.getTotalSize()-m):k&&(b=this.applyScrollAdjustment(p)),this.notify(b)}},this.getVirtualItems=Mr(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const a=[];for(let i=0,o=n.length;i<o;i++){const s=n[i],l=r[s];a.push(l)}return a},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const a=this._flatMeasurements,i=this.options.lanes===1&&a!=null,o=tv(0,r.length-1,i?s=>a[s*2]:s=>C2(r[s]).start,n);return C2(r[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,a=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();r==="auto"&&(r=n>=o+i?"end":"start"),r==="center"?n+=(a-i)/2:r==="end"&&(n-=i);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[n];if(!o)return;if(r==="auto")if(o.end>=i+a-this.options.scrollPaddingEnd)r="end";else if(o.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const s=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,o.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:a="auto"}={})=>{this._iosDeferredAdjustment=0;const i=this.getOffsetForAlignment(n,r),o=this.now();this.scrollState={index:null,align:r,behavior:a,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:a="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getOffsetForIndex(n,r);if(!i)return;const[o,s]=i,l=this.now();this.scrollState={index:n,align:s,behavior:a,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:a}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const a=this.getScrollOffset()+n,i=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:i,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let a;if(r.length===0)a=this.options.paddingStart;else if(this.options.lanes===1){const i=r.length-1,o=this._flatMeasurements;o!=null?a=o[i*2]+o[i*2+1]:a=((n=r[i])==null?void 0:n.end)??0}else{const i=Array(this.options.lanes).fill(null);let o=r.length-1;for(;o>=0&&i.some(s=>s===null);){const s=r[o];i[s.lane]===null&&(i[s.lane]=s.end),o--}a=Math.max(...i.filter(s=>s!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const a of r)a&&this.itemSizeCache.has(a.key)&&n.push({index:a.index,key:a.key,start:a.start,size:a.size,end:a.end,lane:a.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:a})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:a,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){return t===0?!1:(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",t),ls()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?(this._iosDeferredAdjustment+=t,!1):(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,a=r?r[0]:this.scrollState.lastTargetOffset,i=1,o=a!==this.scrollState.lastTargetOffset;if(!o&&K_e(a,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==a&&this._scrollToOffset(a,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const s=this.getSize()||600,l=Math.abs(a-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>s;this.scrollState.lastTargetOffset=a,u||(this.scrollState.behavior="auto"),this._scrollToOffset(a,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const tv=(e,t,n,r)=>{for(;e<=t;){const a=(e+t)/2|0,i=n(a);if(i<r)e=a+1;else if(i>r)t=a-1;else return a}return e>0?e-1:0};function oxe(e,t,n){let r=0;for(;r<=t;){const a=(r+t)/2|0,i=e[a*2];if(i<n)r=a+1;else if(i>n)t=a-1;else return a}return r>0?r-1:0}function sxe(e,t,n,r,a){const i=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:i};if(r===1&&a!==null){const u=oxe(a,i,n);let d=u;const p=n+t;for(;d<i&&a[d*2]+a[d*2+1]<p;)d++;return{startIndex:u,endIndex:d}}let s=tv(0,i,u=>e[u].start,n),l=s;if(r===1)for(;l<i&&e[l].end<n+t;)l++;else if(r>1){const u=Array(r).fill(0);for(;l<i&&u.some(p=>p<n+t);){const p=e[l];u[p.lane]=p.end,l++}const d=Array(r).fill(n+t);for(;s>=0&&d.some(p=>p>=n);){const p=e[s];d[p.lane]=p.start,s--}s=Math.max(0,s-s%r),l=Math.min(i,l+(r-1-l%r))}return{startIndex:s,endIndex:l}}const cs=typeof document<"u"?te.useLayoutEffect:te.useEffect;function lxe({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){const a=te.useReducer(d=>d+1,0)[1],i=te.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;const o=d=>{const p=i.current;if(!p.enabled||!p.container)return;const h=d.getTotalSize();if(h!==p.lastSize){p.lastSize=h;const m=d.options.horizontal?"width":"height";p.container.style[m]=`${h}px`}},s=d=>{const p=i.current;if(!p.enabled||!p.container)return;o(d);const h=!!d.options.horizontal,m=p.mode==="transform",f=h?"left":"top",g=d.options.scrollMargin,_=d.getVirtualItems();for(const k of _){const b=k.start-g,x=d.elementsCache.get(k.key);x&&p.lastPositions.get(x)!==b&&(p.lastPositions.set(x,b),m?x.style.transform=h?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:x.style[f]=`${b}px`)}},l={...r,onChange:(d,p)=>{var h;const m=i.current;let f=!0;if(m.enabled){s(d);const g=d.range,_=m.prevRange;f=!_||_.isScrolling!==d.isScrolling||_.startIndex!==g?.startIndex||_.endIndex!==g?.endIndex,f&&(m.prevRange=g?{startIndex:g.startIndex,endIndex:g.endIndex,isScrolling:d.isScrolling}:null)}f&&(e&&p?d5.flushSync(a):a()),(h=r.onChange)==null||h.call(r,d,p)}},[u]=te.useState(()=>{const d=new ixe(l);return Object.assign(d,{containerRef:p=>{const h=i.current;if(h.container=p,h.lastSize=null,p&&h.enabled){const m=d.getTotalSize();h.lastSize=m;const f=d.options.horizontal?"width":"height";p.style[f]=`${m}px`}}})});return u.setOptions(l),cs(()=>u._didMount(),[]),cs(()=>(o(u),u._willUpdate())),cs(()=>{s(u)}),u}function cxe(e){return lxe({observeElementRect:Q_e,observeElementOffset:txe,scrollToFn:axe,...e})}const nv=j.memo(()=>{const e=fe(n=>n.activeChatId??n.draftChatKey),t=fe(n=>De(n,e).composerError);return t?w.jsx("div",{className:"mp-agent-composer-error",children:t}):null});nv.displayName="ComposerError";const uxe=(e,t)=>{switch(e.status){case exports.AgentToolCallStatus.Running:return`Running ${t}...`;case exports.AgentToolCallStatus.Succeeded:return`Completed ${t}`;case exports.AgentToolCallStatus.Failed:return`Failed to run ${t}`;case exports.AgentToolCallStatus.Pending:return`Preparing ${t}...`;default:return`Running ${t}...`}},us=e=>{if(e===void 0)return"undefined";try{return JSON.stringify(e,null,2)??"undefined"}catch{try{return String(e)}catch{return"[unserializable]"}}},I2=({call:e})=>$e().config.debug?w.jsxs("details",{className:"mp-agent-tool-debug-details",children:[w.jsx("summary",{className:"mp-agent-tool-debug-summary",children:"Details"}),w.jsxs("div",{className:"mp-agent-tool-debug-body",children:[w.jsxs("div",{className:"mp-agent-tool-debug-row",children:[w.jsx("div",{className:"mp-agent-tool-debug-label",children:"Tool"}),w.jsx("div",{className:"mp-agent-tool-debug-value",children:e.name})]}),w.jsxs("div",{className:"mp-agent-tool-debug-row",children:[w.jsx("div",{className:"mp-agent-tool-debug-label",children:"Status"}),w.jsx("div",{className:"mp-agent-tool-debug-value",children:e.status})]}),w.jsxs("details",{className:"mp-agent-tool-debug-section",children:[w.jsx("summary",{className:"mp-agent-tool-debug-section-summary",children:"Input"}),w.jsx("pre",{className:"mp-agent-tool-debug-code",children:w.jsx("code",{children:us(e.input)})})]}),w.jsxs("details",{className:"mp-agent-tool-debug-section",children:[w.jsx("summary",{className:"mp-agent-tool-debug-section-summary",children:"Output"}),w.jsx("pre",{className:"mp-agent-tool-debug-code",children:w.jsx("code",{children:us(e.output)})})]}),e.error&&w.jsxs("details",{className:"mp-agent-tool-debug-section",children:[w.jsx("summary",{className:"mp-agent-tool-debug-section-summary",children:"Error"}),w.jsx("pre",{className:"mp-agent-tool-debug-code",children:w.jsx("code",{children:us(e.error)})})]})]})]}):null,rv=j.memo(({call:e})=>{const t=$e(),n=e.status===exports.AgentToolCallStatus.Succeeded||e.status===exports.AgentToolCallStatus.Failed;if(!t.config.debug||n)return null;const a=t.tools.get(e.name)?.label??e.name;return w.jsx("div",{className:"mp-agent-tool-header",children:w.jsx("div",{className:"mp-agent-tool-simple-message",children:uxe(e,a)})})});rv.displayName="ToolCallHeader";function dxe(e){try{const t=JSON.parse(e);return{question:typeof t.question=="string"?t.question:void 0,selectedOptions:Array.isArray(t.selectedOptions)?t.selectedOptions:void 0,freeText:typeof t.freeText=="string"?t.freeText:void 0}}catch{return e}}const av=({call:e})=>{if(e.approved===void 0)return null;const t=e.userResponse?dxe(e.userResponse):null,n=()=>{if(!t)return null;if(typeof t=="string")return w.jsx("span",{className:"mp-agent-tool-approval-response",children:t});const r=t.freeText??t.selectedOptions?.map(a=>a.label).join(", ");return!t.question&&!r?null:w.jsxs("div",{className:"mp-agent-tool-approval-result",children:[t.question&&w.jsx("span",{className:"mp-agent-tool-approval-question",children:t.question}),r&&w.jsx("span",{className:"mp-agent-tool-approval-response",children:r})]})};return w.jsxs("div",{className:"mp-agent-tool-approval-status-inline",children:[e.approved&&n(),e.approved?w.jsx("div",{className:"mp-agent-tool-approved",children:w.jsx("span",{children:"✓ Approved"})}):w.jsx("span",{className:"mp-agent-tool-denied",children:"✗ Denied"})]})},pxe=e=>{if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e.question,n=e.selectionMode,r=e.options,a=e.allowFreeText;if(typeof t!="string"||t.trim().length<1||n!=="single"&&n!=="multiple"||!Array.isArray(r)||r.length<2||r.length>6)return null;const i=r.map(o=>{if(!o||typeof o!="object"||Array.isArray(o))return null;const s=o.id,l=o.label,u=o.description;return typeof s!="string"||s.trim().length<1||typeof l!="string"||l.trim().length<1||u!==void 0&&typeof u!="string"?null:{id:s,label:l,...typeof u=="string"?{description:u}:{}}}).filter(o=>o!==null);return i.length!==r.length?null:{question:t,selectionMode:n,options:i,allowFreeText:typeof a=="boolean"?a:!1}},hxe=({callId:e,input:t,isSubmitting:n,onSubmit:r})=>{const[a,i]=j.useState([]),[o,s]=j.useState(""),[l,u]=j.useState(void 0),d=j.useMemo(()=>pxe(t),[t]);j.useEffect(()=>{i([]),s(""),u(void 0)},[e,t]);const p=m=>{if(d){if(u(void 0),d.selectionMode==="single"){i([m]);return}i(f=>f.includes(m)?f.filter(g=>g!==m):[...f,m])}},h=async()=>{if(!d)return;const m=o.trim(),f=a.length>0,g=d.allowFreeText&&m.length>0;if(!f&&!g){u(d.allowFreeText?"Select at least one option or provide a custom response.":"Select at least one option before submitting.");return}const _=d.options.filter(b=>a.includes(b.id)).map(({id:b,label:x,description:M})=>({id:b,label:x,...M?{description:M}:{}})),k={question:d.question,selectionMode:d.selectionMode,selectedOptionIds:a,selectedOptions:_,...m?{freeText:m}:{}};await r(JSON.stringify(k))};return d?w.jsxs("div",{className:"mp-agent-tool-user-action-form",children:[w.jsx("div",{className:"mp-agent-tool-user-action-question",children:d.question}),w.jsx("div",{className:"mp-agent-tool-user-action-options",children:d.options.map(m=>{const f=`${e}-${m.id}`,g=a.includes(m.id);return w.jsxs("label",{htmlFor:f,className:"mp-agent-tool-user-action-option",children:[w.jsx("input",{id:f,type:d.selectionMode==="single"?"radio":"checkbox",name:`mp-agent-tool-user-action-${e}`,checked:g,onChange:()=>p(m.id),disabled:n}),w.jsxs("span",{className:"mp-agent-tool-user-action-option-content",children:[w.jsx("span",{className:"mp-agent-tool-user-action-option-label",children:m.label}),m.description?w.jsx("span",{className:"mp-agent-tool-user-action-option-description",children:m.description}):null]})]},m.id)})}),d.allowFreeText?w.jsx("textarea",{className:"mp-agent-tool-user-action-free-text",value:o,onChange:m=>{s(m.target.value),l&&u(void 0)},placeholder:"Optional custom response",rows:3,disabled:n}):null,l?w.jsx("div",{className:"mp-agent-tool-input-error",children:l}):null,w.jsx("div",{className:"mp-agent-tool-approval-actions",children:w.jsx("button",{className:"mp-agent-tool-approve-button",onClick:h,disabled:n,children:n?"Submitting...":"Submit response"})})]}):w.jsx("div",{className:"mp-agent-tool-user-action-form",children:w.jsx("div",{className:"mp-agent-tool-input-error",children:"Invalid user action input schema in tool call."})})},mxe=({call:e,messageId:t,chatId:n,onApprovalSent:r})=>{const a=$e(),i=a.tools.get(e.name)?.label??e.name,o=fe(q=>q.appendMessagesToChat),s=fe(q=>q.setChatMessages),l=fe(q=>q.setChatStatus),u=fe(q=>q.setPendingAssistant),[d,p]=j.useState(!1),[h,m]=j.useState(!1),[f,g]=j.useState(!1),[_,k]=j.useState(JSON.stringify(e.input??{},null,2)),[b,x]=j.useState(void 0),M=a.config.user?.id??"guest",N=e.requiresUserAction;j.useEffect(()=>{h||(k(JSON.stringify(e.input??{},null,2)),x(void 0))},[e.id,e.input,h]);const E=()=>{k(JSON.stringify(e.input??{},null,2)),x(void 0),m(!0)},D=()=>{k(JSON.stringify(e.input??{},null,2)),x(void 0),m(!1)},P=async()=>{if(!(!a.transport.updateToolCall||f||d)){x(void 0),g(!0);try{const q=JSON.parse(_);if(!q||typeof q!="object"||Array.isArray(q))throw new Error("Tool input must be a JSON object.");const Z=await a.transport.updateToolCall({chatId:n,messageId:t,toolCallId:e.id,input:q});o(n,[Z]),m(!1)}catch(q){x(q instanceof Error?q.message:"Failed to update tool input.")}finally{g(!1)}}},C=q=>{s(n,Z=>Z.map(X=>X.id===t?{...X,toolCalls:(X.toolCalls??[]).map(K=>K.id===e.id?{...K,...q}:K)}:X))},I=async(q,Z)=>{if(!(!e.approvalId||d||f||h)){p(!0),C({approved:q,...Z?{userResponse:Z}:{}}),l(n,ct.Streaming),u(n,{id:`pending-approval-${e.id}`,chat:n,role:exports.MessageRole.Assistant,content:"",reasoning:"",toolCalls:[],attachments:[],createdAt:new Date().toISOString()});try{const X={chatId:n,messageId:t,approvalId:e.approvalId,approved:q,...Z?{userResponse:Z}:{},userId:M},K=await a.transport.streamMessage(X,R=>{R.type===exports.StreamChunkType.Message&&R.message&&(R.message.id!==t&&u(n,void 0),o(n,[R.message]))},{streamKey:n});K&&o(K.id,K.messages),await r()}catch(X){console.error("Failed to send approval:",X),C({approved:void 0,userResponse:void 0}),l(n,ct.Idle)}finally{u(n,void 0),p(!1)}}};return e.approved!==void 0?w.jsx(av,{call:e}):N?w.jsx(hxe,{callId:e.id,input:e.input,isSubmitting:d,onSubmit:q=>I(!0,q)}):w.jsxs("div",{className:"mp-agent-tool-approval-buttons",children:[w.jsxs("div",{className:"mp-agent-tool-approval-request-message",children:["Agent wants to execute tool ",i,"."]}),w.jsxs("div",{className:"mp-agent-tool-input-card",children:[w.jsxs("div",{className:"mp-agent-tool-input-card-header",children:[w.jsx("span",{className:"mp-agent-tool-input-card-title",children:"Tool input"}),h?w.jsxs("div",{className:"mp-agent-tool-input-actions",children:[w.jsx(un,{icon:"Check",size:"sm",tooltip:"Save tool input",onClick:P,disabled:f||d,"aria-label":"Save tool input"}),w.jsx(un,{icon:"X",size:"sm",tooltip:"Cancel input edit",onClick:D,disabled:f||d,"aria-label":"Cancel tool input edit"})]}):w.jsx(un,{icon:"Pencil",size:"sm",tooltip:"Edit tool input",onClick:E,disabled:d||f,"aria-label":"Edit tool input"})]}),h?w.jsx("textarea",{className:"mp-agent-tool-input-editor",value:_,onChange:q=>{k(q.target.value),b&&x(void 0)},rows:8,spellCheck:!1,disabled:f||d}):w.jsx("pre",{className:"mp-agent-tool-input-preview",children:JSON.stringify(e.input??{},null,2)}),b&&w.jsx("div",{className:"mp-agent-tool-input-error",children:b})]}),w.jsxs("div",{className:"mp-agent-tool-approval-actions",children:[w.jsx("button",{className:"mp-agent-tool-approve-button",onClick:()=>I(!0),disabled:d||h||f,children:d?"Processing...":"Approve"}),w.jsx("button",{className:"mp-agent-tool-deny-button",onClick:()=>I(!1),disabled:d||f,children:d?"Processing...":"Deny"})]})]})},O2=({call:e,messageId:t,chatId:n})=>{const r=$e(),a=fe(p=>p.upsertChat),i=fe(p=>p.setChatStatus),o=r.config.debug&&!!e.approvalId,s=e.requiresConfirmation&&e.approvalId||o,l=s&&e.approved===void 0,u=s&&e.approved!==void 0,d=async()=>{try{const p=await r.transport.getChat(n);a(p),i(n,ka(p.status))}catch(p){console.error("Failed to refresh chat after approval:",p),i(n,ct.Idle)}};return!l&&!u?null:w.jsxs("div",{className:"mp-agent-tool-approval",children:[l&&w.jsx(mxe,{call:e,messageId:t,chatId:n,onApprovalSent:d}),u&&w.jsx(av,{call:e})]})},iv=j.memo(({chatId:e,isExpanded:t})=>{const n=$e(),r=fe(d=>De(d,e).messages),a=fe(d=>De(d,e).pendingAssistant),i=fe(d=>d.chats[e]?.contextKey??d.contextKey),[o,s]=j.useState(t);t&&!o&&s(!0);const l=mp(e,{requireRegisteredChat:!1,enabled:o}),u=j.useMemo(()=>{const d=[...r].sort((h,m)=>h.createdAt.localeCompare(m.createdAt));if(n.config.debug)return d;const p=d.findIndex(h=>h.role===exports.MessageRole.User);return p===-1?d:d.filter((h,m)=>m!==p)},[r,n.config.debug]);return t?w.jsx("div",{className:"mp-agent-subagent-preview",children:w.jsx("div",{className:"mp-agent-subagent-preview-body",children:u.length===0&&!a?w.jsx("div",{className:"mp-agent-subagent-preview-empty",children:l.isLoading?"Loading subagent chat...":"Subagent chat started."}):w.jsxs(w.Fragment,{children:[u.map(d=>w.jsx(eo,{message:d,contextKey:i,showParticipantChrome:!0},d.id)),a&&w.jsx(eo,{message:a,contextKey:i,isStreaming:!0,showParticipantChrome:!0})]})})}):null});iv.displayName="SubagentChatPreview";const fxe=e=>{switch(e){case exports.AgentToolCallStatus.Succeeded:return{key:"succeeded",label:"Done",icon:w.jsx(Gd,{size:12})};case exports.AgentToolCallStatus.Failed:return{key:"failed",label:"Failed",icon:w.jsx(L5,{size:12})};case exports.AgentToolCallStatus.Pending:return{key:"running",label:"Preparing",icon:w.jsx(ma,{size:12,className:"mp-agent-subagent-spinner"})};default:return{key:"running",label:"Running",icon:w.jsx(ma,{size:12,className:"mp-agent-subagent-spinner"})}}},ov=j.memo(({call:e,subagentChatId:t})=>{const[n,r]=j.useState(()=>e.status===exports.AgentToolCallStatus.Running||e.status===exports.AgentToolCallStatus.Pending),a=fe(o=>{const{messages:s,pendingAssistant:l}=De(o,t),u=s.find(d=>d.agentName||d.sender?.type==="agent")??l;return u?.agentName||u?.sender?.displayName||void 0}),i=fxe(e.status);return w.jsxs("div",{className:"mp-agent-subagent",children:[w.jsxs("button",{className:"mp-agent-subagent-row",type:"button",onClick:()=>r(o=>!o),"aria-expanded":n,children:[w.jsx("span",{className:"mp-agent-subagent-row-icon",children:w.jsx(v5,{size:14})}),w.jsx("span",{className:"mp-agent-subagent-row-title",children:a?w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"mp-agent-subagent-row-label",children:"Subagent:"})," ",a]}):"Subagent"}),w.jsxs("span",{className:`mp-agent-subagent-row-status is-${i.key}`,children:[i.icon,i.label]}),w.jsx("span",{className:"mp-agent-subagent-row-chevron",children:n?w.jsx(Wd,{size:14}):w.jsx(no,{size:14})})]}),w.jsx(iv,{chatId:t,isExpanded:n})]})});ov.displayName="SubagentToolCall";const xp=j.memo(({call:e,contextKey:t,messageId:n,chatId:r})=>{const a=$e(),i=e.subagentChatId||(typeof e.input?.subagentChatId=="string"?e.input.subagentChatId:void 0),o=j.useMemo(()=>a.getToolRenderer(e),[a,e.name]),s=i?w.jsx(ov,{call:e,subagentChatId:i}):null;if(!o){const l=!!(e.requiresConfirmation&&e.approvalId);return!!i||a.config.debug||l?w.jsxs("div",{className:"mp-agent-tool-panel",children:[w.jsx(rv,{call:e}),w.jsx(O2,{call:e,messageId:n,chatId:r}),w.jsx(I2,{call:e}),s]}):null}return w.jsxs("div",{className:"mp-agent-tool-panel",children:[w.jsx(o,{call:e,contextKey:t,chatId:r}),w.jsx(O2,{call:e,messageId:n,chatId:r}),w.jsx(I2,{call:e}),s]})});xp.displayName="ToolCallCard";const gxe=e=>{const t=e.sender?.displayName||e.sender?.id||e.agentName;if(!t)return e.role===exports.MessageRole.User?"You":"AI";const n=t.split(/\s+/).filter(Boolean);return n.length>=2?`${n[0][0]}${n[1][0]}`.toUpperCase():t.slice(0,2).toUpperCase()},wp=j.memo(({message:e})=>{const t=e.role===exports.MessageRole.User;return w.jsx("div",{className:`mp-agent-message-avatar ${t?"mp-agent-message-avatar-user":""}`,children:e.sender?.avatarUrl?w.jsx("img",{className:"mp-agent-message-avatar-image",src:e.sender.avatarUrl,alt:""}):w.jsx("div",{className:"mp-agent-message-avatar-icon",children:gxe(e)})})});wp.displayName="MessageAvatar";const yxe=e=>e?new Date(e).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}):"",bxe=e=>e.sender?.displayName?e.sender.displayName:e.sender?.id&&e.sender.id!=="guest"?e.sender.id:e.agentName?e.agentName:e.role===exports.MessageRole.User?"You":"Assistant",Ep=j.memo(({message:e})=>{const t=bxe(e);return w.jsxs("div",{className:"mp-agent-message-header",children:[w.jsx("span",{className:"mp-agent-message-role",children:t}),w.jsx("span",{className:"mp-agent-message-time",children:yxe(e.createdAt)})]})});Ep.displayName="MessageHeader";function L2(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const o=n.slice(a,r).trim();(o||!i)&&t.push(o),a=r+1,r=n.indexOf(",",a)}return t}function kxe(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vxe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_xe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xxe={};function D2(e,t){return(xxe.jsx?_xe:vxe).test(e)}const wxe=/[ \t\n\f\r]/g;function Exe(e){return typeof e=="object"?e.type==="text"?z2(e.value):!1:z2(e)}function z2(e){return e.replace(wxe,"")===""}let La=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};La.prototype.normal={};La.prototype.property={};La.prototype.space=void 0;function sv(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new La(n,r,t)}function va(e){return e.toLowerCase()}let Ft=class{constructor(t,n){this.attribute=n,this.property=t}};Ft.prototype.attribute="";Ft.prototype.booleanish=!1;Ft.prototype.boolean=!1;Ft.prototype.commaOrSpaceSeparated=!1;Ft.prototype.commaSeparated=!1;Ft.prototype.defined=!1;Ft.prototype.mustUseProperty=!1;Ft.prototype.number=!1;Ft.prototype.overloadedBoolean=!1;Ft.prototype.property="";Ft.prototype.spaceSeparated=!1;Ft.prototype.space=void 0;let Mxe=0;const Te=kr(),lt=kr(),yd=kr(),le=kr(),Ze=kr(),fr=kr(),Ut=kr();function kr(){return 2**++Mxe}const bd=Object.freeze(Object.defineProperty({__proto__:null,boolean:Te,booleanish:lt,commaOrSpaceSeparated:Ut,commaSeparated:fr,number:le,overloadedBoolean:yd,spaceSeparated:Ze},Symbol.toStringTag,{value:"Module"})),ds=Object.keys(bd);let Mp=class extends Ft{constructor(t,n,r,a){let i=-1;if(super(t,n),$2(this,"space",a),typeof r=="number")for(;++i<ds.length;){const o=ds[i];$2(this,ds[i],(r&bd[o])===bd[o])}}};Mp.prototype.defined=!0;function $2(e,t,n){n&&(e[t]=n)}function Gr(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const i=new Mp(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[va(r)]=r,n[va(i.attribute)]=r}return new La(t,n,e.space)}const lv=Gr({properties:{ariaActiveDescendant:null,ariaAtomic:lt,ariaAutoComplete:null,ariaBusy:lt,ariaChecked:lt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:Ze,ariaCurrent:null,ariaDescribedBy:Ze,ariaDetails:null,ariaDisabled:lt,ariaDropEffect:Ze,ariaErrorMessage:null,ariaExpanded:lt,ariaFlowTo:Ze,ariaGrabbed:lt,ariaHasPopup:null,ariaHidden:lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ze,ariaLevel:le,ariaLive:null,ariaModal:lt,ariaMultiLine:lt,ariaMultiSelectable:lt,ariaOrientation:null,ariaOwns:Ze,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:lt,ariaReadOnly:lt,ariaRelevant:null,ariaRequired:lt,ariaRoleDescription:Ze,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:lt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function cv(e,t){return t in e?e[t]:t}function uv(e,t){return cv(e,t.toLowerCase())}const Sxe=Gr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fr,acceptCharset:Ze,accessKey:Ze,action:null,allow:null,allowFullScreen:Te,allowPaymentRequest:Te,allowUserMedia:Te,alpha:Te,alt:null,as:null,async:Te,autoCapitalize:null,autoComplete:Ze,autoFocus:Te,autoPlay:Te,blocking:Ze,capture:null,charSet:null,checked:Te,cite:null,className:Ze,closedBy:null,colorSpace:null,cols:le,colSpan:le,command:null,commandFor:null,content:null,contentEditable:lt,controls:Te,controlsList:Ze,coords:le|fr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Te,defer:Te,dir:null,dirName:null,disabled:Te,download:yd,draggable:lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Te,formTarget:null,headers:Ze,height:le,hidden:yd,high:le,href:null,hrefLang:null,htmlFor:Ze,httpEquiv:Ze,id:null,imageSizes:null,imageSrcSet:null,inert:Te,inputMode:null,integrity:null,is:null,isMap:Te,itemId:null,itemProp:Ze,itemRef:Ze,itemScope:Te,itemType:Ze,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Te,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:Te,muted:Te,name:null,nonce:null,noModule:Te,noValidate:Te,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Te,optimum:le,pattern:null,ping:Ze,placeholder:null,playsInline:Te,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Te,referrerPolicy:null,rel:Ze,required:Te,reversed:Te,rows:le,rowSpan:le,sandbox:Ze,scope:null,scoped:Te,seamless:Te,selected:Te,shadowRootClonable:Te,shadowRootCustomElementRegistry:Te,shadowRootDelegatesFocus:Te,shadowRootMode:null,shadowRootSerializable:Te,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:lt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:Te,useMap:null,value:lt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ze,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Te,declare:Te,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:Te,noHref:Te,noShade:Te,noWrap:Te,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:lt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Te,disablePictureInPicture:Te,disableRemotePlayback:Te,exportParts:fr,part:Ze,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:uv}),Nxe=Gr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ut,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:Ze,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:Te,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fr,g2:fr,glyphName:fr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:Ut,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:le,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ze,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ut,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ut,rev:Ut,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ut,requiredFeatures:Ut,requiredFonts:Ut,requiredFormats:Ut,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:Ut,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ut,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ut,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:cv}),dv=Gr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),pv=Gr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uv}),hv=Gr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Axe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Txe=/[A-Z]/g,F2=/-[a-z]/g,Cxe=/^data[-\w.:]+$/i;function mv(e,t){const n=va(t);let r=t,a=Ft;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Cxe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(F2,Ixe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!F2.test(i)){let o=i.replace(Txe,Rxe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=Mp}return new a(r,t)}function Rxe(e){return"-"+e.toLowerCase()}function Ixe(e){return e.charAt(1).toUpperCase()}const fv=sv([lv,Sxe,dv,pv,hv],"html"),vo=sv([lv,Nxe,dv,pv,hv],"svg");function P2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Oxe(e){return e.join(" ").trim()}var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sp={},q2=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Lxe=/\n/g,Dxe=/^\s*/,zxe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,$xe=/^:\s*/,Fxe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Pxe=/^[;\s]*/,qxe=/^\s+|\s+$/g,Bxe=`
|
|
8297
8297
|
`,B2="/",U2="*",hr="",Uxe="comment",Hxe="declaration";function jxe(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function a(f){var g=f.match(Lxe);g&&(n+=g.length);var _=f.lastIndexOf(Bxe);r=~_?f.length-_:r+f.length}function i(){var f={line:n,column:r};return function(g){return g.position=new o(f),u(),g}}function o(f){this.start=f,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(f){var g=new Error(t.source+":"+n+":"+r+": "+f);if(g.reason=f,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function l(f){var g=f.exec(e);if(g){var _=g[0];return a(_),e=e.slice(_.length),g}}function u(){l(Dxe)}function d(f){var g;for(f=f||[];g=p();)g!==!1&&f.push(g);return f}function p(){var f=i();if(!(B2!=e.charAt(0)||U2!=e.charAt(1))){for(var g=2;hr!=e.charAt(g)&&(U2!=e.charAt(g)||B2!=e.charAt(g+1));)++g;if(g+=2,hr===e.charAt(g-1))return s("End of comment missing");var _=e.slice(2,g-2);return r+=2,a(_),e=e.slice(g),r+=2,f({type:Uxe,comment:_})}}function h(){var f=i(),g=l(zxe);if(g){if(p(),!l($xe))return s("property missing ':'");var _=l(Fxe),k=f({type:Hxe,property:H2(g[0].replace(q2,hr)),value:_?H2(_[0].replace(q2,hr)):hr});return l(Pxe),k}}function m(){var f=[];d(f);for(var g;g=h();)g!==!1&&(f.push(g),d(f));return f}return u(),m()}function H2(e){return e?e.replace(qxe,hr):hr}var Vxe=jxe,Gxe=Jn&&Jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sp,"__esModule",{value:!0});Sp.default=Kxe;const Wxe=Gxe(Vxe);function Kxe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Wxe.default)(e),a=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:s}=i;a?t(o,s,i):s&&(n=n||{},n[o]=s)}),n}var xo={};Object.defineProperty(xo,"__esModule",{value:!0});xo.camelCase=void 0;var Yxe=/^--[a-zA-Z0-9_-]+$/,Zxe=/-([a-z])/g,Xxe=/^[^-]+$/,Qxe=/^-(webkit|moz|ms|o|khtml)-/,Jxe=/^-(ms)-/,ewe=function(e){return!e||Xxe.test(e)||Yxe.test(e)},twe=function(e,t){return t.toUpperCase()},j2=function(e,t){return"".concat(t,"-")},nwe=function(e,t){return t===void 0&&(t={}),ewe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Jxe,j2):e=e.replace(Qxe,j2),e.replace(Zxe,twe))};xo.camelCase=nwe;var rwe=Jn&&Jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},awe=rwe(Sp),iwe=xo;function kd(e,t){var n={};return!e||typeof e!="string"||(0,awe.default)(e,function(r,a){r&&a&&(n[(0,iwe.camelCase)(r,t)]=a)}),n}kd.default=kd;var owe=kd;const swe=_o(owe),gv=yv("end"),Np=yv("start");function yv(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lwe(e){const t=Np(e),n=gv(e);if(t&&n)return{start:t,end:n}}function ua(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?V2(e.position):"start"in e||"end"in e?V2(e):"line"in e||"column"in e?vd(e):""}function vd(e){return G2(e&&e.line)+":"+G2(e&&e.column)}function V2(e){return vd(e&&e.start)+"-"+vd(e&&e.end)}function G2(e){return e&&typeof e=="number"?e:1}class wt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(o=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=s?s.line:void 0,this.name=ua(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wt.prototype.file="";wt.prototype.name="";wt.prototype.reason="";wt.prototype.message="";wt.prototype.stack="";wt.prototype.column=void 0;wt.prototype.line=void 0;wt.prototype.ancestors=void 0;wt.prototype.cause=void 0;wt.prototype.fatal=void 0;wt.prototype.place=void 0;wt.prototype.ruleId=void 0;wt.prototype.source=void 0;const Ap={}.hasOwnProperty,cwe=new Map,uwe=/[A-Z]/g,dwe=new Set(["table","tbody","thead","tfoot","tr"]),pwe=new Set(["td","th"]),bv="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hwe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=_we(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=vwe(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?vo:fv,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=kv(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function kv(e,t,n){if(t.type==="element")return mwe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fwe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ywe(e,t,n);if(t.type==="mdxjsEsm")return gwe(e,t);if(t.type==="root")return bwe(e,t,n);if(t.type==="text")return kwe(e,t)}function mwe(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=vo,e.schema=a),e.ancestors.push(t);const i=_v(e,t.tagName,!1),o=xwe(e,t);let s=Cp(e,t);return dwe.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!Exe(l):!0})),vv(e,o,i,t),Tp(o,s),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function fwe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}_a(e,t.position)}function gwe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_a(e,t.position)}function ywe(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=vo,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:_v(e,t.name,!0),o=wwe(e,t),s=Cp(e,t);return vv(e,o,i,t),Tp(o,s),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function bwe(e,t,n){const r={};return Tp(r,Cp(e,t)),e.create(t,e.Fragment,r,n)}function kwe(e,t){return t.value}function vv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Tp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function vwe(e,t,n){return r;function r(a,i,o,s){const u=Array.isArray(o.children)?n:t;return s?u(i,o,s):u(i,o)}}function _we(e,t){return n;function n(r,a,i,o){const s=Array.isArray(i.children),l=Np(r);return t(a,i,o,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function xwe(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Ap.call(t.properties,a)){const i=Ewe(e,a,t.properties[a]);if(i){const[o,s]=i;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&pwe.has(t.tagName)?r=s:n[o]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function wwe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else _a(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else _a(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function Cp(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:cwe;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const u=a.get(l)||0;o=l+"-"+u,a.set(l,u+1)}}const s=kv(e,i,o);s!==void 0&&n.push(s)}return n}function Ewe(e,t,n){const r=mv(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kxe(n):Oxe(n)),r.property==="style"){let a=typeof n=="object"?n:Mwe(e,String(n));return e.stylePropertyNameCase==="css"&&(a=Swe(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?Axe[r.property]||r.property:r.attribute,n]}}function Mwe(e,t){try{return swe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new wt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=bv+"#cannot-parse-style-attribute",a}}function _v(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,o;for(;++i<a.length;){const s=D2(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}r=o}else r=D2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return Ap.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);_a(e)}function _a(e,t){const n=new wt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=bv+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Swe(e){const t={};let n;for(n in e)Ap.call(e,n)&&(t[Nwe(n)]=e[n]);return t}function Nwe(e){let t=e.replace(uwe,Awe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Awe(e){return"-"+e.toLowerCase()}const ps={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Twe={};function Rp(e,t){const n=Twe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return xv(e,r,a)}function xv(e,t,n){if(Cwe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return W2(e.children,t,n)}return Array.isArray(e)?W2(e,t,n):""}function W2(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=xv(e[a],t,n);return r.join("")}function Cwe(e){return!!(e&&typeof e=="object")}const K2=document.createElement("i");function xa(e){const t="&"+e+";";K2.innerHTML=t;const n=K2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gt(e,t,n,r){const a=e.length;let i=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Jt(e,t){return e.length>0?(Gt(e,e.length,0,t),e):t}const Y2={}.hasOwnProperty;function wv(e){const t={};let n=-1;for(;++n<e.length;)Rwe(t,e[n]);return t}function Rwe(e,t){let n;for(n in t){const a=(Y2.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){Y2.call(a,o)||(a[o]=[]);const s=i[o];Iwe(a[o],Array.isArray(s)?s:s?[s]:[])}}}function Iwe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gt(e,0,0,r)}function Ev(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const At=ar(/[A-Za-z]/),_t=ar(/[\dA-Za-z]/),Owe=ar(/[#-'*+\--9=?A-Z^-~]/);function qi(e){return e!==null&&(e<32||e===127)}const _d=ar(/\d/),Lwe=ar(/[\dA-Fa-f]/),Dwe=ar(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function He(e){return e!==null&&(e<0||e===32)}function ze(e){return e===-2||e===-1||e===32}const er=ar(/\p{P}|\p{S}/u),hn=ar(/\s/);function ar(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wr(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&_t(e.charCodeAt(n+1))&&_t(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(o=String.fromCharCode(i,s),a=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Ae(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return ze(l)?(e.enter(n),s(l)):t(l)}function s(l){return ze(l)&&i++<a?(e.consume(l),s):(e.exit(n),t(l))}}const zwe={tokenize:$we};function $we(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ae(e,t,"linePrefix")}function a(s){return e.enter("paragraph"),i(s)}function i(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return he(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),o)}}const Fwe={tokenize:Pwe},Z2={tokenize:qwe};function Pwe(e){const t=this,n=[];let r=0,a,i,o;return s;function s(x){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,l,u)(x)}return u(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&b();const M=t.events.length;let N=M,E;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){E=t.events[N][1].end;break}k(r);let D=M;for(;D<t.events.length;)t.events[D][1].end={...E},D++;return Gt(t.events,N+1,0,t.events.slice(M)),t.events.length=D,u(x)}return s(x)}function u(x){if(r===n.length){if(!a)return h(x);if(a.currentConstruct&&a.currentConstruct.concrete)return f(x);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Z2,d,p)(x)}function d(x){return a&&b(),k(r),h(x)}function p(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,f(x)}function h(x){return t.containerState={},e.attempt(Z2,m,f)(x)}function m(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function f(x){if(x===null){a&&b(),k(0),e.consume(x);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),g(x)}function g(x){if(x===null){_(e.exit("chunkFlow"),!0),k(0),e.consume(x);return}return he(x)?(e.consume(x),_(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(x),g)}function _(x,M){const N=t.sliceStream(x);if(M&&N.push(null),x.previous=i,i&&(i.next=x),i=x,a.defineSkip(x.start),a.write(N),t.parser.lazy[x.start.line]){let E=a.events.length;for(;E--;)if(a.events[E][1].start.offset<o&&(!a.events[E][1].end||a.events[E][1].end.offset>o))return;const D=t.events.length;let P=D,C,I;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(C){I=t.events[P][1].end;break}C=!0}for(k(r),E=D;E<t.events.length;)t.events[E][1].end={...I},E++;Gt(t.events,P+1,0,t.events.slice(D)),t.events.length=E}}function k(x){let M=n.length;for(;M-- >x;){const N=n[M];t.containerState=N[1],N[0].exit.call(t,e)}n.length=x}function b(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function qwe(e,t,n){return Ae(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qr(e){if(e===null||He(e)||hn(e))return 1;if(er(e))return 2}function wo(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const xd={name:"attention",resolveAll:Bwe,tokenize:Uwe};function Bwe(e,t){let n=-1,r,a,i,o,s,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},h={...e[n][1].start};X2(p,-l),X2(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:l>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Jt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Jt(u,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",i,t]]),u=Jt(u,wo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Jt(u,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Jt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Gt(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Uwe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=qr(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;const u=e.exit("attentionSequence"),d=qr(l),p=!d||d===2&&a||n.includes(l),h=!a||a===2&&d||n.includes(r);return u._open=!!(i===42?p:p&&(a||!h)),u._close=!!(i===42?h:h&&(d||!p)),t(l)}}function X2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Hwe={name:"autolink",tokenize:jwe};function jwe(e,t,n){let r=0;return a;function a(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return At(m)?(e.consume(m),o):m===64?n(m):u(m)}function o(m){return m===43||m===45||m===46||_t(m)?(r=1,s(m)):u(m)}function s(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||_t(m))&&r++<32?(e.consume(m),s):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||qi(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),d):Owe(m)?(e.consume(m),u):n(m)}function d(m){return _t(m)?p(m):n(m)}function p(m){return m===46?(e.consume(m),r=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||_t(m))&&r++<63){const f=m===45?h:p;return e.consume(m),f}return n(m)}}const Da={partial:!0,tokenize:Vwe};function Vwe(e,t,n){return r;function r(i){return ze(i)?Ae(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||he(i)?t(i):n(i)}}const Mv={continuation:{tokenize:Wwe},exit:Kwe,name:"blockQuote",tokenize:Gwe};function Gwe(e,t,n){const r=this;return a;function a(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function Wwe(e,t,n){const r=this;return a;function a(o){return ze(o)?Ae(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(Mv,t,n)(o)}}function Kwe(e){e.exit("blockQuote")}const Sv={name:"characterEscape",tokenize:Ywe};function Ywe(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return Dwe(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Nv={name:"characterReference",tokenize:Zwe};function Zwe(e,t,n){const r=this;let a=0,i,o;return s;function s(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),l}function l(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,o=_t,d(p))}function u(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=Lwe,d):(e.enter("characterReferenceValue"),i=7,o=_d,d(p))}function d(p){if(p===59&&a){const h=e.exit("characterReferenceValue");return o===_t&&!xa(r.sliceSerialize(h))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&a++<i?(e.consume(p),d):n(p)}}const Q2={partial:!0,tokenize:Qwe},J2={concrete:!0,name:"codeFenced",tokenize:Xwe};function Xwe(e,t,n){const r=this,a={partial:!0,tokenize:N};let i=0,o=0,s;return l;function l(E){return u(E)}function u(E){const D=r.events[r.events.length-1];return i=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===s?(o++,e.consume(E),d):o<3?n(E):(e.exit("codeFencedFenceSequence"),ze(E)?Ae(e,p,"whitespace")(E):p(E))}function p(E){return E===null||he(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Q2,g,M)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||he(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(E)):ze(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ae(e,m,"whitespace")(E)):E===96&&E===s?n(E):(e.consume(E),h)}function m(E){return E===null||he(E)?p(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(E))}function f(E){return E===null||he(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(E)):E===96&&E===s?n(E):(e.consume(E),f)}function g(E){return e.attempt(a,M,_)(E)}function _(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return i>0&&ze(E)?Ae(e,b,"linePrefix",i+1)(E):b(E)}function b(E){return E===null||he(E)?e.check(Q2,g,M)(E):(e.enter("codeFlowValue"),x(E))}function x(E){return E===null||he(E)?(e.exit("codeFlowValue"),b(E)):(e.consume(E),x)}function M(E){return e.exit("codeFenced"),t(E)}function N(E,D,P){let C=0;return I;function I(R){return E.enter("lineEnding"),E.consume(R),E.exit("lineEnding"),q}function q(R){return E.enter("codeFencedFence"),ze(R)?Ae(E,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):Z(R)}function Z(R){return R===s?(E.enter("codeFencedFenceSequence"),X(R)):P(R)}function X(R){return R===s?(C++,E.consume(R),X):C>=o?(E.exit("codeFencedFenceSequence"),ze(R)?Ae(E,K,"whitespace")(R):K(R)):P(R)}function K(R){return R===null||he(R)?(E.exit("codeFencedFence"),D(R)):P(R)}}}function Qwe(e,t,n){const r=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const hs={name:"codeIndented",tokenize:e9e},Jwe={partial:!0,tokenize:t9e};function e9e(e,t,n){const r=this;return a;function a(u){return e.enter("codeIndented"),Ae(e,i,"linePrefix",5)(u)}function i(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):he(u)?e.attempt(Jwe,o,l)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||he(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),s)}function l(u){return e.exit("codeIndented"),t(u)}}function t9e(e,t,n){const r=this;return a;function a(o){return r.parser.lazy[r.now().line]?n(o):he(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):Ae(e,i,"linePrefix",5)(o)}function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):he(o)?a(o):n(o)}}const n9e={name:"codeText",previous:a9e,resolve:r9e,tokenize:i9e};function r9e(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function a9e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function i9e(e,t,n){let r=0,a,i;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),s(p)}function s(p){return p===96?(e.consume(p),r++,s):(e.exit("codeTextSequence"),l(p))}function l(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),l):p===96?(i=e.enter("codeTextSequence"),a=0,d(p)):he(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||he(p)?(e.exit("codeTextData"),l(p)):(e.consume(p),u)}function d(p){return p===96?(e.consume(p),a++,d):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",u(p))}}class o9e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Jr(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Jr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Jr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Jr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Jr(this.left,n.reverse())}}}function Jr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Av(e){const t={};let n=-1,r,a,i,o,s,l,u;const d=new o9e(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,s9e(d,n)),n=t[n],u=!0);else if(r[1]._container){for(i=n,a=void 0;i--;)if(o=d.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(r[1].end={...d.get(a)[1].start},s=d.slice(a,n),s.unshift(r),d.splice(a,n-a+1,s))}}return Gt(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function s9e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const s=o.events,l=[],u={};let d,p,h=-1,m=n,f=0,g=0;const _=[g];for(;m;){for(;e.get(++a)[1]!==m;);i.push(a),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),p&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=m,m=m.next}for(m=n;++h<s.length;)s[h][0]==="exit"&&s[h-1][0]==="enter"&&s[h][1].type===s[h-1][1].type&&s[h][1].start.line!==s[h][1].end.line&&(g=h+1,_.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):_.pop(),h=_.length;h--;){const k=s.slice(_[h],_[h+1]),b=i.pop();l.push([b,b+k.length-1]),e.splice(b,2,k)}for(l.reverse(),h=-1;++h<l.length;)u[f+l[h][0]]=f+l[h][1],f+=l[h][1]-l[h][0]-1;return u}const l9e={resolve:u9e,tokenize:d9e},c9e={partial:!0,tokenize:p9e};function u9e(e){return Av(e),e}function d9e(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(s)}function a(s){return s===null?i(s):he(s)?e.check(c9e,o,i)(s):(e.consume(s),a)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function p9e(e,t,n){const r=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ae(e,i,"linePrefix")}function i(o){if(o===null||he(o))return n(o);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Tv(e,t,n,r,a,i,o,s,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return p;function p(k){return k===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(k),e.exit(i),h):k===null||k===32||k===41||qi(k)?n(k):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),g(k))}function h(k){return k===62?(e.enter(i),e.consume(k),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(k))}function m(k){return k===62?(e.exit("chunkString"),e.exit(s),h(k)):k===null||k===60||he(k)?n(k):(e.consume(k),k===92?f:m)}function f(k){return k===60||k===62||k===92?(e.consume(k),m):m(k)}function g(k){return!d&&(k===null||k===41||He(k))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(k)):d<u&&k===40?(e.consume(k),d++,g):k===41?(e.consume(k),d--,g):k===null||k===32||k===40||qi(k)?n(k):(e.consume(k),k===92?_:g)}function _(k){return k===40||k===41||k===92?(e.consume(k),g):g(k)}}function Cv(e,t,n,r,a,i){const o=this;let s=0,l;return u;function u(m){return e.enter(r),e.enter(a),e.consume(m),e.exit(a),e.enter(i),d}function d(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(i),e.enter(a),e.consume(m),e.exit(a),e.exit(r),t):he(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===null||m===91||m===93||he(m)||s++>999?(e.exit("chunkString"),d(m)):(e.consume(m),l||(l=!ze(m)),m===92?h:p)}function h(m){return m===91||m===92||m===93?(e.consume(m),s++,p):p(m)}}function Rv(e,t,n,r,a,i){let o;return s;function s(h){return h===34||h===39||h===40?(e.enter(r),e.enter(a),e.consume(h),e.exit(a),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):(e.enter(i),u(h))}function u(h){return h===o?(e.exit(i),l(o)):h===null?n(h):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ae(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===o||h===null||he(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?p:d)}function p(h){return h===o||h===92?(e.consume(h),d):d(h)}}function Cn(e,t){let n;return r;function r(a){return he(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):ze(a)?Ae(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const h9e={name:"definition",tokenize:f9e},m9e={partial:!0,tokenize:g9e};function f9e(e,t,n){const r=this;let a;return i;function i(m){return e.enter("definition"),o(m)}function o(m){return Cv.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return a=dn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return He(m)?Cn(e,u)(m):u(m)}function u(m){return Tv(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(m9e,p,p)(m)}function p(m){return ze(m)?Ae(e,h,"whitespace")(m):h(m)}function h(m){return m===null||he(m)?(e.exit("definition"),r.parser.defined.push(a),t(m)):n(m)}}function g9e(e,t,n){return r;function r(s){return He(s)?Cn(e,a)(s):n(s)}function a(s){return Rv(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return ze(s)?Ae(e,o,"whitespace")(s):o(s)}function o(s){return s===null||he(s)?t(s):n(s)}}const y9e={name:"hardBreakEscape",tokenize:b9e};function b9e(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return he(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const k9e={name:"headingAtx",resolve:v9e,tokenize:_9e};function v9e(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gt(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function _9e(e,t,n){let r=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||He(d)?(e.exit("atxHeadingSequence"),s(d)):n(d)}function s(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||he(d)?(e.exit("atxHeading"),t(d)):ze(d)?Ae(e,s,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),s(d))}function u(d){return d===null||d===35||He(d)?(e.exit("atxHeadingText"),s(d)):(e.consume(d),u)}}const x9e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],em=["pre","script","style","textarea"],w9e={concrete:!0,name:"htmlFlow",resolveTo:S9e,tokenize:N9e},E9e={partial:!0,tokenize:T9e},M9e={partial:!0,tokenize:A9e};function S9e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function N9e(e,t,n){const r=this;let a,i,o,s,l;return u;function u(L){return d(L)}function d(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),p}function p(L){return L===33?(e.consume(L),h):L===47?(e.consume(L),i=!0,g):L===63?(e.consume(L),a=3,r.interrupt?t:A):At(L)?(e.consume(L),o=String.fromCharCode(L),_):n(L)}function h(L){return L===45?(e.consume(L),a=2,m):L===91?(e.consume(L),a=5,s=0,f):At(L)?(e.consume(L),a=4,r.interrupt?t:A):n(L)}function m(L){return L===45?(e.consume(L),r.interrupt?t:A):n(L)}function f(L){const se="CDATA[";return L===se.charCodeAt(s++)?(e.consume(L),s===se.length?r.interrupt?t:Z:f):n(L)}function g(L){return At(L)?(e.consume(L),o=String.fromCharCode(L),_):n(L)}function _(L){if(L===null||L===47||L===62||He(L)){const se=L===47,ye=o.toLowerCase();return!se&&!i&&em.includes(ye)?(a=1,r.interrupt?t(L):Z(L)):x9e.includes(o.toLowerCase())?(a=6,se?(e.consume(L),k):r.interrupt?t(L):Z(L)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):i?b(L):x(L))}return L===45||_t(L)?(e.consume(L),o+=String.fromCharCode(L),_):n(L)}function k(L){return L===62?(e.consume(L),r.interrupt?t:Z):n(L)}function b(L){return ze(L)?(e.consume(L),b):I(L)}function x(L){return L===47?(e.consume(L),I):L===58||L===95||At(L)?(e.consume(L),M):ze(L)?(e.consume(L),x):I(L)}function M(L){return L===45||L===46||L===58||L===95||_t(L)?(e.consume(L),M):N(L)}function N(L){return L===61?(e.consume(L),E):ze(L)?(e.consume(L),N):x(L)}function E(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),l=L,D):ze(L)?(e.consume(L),E):P(L)}function D(L){return L===l?(e.consume(L),l=null,C):L===null||he(L)?n(L):(e.consume(L),D)}function P(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||He(L)?N(L):(e.consume(L),P)}function C(L){return L===47||L===62||ze(L)?x(L):n(L)}function I(L){return L===62?(e.consume(L),q):n(L)}function q(L){return L===null||he(L)?Z(L):ze(L)?(e.consume(L),q):n(L)}function Z(L){return L===45&&a===2?(e.consume(L),H):L===60&&a===1?(e.consume(L),G):L===62&&a===4?(e.consume(L),Y):L===63&&a===3?(e.consume(L),A):L===93&&a===5?(e.consume(L),V):he(L)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(E9e,ee,X)(L)):L===null||he(L)?(e.exit("htmlFlowData"),X(L)):(e.consume(L),Z)}function X(L){return e.check(M9e,K,ee)(L)}function K(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),R}function R(L){return L===null||he(L)?X(L):(e.enter("htmlFlowData"),Z(L))}function H(L){return L===45?(e.consume(L),A):Z(L)}function G(L){return L===47?(e.consume(L),o="",z):Z(L)}function z(L){if(L===62){const se=o.toLowerCase();return em.includes(se)?(e.consume(L),Y):Z(L)}return At(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),z):Z(L)}function V(L){return L===93?(e.consume(L),A):Z(L)}function A(L){return L===62?(e.consume(L),Y):L===45&&a===2?(e.consume(L),A):Z(L)}function Y(L){return L===null||he(L)?(e.exit("htmlFlowData"),ee(L)):(e.consume(L),Y)}function ee(L){return e.exit("htmlFlow"),t(L)}}function A9e(e,t,n){const r=this;return a;function a(o){return he(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function T9e(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Da,t,n)}}const C9e={name:"htmlText",tokenize:R9e};function R9e(e,t,n){const r=this;let a,i,o;return s;function s(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),l}function l(A){return A===33?(e.consume(A),u):A===47?(e.consume(A),N):A===63?(e.consume(A),x):At(A)?(e.consume(A),P):n(A)}function u(A){return A===45?(e.consume(A),d):A===91?(e.consume(A),i=0,f):At(A)?(e.consume(A),b):n(A)}function d(A){return A===45?(e.consume(A),m):n(A)}function p(A){return A===null?n(A):A===45?(e.consume(A),h):he(A)?(o=p,G(A)):(e.consume(A),p)}function h(A){return A===45?(e.consume(A),m):p(A)}function m(A){return A===62?H(A):A===45?h(A):p(A)}function f(A){const Y="CDATA[";return A===Y.charCodeAt(i++)?(e.consume(A),i===Y.length?g:f):n(A)}function g(A){return A===null?n(A):A===93?(e.consume(A),_):he(A)?(o=g,G(A)):(e.consume(A),g)}function _(A){return A===93?(e.consume(A),k):g(A)}function k(A){return A===62?H(A):A===93?(e.consume(A),k):g(A)}function b(A){return A===null||A===62?H(A):he(A)?(o=b,G(A)):(e.consume(A),b)}function x(A){return A===null?n(A):A===63?(e.consume(A),M):he(A)?(o=x,G(A)):(e.consume(A),x)}function M(A){return A===62?H(A):x(A)}function N(A){return At(A)?(e.consume(A),E):n(A)}function E(A){return A===45||_t(A)?(e.consume(A),E):D(A)}function D(A){return he(A)?(o=D,G(A)):ze(A)?(e.consume(A),D):H(A)}function P(A){return A===45||_t(A)?(e.consume(A),P):A===47||A===62||He(A)?C(A):n(A)}function C(A){return A===47?(e.consume(A),H):A===58||A===95||At(A)?(e.consume(A),I):he(A)?(o=C,G(A)):ze(A)?(e.consume(A),C):H(A)}function I(A){return A===45||A===46||A===58||A===95||_t(A)?(e.consume(A),I):q(A)}function q(A){return A===61?(e.consume(A),Z):he(A)?(o=q,G(A)):ze(A)?(e.consume(A),q):C(A)}function Z(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),a=A,X):he(A)?(o=Z,G(A)):ze(A)?(e.consume(A),Z):(e.consume(A),K)}function X(A){return A===a?(e.consume(A),a=void 0,R):A===null?n(A):he(A)?(o=X,G(A)):(e.consume(A),X)}function K(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||He(A)?C(A):(e.consume(A),K)}function R(A){return A===47||A===62||He(A)?C(A):n(A)}function H(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),z}function z(A){return ze(A)?Ae(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):V(A)}function V(A){return e.enter("htmlTextData"),o(A)}}const Ip={name:"labelEnd",resolveAll:D9e,resolveTo:z9e,tokenize:$9e},I9e={tokenize:F9e},O9e={tokenize:P9e},L9e={tokenize:q9e};function D9e(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&Gt(e,0,e.length,n),e}function z9e(e,t){let n=e.length,r=0,a,i,o,s;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(o=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[o-2][1].start}};return s=[["enter",l,t],["enter",u,t]],s=Jt(s,e.slice(i+1,i+r+3)),s=Jt(s,[["enter",d,t]]),s=Jt(s,wo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),s=Jt(s,[["exit",d,t],e[o-2],e[o-1],["exit",u,t]]),s=Jt(s,e.slice(o+1)),s=Jt(s,[["exit",l,t]]),Gt(e,i,e.length,s),e}function $9e(e,t,n){const r=this;let a=r.events.length,i,o;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return s;function s(h){return i?i._inactive?p(h):(o=r.parser.defined.includes(dn(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(I9e,d,o?d:p)(h):h===91?e.attempt(O9e,d,o?u:p)(h):o?d(h):p(h)}function u(h){return e.attempt(L9e,d,p)(h)}function d(h){return t(h)}function p(h){return i._balanced=!0,n(h)}}function F9e(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return He(p)?Cn(e,i)(p):i(p)}function i(p){return p===41?d(p):Tv(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return He(p)?Cn(e,l)(p):d(p)}function s(p){return n(p)}function l(p){return p===34||p===39||p===40?Rv(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function u(p){return He(p)?Cn(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function P9e(e,t,n){const r=this;return a;function a(s){return Cv.call(r,e,i,o,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes(dn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function q9e(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const B9e={name:"labelStartImage",resolveAll:Ip.resolveAll,tokenize:U9e};function U9e(e,t,n){const r=this;return a;function a(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const H9e={name:"labelStartLink",resolveAll:Ip.resolveAll,tokenize:j9e};function j9e(e,t,n){const r=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const ms={name:"lineEnding",tokenize:V9e};function V9e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ae(e,t,"linePrefix")}}const Mi={name:"thematicBreak",tokenize:G9e};function G9e(e,t,n){let r=0,a;return i;function i(u){return e.enter("thematicBreak"),o(u)}function o(u){return a=u,s(u)}function s(u){return u===a?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||he(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===a?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ze(u)?Ae(e,s,"whitespace")(u):s(u))}}const Dt={continuation:{tokenize:Z9e},exit:Q9e,name:"list",tokenize:Y9e},W9e={partial:!0,tokenize:J9e},K9e={partial:!0,tokenize:X9e};function Y9e(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return s;function s(m){const f=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(f==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:_d(m)){if(r.containerState.type||(r.containerState.type=f,e.enter(f,{_container:!0})),f==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Mi,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return _d(m)&&++o<10?(e.consume(m),l):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Da,r.interrupt?n:d,e.attempt(W9e,h,p))}function d(m){return r.containerState.initialBlankLine=!0,i++,h(m)}function p(m){return ze(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Z9e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Da,a,i);function a(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ae(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!ze(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(K9e,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ae(e,e.attempt(Dt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function X9e(e,t,n){const r=this;return Ae(e,a,"listItemIndent",r.containerState.size+1);function a(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function Q9e(e){e.exit(this.containerState.type)}function J9e(e,t,n){const r=this;return Ae(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const o=r.events[r.events.length-1];return!ze(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const tm={name:"setextUnderline",resolveTo:eEe,tokenize:tEe};function eEe(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end={...e[i][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function tEe(e,t,n){const r=this;let a;return i;function i(u){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===a?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),ze(u)?Ae(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||he(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const nEe={tokenize:rEe};function rEe(e){const t=this,n=e.attempt(Da,r,e.attempt(this.parser.constructs.flowInitial,a,Ae(e,e.attempt(this.parser.constructs.flow,a,e.attempt(l9e,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const aEe={resolveAll:Ov()},iEe=Iv("string"),oEe=Iv("text");function Iv(e){return{resolveAll:Ov(e==="text"?sEe:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,o,s);return o;function o(d){return u(d)?i(d):s(d)}function s(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const p=a[d];let h=-1;if(p)for(;++h<p.length;){const m=p[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Ov(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function sEe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,o=-1,s=0,l;for(;i--;){const u=a[i];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(u===-2)l=!0,s++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:r.start._bufferIndex+o,_index:r.start._index+i,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const lEe={42:Dt,43:Dt,45:Dt,48:Dt,49:Dt,50:Dt,51:Dt,52:Dt,53:Dt,54:Dt,55:Dt,56:Dt,57:Dt,62:Mv},cEe={91:h9e},uEe={[-2]:hs,[-1]:hs,32:hs},dEe={35:k9e,42:Mi,45:[tm,Mi],60:w9e,61:tm,95:Mi,96:J2,126:J2},pEe={38:Nv,92:Sv},hEe={[-5]:ms,[-4]:ms,[-3]:ms,33:B9e,38:Nv,42:xd,60:[Hwe,C9e],91:H9e,92:[y9e,Sv],93:Ip,95:xd,96:n9e},mEe={null:[xd,aEe]},fEe={null:[42,95]},gEe={null:[]},yEe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fEe,contentInitial:cEe,disable:gEe,document:lEe,flow:dEe,flowInitial:uEe,insideSpan:mEe,string:pEe,text:hEe},Symbol.toStringTag,{value:"Module"}));function bEe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},i=[];let o=[],s=[];const l={attempt:D(N),check:D(E),consume:b,enter:x,exit:M,interrupt:D(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:g,events:[],now:f,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:p};let d=t.tokenize.call(u,l);return t.resolveAll&&i.push(t),u;function p(q){return o=Jt(o,q),_(),o[o.length-1]!==null?[]:(P(t,0),u.events=wo(i,u.events,u),u.events)}function h(q,Z){return vEe(m(q),Z)}function m(q){return kEe(o,q)}function f(){const{_bufferIndex:q,_index:Z,line:X,column:K,offset:R}=r;return{_bufferIndex:q,_index:Z,line:X,column:K,offset:R}}function g(q){a[q.line]=q.column,I()}function _(){let q;for(;r._index<o.length;){const Z=o[r._index];if(typeof Z=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<Z.length;)k(Z.charCodeAt(r._bufferIndex));else k(Z)}}function k(q){d=d(q)}function b(q){he(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,I()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=q}function x(q,Z){const X=Z||{};return X.type=q,X.start=f(),u.events.push(["enter",X,u]),s.push(X),X}function M(q){const Z=s.pop();return Z.end=f(),u.events.push(["exit",Z,u]),Z}function N(q,Z){P(q,Z.from)}function E(q,Z){Z.restore()}function D(q,Z){return X;function X(K,R,H){let G,z,V,A;return Array.isArray(K)?ee(K):"tokenize"in K?ee([K]):Y(K);function Y(ke){return Ie;function Ie(Pe){const Ke=Pe!==null&&ke[Pe],Ge=Pe!==null&&ke.null,nt=[...Array.isArray(Ke)?Ke:Ke?[Ke]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return ee(nt)(Pe)}}function ee(ke){return G=ke,z=0,ke.length===0?H:L(ke[z])}function L(ke){return Ie;function Ie(Pe){return A=C(),V=ke,ke.partial||(u.currentConstruct=ke),ke.name&&u.parser.constructs.disable.null.includes(ke.name)?ye():ke.tokenize.call(Z?Object.assign(Object.create(u),Z):u,l,se,ye)(Pe)}}function se(ke){return q(V,A),R}function ye(ke){return A.restore(),++z<G.length?L(G[z]):H}}}function P(q,Z){q.resolveAll&&!i.includes(q)&&i.push(q),q.resolve&&Gt(u.events,Z,u.events.length-Z,q.resolve(u.events.slice(Z),u)),q.resolveTo&&(u.events=q.resolveTo(u.events,u))}function C(){const q=f(),Z=u.previous,X=u.currentConstruct,K=u.events.length,R=Array.from(s);return{from:K,restore:H};function H(){r=q,u.previous=Z,u.currentConstruct=X,u.events.length=K,s=R,I()}}function I(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function kEe(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(r,i)];else{if(o=e.slice(n,a),r>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}i>0&&o.push(e[a].slice(0,i))}return o}function vEe(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
|
|
8298
8298
|
`;break}case-3:{o=`\r
|
|
8299
8299
|
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(i)}a=i===-2,r.push(o)}return r.join("")}function _Ee(e){const r={constructs:wv([yEe,...(e||{}).extensions||[]]),content:a(zwe),defined:[],document:a(Fwe),flow:a(nEe),lazy:{},string:a(iEe),text:a(oEe)};return r;function a(i){return o;function o(s){return bEe(r,i,s)}}}function xEe(e){for(;!Av(e););return e}const nm=/[\0\t\n\r]/g;function wEe(){let e=1,t="",n=!0,r;return a;function a(i,o,s){const l=[];let u,d,p,h,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(nm.lastIndex=p,u=nm.exec(i),h=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(h),!u){t=i.slice(p);break}if(m===10&&p===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),p<h&&(l.push(i.slice(p,h)),e+=h-p),m){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}p=h+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const EEe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MEe(e){return e.replace(EEe,SEe)}function SEe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return Ev(n.slice(i?2:1),i?16:10)}return xa(n)||e}const Lv={}.hasOwnProperty;function NEe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),AEe(n)(xEe(_Ee(n).document().write(wEe()(e,t,!0))))}function AEe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Le),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(xe),blockQuote:i(Ge),characterEscape:C,characterReference:C,codeFenced:i(nt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(nt,o),codeText:i(mt,o),codeTextData:C,data:C,codeFlowValue:C,definition:i(Ye),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(ie),hardBreakEscape:i(we),hardBreakTrailing:i(we),htmlFlow:i(Ve,o),htmlFlowData:C,htmlText:i(Ve,o),htmlTextData:C,image:i(ue),label:o,link:i(Le),listItem:i(Ce),listItemValue:h,listOrdered:i(Be,p),listUnordered:i(Be),paragraph:i(ve),reference:L,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(xe),strong:i(pe),thematicBreak:i(Re)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:Ke,autolinkProtocol:Pe,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:ke,characterReference:Ie,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:f,codeFlowValue:I,codeIndented:l(k),codeText:l(R),codeTextData:I,data:I,definition:l(),definitionDestinationString:M,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(Z),hardBreakTrailing:l(Z),htmlFlow:l(X),htmlFlowData:I,htmlText:l(K),htmlTextData:I,image:l(G),label:V,labelText:z,lineEnding:q,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:se,resourceDestinationString:A,resourceTitleString:Y,resource:ee,setextHeading:l(P),setextHeadingLineSequence:D,setextHeadingText:E,strong:l(),thematicBreak:l()}};Dv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(B){let Q={type:"root",children:[]};const oe={stack:[Q],tokenStack:[],config:t,enter:s,exit:u,buffer:o,resume:d,data:n},re=[];let _e=-1;for(;++_e<B.length;)if(B[_e][1].type==="listOrdered"||B[_e][1].type==="listUnordered")if(B[_e][0]==="enter")re.push(_e);else{const qe=re.pop();_e=a(B,qe,_e)}for(_e=-1;++_e<B.length;){const qe=t[B[_e][0]];Lv.call(qe,B[_e][1].type)&&qe[B[_e][1].type].call(Object.assign({sliceSerialize:B[_e][2].sliceSerialize},oe),B[_e][1])}if(oe.tokenStack.length>0){const qe=oe.tokenStack[oe.tokenStack.length-1];(qe[1]||rm).call(oe,void 0,qe[0])}for(Q.position={start:Un(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Un(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},_e=-1;++_e<t.transforms.length;)Q=t.transforms[_e](Q)||Q;return Q}function a(B,Q,oe){let re=Q-1,_e=-1,qe=!1,it,bt,qn,Bn;for(;++re<=oe;){const ft=B[re];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?_e++:_e--,Bn=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(it&&!Bn&&!_e&&!qn&&(qn=re),Bn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bn=void 0}if(!_e&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||_e===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(it){let Et=re;for(bt=void 0;Et--;){const It=B[Et];if(It[1].type==="lineEnding"||It[1].type==="lineEndingBlank"){if(It[0]==="exit")continue;bt&&(B[bt][1].type="lineEndingBlank",qe=!0),It[1].type="lineEnding",bt=Et}else if(!(It[1].type==="linePrefix"||It[1].type==="blockQuotePrefix"||It[1].type==="blockQuotePrefixWhitespace"||It[1].type==="blockQuoteMarker"||It[1].type==="listItemIndent"))break}qn&&(!bt||qn<bt)&&(it._spread=!0),it.end=Object.assign({},bt?B[bt][1].start:ft[1].end),B.splice(bt||re,0,["exit",it,ft[2]]),re++,oe++}if(ft[1].type==="listItemPrefix"){const Et={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};it=Et,B.splice(re,0,["enter",Et,ft[2]]),re++,oe++,qn=void 0,Bn=!0}}}return B[Q][1]._spread=qe,oe}function i(B,Q){return oe;function oe(re){s.call(this,B(re),re),Q&&Q.call(this,re)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(B,Q,oe){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([Q,oe||void 0]),B.position={start:Un(Q.start),end:void 0}}function l(B){return Q;function Q(oe){B&&B.call(this,oe),u.call(this,oe)}}function u(B,Q){const oe=this.stack.pop(),re=this.tokenStack.pop();if(re)re[0].type!==B.type&&(Q?Q.call(this,B,re[0]):(re[1]||rm).call(this,B,re[0]));else throw new Error("Cannot close `"+B.type+"` ("+ua({start:B.start,end:B.end})+"): it’s not open");oe.position.end=Un(B.end)}function d(){return Rp(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function h(B){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function m(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=B}function f(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=B}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.value=B.replace(/(\r?\n|\r)$/g,"")}function b(B){const Q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=Q,oe.identifier=dn(this.sliceSerialize(B)).toLowerCase()}function x(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.title=B}function M(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.url=B}function N(B){const Q=this.stack[this.stack.length-1];if(!Q.depth){const oe=this.sliceSerialize(B).length;Q.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function D(B){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function C(B){const oe=this.stack[this.stack.length-1].children;let re=oe[oe.length-1];(!re||re.type!=="text")&&(re=be(),re.position={start:Un(B.start),end:void 0},oe.push(re)),this.stack.push(re)}function I(B){const Q=this.stack.pop();Q.value+=this.sliceSerialize(B),Q.position.end=Un(B.end)}function q(B){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=Q.children[Q.children.length-1];oe.position.end=Un(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(C.call(this,B),I.call(this,B))}function Z(){this.data.atHardBreak=!0}function X(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.value=B}function K(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.value=B}function R(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.value=B}function H(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=Q,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function G(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=Q,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function z(B){const Q=this.sliceSerialize(B),oe=this.stack[this.stack.length-2];oe.label=MEe(Q),oe.identifier=dn(Q).toLowerCase()}function V(){const B=this.stack[this.stack.length-1],Q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const re=B.children;oe.children=re}else oe.alt=Q}function A(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.url=B}function Y(){const B=this.resume(),Q=this.stack[this.stack.length-1];Q.title=B}function ee(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function se(B){const Q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=Q,oe.identifier=dn(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function ye(B){this.data.characterReferenceType=B.type}function ke(B){const Q=this.sliceSerialize(B),oe=this.data.characterReferenceType;let re;oe?(re=Ev(Q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):re=xa(Q);const _e=this.stack[this.stack.length-1];_e.value+=re}function Ie(B){const Q=this.stack.pop();Q.position.end=Un(B.end)}function Pe(B){I.call(this,B);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(B)}function Ke(B){I.call(this,B);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(B)}function Ge(){return{type:"blockquote",children:[]}}function nt(){return{type:"code",lang:null,meta:null,value:""}}function mt(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ie(){return{type:"emphasis",children:[]}}function xe(){return{type:"heading",depth:0,children:[]}}function we(){return{type:"break"}}function Ve(){return{type:"html",value:""}}function ue(){return{type:"image",title:null,url:"",alt:null}}function Le(){return{type:"link",title:null,url:"",children:[]}}function Be(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function Ce(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function ve(){return{type:"paragraph",children:[]}}function pe(){return{type:"strong",children:[]}}function be(){return{type:"text",value:""}}function Re(){return{type:"thematicBreak"}}}function Un(e){return{line:e.line,column:e.column,offset:e.offset}}function Dv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Dv(e,r):TEe(e,r)}}function TEe(e,t){let n;for(n in t)if(Lv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function rm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ua({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ua({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ua({start:t.start,end:t.end})+") is still open")}function CEe(e){const t=this;t.parser=n;function n(r){return NEe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function REe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function IEe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -8579,8 +8579,8 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6
|
|
|
8579
8579
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
8580
8580
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
8581
8581
|
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
8582
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Fa{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return Ee.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){var t=n=>n.toText();return this.children.map(t).join("")}}var bn={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ja={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Im={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function qAe(e,t){bn[e]=t}function Hp(e,t,n){if(!bn[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),a=bn[t][r];if(!a&&e[0]in Im&&(r=Im[e[0]].charCodeAt(0),a=bn[t][r]),!a&&n==="text"&&y6(r)&&(a=bn[t][77]),a)return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}var Ss={};function BAe(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Ss[t]){var n=Ss[t]={cssEmPerMu:Ja.quad[t]/18};for(var r in Ja)Ja.hasOwnProperty(r)&&(n[r]=Ja[r][t])}return Ss[t]}var UAe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Om=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Lm=function(t,n){return n.size<2?t:UAe[t-1][n.size-1]};class Nn{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Nn.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Om[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return new Nn(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Lm(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Om[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Lm(Nn.BASESIZE,t);return this.size===n&&this.textSize===Nn.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nn.BASESIZE?["sizing","reset-size"+this.size,"size"+Nn.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=BAe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nn.BASESIZE=6;var Td={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},HAe={ex:!0,em:!0,mu:!0},b6=function(t){return typeof t!="string"&&(t=t.unit),t in Td||t in HAe||t==="ex"},at=function(t,n){var r;if(t.unit in Td)r=Td[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var a;if(n.style.isTight()?a=n.havingStyle(n.style.text()):a=n,t.unit==="ex")r=a.fontMetrics().xHeight;else if(t.unit==="em")r=a.fontMetrics().quad;else throw new ce("Invalid unit: '"+t.unit+"'");a!==n&&(r*=a.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},de=function(t){return+t.toFixed(4)+"em"},tr=function(t){return t.filter(n=>n).join(" ")},k6=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var a=n.getColor();a&&(this.style.color=a)}},v6=function(t){var n=document.createElement(t);n.className=tr(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var a in this.attributes)this.attributes.hasOwnProperty(a)&&n.setAttribute(a,this.attributes[a]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},_6=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Ee.escape(tr(this.classes))+'"');var r="";for(var a in this.style)this.style.hasOwnProperty(a)&&(r+=Ee.hyphenate(a)+":"+this.style[a]+";");r&&(n+=' style="'+Ee.escape(r)+'"');for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&(n+=" "+i+'="'+Ee.escape(this.attributes[i])+'"');n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class Pa{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,k6.call(this,t,r,a),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return Ee.contains(this.classes,t)}toNode(){return v6.call(this,"span")}toMarkup(){return _6.call(this,"span")}}class jp{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,k6.call(this,n,a),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return Ee.contains(this.classes,t)}toNode(){return v6.call(this,"a")}toMarkup(){return _6.call(this,"a")}}class jAe{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=r}hasClass(t){return Ee.contains(this.classes,t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t='<img src="'+Ee.escape(this.src)+'"'+(' alt="'+Ee.escape(this.alt)+'"'),n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Ee.hyphenate(r)+":"+this.style[r]+";");return n&&(t+=' style="'+Ee.escape(n)+'"'),t+="'/>",t}}var VAe={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class rn{constructor(t,n,r,a,i,o,s,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=a||0,this.skew=i||0,this.width=o||0,this.classes=s||[],this.style=l||{},this.maxFontSize=0;var u=TAe(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=VAe[this.text])}hasClass(t){return Ee.contains(this.classes,t)}toNode(){var t=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=de(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=tr(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Ee.escape(tr(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var a in this.style)this.style.hasOwnProperty(a)&&(r+=Ee.hyphenate(a)+":"+this.style[a]+";");r&&(t=!0,n+=' style="'+Ee.escape(r)+'"');var i=Ee.escape(this.text);return t?(n+=">",n+=i,n+="</span>",n):i}}class Ln{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ee.escape(this.attributes[n])+'"');t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class nr{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Rm[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Ee.escape(this.alternate)+'"/>':'<path d="'+Ee.escape(Rm[this.pathName])+'"/>'}}class Cd{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ee.escape(this.attributes[n])+'"');return t+="/>",t}}function Dm(e){if(e instanceof rn)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function GAe(e){if(e instanceof Pa)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var WAe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},KAe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Qe={math:{},text:{}};function y(e,t,n,r,a,i){Qe[e][a]={font:t,group:n,replace:r},i&&r&&(Qe[e][r]=Qe[e][a])}var v="math",ne="text",S="main",$="ams",tt="accent-token",ge="bin",Rt="close",Kr="inner",Me="mathord",pt="op-token",Kt="open",Ao="punct",F="rel",Pn="spacing",W="textord";y(v,S,F,"≡","\\equiv",!0);y(v,S,F,"≺","\\prec",!0);y(v,S,F,"≻","\\succ",!0);y(v,S,F,"∼","\\sim",!0);y(v,S,F,"⊥","\\perp");y(v,S,F,"⪯","\\preceq",!0);y(v,S,F,"⪰","\\succeq",!0);y(v,S,F,"≃","\\simeq",!0);y(v,S,F,"∣","\\mid",!0);y(v,S,F,"≪","\\ll",!0);y(v,S,F,"≫","\\gg",!0);y(v,S,F,"≍","\\asymp",!0);y(v,S,F,"∥","\\parallel");y(v,S,F,"⋈","\\bowtie",!0);y(v,S,F,"⌣","\\smile",!0);y(v,S,F,"⊑","\\sqsubseteq",!0);y(v,S,F,"⊒","\\sqsupseteq",!0);y(v,S,F,"≐","\\doteq",!0);y(v,S,F,"⌢","\\frown",!0);y(v,S,F,"∋","\\ni",!0);y(v,S,F,"∝","\\propto",!0);y(v,S,F,"⊢","\\vdash",!0);y(v,S,F,"⊣","\\dashv",!0);y(v,S,F,"∋","\\owns");y(v,S,Ao,".","\\ldotp");y(v,S,Ao,"⋅","\\cdotp");y(v,S,W,"#","\\#");y(ne,S,W,"#","\\#");y(v,S,W,"&","\\&");y(ne,S,W,"&","\\&");y(v,S,W,"ℵ","\\aleph",!0);y(v,S,W,"∀","\\forall",!0);y(v,S,W,"ℏ","\\hbar",!0);y(v,S,W,"∃","\\exists",!0);y(v,S,W,"∇","\\nabla",!0);y(v,S,W,"♭","\\flat",!0);y(v,S,W,"ℓ","\\ell",!0);y(v,S,W,"♮","\\natural",!0);y(v,S,W,"♣","\\clubsuit",!0);y(v,S,W,"℘","\\wp",!0);y(v,S,W,"♯","\\sharp",!0);y(v,S,W,"♢","\\diamondsuit",!0);y(v,S,W,"ℜ","\\Re",!0);y(v,S,W,"♡","\\heartsuit",!0);y(v,S,W,"ℑ","\\Im",!0);y(v,S,W,"♠","\\spadesuit",!0);y(v,S,W,"§","\\S",!0);y(ne,S,W,"§","\\S");y(v,S,W,"¶","\\P",!0);y(ne,S,W,"¶","\\P");y(v,S,W,"†","\\dag");y(ne,S,W,"†","\\dag");y(ne,S,W,"†","\\textdagger");y(v,S,W,"‡","\\ddag");y(ne,S,W,"‡","\\ddag");y(ne,S,W,"‡","\\textdaggerdbl");y(v,S,Rt,"⎱","\\rmoustache",!0);y(v,S,Kt,"⎰","\\lmoustache",!0);y(v,S,Rt,"⟯","\\rgroup",!0);y(v,S,Kt,"⟮","\\lgroup",!0);y(v,S,ge,"∓","\\mp",!0);y(v,S,ge,"⊖","\\ominus",!0);y(v,S,ge,"⊎","\\uplus",!0);y(v,S,ge,"⊓","\\sqcap",!0);y(v,S,ge,"∗","\\ast");y(v,S,ge,"⊔","\\sqcup",!0);y(v,S,ge,"◯","\\bigcirc",!0);y(v,S,ge,"∙","\\bullet",!0);y(v,S,ge,"‡","\\ddagger");y(v,S,ge,"≀","\\wr",!0);y(v,S,ge,"⨿","\\amalg");y(v,S,ge,"&","\\And");y(v,S,F,"⟵","\\longleftarrow",!0);y(v,S,F,"⇐","\\Leftarrow",!0);y(v,S,F,"⟸","\\Longleftarrow",!0);y(v,S,F,"⟶","\\longrightarrow",!0);y(v,S,F,"⇒","\\Rightarrow",!0);y(v,S,F,"⟹","\\Longrightarrow",!0);y(v,S,F,"↔","\\leftrightarrow",!0);y(v,S,F,"⟷","\\longleftrightarrow",!0);y(v,S,F,"⇔","\\Leftrightarrow",!0);y(v,S,F,"⟺","\\Longleftrightarrow",!0);y(v,S,F,"↦","\\mapsto",!0);y(v,S,F,"⟼","\\longmapsto",!0);y(v,S,F,"↗","\\nearrow",!0);y(v,S,F,"↩","\\hookleftarrow",!0);y(v,S,F,"↪","\\hookrightarrow",!0);y(v,S,F,"↘","\\searrow",!0);y(v,S,F,"↼","\\leftharpoonup",!0);y(v,S,F,"⇀","\\rightharpoonup",!0);y(v,S,F,"↙","\\swarrow",!0);y(v,S,F,"↽","\\leftharpoondown",!0);y(v,S,F,"⇁","\\rightharpoondown",!0);y(v,S,F,"↖","\\nwarrow",!0);y(v,S,F,"⇌","\\rightleftharpoons",!0);y(v,$,F,"≮","\\nless",!0);y(v,$,F,"","\\@nleqslant");y(v,$,F,"","\\@nleqq");y(v,$,F,"⪇","\\lneq",!0);y(v,$,F,"≨","\\lneqq",!0);y(v,$,F,"","\\@lvertneqq");y(v,$,F,"⋦","\\lnsim",!0);y(v,$,F,"⪉","\\lnapprox",!0);y(v,$,F,"⊀","\\nprec",!0);y(v,$,F,"⋠","\\npreceq",!0);y(v,$,F,"⋨","\\precnsim",!0);y(v,$,F,"⪹","\\precnapprox",!0);y(v,$,F,"≁","\\nsim",!0);y(v,$,F,"","\\@nshortmid");y(v,$,F,"∤","\\nmid",!0);y(v,$,F,"⊬","\\nvdash",!0);y(v,$,F,"⊭","\\nvDash",!0);y(v,$,F,"⋪","\\ntriangleleft");y(v,$,F,"⋬","\\ntrianglelefteq",!0);y(v,$,F,"⊊","\\subsetneq",!0);y(v,$,F,"","\\@varsubsetneq");y(v,$,F,"⫋","\\subsetneqq",!0);y(v,$,F,"","\\@varsubsetneqq");y(v,$,F,"≯","\\ngtr",!0);y(v,$,F,"","\\@ngeqslant");y(v,$,F,"","\\@ngeqq");y(v,$,F,"⪈","\\gneq",!0);y(v,$,F,"≩","\\gneqq",!0);y(v,$,F,"","\\@gvertneqq");y(v,$,F,"⋧","\\gnsim",!0);y(v,$,F,"⪊","\\gnapprox",!0);y(v,$,F,"⊁","\\nsucc",!0);y(v,$,F,"⋡","\\nsucceq",!0);y(v,$,F,"⋩","\\succnsim",!0);y(v,$,F,"⪺","\\succnapprox",!0);y(v,$,F,"≆","\\ncong",!0);y(v,$,F,"","\\@nshortparallel");y(v,$,F,"∦","\\nparallel",!0);y(v,$,F,"⊯","\\nVDash",!0);y(v,$,F,"⋫","\\ntriangleright");y(v,$,F,"⋭","\\ntrianglerighteq",!0);y(v,$,F,"","\\@nsupseteqq");y(v,$,F,"⊋","\\supsetneq",!0);y(v,$,F,"","\\@varsupsetneq");y(v,$,F,"⫌","\\supsetneqq",!0);y(v,$,F,"","\\@varsupsetneqq");y(v,$,F,"⊮","\\nVdash",!0);y(v,$,F,"⪵","\\precneqq",!0);y(v,$,F,"⪶","\\succneqq",!0);y(v,$,F,"","\\@nsubseteqq");y(v,$,ge,"⊴","\\unlhd");y(v,$,ge,"⊵","\\unrhd");y(v,$,F,"↚","\\nleftarrow",!0);y(v,$,F,"↛","\\nrightarrow",!0);y(v,$,F,"⇍","\\nLeftarrow",!0);y(v,$,F,"⇏","\\nRightarrow",!0);y(v,$,F,"↮","\\nleftrightarrow",!0);y(v,$,F,"⇎","\\nLeftrightarrow",!0);y(v,$,F,"△","\\vartriangle");y(v,$,W,"ℏ","\\hslash");y(v,$,W,"▽","\\triangledown");y(v,$,W,"◊","\\lozenge");y(v,$,W,"Ⓢ","\\circledS");y(v,$,W,"®","\\circledR");y(ne,$,W,"®","\\circledR");y(v,$,W,"∡","\\measuredangle",!0);y(v,$,W,"∄","\\nexists");y(v,$,W,"℧","\\mho");y(v,$,W,"Ⅎ","\\Finv",!0);y(v,$,W,"⅁","\\Game",!0);y(v,$,W,"‵","\\backprime");y(v,$,W,"▲","\\blacktriangle");y(v,$,W,"▼","\\blacktriangledown");y(v,$,W,"■","\\blacksquare");y(v,$,W,"⧫","\\blacklozenge");y(v,$,W,"★","\\bigstar");y(v,$,W,"∢","\\sphericalangle",!0);y(v,$,W,"∁","\\complement",!0);y(v,$,W,"ð","\\eth",!0);y(ne,S,W,"ð","ð");y(v,$,W,"╱","\\diagup");y(v,$,W,"╲","\\diagdown");y(v,$,W,"□","\\square");y(v,$,W,"□","\\Box");y(v,$,W,"◊","\\Diamond");y(v,$,W,"¥","\\yen",!0);y(ne,$,W,"¥","\\yen",!0);y(v,$,W,"✓","\\checkmark",!0);y(ne,$,W,"✓","\\checkmark");y(v,$,W,"ℶ","\\beth",!0);y(v,$,W,"ℸ","\\daleth",!0);y(v,$,W,"ℷ","\\gimel",!0);y(v,$,W,"ϝ","\\digamma",!0);y(v,$,W,"ϰ","\\varkappa");y(v,$,Kt,"┌","\\@ulcorner",!0);y(v,$,Rt,"┐","\\@urcorner",!0);y(v,$,Kt,"└","\\@llcorner",!0);y(v,$,Rt,"┘","\\@lrcorner",!0);y(v,$,F,"≦","\\leqq",!0);y(v,$,F,"⩽","\\leqslant",!0);y(v,$,F,"⪕","\\eqslantless",!0);y(v,$,F,"≲","\\lesssim",!0);y(v,$,F,"⪅","\\lessapprox",!0);y(v,$,F,"≊","\\approxeq",!0);y(v,$,ge,"⋖","\\lessdot");y(v,$,F,"⋘","\\lll",!0);y(v,$,F,"≶","\\lessgtr",!0);y(v,$,F,"⋚","\\lesseqgtr",!0);y(v,$,F,"⪋","\\lesseqqgtr",!0);y(v,$,F,"≑","\\doteqdot");y(v,$,F,"≓","\\risingdotseq",!0);y(v,$,F,"≒","\\fallingdotseq",!0);y(v,$,F,"∽","\\backsim",!0);y(v,$,F,"⋍","\\backsimeq",!0);y(v,$,F,"⫅","\\subseteqq",!0);y(v,$,F,"⋐","\\Subset",!0);y(v,$,F,"⊏","\\sqsubset",!0);y(v,$,F,"≼","\\preccurlyeq",!0);y(v,$,F,"⋞","\\curlyeqprec",!0);y(v,$,F,"≾","\\precsim",!0);y(v,$,F,"⪷","\\precapprox",!0);y(v,$,F,"⊲","\\vartriangleleft");y(v,$,F,"⊴","\\trianglelefteq");y(v,$,F,"⊨","\\vDash",!0);y(v,$,F,"⊪","\\Vvdash",!0);y(v,$,F,"⌣","\\smallsmile");y(v,$,F,"⌢","\\smallfrown");y(v,$,F,"≏","\\bumpeq",!0);y(v,$,F,"≎","\\Bumpeq",!0);y(v,$,F,"≧","\\geqq",!0);y(v,$,F,"⩾","\\geqslant",!0);y(v,$,F,"⪖","\\eqslantgtr",!0);y(v,$,F,"≳","\\gtrsim",!0);y(v,$,F,"⪆","\\gtrapprox",!0);y(v,$,ge,"⋗","\\gtrdot");y(v,$,F,"⋙","\\ggg",!0);y(v,$,F,"≷","\\gtrless",!0);y(v,$,F,"⋛","\\gtreqless",!0);y(v,$,F,"⪌","\\gtreqqless",!0);y(v,$,F,"≖","\\eqcirc",!0);y(v,$,F,"≗","\\circeq",!0);y(v,$,F,"≜","\\triangleq",!0);y(v,$,F,"∼","\\thicksim");y(v,$,F,"≈","\\thickapprox");y(v,$,F,"⫆","\\supseteqq",!0);y(v,$,F,"⋑","\\Supset",!0);y(v,$,F,"⊐","\\sqsupset",!0);y(v,$,F,"≽","\\succcurlyeq",!0);y(v,$,F,"⋟","\\curlyeqsucc",!0);y(v,$,F,"≿","\\succsim",!0);y(v,$,F,"⪸","\\succapprox",!0);y(v,$,F,"⊳","\\vartriangleright");y(v,$,F,"⊵","\\trianglerighteq");y(v,$,F,"⊩","\\Vdash",!0);y(v,$,F,"∣","\\shortmid");y(v,$,F,"∥","\\shortparallel");y(v,$,F,"≬","\\between",!0);y(v,$,F,"⋔","\\pitchfork",!0);y(v,$,F,"∝","\\varpropto");y(v,$,F,"◀","\\blacktriangleleft");y(v,$,F,"∴","\\therefore",!0);y(v,$,F,"∍","\\backepsilon");y(v,$,F,"▶","\\blacktriangleright");y(v,$,F,"∵","\\because",!0);y(v,$,F,"⋘","\\llless");y(v,$,F,"⋙","\\gggtr");y(v,$,ge,"⊲","\\lhd");y(v,$,ge,"⊳","\\rhd");y(v,$,F,"≂","\\eqsim",!0);y(v,S,F,"⋈","\\Join");y(v,$,F,"≑","\\Doteq",!0);y(v,$,ge,"∔","\\dotplus",!0);y(v,$,ge,"∖","\\smallsetminus");y(v,$,ge,"⋒","\\Cap",!0);y(v,$,ge,"⋓","\\Cup",!0);y(v,$,ge,"⩞","\\doublebarwedge",!0);y(v,$,ge,"⊟","\\boxminus",!0);y(v,$,ge,"⊞","\\boxplus",!0);y(v,$,ge,"⋇","\\divideontimes",!0);y(v,$,ge,"⋉","\\ltimes",!0);y(v,$,ge,"⋊","\\rtimes",!0);y(v,$,ge,"⋋","\\leftthreetimes",!0);y(v,$,ge,"⋌","\\rightthreetimes",!0);y(v,$,ge,"⋏","\\curlywedge",!0);y(v,$,ge,"⋎","\\curlyvee",!0);y(v,$,ge,"⊝","\\circleddash",!0);y(v,$,ge,"⊛","\\circledast",!0);y(v,$,ge,"⋅","\\centerdot");y(v,$,ge,"⊺","\\intercal",!0);y(v,$,ge,"⋒","\\doublecap");y(v,$,ge,"⋓","\\doublecup");y(v,$,ge,"⊠","\\boxtimes",!0);y(v,$,F,"⇢","\\dashrightarrow",!0);y(v,$,F,"⇠","\\dashleftarrow",!0);y(v,$,F,"⇇","\\leftleftarrows",!0);y(v,$,F,"⇆","\\leftrightarrows",!0);y(v,$,F,"⇚","\\Lleftarrow",!0);y(v,$,F,"↞","\\twoheadleftarrow",!0);y(v,$,F,"↢","\\leftarrowtail",!0);y(v,$,F,"↫","\\looparrowleft",!0);y(v,$,F,"⇋","\\leftrightharpoons",!0);y(v,$,F,"↶","\\curvearrowleft",!0);y(v,$,F,"↺","\\circlearrowleft",!0);y(v,$,F,"↰","\\Lsh",!0);y(v,$,F,"⇈","\\upuparrows",!0);y(v,$,F,"↿","\\upharpoonleft",!0);y(v,$,F,"⇃","\\downharpoonleft",!0);y(v,S,F,"⊶","\\origof",!0);y(v,S,F,"⊷","\\imageof",!0);y(v,$,F,"⊸","\\multimap",!0);y(v,$,F,"↭","\\leftrightsquigarrow",!0);y(v,$,F,"⇉","\\rightrightarrows",!0);y(v,$,F,"⇄","\\rightleftarrows",!0);y(v,$,F,"↠","\\twoheadrightarrow",!0);y(v,$,F,"↣","\\rightarrowtail",!0);y(v,$,F,"↬","\\looparrowright",!0);y(v,$,F,"↷","\\curvearrowright",!0);y(v,$,F,"↻","\\circlearrowright",!0);y(v,$,F,"↱","\\Rsh",!0);y(v,$,F,"⇊","\\downdownarrows",!0);y(v,$,F,"↾","\\upharpoonright",!0);y(v,$,F,"⇂","\\downharpoonright",!0);y(v,$,F,"⇝","\\rightsquigarrow",!0);y(v,$,F,"⇝","\\leadsto");y(v,$,F,"⇛","\\Rrightarrow",!0);y(v,$,F,"↾","\\restriction");y(v,S,W,"‘","`");y(v,S,W,"$","\\$");y(ne,S,W,"$","\\$");y(ne,S,W,"$","\\textdollar");y(v,S,W,"%","\\%");y(ne,S,W,"%","\\%");y(v,S,W,"_","\\_");y(ne,S,W,"_","\\_");y(ne,S,W,"_","\\textunderscore");y(v,S,W,"∠","\\angle",!0);y(v,S,W,"∞","\\infty",!0);y(v,S,W,"′","\\prime");y(v,S,W,"△","\\triangle");y(v,S,W,"Γ","\\Gamma",!0);y(v,S,W,"Δ","\\Delta",!0);y(v,S,W,"Θ","\\Theta",!0);y(v,S,W,"Λ","\\Lambda",!0);y(v,S,W,"Ξ","\\Xi",!0);y(v,S,W,"Π","\\Pi",!0);y(v,S,W,"Σ","\\Sigma",!0);y(v,S,W,"Υ","\\Upsilon",!0);y(v,S,W,"Φ","\\Phi",!0);y(v,S,W,"Ψ","\\Psi",!0);y(v,S,W,"Ω","\\Omega",!0);y(v,S,W,"A","Α");y(v,S,W,"B","Β");y(v,S,W,"E","Ε");y(v,S,W,"Z","Ζ");y(v,S,W,"H","Η");y(v,S,W,"I","Ι");y(v,S,W,"K","Κ");y(v,S,W,"M","Μ");y(v,S,W,"N","Ν");y(v,S,W,"O","Ο");y(v,S,W,"P","Ρ");y(v,S,W,"T","Τ");y(v,S,W,"X","Χ");y(v,S,W,"¬","\\neg",!0);y(v,S,W,"¬","\\lnot");y(v,S,W,"⊤","\\top");y(v,S,W,"⊥","\\bot");y(v,S,W,"∅","\\emptyset");y(v,$,W,"∅","\\varnothing");y(v,S,Me,"α","\\alpha",!0);y(v,S,Me,"β","\\beta",!0);y(v,S,Me,"γ","\\gamma",!0);y(v,S,Me,"δ","\\delta",!0);y(v,S,Me,"ϵ","\\epsilon",!0);y(v,S,Me,"ζ","\\zeta",!0);y(v,S,Me,"η","\\eta",!0);y(v,S,Me,"θ","\\theta",!0);y(v,S,Me,"ι","\\iota",!0);y(v,S,Me,"κ","\\kappa",!0);y(v,S,Me,"λ","\\lambda",!0);y(v,S,Me,"μ","\\mu",!0);y(v,S,Me,"ν","\\nu",!0);y(v,S,Me,"ξ","\\xi",!0);y(v,S,Me,"ο","\\omicron",!0);y(v,S,Me,"π","\\pi",!0);y(v,S,Me,"ρ","\\rho",!0);y(v,S,Me,"σ","\\sigma",!0);y(v,S,Me,"τ","\\tau",!0);y(v,S,Me,"υ","\\upsilon",!0);y(v,S,Me,"ϕ","\\phi",!0);y(v,S,Me,"χ","\\chi",!0);y(v,S,Me,"ψ","\\psi",!0);y(v,S,Me,"ω","\\omega",!0);y(v,S,Me,"ε","\\varepsilon",!0);y(v,S,Me,"ϑ","\\vartheta",!0);y(v,S,Me,"ϖ","\\varpi",!0);y(v,S,Me,"ϱ","\\varrho",!0);y(v,S,Me,"ς","\\varsigma",!0);y(v,S,Me,"φ","\\varphi",!0);y(v,S,ge,"∗","*",!0);y(v,S,ge,"+","+");y(v,S,ge,"−","-",!0);y(v,S,ge,"⋅","\\cdot",!0);y(v,S,ge,"∘","\\circ",!0);y(v,S,ge,"÷","\\div",!0);y(v,S,ge,"±","\\pm",!0);y(v,S,ge,"×","\\times",!0);y(v,S,ge,"∩","\\cap",!0);y(v,S,ge,"∪","\\cup",!0);y(v,S,ge,"∖","\\setminus",!0);y(v,S,ge,"∧","\\land");y(v,S,ge,"∨","\\lor");y(v,S,ge,"∧","\\wedge",!0);y(v,S,ge,"∨","\\vee",!0);y(v,S,W,"√","\\surd");y(v,S,Kt,"⟨","\\langle",!0);y(v,S,Kt,"∣","\\lvert");y(v,S,Kt,"∥","\\lVert");y(v,S,Rt,"?","?");y(v,S,Rt,"!","!");y(v,S,Rt,"⟩","\\rangle",!0);y(v,S,Rt,"∣","\\rvert");y(v,S,Rt,"∥","\\rVert");y(v,S,F,"=","=");y(v,S,F,":",":");y(v,S,F,"≈","\\approx",!0);y(v,S,F,"≅","\\cong",!0);y(v,S,F,"≥","\\ge");y(v,S,F,"≥","\\geq",!0);y(v,S,F,"←","\\gets");y(v,S,F,">","\\gt",!0);y(v,S,F,"∈","\\in",!0);y(v,S,F,"","\\@not");y(v,S,F,"⊂","\\subset",!0);y(v,S,F,"⊃","\\supset",!0);y(v,S,F,"⊆","\\subseteq",!0);y(v,S,F,"⊇","\\supseteq",!0);y(v,$,F,"⊈","\\nsubseteq",!0);y(v,$,F,"⊉","\\nsupseteq",!0);y(v,S,F,"⊨","\\models");y(v,S,F,"←","\\leftarrow",!0);y(v,S,F,"≤","\\le");y(v,S,F,"≤","\\leq",!0);y(v,S,F,"<","\\lt",!0);y(v,S,F,"→","\\rightarrow",!0);y(v,S,F,"→","\\to");y(v,$,F,"≱","\\ngeq",!0);y(v,$,F,"≰","\\nleq",!0);y(v,S,Pn," ","\\ ");y(v,S,Pn," ","\\space");y(v,S,Pn," ","\\nobreakspace");y(ne,S,Pn," ","\\ ");y(ne,S,Pn," "," ");y(ne,S,Pn," ","\\space");y(ne,S,Pn," ","\\nobreakspace");y(v,S,Pn,null,"\\nobreak");y(v,S,Pn,null,"\\allowbreak");y(v,S,Ao,",",",");y(v,S,Ao,";",";");y(v,$,ge,"⊼","\\barwedge",!0);y(v,$,ge,"⊻","\\veebar",!0);y(v,S,ge,"⊙","\\odot",!0);y(v,S,ge,"⊕","\\oplus",!0);y(v,S,ge,"⊗","\\otimes",!0);y(v,S,W,"∂","\\partial",!0);y(v,S,ge,"⊘","\\oslash",!0);y(v,$,ge,"⊚","\\circledcirc",!0);y(v,$,ge,"⊡","\\boxdot",!0);y(v,S,ge,"△","\\bigtriangleup");y(v,S,ge,"▽","\\bigtriangledown");y(v,S,ge,"†","\\dagger");y(v,S,ge,"⋄","\\diamond");y(v,S,ge,"⋆","\\star");y(v,S,ge,"◃","\\triangleleft");y(v,S,ge,"▹","\\triangleright");y(v,S,Kt,"{","\\{");y(ne,S,W,"{","\\{");y(ne,S,W,"{","\\textbraceleft");y(v,S,Rt,"}","\\}");y(ne,S,W,"}","\\}");y(ne,S,W,"}","\\textbraceright");y(v,S,Kt,"{","\\lbrace");y(v,S,Rt,"}","\\rbrace");y(v,S,Kt,"[","\\lbrack",!0);y(ne,S,W,"[","\\lbrack",!0);y(v,S,Rt,"]","\\rbrack",!0);y(ne,S,W,"]","\\rbrack",!0);y(v,S,Kt,"(","\\lparen",!0);y(v,S,Rt,")","\\rparen",!0);y(ne,S,W,"<","\\textless",!0);y(ne,S,W,">","\\textgreater",!0);y(v,S,Kt,"⌊","\\lfloor",!0);y(v,S,Rt,"⌋","\\rfloor",!0);y(v,S,Kt,"⌈","\\lceil",!0);y(v,S,Rt,"⌉","\\rceil",!0);y(v,S,W,"\\","\\backslash");y(v,S,W,"∣","|");y(v,S,W,"∣","\\vert");y(ne,S,W,"|","\\textbar",!0);y(v,S,W,"∥","\\|");y(v,S,W,"∥","\\Vert");y(ne,S,W,"∥","\\textbardbl");y(ne,S,W,"~","\\textasciitilde");y(ne,S,W,"\\","\\textbackslash");y(ne,S,W,"^","\\textasciicircum");y(v,S,F,"↑","\\uparrow",!0);y(v,S,F,"⇑","\\Uparrow",!0);y(v,S,F,"↓","\\downarrow",!0);y(v,S,F,"⇓","\\Downarrow",!0);y(v,S,F,"↕","\\updownarrow",!0);y(v,S,F,"⇕","\\Updownarrow",!0);y(v,S,pt,"∐","\\coprod");y(v,S,pt,"⋁","\\bigvee");y(v,S,pt,"⋀","\\bigwedge");y(v,S,pt,"⨄","\\biguplus");y(v,S,pt,"⋂","\\bigcap");y(v,S,pt,"⋃","\\bigcup");y(v,S,pt,"∫","\\int");y(v,S,pt,"∫","\\intop");y(v,S,pt,"∬","\\iint");y(v,S,pt,"∭","\\iiint");y(v,S,pt,"∏","\\prod");y(v,S,pt,"∑","\\sum");y(v,S,pt,"⨂","\\bigotimes");y(v,S,pt,"⨁","\\bigoplus");y(v,S,pt,"⨀","\\bigodot");y(v,S,pt,"∮","\\oint");y(v,S,pt,"∯","\\oiint");y(v,S,pt,"∰","\\oiiint");y(v,S,pt,"⨆","\\bigsqcup");y(v,S,pt,"∫","\\smallint");y(ne,S,Kr,"…","\\textellipsis");y(v,S,Kr,"…","\\mathellipsis");y(ne,S,Kr,"…","\\ldots",!0);y(v,S,Kr,"…","\\ldots",!0);y(v,S,Kr,"⋯","\\@cdots",!0);y(v,S,Kr,"⋱","\\ddots",!0);y(v,S,W,"⋮","\\varvdots");y(v,S,tt,"ˊ","\\acute");y(v,S,tt,"ˋ","\\grave");y(v,S,tt,"¨","\\ddot");y(v,S,tt,"~","\\tilde");y(v,S,tt,"ˉ","\\bar");y(v,S,tt,"˘","\\breve");y(v,S,tt,"ˇ","\\check");y(v,S,tt,"^","\\hat");y(v,S,tt,"⃗","\\vec");y(v,S,tt,"˙","\\dot");y(v,S,tt,"˚","\\mathring");y(v,S,Me,"","\\@imath");y(v,S,Me,"","\\@jmath");y(v,S,W,"ı","ı");y(v,S,W,"ȷ","ȷ");y(ne,S,W,"ı","\\i",!0);y(ne,S,W,"ȷ","\\j",!0);y(ne,S,W,"ß","\\ss",!0);y(ne,S,W,"æ","\\ae",!0);y(ne,S,W,"œ","\\oe",!0);y(ne,S,W,"ø","\\o",!0);y(ne,S,W,"Æ","\\AE",!0);y(ne,S,W,"Œ","\\OE",!0);y(ne,S,W,"Ø","\\O",!0);y(ne,S,tt,"ˊ","\\'");y(ne,S,tt,"ˋ","\\`");y(ne,S,tt,"ˆ","\\^");y(ne,S,tt,"˜","\\~");y(ne,S,tt,"ˉ","\\=");y(ne,S,tt,"˘","\\u");y(ne,S,tt,"˙","\\.");y(ne,S,tt,"¸","\\c");y(ne,S,tt,"˚","\\r");y(ne,S,tt,"ˇ","\\v");y(ne,S,tt,"¨",'\\"');y(ne,S,tt,"˝","\\H");y(ne,S,tt,"◯","\\textcircled");var x6={"--":!0,"---":!0,"``":!0,"''":!0};y(ne,S,W,"–","--",!0);y(ne,S,W,"–","\\textendash");y(ne,S,W,"—","---",!0);y(ne,S,W,"—","\\textemdash");y(ne,S,W,"‘","`",!0);y(ne,S,W,"‘","\\textquoteleft");y(ne,S,W,"’","'",!0);y(ne,S,W,"’","\\textquoteright");y(ne,S,W,"“","``",!0);y(ne,S,W,"“","\\textquotedblleft");y(ne,S,W,"”","''",!0);y(ne,S,W,"”","\\textquotedblright");y(v,S,W,"°","\\degree",!0);y(ne,S,W,"°","\\degree");y(ne,S,W,"°","\\textdegree",!0);y(v,S,W,"£","\\pounds");y(v,S,W,"£","\\mathsterling",!0);y(ne,S,W,"£","\\pounds");y(ne,S,W,"£","\\textsterling",!0);y(v,$,W,"✠","\\maltese");y(ne,$,W,"✠","\\maltese");var zm='0123456789/@."';for(var Ns=0;Ns<zm.length;Ns++){var $m=zm.charAt(Ns);y(v,S,W,$m,$m)}var Fm='0123456789!@*()-=+";:?/.,';for(var As=0;As<Fm.length;As++){var Pm=Fm.charAt(As);y(ne,S,W,Pm,Pm)}var Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Ts=0;Ts<Gi.length;Ts++){var ei=Gi.charAt(Ts);y(v,S,Me,ei,ei),y(ne,S,W,ei,ei)}y(v,$,W,"C","ℂ");y(ne,$,W,"C","ℂ");y(v,$,W,"H","ℍ");y(ne,$,W,"H","ℍ");y(v,$,W,"N","ℕ");y(ne,$,W,"N","ℕ");y(v,$,W,"P","ℙ");y(ne,$,W,"P","ℙ");y(v,$,W,"Q","ℚ");y(ne,$,W,"Q","ℚ");y(v,$,W,"R","ℝ");y(ne,$,W,"R","ℝ");y(v,$,W,"Z","ℤ");y(ne,$,W,"Z","ℤ");y(v,S,Me,"h","ℎ");y(ne,S,Me,"h","ℎ");var Ne="";for(var Mt=0;Mt<Gi.length;Mt++){var ot=Gi.charAt(Mt);Ne=String.fromCharCode(55349,56320+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56372+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56424+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56580+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56684+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56736+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56788+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56840+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56944+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Mt<26&&(Ne=String.fromCharCode(55349,56632+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56476+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne))}Ne="𝕜";y(v,S,Me,"k",Ne);y(ne,S,W,"k",Ne);for(var cr=0;cr<10;cr++){var jn=cr.toString();Ne=String.fromCharCode(55349,57294+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne),Ne=String.fromCharCode(55349,57314+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne),Ne=String.fromCharCode(55349,57324+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne),Ne=String.fromCharCode(55349,57334+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne)}var Rd="ÐÞþ";for(var Cs=0;Cs<Rd.length;Cs++){var ti=Rd.charAt(Cs);y(v,S,Me,ti,ti),y(ne,S,W,ti,ti)}var ni=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],qm=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],YAe=function(t,n){var r=t.charCodeAt(0),a=t.charCodeAt(1),i=(r-55296)*1024+(a-56320)+65536,o=n==="math"?0:1;if(119808<=i&&i<120484){var s=Math.floor((i-119808)/26);return[ni[s][2],ni[s][o]]}else if(120782<=i&&i<=120831){var l=Math.floor((i-120782)/10);return[qm[l][2],qm[l][o]]}else{if(i===120485||i===120486)return[ni[0][2],ni[0][o]];if(120486<i&&i<120782)return["",""];throw new ce("Unsupported character: "+t)}},To=function(t,n,r){return Qe[r][t]&&Qe[r][t].replace&&(t=Qe[r][t].replace),{value:t,metrics:Hp(t,n,r)}},ln=function(t,n,r,a,i){var o=To(t,n,r),s=o.metrics;t=o.value;var l;if(s){var u=s.italic;(r==="text"||a&&a.font==="mathit")&&(u=0),l=new rn(t,s.height,s.depth,u,s.skew,s.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new rn(t,0,0,0,0,0,i);if(a){l.maxFontSize=a.sizeMultiplier,a.style.isTight()&&l.classes.push("mtight");var d=a.getColor();d&&(l.style.color=d)}return l},ZAe=function(t,n,r,a){return a===void 0&&(a=[]),r.font==="boldsymbol"&&To(t,"Main-Bold",n).metrics?ln(t,"Main-Bold",n,r,a.concat(["mathbf"])):t==="\\"||Qe[n][t].font==="main"?ln(t,"Main-Regular",n,r,a):ln(t,"AMS-Regular",n,r,a.concat(["amsrm"]))},XAe=function(t,n,r,a,i){return i!=="textord"&&To(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},QAe=function(t,n,r){var a=t.mode,i=t.text,o=["mord"],s=a==="math"||a==="text"&&n.font,l=s?n.font:n.fontFamily,u="",d="";if(i.charCodeAt(0)===55349&&([u,d]=YAe(i,a)),u.length>0)return ln(i,u,a,n,o.concat(d));if(l){var p,h;if(l==="boldsymbol"){var m=XAe(i,a,n,o,r);p=m.fontName,h=[m.fontClass]}else s?(p=M6[l].fontName,h=[l]):(p=ri(l,n.fontWeight,n.fontShape),h=[l,n.fontWeight,n.fontShape]);if(To(i,p,a).metrics)return ln(i,p,a,n,o.concat(h));if(x6.hasOwnProperty(i)&&p.slice(0,10)==="Typewriter"){for(var f=[],g=0;g<i.length;g++)f.push(ln(i[g],p,a,n,o.concat(h)));return E6(f)}}if(r==="mathord")return ln(i,"Math-Italic",a,n,o.concat(["mathnormal"]));if(r==="textord"){var _=Qe[a][i]&&Qe[a][i].font;if(_==="ams"){var k=ri("amsrm",n.fontWeight,n.fontShape);return ln(i,k,a,n,o.concat("amsrm",n.fontWeight,n.fontShape))}else if(_==="main"||!_){var b=ri("textrm",n.fontWeight,n.fontShape);return ln(i,b,a,n,o.concat(n.fontWeight,n.fontShape))}else{var x=ri(_,n.fontWeight,n.fontShape);return ln(i,x,a,n,o.concat(x,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},JAe=(e,t)=>{if(tr(e.classes)!==tr(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var a in t.style)if(t.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;return!0},eTe=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof rn&&r instanceof rn&&JAe(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Vp=function(t){for(var n=0,r=0,a=0,i=0;i<t.children.length;i++){var o=t.children[i];o.height>n&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>a&&(a=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=a},zt=function(t,n,r,a){var i=new Pa(t,n,r,a);return Vp(i),i},w6=(e,t,n,r)=>new Pa(e,t,n,r),tTe=function(t,n,r){var a=zt([t],[],n);return a.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),a.style.borderBottomWidth=de(a.height),a.maxFontSize=1,a},nTe=function(t,n,r,a){var i=new jp(t,n,r,a);return Vp(i),i},E6=function(t){var n=new Fa(t);return Vp(n),n},rTe=function(t,n){return t instanceof Fa?zt([],[t],n):t},aTe=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],a=-n[0].shift-n[0].elem.depth,i=a,o=1;o<n.length;o++){var s=-n[o].shift-i-n[o].elem.depth,l=s-(n[o-1].elem.height+n[o-1].elem.depth);i=i+s,r.push({type:"kern",size:l}),r.push(n[o])}return{children:r,depth:a}}var u;if(t.positionType==="top"){for(var d=t.positionData,p=0;p<t.children.length;p++){var h=t.children[p];d-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}u=d}else if(t.positionType==="bottom")u=-t.positionData;else{var m=t.children[0];if(m.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")u=-m.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")u=-m.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:u}},iTe=function(t,n){for(var{children:r,depth:a}=aTe(t),i=0,o=0;o<r.length;o++){var s=r[o];if(s.type==="elem"){var l=s.elem;i=Math.max(i,l.maxFontSize,l.height)}}i+=2;var u=zt(["pstrut"],[]);u.style.height=de(i);for(var d=[],p=a,h=a,m=a,f=0;f<r.length;f++){var g=r[f];if(g.type==="kern")m+=g.size;else{var _=g.elem,k=g.wrapperClasses||[],b=g.wrapperStyle||{},x=zt(k,[u,_],void 0,b);x.style.top=de(-i-m-_.depth),g.marginLeft&&(x.style.marginLeft=g.marginLeft),g.marginRight&&(x.style.marginRight=g.marginRight),d.push(x),m+=_.height+_.depth}p=Math.min(p,m),h=Math.max(h,m)}var M=zt(["vlist"],d);M.style.height=de(h);var N;if(p<0){var E=zt([],[]),D=zt(["vlist"],[E]);D.style.height=de(-p);var P=zt(["vlist-s"],[new rn("")]);N=[zt(["vlist-r"],[M,P]),zt(["vlist-r"],[D])]}else N=[zt(["vlist-r"],[M])];var C=zt(["vlist-t"],N);return N.length===2&&C.classes.push("vlist-t2"),C.height=h,C.depth=-p,C},oTe=(e,t)=>{var n=zt(["mspace"],[],t),r=at(e,t);return n.style.marginRight=de(r),n},ri=function(t,n,r){var a="";switch(t){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=t}var i;return n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",a+"-"+i},M6={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},S6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},sTe=function(t,n){var[r,a,i]=S6[t],o=new nr(r),s=new Ln([o],{width:de(a),height:de(i),style:"width:"+de(a),viewBox:"0 0 "+1e3*a+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=w6(["overlay"],[s],n);return l.height=i,l.style.height=de(i),l.style.width=de(a),l},J={fontMap:M6,makeSymbol:ln,mathsym:ZAe,makeSpan:zt,makeSvgSpan:w6,makeLineSpan:tTe,makeAnchor:nTe,makeFragment:E6,wrapFragment:rTe,makeVList:iTe,makeOrd:QAe,makeGlue:oTe,staticSvg:sTe,svgData:S6,tryCombineChars:eTe},rt={number:3,unit:"mu"},ur={number:4,unit:"mu"},Sn={number:5,unit:"mu"},lTe={mord:{mop:rt,mbin:ur,mrel:Sn,minner:rt},mop:{mord:rt,mop:rt,mrel:Sn,minner:rt},mbin:{mord:ur,mop:ur,mopen:ur,minner:ur},mrel:{mord:Sn,mop:Sn,mopen:Sn,minner:Sn},mopen:{},mclose:{mop:rt,mbin:ur,mrel:Sn,minner:rt},mpunct:{mord:rt,mop:rt,mrel:Sn,mopen:rt,mclose:rt,mpunct:rt,minner:rt},minner:{mord:rt,mop:rt,mbin:ur,mrel:Sn,mopen:rt,mpunct:rt,minner:rt}},cTe={mord:{mop:rt},mop:{mord:rt,mop:rt},mbin:{},mrel:{},mopen:{},mclose:{mop:rt},mpunct:{},minner:{mop:rt}},N6={},Wi={},Ki={};function me(e){for(var{type:t,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:a},l=0;l<n.length;++l)N6[n[l]]=s;t&&(i&&(Wi[t]=i),o&&(Ki[t]=o))}function vr(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;me({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Yi=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},lt=function(t){return t.type==="ordgroup"?t.body:[t]},Dn=J.makeSpan,uTe=["leftmost","mbin","mopen","mrel","mop","mpunct"],dTe=["rightmost","mrel","mclose","mpunct"],pTe={display:Se.DISPLAY,text:Se.TEXT,script:Se.SCRIPT,scriptscript:Se.SCRIPTSCRIPT},hTe={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ht=function(t,n,r,a){a===void 0&&(a=[null,null]);for(var i=[],o=0;o<t.length;o++){var s=je(t[o],n);if(s instanceof Fa){var l=s.children;i.push(...l)}else i.push(s)}if(J.tryCombineChars(i),!r)return i;var u=n;if(t.length===1){var d=t[0];d.type==="sizing"?u=n.havingSize(d.size):d.type==="styling"&&(u=n.havingStyle(pTe[d.style]))}var p=Dn([a[0]||"leftmost"],[],n),h=Dn([a[1]||"rightmost"],[],n),m=r==="root";return Bm(i,(f,g)=>{var _=g.classes[0],k=f.classes[0];_==="mbin"&&Ee.contains(dTe,k)?g.classes[0]="mord":k==="mbin"&&Ee.contains(uTe,_)&&(f.classes[0]="mord")},{node:p},h,m),Bm(i,(f,g)=>{var _=Id(g),k=Id(f),b=_&&k?f.hasClass("mtight")?cTe[_][k]:lTe[_][k]:null;if(b)return J.makeGlue(b,u)},{node:p},h,m),i},Bm=function e(t,n,r,a,i){a&&t.push(a);for(var o=0;o<t.length;o++){var s=t[o],l=A6(s);if(l){e(l.children,n,r,null,i);continue}var u=!s.hasClass("mspace");if(u){var d=n(s,r.node);d&&(r.insertAfter?r.insertAfter(d):(t.unshift(d),o++))}u?r.node=s:i&&s.hasClass("newline")&&(r.node=Dn(["leftmost"])),r.insertAfter=(p=>h=>{t.splice(p+1,0,h),o++})(o)}a&&t.pop()},A6=function(t){return t instanceof Fa||t instanceof jp||t instanceof Pa&&t.hasClass("enclosing")?t:null},mTe=function e(t,n){var r=A6(t);if(r){var a=r.children;if(a.length){if(n==="right")return e(a[a.length-1],"right");if(n==="left")return e(a[0],"left")}}return t},Id=function(t,n){return t?(n&&(t=mTe(t,n)),hTe[t.classes[0]]||null):null},Ma=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Dn(n.concat(r))},je=function(t,n,r){if(!t)return Dn();if(Wi[t.type]){var a=Wi[t.type](t,n);if(r&&n.size!==r.size){a=Dn(n.sizingClasses(r),[a],n);var i=n.sizeMultiplier/r.sizeMultiplier;a.height*=i,a.depth*=i}return a}else throw new ce("Got group of unknown type: '"+t.type+"'")};function ai(e,t){var n=Dn(["base"],e,t),r=Dn(["strut"]);return r.style.height=de(n.height+n.depth),n.depth&&(r.style.verticalAlign=de(-n.depth)),n.children.unshift(r),n}function Od(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=ht(e,t,"root"),a;r.length===2&&r[1].hasClass("tag")&&(a=r.pop());for(var i=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass("mbin")||r[s].hasClass("mrel")||r[s].hasClass("allowbreak")){for(var l=!1;s<r.length-1&&r[s+1].hasClass("mspace")&&!r[s+1].hasClass("newline");)s++,o.push(r[s]),r[s].hasClass("nobreak")&&(l=!0);l||(i.push(ai(o,t)),o=[])}else r[s].hasClass("newline")&&(o.pop(),o.length>0&&(i.push(ai(o,t)),o=[]),i.push(r[s]));o.length>0&&i.push(ai(o,t));var u;n?(u=ai(ht(n,t,!0)),u.classes=["tag"],i.push(u)):a&&i.push(a);var d=Dn(["katex-html"],i);if(d.setAttribute("aria-hidden","true"),u){var p=u.children[0];p.style.height=de(d.height+d.depth),d.depth&&(p.style.verticalAlign=de(-d.depth))}return d}function T6(e){return new Fa(e)}class en{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=tr(this.classes));for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=Ee.escape(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+Ee.escape(tr(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class pa{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ee.escape(this.toText())}toText(){return this.text}}class fTe{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",de(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+de(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var ae={MathNode:en,TextNode:pa,SpaceNode:fTe,newDocumentFragment:T6},an=function(t,n,r){return Qe[n][t]&&Qe[n][t].replace&&t.charCodeAt(0)!==55349&&!(x6.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Qe[n][t].replace),new ae.TextNode(t)},Gp=function(t){return t.length===1?t[0]:new ae.MathNode("mrow",t)},Wp=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var a=t.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var i=t.text;if(Ee.contains(["\\imath","\\jmath"],i))return null;Qe[a][i]&&Qe[a][i].replace&&(i=Qe[a][i].replace);var o=J.fontMap[r].fontName;return Hp(i,o,a)?J.fontMap[r].variant:null},Pt=function(t,n,r){if(t.length===1){var a=Xe(t[0],n);return r&&a instanceof en&&a.type==="mo"&&(a.setAttribute("lspace","0em"),a.setAttribute("rspace","0em")),[a]}for(var i=[],o,s=0;s<t.length;s++){var l=Xe(t[s],n);if(l instanceof en&&o instanceof en){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mi"&&l.children.length===1&&o.type==="mn"){var u=l.children[0];if(u instanceof pa&&u.text==="."){o.children.push(...l.children);continue}}else if(o.type==="mi"&&o.children.length===1){var d=o.children[0];if(d instanceof pa&&d.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var p=l.children[0];p instanceof pa&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),i.pop())}}}i.push(l),o=l}return i},rr=function(t,n,r){return Gp(Pt(t,n,r))},Xe=function(t,n){if(!t)return new ae.MathNode("mrow");if(Ki[t.type]){var r=Ki[t.type](t,n);return r}else throw new ce("Got group of unknown type: '"+t.type+"'")};function Um(e,t,n,r,a){var i=Pt(e,n),o;i.length===1&&i[0]instanceof en&&Ee.contains(["mrow","mtable"],i[0].type)?o=i[0]:o=new ae.MathNode("mrow",i);var s=new ae.MathNode("annotation",[new ae.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new ae.MathNode("semantics",[o,s]),u=new ae.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var d=a?"katex":"katex-mathml";return J.makeSpan([d],[u])}var C6=function(t){return new Nn({style:t.displayMode?Se.DISPLAY:Se.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},R6=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=J.makeSpan(r,[t])}return t},gTe=function(t,n,r){var a=C6(r),i;if(r.output==="mathml")return Um(t,n,a,r.displayMode,!0);if(r.output==="html"){var o=Od(t,a);i=J.makeSpan(["katex"],[o])}else{var s=Um(t,n,a,r.displayMode,!1),l=Od(t,a);i=J.makeSpan(["katex"],[s,l])}return R6(i,r)},yTe=function(t,n,r){var a=C6(r),i=Od(t,a),o=J.makeSpan(["katex"],[i]);return R6(o,r)},bTe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},kTe=function(t){var n=new ae.MathNode("mo",[new ae.TextNode(bTe[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},vTe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},_Te=function(t){return t.type==="ordgroup"?t.body.length:1},xTe=function(t,n){function r(){var s=4e5,l=t.label.slice(1);if(Ee.contains(["widehat","widecheck","widetilde","utilde"],l)){var u=t,d=_Te(u.base),p,h,m;if(d>5)l==="widehat"||l==="widecheck"?(p=420,s=2364,m=.42,h=l+"4"):(p=312,s=2340,m=.34,h="tilde4");else{var f=[1,1,2,2,3,3][d];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][f],p=[0,239,300,360,420][f],m=[0,.24,.3,.3,.36,.42][f],h=l+f):(s=[0,600,1033,2339,2340][f],p=[0,260,286,306,312][f],m=[0,.26,.286,.3,.306,.34][f],h="tilde"+f)}var g=new nr(h),_=new Ln([g],{width:"100%",height:de(m),viewBox:"0 0 "+s+" "+p,preserveAspectRatio:"none"});return{span:J.makeSvgSpan([],[_],n),minWidth:0,height:m}}else{var k=[],b=vTe[l],[x,M,N]=b,E=N/1e3,D=x.length,P,C;if(D===1){var I=b[3];P=["hide-tail"],C=[I]}else if(D===2)P=["halfarrow-left","halfarrow-right"],C=["xMinYMin","xMaxYMin"];else if(D===3)P=["brace-left","brace-center","brace-right"],C=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
8583
|
-
`+D+" children.");for(var q=0;q<D;q++){var Z=new nr(x[q]),X=new Ln([Z],{width:"400em",height:de(E),viewBox:"0 0 "+s+" "+N,preserveAspectRatio:C[q]+" slice"}),K=J.makeSvgSpan([P[q]],[X],n);if(D===1)return{span:K,minWidth:M,height:E};K.style.height=de(E),k.push(K)}return{span:J.makeSpan(["stretchy"],k,n),minWidth:M,height:E}}}var{span:a,minWidth:i,height:o}=r();return a.height=o,a.style.height=de(o),i>0&&(a.style.minWidth=de(i)),a},wTe=function(t,n,r,a,i){var o,s=t.height+t.depth+r+a;if(/fbox|color|angl/.test(n)){if(o=J.makeSpan(["stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new Cd({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new Cd({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new Ln(u,{width:"100%",height:de(s)});o=J.makeSvgSpan([],[d],i)}return o.height=s,o.style.height=de(s),o},zn={encloseSpan:wTe,mathMLnode:kTe,svgSpan:xTe};function Oe(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Kp(e){var t=Co(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Co(e){return e&&(e.type==="atom"||KAe.hasOwnProperty(e.type))?e:null}var Yp=(e,t)=>{var n,r,a;e&&e.type==="supsub"?(r=Oe(e.base,"accent"),n=r.base,e.base=n,a=GAe(je(e,t)),e.base=r):(r=Oe(e,"accent"),n=r.base);var i=je(n,t.havingCrampedStyle()),o=r.isShifty&&Ee.isCharacterBox(n),s=0;if(o){var l=Ee.getBaseElem(n),u=je(l,t.havingCrampedStyle());s=Dm(u).skew}var d=r.label==="\\c",p=d?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),h;if(r.isStretchy)h=zn.svgSpan(r,t),h=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+de(2*s)+")",marginLeft:de(2*s)}:void 0}]},t);else{var m,f;r.label==="\\vec"?(m=J.staticSvg("vec",t),f=J.svgData.vec[1]):(m=J.makeOrd({mode:r.mode,text:r.label},t,"textord"),m=Dm(m),m.italic=0,f=m.width,d&&(p+=m.depth)),h=J.makeSpan(["accent-body"],[m]);var g=r.label==="\\textcircled";g&&(h.classes.push("accent-full"),p=i.height);var _=s;g||(_-=f/2),h.style.left=de(_),r.label==="\\textcircled"&&(h.style.top=".2em"),h=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-p},{type:"elem",elem:h}]},t)}var k=J.makeSpan(["mord","accent"],[h],t);return a?(a.children[0]=k,a.height=Math.max(k.height,a.height),a.classes[0]="mord",a):k},I6=(e,t)=>{var n=e.isStretchy?zn.mathMLnode(e.label):new ae.MathNode("mo",[an(e.label,e.mode)]),r=new ae.MathNode("mover",[Xe(e.base,t),n]);return r.setAttribute("accent","true"),r},ETe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));me({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Yi(t[0]),r=!ETe.test(e.funcName),a=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:Yp,mathmlBuilder:I6});me({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Yp,mathmlBuilder:I6});me({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:a}},htmlBuilder:(e,t)=>{var n=je(e.base,t),r=zn.svgSpan(e,t),a=e.label==="\\utilde"?.12:0,i=J.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:n}]},t);return J.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=zn.mathMLnode(e.label),r=new ae.MathNode("munder",[Xe(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var ii=e=>{var t=new ae.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};me({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:a}=e;return{type:"xArrow",mode:r.mode,label:a,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),a=J.wrapFragment(je(e.body,r,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";a.classes.push(i+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=J.wrapFragment(je(e.below,r,t),t),o.classes.push(i+"-arrow-pad"));var s=zn.svgSpan(e,t),l=-t.fontMetrics().axisHeight+.5*s.height,u=-t.fontMetrics().axisHeight-.5*s.height-.111;(a.depth>.25||e.label==="\\xleftequilibrium")&&(u-=a.depth);var d;if(o){var p=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;d=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:s,shift:l},{type:"elem",elem:o,shift:p}]},t)}else d=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:s,shift:l}]},t);return d.children[0].children[0].children[1].classes.push("svg-align"),J.makeSpan(["mrel","x-arrow"],[d],t)},mathmlBuilder(e,t){var n=zn.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var a=ii(Xe(e.body,t));if(e.below){var i=ii(Xe(e.below,t));r=new ae.MathNode("munderover",[n,i,a])}else r=new ae.MathNode("mover",[n,a])}else if(e.below){var o=ii(Xe(e.below,t));r=new ae.MathNode("munder",[n,o])}else r=ii(),r=new ae.MathNode("mover",[n,r]);return r}});var MTe=J.makeSpan;function O6(e,t){var n=ht(e.body,t,!0);return MTe([e.mclass],n,t)}function L6(e,t){var n,r=Pt(e.body,t);return e.mclass==="minner"?n=new ae.MathNode("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new ae.MathNode("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new ae.MathNode("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}me({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:lt(a),isCharacterBox:Ee.isCharacterBox(a)}},htmlBuilder:O6,mathmlBuilder:L6});var Ro=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};me({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Ro(t[0]),body:lt(t[1]),isCharacterBox:Ee.isCharacterBox(t[1])}}});me({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,a=t[1],i=t[0],o;r!=="\\stackrel"?o=Ro(a):o="mrel";var s={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:lt(a)},l={type:"supsub",mode:i.mode,base:s,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:o,body:[l],isCharacterBox:Ee.isCharacterBox(l)}},htmlBuilder:O6,mathmlBuilder:L6});me({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Ro(t[0]),body:lt(t[0])}},htmlBuilder(e,t){var n=ht(e.body,t,!0),r=J.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Pt(e.body,t),r=new ae.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var STe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Hm=()=>({type:"styling",body:[],mode:"math",style:"display"}),jm=e=>e.type==="textord"&&e.text==="@",NTe=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function ATe(e,t,n){var r=STe[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var a=n.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[i],[]),s=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[a,o,s]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function TTe(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ce("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],a=[r],i=0;i<t.length;i++){for(var o=t[i],s=Hm(),l=0;l<o.length;l++)if(!jm(o[l]))s.body.push(o[l]);else{r.push(s),l+=1;var u=Kp(o[l]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(u)>-1))if("<>AV".indexOf(u)>-1)for(var p=0;p<2;p++){for(var h=!0,m=l+1;m<o.length;m++){if(NTe(o[m],u)){h=!1,l=m;break}if(jm(o[m]))throw new ce("Missing a "+u+" character to complete a CD arrow.",o[m]);d[p].body.push(o[m])}if(h)throw new ce("Missing a "+u+" character to complete a CD arrow.",o[l])}else throw new ce('Expected one of "<>AV=|." after @',o[l]);var f=ATe(u,d,e),g={type:"styling",body:[f],mode:"math",style:"display"};r.push(g),s=Hm()}i%2===0?r.push(s):r.shift(),r=[],a.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var _=new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:_,colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}me({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=J.wrapFragment(je(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=de(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ae.MathNode("mrow",[Xe(e.label,t)]);return n=new ae.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new ae.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});me({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=J.wrapFragment(je(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new ae.MathNode("mrow",[Xe(e.fragment,t)])}});me({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Oe(t[0],"ordgroup"),a=r.body,i="",o=0;o<a.length;o++){var s=Oe(a[o],"textord");i+=s.text}var l=parseInt(i),u;if(isNaN(l))throw new ce("\\@char has non-numeric argument "+i);if(l<0||l>=1114111)throw new ce("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:u}}});var D6=(e,t)=>{var n=ht(e.body,t.withColor(e.color),!1);return J.makeFragment(n)},z6=(e,t)=>{var n=Pt(e.body,t.withColor(e.color)),r=new ae.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};me({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Oe(t[0],"color-token").color,a=t[1];return{type:"color",mode:n.mode,color:r,body:lt(a)}},htmlBuilder:D6,mathmlBuilder:z6});me({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,a=Oe(t[0],"color-token").color;n.gullet.macros.set("\\current@color",a);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:a,body:i}},htmlBuilder:D6,mathmlBuilder:z6});me({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,a=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:a&&Oe(a,"size").value}},htmlBuilder(e,t){var n=J.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=de(at(e.size,t)))),n},mathmlBuilder(e,t){var n=new ae.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",de(at(e.size,t)))),n}});var Ld={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},$6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ce("Expected a control sequence",e);return t},CTe=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},F6=(e,t,n,r)=>{var a=e.gullet.macros.get(n.text);a==null&&(n.noexpand=!0,a={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,a,r)};me({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Ld[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Ld[r.text]),Oe(t.parseFunction(),"internal");throw new ce("Invalid token after macro prefix",r)}});me({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),a=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(a))throw new ce("Expected a control sequence",r);for(var i=0,o,s=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),s[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ce('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new ce('Argument number "'+r.text+'" out of order');i++,s.push([])}else{if(r.text==="EOF")throw new ce("Expected a macro definition");s[i].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(a,{tokens:l,numArgs:i,delimiters:s},n===Ld[n]),{type:"internal",mode:t.mode}}});me({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=$6(t.gullet.popToken());t.gullet.consumeSpaces();var a=CTe(t);return F6(t,r,a,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});me({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=$6(t.gullet.popToken()),a=t.gullet.popToken(),i=t.gullet.popToken();return F6(t,r,i,n==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var ia=function(t,n,r){var a=Qe.math[t]&&Qe.math[t].replace,i=Hp(a||t,n,r);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return i},Zp=function(t,n,r,a){var i=r.havingBaseStyle(n),o=J.makeSpan(a.concat(i.sizingClasses(r)),[t],r),s=i.sizeMultiplier/r.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=i.sizeMultiplier,o},P6=function(t,n,r){var a=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/a.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=de(i),t.height-=i,t.depth+=i},RTe=function(t,n,r,a,i,o){var s=J.makeSymbol(t,"Main-Regular",i,a),l=Zp(s,n,a,o);return r&&P6(l,a,n),l},ITe=function(t,n,r,a){return J.makeSymbol(t,"Size"+n+"-Regular",r,a)},q6=function(t,n,r,a,i,o){var s=ITe(t,n,i,a),l=Zp(J.makeSpan(["delimsizing","size"+n],[s],a),Se.TEXT,a,o);return r&&P6(l,a,Se.TEXT),l},Rs=function(t,n,r){var a;n==="Size1-Regular"?a="delim-size1":a="delim-size4";var i=J.makeSpan(["delimsizinginner",a],[J.makeSpan([],[J.makeSymbol(t,n,r)])]);return{type:"elem",elem:i}},Is=function(t,n,r){var a=bn["Size4-Regular"][t.charCodeAt(0)]?bn["Size4-Regular"][t.charCodeAt(0)][4]:bn["Size1-Regular"][t.charCodeAt(0)][4],i=new nr("inner",FAe(t,Math.round(1e3*n))),o=new Ln([i],{width:de(a),height:de(n),style:"width:"+de(a),viewBox:"0 0 "+1e3*a+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),s=J.makeSvgSpan([],[o],r);return s.height=n,s.style.height=de(n),s.style.width=de(a),{type:"elem",elem:s}},Dd=.008,oi={type:"kern",size:-1*Dd},OTe=["|","\\lvert","\\rvert","\\vert"],LTe=["\\|","\\lVert","\\rVert","\\Vert"],B6=function(t,n,r,a,i,o){var s,l,u,d,p="",h=0;s=u=d=t,l=null;var m="Size1-Regular";t==="\\uparrow"?u=d="⏐":t==="\\Uparrow"?u=d="‖":t==="\\downarrow"?s=u="⏐":t==="\\Downarrow"?s=u="‖":t==="\\updownarrow"?(s="\\uparrow",u="⏐",d="\\downarrow"):t==="\\Updownarrow"?(s="\\Uparrow",u="‖",d="\\Downarrow"):Ee.contains(OTe,t)?(u="∣",p="vert",h=333):Ee.contains(LTe,t)?(u="∥",p="doublevert",h=556):t==="["||t==="\\lbrack"?(s="⎡",u="⎢",d="⎣",m="Size4-Regular",p="lbrack",h=667):t==="]"||t==="\\rbrack"?(s="⎤",u="⎥",d="⎦",m="Size4-Regular",p="rbrack",h=667):t==="\\lfloor"||t==="⌊"?(u=s="⎢",d="⎣",m="Size4-Regular",p="lfloor",h=667):t==="\\lceil"||t==="⌈"?(s="⎡",u=d="⎢",m="Size4-Regular",p="lceil",h=667):t==="\\rfloor"||t==="⌋"?(u=s="⎥",d="⎦",m="Size4-Regular",p="rfloor",h=667):t==="\\rceil"||t==="⌉"?(s="⎤",u=d="⎥",m="Size4-Regular",p="rceil",h=667):t==="("||t==="\\lparen"?(s="⎛",u="⎜",d="⎝",m="Size4-Regular",p="lparen",h=875):t===")"||t==="\\rparen"?(s="⎞",u="⎟",d="⎠",m="Size4-Regular",p="rparen",h=875):t==="\\{"||t==="\\lbrace"?(s="⎧",l="⎨",d="⎩",u="⎪",m="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(s="⎫",l="⎬",d="⎭",u="⎪",m="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(s="⎧",d="⎩",u="⎪",m="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(s="⎫",d="⎭",u="⎪",m="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(s="⎧",d="⎭",u="⎪",m="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(s="⎫",d="⎩",u="⎪",m="Size4-Regular");var f=ia(s,m,i),g=f.height+f.depth,_=ia(u,m,i),k=_.height+_.depth,b=ia(d,m,i),x=b.height+b.depth,M=0,N=1;if(l!==null){var E=ia(l,m,i);M=E.height+E.depth,N=2}var D=g+x+M,P=Math.max(0,Math.ceil((n-D)/(N*k))),C=D+P*N*k,I=a.fontMetrics().axisHeight;r&&(I*=a.sizeMultiplier);var q=C/2-I,Z=[];if(p.length>0){var X=C-g-x,K=Math.round(C*1e3),R=PAe(p,Math.round(X*1e3)),H=new nr(p,R),G=(h/1e3).toFixed(3)+"em",z=(K/1e3).toFixed(3)+"em",V=new Ln([H],{width:G,height:z,viewBox:"0 0 "+h+" "+K}),A=J.makeSvgSpan([],[V],a);A.height=K/1e3,A.style.width=G,A.style.height=z,Z.push({type:"elem",elem:A})}else{if(Z.push(Rs(d,m,i)),Z.push(oi),l===null){var Y=C-g-x+2*Dd;Z.push(Is(u,Y,a))}else{var ee=(C-g-x-M)/2+2*Dd;Z.push(Is(u,ee,a)),Z.push(oi),Z.push(Rs(l,m,i)),Z.push(oi),Z.push(Is(u,ee,a))}Z.push(oi),Z.push(Rs(s,m,i))}var L=a.havingBaseStyle(Se.TEXT),se=J.makeVList({positionType:"bottom",positionData:q,children:Z},L);return Zp(J.makeSpan(["delimsizing","mult"],[se],L),Se.TEXT,a,o)},Os=80,Ls=.08,Ds=function(t,n,r,a,i){var o=$Ae(t,a,r),s=new nr(t,o),l=new Ln([s],{width:"400em",height:de(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return J.makeSvgSpan(["hide-tail"],[l],i)},DTe=function(t,n){var r=n.havingBaseSizing(),a=V6("\\surd",t*r.sizeMultiplier,j6,r),i=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),s,l=0,u=0,d=0,p;return a.type==="small"?(d=1e3+1e3*o+Os,t<1?i=1:t<1.4&&(i=.7),l=(1+o+Ls)/i,u=(1+o)/i,s=Ds("sqrtMain",l,d,o,n),s.style.minWidth="0.853em",p=.833/i):a.type==="large"?(d=(1e3+Os)*ha[a.size],u=(ha[a.size]+o)/i,l=(ha[a.size]+o+Ls)/i,s=Ds("sqrtSize"+a.size,l,d,o,n),s.style.minWidth="1.02em",p=1/i):(l=t+o+Ls,u=t+o,d=Math.floor(1e3*t+o)+Os,s=Ds("sqrtTall",l,d,o,n),s.style.minWidth="0.742em",p=1.056),s.height=u,s.style.height=de(l),{span:s,advanceWidth:p,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*i}},U6=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],zTe=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],H6=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ha=[0,1.2,1.8,2.4,3],$Te=function(t,n,r,a,i){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),Ee.contains(U6,t)||Ee.contains(H6,t))return q6(t,n,!1,r,a,i);if(Ee.contains(zTe,t))return B6(t,ha[n],!1,r,a,i);throw new ce("Illegal delimiter: '"+t+"'")},FTe=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],PTe=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"stack"}],j6=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],qTe=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},V6=function(t,n,r,a){for(var i=Math.min(2,3-a.style.size),o=i;o<r.length&&r[o].type!=="stack";o++){var s=ia(t,qTe(r[o]),"math"),l=s.height+s.depth;if(r[o].type==="small"){var u=a.havingBaseStyle(r[o].style);l*=u.sizeMultiplier}if(l>n)return r[o]}return r[r.length-1]},G6=function(t,n,r,a,i,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var s;Ee.contains(H6,t)?s=FTe:Ee.contains(U6,t)?s=j6:s=PTe;var l=V6(t,n,s,a);return l.type==="small"?RTe(t,l.style,r,a,i,o):l.type==="large"?q6(t,l.size,r,a,i,o):B6(t,n,r,a,i,o)},BTe=function(t,n,r,a,i,o){var s=a.fontMetrics().axisHeight*a.sizeMultiplier,l=901,u=5/a.fontMetrics().ptPerEm,d=Math.max(n-s,r+s),p=Math.max(d/500*l,2*d-u);return G6(t,p,!0,a,i,o)},On={sqrtImage:DTe,sizedDelim:$Te,sizeToMaxHeight:ha,customSizedDelim:G6,leftRightDelim:BTe},Vm={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},UTe=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Io(e,t){var n=Co(e);if(n&&Ee.contains(UTe,n.text))return n;throw n?new ce("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new ce("Invalid delimiter type '"+e.type+"'",e)}me({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Io(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Vm[e.funcName].size,mclass:Vm[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?J.makeSpan([e.mclass]):On.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(an(e.delim,e.mode));var n=new ae.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=de(On.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function Gm(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}me({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ce("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Io(t[0],e).text,color:n}}});me({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Io(t[0],e),r=e.parser;++r.leftrightDepth;var a=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Oe(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:a,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{Gm(e);for(var n=ht(e.body,t,!0,["mopen","mclose"]),r=0,a=0,i=!1,o=0;o<n.length;o++)n[o].isMiddle?i=!0:(r=Math.max(n[o].height,r),a=Math.max(n[o].depth,a));r*=t.sizeMultiplier,a*=t.sizeMultiplier;var s;if(e.left==="."?s=Ma(t,["mopen"]):s=On.leftRightDelim(e.left,r,a,t,e.mode,["mopen"]),n.unshift(s),i)for(var l=1;l<n.length;l++){var u=n[l],d=u.isMiddle;d&&(n[l]=On.leftRightDelim(d.delim,r,a,d.options,e.mode,[]))}var p;if(e.right===".")p=Ma(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;p=On.leftRightDelim(e.right,r,a,h,e.mode,["mclose"])}return n.push(p),J.makeSpan(["minner"],n,t)},mathmlBuilder:(e,t)=>{Gm(e);var n=Pt(e.body,t);if(e.left!=="."){var r=new ae.MathNode("mo",[an(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var a=new ae.MathNode("mo",[an(e.right,e.mode)]);a.setAttribute("fence","true"),e.rightColor&&a.setAttribute("mathcolor",e.rightColor),n.push(a)}return Gp(n)}});me({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Io(t[0],e);if(!e.parser.leftrightDepth)throw new ce("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=Ma(t,[]);else{n=On.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?an("|","text"):an(e.delim,e.mode),r=new ae.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Xp=(e,t)=>{var n=J.wrapFragment(je(e.body,t),t),r=e.label.slice(1),a=t.sizeMultiplier,i,o=0,s=Ee.isCharacterBox(e.body);if(r==="sout")i=J.makeSpan(["stretchy","sout"]),i.height=t.fontMetrics().defaultRuleThickness/a,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=at({number:.6,unit:"pt"},t),u=at({number:.35,unit:"ex"},t),d=t.havingBaseSizing();a=a/d.sizeMultiplier;var p=n.height+n.depth+l+u;n.style.paddingLeft=de(p/2+l);var h=Math.floor(1e3*p*a),m=DAe(h),f=new Ln([new nr("phase",m)],{width:"400em",height:de(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});i=J.makeSvgSpan(["hide-tail"],[f],t),i.style.height=de(p),o=n.depth+l+u}else{/cancel/.test(r)?s||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var g=0,_=0,k=0;/box/.test(r)?(k=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=t.fontMetrics().fboxsep+(r==="colorbox"?0:k),_=g):r==="angl"?(k=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),g=4*k,_=Math.max(0,.25-n.depth)):(g=s?.2:0,_=g),i=zn.encloseSpan(n,r,g,_,t),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=de(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=de(k),i.style.borderRightWidth=de(k)),o=n.depth+_,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var b;if(e.backgroundColor)b=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:o},{type:"elem",elem:n,shift:0}]},t);else{var x=/cancel|phase/.test(r)?["svg-align"]:[];b=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:o,wrapperClasses:x}]},t)}return/cancel/.test(r)&&(b.height=n.height,b.depth=n.depth),/cancel/.test(r)&&!s?J.makeSpan(["mord","cancel-lap"],[b],t):J.makeSpan(["mord"],[b],t)},Qp=(e,t)=>{var n=0,r=new ae.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Xe(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};me({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:a}=e,i=Oe(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:a,backgroundColor:i,body:o}},htmlBuilder:Xp,mathmlBuilder:Qp});me({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:a}=e,i=Oe(t[0],"color-token").color,o=Oe(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:a,backgroundColor:o,borderColor:i,body:s}},htmlBuilder:Xp,mathmlBuilder:Qp});me({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});me({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"enclose",mode:n.mode,label:r,body:a}},htmlBuilder:Xp,mathmlBuilder:Qp});me({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var W6={};function xn(e){for(var{type:t,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},l=0;l<n.length;++l)W6[n[l]]=s;i&&(Wi[t]=i),o&&(Ki[t]=o)}var K6={};function T(e,t){K6[e]=t}function Wm(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Oo=e=>{var t=e.parser.settings;if(!t.displayMode)throw new ce("{"+e.envName+"} can be used only in display mode.")};function Jp(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function ir(e,t,n){var{hskipBeforeAndAfter:r,addJot:a,cols:i,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:d,maxNumCols:p,leqno:h}=t;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)o=1;else if(o=parseFloat(m),!o||o<0)throw new ce("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var f=[],g=[f],_=[],k=[],b=l!=null?[]:void 0;function x(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function M(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new nn("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),k.push(Wm(e));;){var N=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),N={type:"ordgroup",mode:e.mode,body:N},n&&(N={type:"styling",mode:e.mode,style:n,body:[N]}),f.push(N);var E=e.fetch().text;if(E==="&"){if(p&&f.length===p){if(u||s)throw new ce("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(E==="\\end"){M(),f.length===1&&N.type==="styling"&&N.body[0].body.length===0&&(g.length>1||!d)&&g.pop(),k.length<g.length+1&&k.push([]);break}else if(E==="\\\\"){e.consume();var D=void 0;e.gullet.future().text!==" "&&(D=e.parseSizeGroup(!0)),_.push(D?D.value:null),M(),k.push(Wm(e)),f=[],g.push(f),x()}else throw new ce("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:a,arraystretch:o,body:g,cols:i,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:k,colSeparationType:s,tags:b,leqno:h}}function eh(e){return e.slice(0,1)==="d"?"display":"text"}var wn=function(t,n){var r,a,i=t.body.length,o=t.hLinesBeforeRow,s=0,l=new Array(i),u=[],d=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),p=1/n.fontMetrics().ptPerEm,h=5*p;if(t.colSeparationType&&t.colSeparationType==="small"){var m=n.havingStyle(Se.SCRIPT).sizeMultiplier;h=.2778*(m/n.sizeMultiplier)}var f=t.colSeparationType==="CD"?at({number:3,unit:"ex"},n):12*p,g=3*p,_=t.arraystretch*f,k=.7*_,b=.3*_,x=0;function M(ue){for(var Le=0;Le<ue.length;++Le)Le>0&&(x+=.25),u.push({pos:x,isDashed:ue[Le]})}for(M(o[0]),r=0;r<t.body.length;++r){var N=t.body[r],E=k,D=b;s<N.length&&(s=N.length);var P=new Array(N.length);for(a=0;a<N.length;++a){var C=je(N[a],n);D<C.depth&&(D=C.depth),E<C.height&&(E=C.height),P[a]=C}var I=t.rowGaps[r],q=0;I&&(q=at(I,n),q>0&&(q+=b,D<q&&(D=q),q=0)),t.addJot&&(D+=g),P.height=E,P.depth=D,x+=E,P.pos=x,x+=D+q,l[r]=P,M(o[r+1])}var Z=x/2+n.fontMetrics().axisHeight,X=t.cols||[],K=[],R,H,G=[];if(t.tags&&t.tags.some(ue=>ue))for(r=0;r<i;++r){var z=l[r],V=z.pos-Z,A=t.tags[r],Y=void 0;A===!0?Y=J.makeSpan(["eqn-num"],[],n):A===!1?Y=J.makeSpan([],[],n):Y=J.makeSpan([],ht(A,n,!0),n),Y.depth=z.depth,Y.height=z.height,G.push({type:"elem",elem:Y,shift:V})}for(a=0,H=0;a<s||H<X.length;++a,++H){for(var ee=X[H]||{},L=!0;ee.type==="separator";){if(L||(R=J.makeSpan(["arraycolsep"],[]),R.style.width=de(n.fontMetrics().doubleRuleSep),K.push(R)),ee.separator==="|"||ee.separator===":"){var se=ee.separator==="|"?"solid":"dashed",ye=J.makeSpan(["vertical-separator"],[],n);ye.style.height=de(x),ye.style.borderRightWidth=de(d),ye.style.borderRightStyle=se,ye.style.margin="0 "+de(-d/2);var ke=x-Z;ke&&(ye.style.verticalAlign=de(-ke)),K.push(ye)}else throw new ce("Invalid separator type: "+ee.separator);H++,ee=X[H]||{},L=!1}if(!(a>=s)){var Ie=void 0;(a>0||t.hskipBeforeAndAfter)&&(Ie=Ee.deflt(ee.pregap,h),Ie!==0&&(R=J.makeSpan(["arraycolsep"],[]),R.style.width=de(Ie),K.push(R)));var Pe=[];for(r=0;r<i;++r){var Ke=l[r],Ge=Ke[a];if(Ge){var nt=Ke.pos-Z;Ge.depth=Ke.depth,Ge.height=Ke.height,Pe.push({type:"elem",elem:Ge,shift:nt})}}Pe=J.makeVList({positionType:"individualShift",children:Pe},n),Pe=J.makeSpan(["col-align-"+(ee.align||"c")],[Pe]),K.push(Pe),(a<s-1||t.hskipBeforeAndAfter)&&(Ie=Ee.deflt(ee.postgap,h),Ie!==0&&(R=J.makeSpan(["arraycolsep"],[]),R.style.width=de(Ie),K.push(R)))}}if(l=J.makeSpan(["mtable"],K),u.length>0){for(var mt=J.makeLineSpan("hline",n,d),Ye=J.makeLineSpan("hdashline",n,d),ie=[{type:"elem",elem:l,shift:0}];u.length>0;){var xe=u.pop(),we=xe.pos-Z;xe.isDashed?ie.push({type:"elem",elem:Ye,shift:we}):ie.push({type:"elem",elem:mt,shift:we})}l=J.makeVList({positionType:"individualShift",children:ie},n)}if(G.length===0)return J.makeSpan(["mord"],[l],n);var Ve=J.makeVList({positionType:"individualShift",children:G},n);return Ve=J.makeSpan(["tag"],[Ve],n),J.makeFragment([l,Ve])},HTe={c:"center ",l:"left ",r:"right "},En=function(t,n){for(var r=[],a=new ae.MathNode("mtd",[],["mtr-glue"]),i=new ae.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<t.body.length;o++){for(var s=t.body[o],l=[],u=0;u<s.length;u++)l.push(new ae.MathNode("mtd",[Xe(s[u],n)]));t.tags&&t.tags[o]&&(l.unshift(a),l.push(a),t.leqno?l.unshift(i):l.push(i)),r.push(new ae.MathNode("mtr",l))}var d=new ae.MathNode("mtable",r),p=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);d.setAttribute("rowspacing",de(p));var h="",m="";if(t.cols&&t.cols.length>0){var f=t.cols,g="",_=!1,k=0,b=f.length;f[0].type==="separator"&&(h+="top ",k=1),f[f.length-1].type==="separator"&&(h+="bottom ",b-=1);for(var x=k;x<b;x++)f[x].type==="align"?(m+=HTe[f[x].align],_&&(g+="none "),_=!0):f[x].type==="separator"&&_&&(g+=f[x].separator==="|"?"solid ":"dashed ",_=!1);d.setAttribute("columnalign",m.trim()),/[sd]/.test(g)&&d.setAttribute("columnlines",g.trim())}if(t.colSeparationType==="align"){for(var M=t.cols||[],N="",E=1;E<M.length;E++)N+=E%2?"0em ":"1em ";d.setAttribute("columnspacing",N.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?d.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?d.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?d.setAttribute("columnspacing","0.5em"):d.setAttribute("columnspacing","1em");var D="",P=t.hLinesBeforeRow;h+=P[0].length>0?"left ":"",h+=P[P.length-1].length>0?"right ":"";for(var C=1;C<P.length-1;C++)D+=P[C].length===0?"none ":P[C][0]?"dashed ":"solid ";return/[sd]/.test(D)&&d.setAttribute("rowlines",D.trim()),h!==""&&(d=new ae.MathNode("menclose",[d]),d.setAttribute("notation",h.trim())),t.arraystretch&&t.arraystretch<1&&(d=new ae.MathNode("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},Y6=function(t,n){t.envName.indexOf("ed")===-1&&Oo(t);var r=[],a=t.envName.indexOf("at")>-1?"alignat":"align",i=t.envName==="split",o=ir(t.parser,{cols:r,addJot:!0,autoTag:i?void 0:Jp(t.envName),emptySingleRow:!0,colSeparationType:a,maxNumCols:i?2:void 0,leqno:t.parser.settings.leqno},"display"),s,l=0,u={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var d="",p=0;p<n[0].body.length;p++){var h=Oe(n[0].body[p],"textord");d+=h.text}s=Number(d),l=s*2}var m=!l;o.body.forEach(function(k){for(var b=1;b<k.length;b+=2){var x=Oe(k[b],"styling"),M=Oe(x.body[0],"ordgroup");M.body.unshift(u)}if(m)l<k.length&&(l=k.length);else{var N=k.length/2;if(s<N)throw new ce("Too many math in a row: "+("expected "+s+", but got "+N),k[0])}});for(var f=0;f<l;++f){var g="r",_=0;f%2===1?g="l":f>0&&m&&(_=1),r[f]={type:"align",align:g,pregap:_,postgap:0}}return o.colSeparationType=m?"align":"alignat",o};xn({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Co(t[0]),r=n?[t[0]]:Oe(t[0],"ordgroup").body,a=r.map(function(o){var s=Kp(o),l=s.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ce("Unknown column alignment: "+l,o)}),i={cols:a,hskipBeforeAndAfter:!0,maxNumCols:a.length};return ir(e.parser,i,eh(e.envName))},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var a=e.parser;if(a.consumeSpaces(),a.fetch().text==="["){if(a.consume(),a.consumeSpaces(),n=a.fetch().text,"lcr".indexOf(n)===-1)throw new ce("Expected l or c or r",a.nextToken);a.consume(),a.consumeSpaces(),a.expect("]"),a.consume(),r.cols=[{type:"align",align:n}]}}var i=ir(e.parser,r,eh(e.envName)),o=Math.max(0,...i.body.map(s=>s.length));return i.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=ir(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Co(t[0]),r=n?[t[0]]:Oe(t[0],"ordgroup").body,a=r.map(function(o){var s=Kp(o),l=s.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new ce("Unknown column alignment: "+l,o)});if(a.length>1)throw new ce("{subarray} can contain only one column");var i={cols:a,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=ir(e.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new ce("{subarray} can contain only one column");return i},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ir(e.parser,t,eh(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y6,htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Ee.contains(["gather","gather*"],e.envName)&&Oo(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Jp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ir(e.parser,t,"display")},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y6,htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Oo(e);var t={autoTag:Jp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ir(e.parser,t,"display")},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Oo(e),TTe(e.parser)},htmlBuilder:wn,mathmlBuilder:En});T("\\nonumber","\\gdef\\@eqnsw{0}");T("\\notag","\\nonumber");me({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new ce(e.funcName+" valid only within array environment")}});var Km=W6;me({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];if(a.type!=="ordgroup")throw new ce("Invalid environment name",a);for(var i="",o=0;o<a.body.length;++o)i+=Oe(a.body[o],"textord").text;if(r==="\\begin"){if(!Km.hasOwnProperty(i))throw new ce("No such environment: "+i,a);var s=Km[i],{args:l,optArgs:u}=n.parseArguments("\\begin{"+i+"}",s),d={mode:n.mode,envName:i,parser:n},p=s.handler(d,l,u);n.expect("\\end",!1);var h=n.nextToken,m=Oe(n.parseFunction(),"environment");if(m.name!==i)throw new ce("Mismatch: \\begin{"+i+"} matched by \\end{"+m.name+"}",h);return p}return{type:"environment",mode:n.mode,name:i,nameGroup:a}}});var Z6=(e,t)=>{var n=e.font,r=t.withFont(n);return je(e.body,r)},X6=(e,t)=>{var n=e.font,r=t.withFont(n);return Xe(e.body,r)},Ym={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};me({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=Yi(t[0]),i=r;return i in Ym&&(i=Ym[i]),{type:"font",mode:n.mode,font:i.slice(1),body:a}},htmlBuilder:Z6,mathmlBuilder:X6});me({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],a=Ee.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Ro(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:a}}});me({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:a}=e,{mode:i}=n,o=n.parseExpression(!0,a),s="math"+r.slice(1);return{type:"font",mode:i,font:s,body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Z6,mathmlBuilder:X6});var Q6=(e,t)=>{var n=t;return e==="display"?n=n.id>=Se.SCRIPT.id?n.text():Se.DISPLAY:e==="text"&&n.size===Se.DISPLAY.size?n=Se.TEXT:e==="script"?n=Se.SCRIPT:e==="scriptscript"&&(n=Se.SCRIPTSCRIPT),n},th=(e,t)=>{var n=Q6(e.size,t.style),r=n.fracNum(),a=n.fracDen(),i;i=t.havingStyle(r);var o=je(e.numer,i,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<l?l:o.depth}i=t.havingStyle(a);var u=je(e.denom,i,t),d,p,h;e.hasBarLine?(e.barSize?(p=at(e.barSize,t),d=J.makeLineSpan("frac-line",t,p)):d=J.makeLineSpan("frac-line",t),p=d.height,h=d.height):(d=null,p=0,h=t.fontMetrics().defaultRuleThickness);var m,f,g;n.size===Se.DISPLAY.size||e.size==="display"?(m=t.fontMetrics().num1,p>0?f=3*h:f=7*h,g=t.fontMetrics().denom1):(p>0?(m=t.fontMetrics().num2,f=h):(m=t.fontMetrics().num3,f=3*h),g=t.fontMetrics().denom2);var _;if(d){var b=t.fontMetrics().axisHeight;m-o.depth-(b+.5*p)<f&&(m+=f-(m-o.depth-(b+.5*p))),b-.5*p-(u.height-g)<f&&(g+=f-(b-.5*p-(u.height-g)));var x=-(b-.5*p);_=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:d,shift:x},{type:"elem",elem:o,shift:-m}]},t)}else{var k=m-o.depth-(u.height-g);k<f&&(m+=.5*(f-k),g+=.5*(f-k)),_=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:o,shift:-m}]},t)}i=t.havingStyle(n),_.height*=i.sizeMultiplier/t.sizeMultiplier,_.depth*=i.sizeMultiplier/t.sizeMultiplier;var M;n.size===Se.DISPLAY.size?M=t.fontMetrics().delim1:n.size===Se.SCRIPTSCRIPT.size?M=t.havingStyle(Se.SCRIPT).fontMetrics().delim2:M=t.fontMetrics().delim2;var N,E;return e.leftDelim==null?N=Ma(t,["mopen"]):N=On.customSizedDelim(e.leftDelim,M,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?E=J.makeSpan([]):e.rightDelim==null?E=Ma(t,["mclose"]):E=On.customSizedDelim(e.rightDelim,M,!0,t.havingStyle(n),e.mode,["mclose"]),J.makeSpan(["mord"].concat(i.sizingClasses(t)),[N,J.makeSpan(["mfrac"],[_]),E],t)},nh=(e,t)=>{var n=new ae.MathNode("mfrac",[Xe(e.numer,t),Xe(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=at(e.barSize,t);n.setAttribute("linethickness",de(r))}var a=Q6(e.size,t.style);if(a.size!==t.style.size){n=new ae.MathNode("mstyle",[n]);var i=a.size===Se.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var o=[];if(e.leftDelim!=null){var s=new ae.MathNode("mo",[new ae.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),o.push(s)}if(o.push(n),e.rightDelim!=null){var l=new ae.MathNode("mo",[new ae.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Gp(o)}return n};me({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=t[1],o,s=null,l=null,u="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,s="(",l=")";break;case"\\\\bracefrac":o=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:a,denom:i,hasBarLine:o,leftDelim:s,rightDelim:l,size:u,barSize:null}},htmlBuilder:th,mathmlBuilder:nh});me({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:a,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});me({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,a;switch(n){case"\\over":a="\\frac";break;case"\\choose":a="\\binom";break;case"\\atop":a="\\\\atopfrac";break;case"\\brace":a="\\\\bracefrac";break;case"\\brack":a="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:a,token:r}}});var Zm=["display","text","script","scriptscript"],Xm=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};me({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],a=t[5],i=Yi(t[0]),o=i.type==="atom"&&i.family==="open"?Xm(i.text):null,s=Yi(t[1]),l=s.type==="atom"&&s.family==="close"?Xm(s.text):null,u=Oe(t[2],"size"),d,p=null;u.isBlank?d=!0:(p=u.value,d=p.number>0);var h="auto",m=t[3];if(m.type==="ordgroup"){if(m.body.length>0){var f=Oe(m.body[0],"textord");h=Zm[Number(f.text)]}}else m=Oe(m,"textord"),h=Zm[Number(m.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:d,barSize:p,leftDelim:o,rightDelim:l,size:h}},htmlBuilder:th,mathmlBuilder:nh});me({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:a}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Oe(t[0],"size").value,token:a}}});me({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=vAe(Oe(t[1],"infix").size),o=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:a,denom:o,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:th,mathmlBuilder:nh});var J6=(e,t)=>{var n=t.style,r,a;e.type==="supsub"?(r=e.sup?je(e.sup,t.havingStyle(n.sup()),t):je(e.sub,t.havingStyle(n.sub()),t),a=Oe(e.base,"horizBrace")):a=Oe(e,"horizBrace");var i=je(a.base,t.havingBaseStyle(Se.DISPLAY)),o=zn.svgSpan(a,t),s;if(a.isOver?(s=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:o}]},t),s.children[0].children[0].children[1].classes.push("svg-align")):(s=J.makeVList({positionType:"bottom",positionData:i.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:i}]},t),s.children[0].children[0].children[0].classes.push("svg-align")),r){var l=J.makeSpan(["mord",a.isOver?"mover":"munder"],[s],t);a.isOver?s=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):s=J.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return J.makeSpan(["mord",a.isOver?"mover":"munder"],[s],t)},jTe=(e,t)=>{var n=zn.mathMLnode(e.label);return new ae.MathNode(e.isOver?"mover":"munder",[Xe(e.base,t),n])};me({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:J6,mathmlBuilder:jTe});me({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],a=Oe(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:n.mode,href:a,body:lt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=ht(e.body,t,!1);return J.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=rr(e.body,t);return n instanceof en||(n=new en("mrow",[n])),n.setAttribute("href",e.href),n}});me({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Oe(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var a=[],i=0;i<r.length;i++){var o=r[i];o==="~"&&(o="\\textasciitilde"),a.push({type:"textord",mode:"text",text:o})}var s={type:"text",mode:n.mode,font:"\\texttt",body:a};return{type:"href",mode:n.mode,href:r,body:lt(s)}}});me({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:lt(t[0])}},htmlBuilder(e,t){var n=ht(e.body,t,!1);return J.makeFragment(n)},mathmlBuilder(e,t){return new ae.MathNode("mrow",Pt(e.body,t))}});me({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:a}=e,i=Oe(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,l={};switch(r){case"\\htmlClass":l.class=i,s={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,s={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,s={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),d=0;d<u.length;d++){var p=u[d].split("=");if(p.length!==2)throw new ce("Error parsing key-value for \\htmlData");l["data-"+p[0].trim()]=p[1].trim()}s={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(s)?{type:"html",mode:n.mode,attributes:l,body:lt(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=ht(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var a=J.makeSpan(r,n,t);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&a.setAttribute(i,e.attributes[i]);return a},mathmlBuilder:(e,t)=>rr(e.body,t)});me({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:lt(t[0]),mathml:lt(t[1])}},htmlBuilder:(e,t)=>{var n=ht(e.html,t,!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>rr(e.mathml,t)});var zs=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new ce("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!b6(r))throw new ce("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};me({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,a={number:0,unit:"em"},i={number:.9,unit:"em"},o={number:0,unit:"em"},s="";if(n[0])for(var l=Oe(n[0],"raw").string,u=l.split(","),d=0;d<u.length;d++){var p=u[d].split("=");if(p.length===2){var h=p[1].trim();switch(p[0].trim()){case"alt":s=h;break;case"width":a=zs(h);break;case"height":i=zs(h);break;case"totalheight":o=zs(h);break;default:throw new ce("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var m=Oe(t[0],"url").url;return s===""&&(s=m,s=s.replace(/^.*[\\/]/,""),s=s.substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:m})?{type:"includegraphics",mode:r.mode,alt:s,width:a,height:i,totalheight:o,src:m}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=at(e.height,t),r=0;e.totalheight.number>0&&(r=at(e.totalheight,t)-n);var a=0;e.width.number>0&&(a=at(e.width,t));var i={height:de(n+r)};a>0&&(i.width=de(a)),r>0&&(i.verticalAlign=de(-r));var o=new jAe(e.src,e.alt,i);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new ae.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=at(e.height,t),a=0;if(e.totalheight.number>0&&(a=at(e.totalheight,t)-r,n.setAttribute("valign",de(-a))),n.setAttribute("height",de(r+a)),e.width.number>0){var i=at(e.width,t);n.setAttribute("width",de(i))}return n.setAttribute("src",e.src),n}});me({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,a=Oe(t[0],"size");if(n.settings.strict){var i=r[1]==="m",o=a.value.unit==="mu";i?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+a.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:a.value}},htmlBuilder(e,t){return J.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=at(e.dimension,t);return new ae.SpaceNode(n)}});me({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:a}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=J.makeSpan([],[je(e.body,t)]),n=J.makeSpan(["inner"],[n],t)):n=J.makeSpan(["inner"],[je(e.body,t)]);var r=J.makeSpan(["fix"],[]),a=J.makeSpan([e.alignment],[n,r],t),i=J.makeSpan(["strut"]);return i.style.height=de(a.height+a.depth),a.depth&&(i.style.verticalAlign=de(-a.depth)),a.children.unshift(i),a=J.makeSpan(["thinbox"],[a],t),J.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:(e,t)=>{var n=new ae.MathNode("mpadded",[Xe(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});me({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,a=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",o=r.parseExpression(!1,i);return r.expect(i),r.switchMode(a),{type:"styling",mode:r.mode,style:"text",body:o}}});me({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new ce("Mismatched "+e.funcName)}});var Qm=(e,t)=>{switch(t.style.size){case Se.DISPLAY.size:return e.display;case Se.TEXT.size:return e.text;case Se.SCRIPT.size:return e.script;case Se.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};me({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:lt(t[0]),text:lt(t[1]),script:lt(t[2]),scriptscript:lt(t[3])}},htmlBuilder:(e,t)=>{var n=Qm(e,t),r=ht(n,t,!1);return J.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Qm(e,t);return rr(n,t)}});var e8=(e,t,n,r,a,i,o)=>{e=J.makeSpan([],[e]);var s=n&&Ee.isCharacterBox(n),l,u;if(t){var d=je(t,r.havingStyle(a.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var p=je(n,r.havingStyle(a.sub()),r);l={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var h;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+o;h=J.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:de(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:de(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(l){var f=e.height-o;h=J.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:de(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]},r)}else if(u){var g=e.depth+o;h=J.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:de(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return e;var _=[h];if(l&&i!==0&&!s){var k=J.makeSpan(["mspace"],[],r);k.style.marginRight=de(i),_.unshift(k)}return J.makeSpan(["mop","op-limits"],_,r)},t8=["\\smallint"],Yr=(e,t)=>{var n,r,a=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Oe(e.base,"op"),a=!0):i=Oe(e,"op");var o=t.style,s=!1;o.size===Se.DISPLAY.size&&i.symbol&&!Ee.contains(t8,i.name)&&(s=!0);var l;if(i.symbol){var u=s?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=J.makeSymbol(i.name,u,"math",t,["mop","op-symbol",s?"large-op":"small-op"]),d.length>0){var p=l.italic,h=J.staticSvg(d+"Size"+(s?"2":"1"),t);l=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:s?.08:0}]},t),i.name="\\"+d,l.classes.unshift("mop"),l.italic=p}}else if(i.body){var m=ht(i.body,t,!0);m.length===1&&m[0]instanceof rn?(l=m[0],l.classes[0]="mop"):l=J.makeSpan(["mop"],m,t)}else{for(var f=[],g=1;g<i.name.length;g++)f.push(J.mathsym(i.name[g],i.mode,t));l=J.makeSpan(["mop"],f,t)}var _=0,k=0;return(l instanceof rn||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(_=(l.height-l.depth)/2-t.fontMetrics().axisHeight,k=l.italic),a?e8(l,n,r,t,o,k,_):(_&&(l.style.position="relative",l.style.top=de(_)),l)},qa=(e,t)=>{var n;if(e.symbol)n=new en("mo",[an(e.name,e.mode)]),Ee.contains(t8,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new en("mo",Pt(e.body,t));else{n=new en("mi",[new pa(e.name.slice(1))]);var r=new en("mo",[an("","text")]);e.parentIsSupSub?n=new en("mrow",[n,r]):n=T6([n,r])}return n},VTe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};me({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=r;return a.length===1&&(a=VTe[a]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:Yr,mathmlBuilder:qa});me({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:lt(r)}},htmlBuilder:Yr,mathmlBuilder:qa});var GTe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};me({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Yr,mathmlBuilder:qa});me({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Yr,mathmlBuilder:qa});me({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=GTe[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Yr,mathmlBuilder:qa});var n8=(e,t)=>{var n,r,a=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Oe(e.base,"operatorname"),a=!0):i=Oe(e,"operatorname");var o;if(i.body.length>0){for(var s=i.body.map(p=>{var h=p.text;return typeof h=="string"?{type:"textord",mode:p.mode,text:h}:p}),l=ht(s,t.withFont("mathrm"),!0),u=0;u<l.length;u++){var d=l[u];d instanceof rn&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=J.makeSpan(["mop"],l,t)}else o=J.makeSpan(["mop"],[],t);return a?e8(o,n,r,t,t.style,0,0):o},WTe=(e,t)=>{for(var n=Pt(e.body,t.withFont("mathrm")),r=!0,a=0;a<n.length;a++){var i=n[a];if(!(i instanceof ae.SpaceNode))if(i instanceof ae.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=i.children[0];i.children.length===1&&o instanceof ae.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var s=n.map(d=>d.toText()).join("");n=[new ae.TextNode(s)]}var l=new ae.MathNode("mi",n);l.setAttribute("mathvariant","normal");var u=new ae.MathNode("mo",[an("","text")]);return e.parentIsSupSub?new ae.MathNode("mrow",[l,u]):ae.newDocumentFragment([l,u])};me({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"operatorname",mode:n.mode,body:lt(a),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:n8,mathmlBuilder:WTe});T("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");vr({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?J.makeFragment(ht(e.body,t,!1)):J.makeSpan(["mord"],ht(e.body,t,!0),t)},mathmlBuilder(e,t){return rr(e.body,t,!0)}});me({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=je(e.body,t.havingCrampedStyle()),r=J.makeLineSpan("overline-line",t),a=t.fontMetrics().defaultRuleThickness,i=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r},{type:"kern",size:a}]},t);return J.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new ae.MathNode("mo",[new ae.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ae.MathNode("mover",[Xe(e.body,t),n]);return r.setAttribute("accent","true"),r}});me({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:lt(r)}},htmlBuilder:(e,t)=>{var n=ht(e.body,t.withPhantom(),!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Pt(e.body,t);return new ae.MathNode("mphantom",n)}});me({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=J.makeSpan([],[je(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),J.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Pt(lt(e.body),t),r=new ae.MathNode("mphantom",n),a=new ae.MathNode("mpadded",[r]);return a.setAttribute("height","0px"),a.setAttribute("depth","0px"),a}});me({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=J.makeSpan(["inner"],[je(e.body,t.withPhantom())]),r=J.makeSpan(["fix"],[]);return J.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Pt(lt(e.body),t),r=new ae.MathNode("mphantom",n),a=new ae.MathNode("mpadded",[r]);return a.setAttribute("width","0px"),a}});me({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Oe(t[0],"size").value,a=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:a}},htmlBuilder(e,t){var n=je(e.body,t),r=at(e.dy,t);return J.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new ae.MathNode("mpadded",[Xe(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});me({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});me({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,a=n[0],i=Oe(t[0],"size"),o=Oe(t[1],"size");return{type:"rule",mode:r.mode,shift:a&&Oe(a,"size").value,width:i.value,height:o.value}},htmlBuilder(e,t){var n=J.makeSpan(["mord","rule"],[],t),r=at(e.width,t),a=at(e.height,t),i=e.shift?at(e.shift,t):0;return n.style.borderRightWidth=de(r),n.style.borderTopWidth=de(a),n.style.bottom=de(i),n.width=r,n.height=a+i,n.depth=-i,n.maxFontSize=a*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=at(e.width,t),r=at(e.height,t),a=e.shift?at(e.shift,t):0,i=t.color&&t.getColor()||"black",o=new ae.MathNode("mspace");o.setAttribute("mathbackground",i),o.setAttribute("width",de(n)),o.setAttribute("height",de(r));var s=new ae.MathNode("mpadded",[o]);return a>=0?s.setAttribute("height",de(a)):(s.setAttribute("height",de(a)),s.setAttribute("depth",de(-a))),s.setAttribute("voffset",de(a)),s}});function r8(e,t,n){for(var r=ht(e,t,!1),a=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var o=r[i].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[o+1]==="reset-size"+t.size&&(r[i].classes[o+1]="reset-size"+n.size),r[i].height*=a,r[i].depth*=a}return J.makeFragment(r)}var Jm=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],KTe=(e,t)=>{var n=t.havingSize(e.size);return r8(e.body,n,t)};me({type:"sizing",names:Jm,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:a}=e,i=a.parseExpression(!1,n);return{type:"sizing",mode:a.mode,size:Jm.indexOf(r)+1,body:i}},htmlBuilder:KTe,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Pt(e.body,n),a=new ae.MathNode("mstyle",r);return a.setAttribute("mathsize",de(n.sizeMultiplier)),a}});me({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,a=!1,i=!1,o=n[0]&&Oe(n[0],"ordgroup");if(o)for(var s="",l=0;l<o.body.length;++l){var u=o.body[l];if(s=u.text,s==="t")a=!0;else if(s==="b")i=!0;else{a=!1,i=!1;break}}else a=!0,i=!0;var d=t[0];return{type:"smash",mode:r.mode,body:d,smashHeight:a,smashDepth:i}},htmlBuilder:(e,t)=>{var n=J.makeSpan([],[je(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var a=0;a<n.children.length;a++)n.children[a].depth=0;var i=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return J.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new ae.MathNode("mpadded",[Xe(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});me({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,a=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:a}},htmlBuilder(e,t){var n=je(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=J.wrapFragment(n,t);var r=t.fontMetrics(),a=r.defaultRuleThickness,i=a;t.style.id<Se.TEXT.id&&(i=t.fontMetrics().xHeight);var o=a+i/4,s=n.height+n.depth+o+a,{span:l,ruleWidth:u,advanceWidth:d}=On.sqrtImage(s,t),p=l.height-u;p>n.height+n.depth+o&&(o=(o+p-n.height-n.depth)/2);var h=l.height-n.height-o-u;n.style.paddingLeft=de(d);var m=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:l},{type:"kern",size:u}]},t);if(e.index){var f=t.havingStyle(Se.SCRIPTSCRIPT),g=je(e.index,f,t),_=.6*(m.height-m.depth),k=J.makeVList({positionType:"shift",positionData:-_,children:[{type:"elem",elem:g}]},t),b=J.makeSpan(["root"],[k]);return J.makeSpan(["mord","sqrt"],[b,m],t)}else return J.makeSpan(["mord","sqrt"],[m],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new ae.MathNode("mroot",[Xe(n,t),Xe(r,t)]):new ae.MathNode("msqrt",[Xe(n,t)])}});var ef={display:Se.DISPLAY,text:Se.TEXT,script:Se.SCRIPT,scriptscript:Se.SCRIPTSCRIPT};me({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:a}=e,i=a.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:a.mode,style:o,body:i}},htmlBuilder(e,t){var n=ef[e.style],r=t.havingStyle(n).withFont("");return r8(e.body,r,t)},mathmlBuilder(e,t){var n=ef[e.style],r=t.havingStyle(n),a=Pt(e.body,r),i=new ae.MathNode("mstyle",a),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=o[e.style];return i.setAttribute("scriptlevel",s[0]),i.setAttribute("displaystyle",s[1]),i}});var YTe=function(t,n){var r=t.base;if(r)if(r.type==="op"){var a=r.limits&&(n.style.size===Se.DISPLAY.size||r.alwaysHandleSupSub);return a?Yr:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Se.DISPLAY.size||r.limits);return i?n8:null}else{if(r.type==="accent")return Ee.isCharacterBox(r.base)?Yp:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?J6:null}else return null}else return null};vr({type:"supsub",htmlBuilder(e,t){var n=YTe(e,t);if(n)return n(e,t);var{base:r,sup:a,sub:i}=e,o=je(r,t),s,l,u=t.fontMetrics(),d=0,p=0,h=r&&Ee.isCharacterBox(r);if(a){var m=t.havingStyle(t.style.sup());s=je(a,m,t),h||(d=o.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(i){var f=t.havingStyle(t.style.sub());l=je(i,f,t),h||(p=o.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}var g;t.style===Se.DISPLAY?g=u.sup1:t.style.cramped?g=u.sup3:g=u.sup2;var _=t.sizeMultiplier,k=de(.5/u.ptPerEm/_),b=null;if(l){var x=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(o instanceof rn||x)&&(b=de(-o.italic))}var M;if(s&&l){d=Math.max(d,g,s.depth+.25*u.xHeight),p=Math.max(p,u.sub2);var N=u.defaultRuleThickness,E=4*N;if(d-s.depth-(l.height-p)<E){p=E-(d-s.depth)+l.height;var D=.8*u.xHeight-(d-s.depth);D>0&&(d+=D,p-=D)}var P=[{type:"elem",elem:l,shift:p,marginRight:k,marginLeft:b},{type:"elem",elem:s,shift:-d,marginRight:k}];M=J.makeVList({positionType:"individualShift",children:P},t)}else if(l){p=Math.max(p,u.sub1,l.height-.8*u.xHeight);var C=[{type:"elem",elem:l,marginLeft:b,marginRight:k}];M=J.makeVList({positionType:"shift",positionData:p,children:C},t)}else if(s)d=Math.max(d,g,s.depth+.25*u.xHeight),M=J.makeVList({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:k}]},t);else throw new Error("supsub must have either sup or sub.");var I=Id(o,"right")||"mord";return J.makeSpan([I],[o,J.makeSpan(["msupsub"],[M])],t)},mathmlBuilder(e,t){var n=!1,r,a;e.base&&e.base.type==="horizBrace"&&(a=!!e.sup,a===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[Xe(e.base,t)];e.sub&&i.push(Xe(e.sub,t)),e.sup&&i.push(Xe(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&t.style===Se.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Se.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Se.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Se.DISPLAY)?o="munder":o="msub"}else{var s=e.base;s&&s.type==="op"&&s.limits&&(t.style===Se.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||t.style===Se.DISPLAY)?o="mover":o="msup"}return new ae.MathNode(o,i)}});vr({type:"atom",htmlBuilder(e,t){return J.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new ae.MathNode("mo",[an(e.text,e.mode)]);if(e.family==="bin"){var r=Wp(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var a8={mi:"italic",mn:"normal",mtext:"normal"};vr({type:"mathord",htmlBuilder(e,t){return J.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new ae.MathNode("mi",[an(e.text,e.mode,t)]),r=Wp(e,t)||"italic";return r!==a8[n.type]&&n.setAttribute("mathvariant",r),n}});vr({type:"textord",htmlBuilder(e,t){return J.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=an(e.text,e.mode,t),r=Wp(e,t)||"normal",a;return e.mode==="text"?a=new ae.MathNode("mtext",[n]):/[0-9]/.test(e.text)?a=new ae.MathNode("mn",[n]):e.text==="\\prime"?a=new ae.MathNode("mo",[n]):a=new ae.MathNode("mi",[n]),r!==a8[a.type]&&a.setAttribute("mathvariant",r),a}});var $s={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Fs={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vr({type:"spacing",htmlBuilder(e,t){if(Fs.hasOwnProperty(e.text)){var n=Fs[e.text].className||"";if(e.mode==="text"){var r=J.makeOrd(e,t,"textord");return r.classes.push(n),r}else return J.makeSpan(["mspace",n],[J.mathsym(e.text,e.mode,t)],t)}else{if($s.hasOwnProperty(e.text))return J.makeSpan(["mspace",$s[e.text]],[],t);throw new ce('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Fs.hasOwnProperty(e.text))n=new ae.MathNode("mtext",[new ae.TextNode(" ")]);else{if($s.hasOwnProperty(e.text))return new ae.MathNode("mspace");throw new ce('Unknown type of space "'+e.text+'"')}return n}});var tf=()=>{var e=new ae.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};vr({type:"tag",mathmlBuilder(e,t){var n=new ae.MathNode("mtable",[new ae.MathNode("mtr",[tf(),new ae.MathNode("mtd",[rr(e.body,t)]),tf(),new ae.MathNode("mtd",[rr(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var nf={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},rf={"\\textbf":"textbf","\\textmd":"textmd"},ZTe={"\\textit":"textit","\\textup":"textup"},af=(e,t)=>{var n=e.font;if(n){if(nf[n])return t.withTextFontFamily(nf[n]);if(rf[n])return t.withTextFontWeight(rf[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(ZTe[n])};me({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"text",mode:n.mode,body:lt(a),font:r}},htmlBuilder(e,t){var n=af(e,t),r=ht(e.body,n,!0);return J.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=af(e,t);return rr(e.body,n)}});me({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=je(e.body,t),r=J.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=J.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:a},{type:"elem",elem:r},{type:"kern",size:3*a},{type:"elem",elem:n}]},t);return J.makeSpan(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new ae.MathNode("mo",[new ae.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ae.MathNode("munder",[Xe(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});me({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=je(e.body,t),r=t.fontMetrics().axisHeight,a=.5*(n.height-r-(n.depth+r));return J.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new ae.MathNode("mpadded",[Xe(e.body,t)],["vcenter"])}});me({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new ce("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=of(e),r=[],a=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var o=n[i];o==="~"&&(o="\\textasciitilde"),r.push(J.makeSymbol(o,"Typewriter-Regular",e.mode,a,["mord","texttt"]))}return J.makeSpan(["mord","text"].concat(a.sizingClasses(t)),J.tryCombineChars(r),a)},mathmlBuilder(e,t){var n=new ae.TextNode(of(e)),r=new ae.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var of=e=>e.body.replace(/ /g,e.star?"␣":" "),Wn=N6,i8=`[ \r
|
|
8582
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Fa{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return Ee.contains(this.classes,t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){var t=n=>n.toText();return this.children.map(t).join("")}}var bn={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Ja={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Im={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function qAe(e,t){bn[e]=t}function Hp(e,t,n){if(!bn[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),a=bn[t][r];if(!a&&e[0]in Im&&(r=Im[e[0]].charCodeAt(0),a=bn[t][r]),!a&&n==="text"&&y6(r)&&(a=bn[t][77]),a)return{depth:a[0],height:a[1],italic:a[2],skew:a[3],width:a[4]}}var Ss={};function BAe(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Ss[t]){var n=Ss[t]={cssEmPerMu:Ja.quad[t]/18};for(var r in Ja)Ja.hasOwnProperty(r)&&(n[r]=Ja[r][t])}return Ss[t]}var UAe=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Om=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Lm=function(t,n){return n.size<2?t:UAe[t-1][n.size-1]};class Nn{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Nn.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Om[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return new Nn(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Lm(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Om[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Lm(Nn.BASESIZE,t);return this.size===n&&this.textSize===Nn.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Nn.BASESIZE?["sizing","reset-size"+this.size,"size"+Nn.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=BAe(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Nn.BASESIZE=6;var Td={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},HAe={ex:!0,em:!0,mu:!0},b6=function(t){return typeof t!="string"&&(t=t.unit),t in Td||t in HAe||t==="ex"},at=function(t,n){var r;if(t.unit in Td)r=Td[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var a;if(n.style.isTight()?a=n.havingStyle(n.style.text()):a=n,t.unit==="ex")r=a.fontMetrics().xHeight;else if(t.unit==="em")r=a.fontMetrics().quad;else throw new ce("Invalid unit: '"+t.unit+"'");a!==n&&(r*=a.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},de=function(t){return+t.toFixed(4)+"em"},tr=function(t){return t.filter(n=>n).join(" ")},k6=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var a=n.getColor();a&&(this.style.color=a)}},v6=function(t){var n=document.createElement(t);n.className=tr(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var a in this.attributes)this.attributes.hasOwnProperty(a)&&n.setAttribute(a,this.attributes[a]);for(var i=0;i<this.children.length;i++)n.appendChild(this.children[i].toNode());return n},_6=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Ee.escape(tr(this.classes))+'"');var r="";for(var a in this.style)this.style.hasOwnProperty(a)&&(r+=Ee.hyphenate(a)+":"+this.style[a]+";");r&&(n+=' style="'+Ee.escape(r)+'"');for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&(n+=" "+i+'="'+Ee.escape(this.attributes[i])+'"');n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class Pa{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,k6.call(this,t,r,a),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return Ee.contains(this.classes,t)}toNode(){return v6.call(this,"span")}toMarkup(){return _6.call(this,"span")}}class jp{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,k6.call(this,n,a),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return Ee.contains(this.classes,t)}toNode(){return v6.call(this,"a")}toMarkup(){return _6.call(this,"a")}}class jAe{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.style=r}hasClass(t){return Ee.contains(this.classes,t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);return t}toMarkup(){var t='<img src="'+Ee.escape(this.src)+'"'+(' alt="'+Ee.escape(this.alt)+'"'),n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Ee.hyphenate(r)+":"+this.style[r]+";");return n&&(t+=' style="'+Ee.escape(n)+'"'),t+="'/>",t}}var VAe={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class rn{constructor(t,n,r,a,i,o,s,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=a||0,this.skew=i||0,this.width=o||0,this.classes=s||[],this.style=l||{},this.maxFontSize=0;var u=TAe(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=VAe[this.text])}hasClass(t){return Ee.contains(this.classes,t)}toNode(){var t=document.createTextNode(this.text),n=null;this.italic>0&&(n=document.createElement("span"),n.style.marginRight=de(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=tr(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Ee.escape(tr(this.classes)),n+='"');var r="";this.italic>0&&(r+="margin-right:"+this.italic+"em;");for(var a in this.style)this.style.hasOwnProperty(a)&&(r+=Ee.hyphenate(a)+":"+this.style[a]+";");r&&(t=!0,n+=' style="'+Ee.escape(r)+'"');var i=Ee.escape(this.text);return t?(n+=">",n+=i,n+="</span>",n):i}}class Ln{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ee.escape(this.attributes[n])+'"');t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</svg>",t}}class nr{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Rm[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Ee.escape(this.alternate)+'"/>':'<path d="'+Ee.escape(Rm[this.pathName])+'"/>'}}class Cd{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var t="<line";for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="'+Ee.escape(this.attributes[n])+'"');return t+="/>",t}}function Dm(e){if(e instanceof rn)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function GAe(e){if(e instanceof Pa)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var WAe={bin:1,close:1,inner:1,open:1,punct:1,rel:1},KAe={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Qe={math:{},text:{}};function y(e,t,n,r,a,i){Qe[e][a]={font:t,group:n,replace:r},i&&r&&(Qe[e][r]=Qe[e][a])}var v="math",ne="text",S="main",$="ams",tt="accent-token",ge="bin",Rt="close",Kr="inner",Me="mathord",pt="op-token",Kt="open",Ao="punct",F="rel",Pn="spacing",W="textord";y(v,S,F,"≡","\\equiv",!0);y(v,S,F,"≺","\\prec",!0);y(v,S,F,"≻","\\succ",!0);y(v,S,F,"∼","\\sim",!0);y(v,S,F,"⊥","\\perp");y(v,S,F,"⪯","\\preceq",!0);y(v,S,F,"⪰","\\succeq",!0);y(v,S,F,"≃","\\simeq",!0);y(v,S,F,"∣","\\mid",!0);y(v,S,F,"≪","\\ll",!0);y(v,S,F,"≫","\\gg",!0);y(v,S,F,"≍","\\asymp",!0);y(v,S,F,"∥","\\parallel");y(v,S,F,"⋈","\\bowtie",!0);y(v,S,F,"⌣","\\smile",!0);y(v,S,F,"⊑","\\sqsubseteq",!0);y(v,S,F,"⊒","\\sqsupseteq",!0);y(v,S,F,"≐","\\doteq",!0);y(v,S,F,"⌢","\\frown",!0);y(v,S,F,"∋","\\ni",!0);y(v,S,F,"∝","\\propto",!0);y(v,S,F,"⊢","\\vdash",!0);y(v,S,F,"⊣","\\dashv",!0);y(v,S,F,"∋","\\owns");y(v,S,Ao,".","\\ldotp");y(v,S,Ao,"⋅","\\cdotp");y(v,S,W,"#","\\#");y(ne,S,W,"#","\\#");y(v,S,W,"&","\\&");y(ne,S,W,"&","\\&");y(v,S,W,"ℵ","\\aleph",!0);y(v,S,W,"∀","\\forall",!0);y(v,S,W,"ℏ","\\hbar",!0);y(v,S,W,"∃","\\exists",!0);y(v,S,W,"∇","\\nabla",!0);y(v,S,W,"♭","\\flat",!0);y(v,S,W,"ℓ","\\ell",!0);y(v,S,W,"♮","\\natural",!0);y(v,S,W,"♣","\\clubsuit",!0);y(v,S,W,"℘","\\wp",!0);y(v,S,W,"♯","\\sharp",!0);y(v,S,W,"♢","\\diamondsuit",!0);y(v,S,W,"ℜ","\\Re",!0);y(v,S,W,"♡","\\heartsuit",!0);y(v,S,W,"ℑ","\\Im",!0);y(v,S,W,"♠","\\spadesuit",!0);y(v,S,W,"§","\\S",!0);y(ne,S,W,"§","\\S");y(v,S,W,"¶","\\P",!0);y(ne,S,W,"¶","\\P");y(v,S,W,"†","\\dag");y(ne,S,W,"†","\\dag");y(ne,S,W,"†","\\textdagger");y(v,S,W,"‡","\\ddag");y(ne,S,W,"‡","\\ddag");y(ne,S,W,"‡","\\textdaggerdbl");y(v,S,Rt,"⎱","\\rmoustache",!0);y(v,S,Kt,"⎰","\\lmoustache",!0);y(v,S,Rt,"⟯","\\rgroup",!0);y(v,S,Kt,"⟮","\\lgroup",!0);y(v,S,ge,"∓","\\mp",!0);y(v,S,ge,"⊖","\\ominus",!0);y(v,S,ge,"⊎","\\uplus",!0);y(v,S,ge,"⊓","\\sqcap",!0);y(v,S,ge,"∗","\\ast");y(v,S,ge,"⊔","\\sqcup",!0);y(v,S,ge,"◯","\\bigcirc",!0);y(v,S,ge,"∙","\\bullet",!0);y(v,S,ge,"‡","\\ddagger");y(v,S,ge,"≀","\\wr",!0);y(v,S,ge,"⨿","\\amalg");y(v,S,ge,"&","\\And");y(v,S,F,"⟵","\\longleftarrow",!0);y(v,S,F,"⇐","\\Leftarrow",!0);y(v,S,F,"⟸","\\Longleftarrow",!0);y(v,S,F,"⟶","\\longrightarrow",!0);y(v,S,F,"⇒","\\Rightarrow",!0);y(v,S,F,"⟹","\\Longrightarrow",!0);y(v,S,F,"↔","\\leftrightarrow",!0);y(v,S,F,"⟷","\\longleftrightarrow",!0);y(v,S,F,"⇔","\\Leftrightarrow",!0);y(v,S,F,"⟺","\\Longleftrightarrow",!0);y(v,S,F,"↦","\\mapsto",!0);y(v,S,F,"⟼","\\longmapsto",!0);y(v,S,F,"↗","\\nearrow",!0);y(v,S,F,"↩","\\hookleftarrow",!0);y(v,S,F,"↪","\\hookrightarrow",!0);y(v,S,F,"↘","\\searrow",!0);y(v,S,F,"↼","\\leftharpoonup",!0);y(v,S,F,"⇀","\\rightharpoonup",!0);y(v,S,F,"↙","\\swarrow",!0);y(v,S,F,"↽","\\leftharpoondown",!0);y(v,S,F,"⇁","\\rightharpoondown",!0);y(v,S,F,"↖","\\nwarrow",!0);y(v,S,F,"⇌","\\rightleftharpoons",!0);y(v,$,F,"≮","\\nless",!0);y(v,$,F,"","\\@nleqslant");y(v,$,F,"","\\@nleqq");y(v,$,F,"⪇","\\lneq",!0);y(v,$,F,"≨","\\lneqq",!0);y(v,$,F,"","\\@lvertneqq");y(v,$,F,"⋦","\\lnsim",!0);y(v,$,F,"⪉","\\lnapprox",!0);y(v,$,F,"⊀","\\nprec",!0);y(v,$,F,"⋠","\\npreceq",!0);y(v,$,F,"⋨","\\precnsim",!0);y(v,$,F,"⪹","\\precnapprox",!0);y(v,$,F,"≁","\\nsim",!0);y(v,$,F,"","\\@nshortmid");y(v,$,F,"∤","\\nmid",!0);y(v,$,F,"⊬","\\nvdash",!0);y(v,$,F,"⊭","\\nvDash",!0);y(v,$,F,"⋪","\\ntriangleleft");y(v,$,F,"⋬","\\ntrianglelefteq",!0);y(v,$,F,"⊊","\\subsetneq",!0);y(v,$,F,"","\\@varsubsetneq");y(v,$,F,"⫋","\\subsetneqq",!0);y(v,$,F,"","\\@varsubsetneqq");y(v,$,F,"≯","\\ngtr",!0);y(v,$,F,"","\\@ngeqslant");y(v,$,F,"","\\@ngeqq");y(v,$,F,"⪈","\\gneq",!0);y(v,$,F,"≩","\\gneqq",!0);y(v,$,F,"","\\@gvertneqq");y(v,$,F,"⋧","\\gnsim",!0);y(v,$,F,"⪊","\\gnapprox",!0);y(v,$,F,"⊁","\\nsucc",!0);y(v,$,F,"⋡","\\nsucceq",!0);y(v,$,F,"⋩","\\succnsim",!0);y(v,$,F,"⪺","\\succnapprox",!0);y(v,$,F,"≆","\\ncong",!0);y(v,$,F,"","\\@nshortparallel");y(v,$,F,"∦","\\nparallel",!0);y(v,$,F,"⊯","\\nVDash",!0);y(v,$,F,"⋫","\\ntriangleright");y(v,$,F,"⋭","\\ntrianglerighteq",!0);y(v,$,F,"","\\@nsupseteqq");y(v,$,F,"⊋","\\supsetneq",!0);y(v,$,F,"","\\@varsupsetneq");y(v,$,F,"⫌","\\supsetneqq",!0);y(v,$,F,"","\\@varsupsetneqq");y(v,$,F,"⊮","\\nVdash",!0);y(v,$,F,"⪵","\\precneqq",!0);y(v,$,F,"⪶","\\succneqq",!0);y(v,$,F,"","\\@nsubseteqq");y(v,$,ge,"⊴","\\unlhd");y(v,$,ge,"⊵","\\unrhd");y(v,$,F,"↚","\\nleftarrow",!0);y(v,$,F,"↛","\\nrightarrow",!0);y(v,$,F,"⇍","\\nLeftarrow",!0);y(v,$,F,"⇏","\\nRightarrow",!0);y(v,$,F,"↮","\\nleftrightarrow",!0);y(v,$,F,"⇎","\\nLeftrightarrow",!0);y(v,$,F,"△","\\vartriangle");y(v,$,W,"ℏ","\\hslash");y(v,$,W,"▽","\\triangledown");y(v,$,W,"◊","\\lozenge");y(v,$,W,"Ⓢ","\\circledS");y(v,$,W,"®","\\circledR");y(ne,$,W,"®","\\circledR");y(v,$,W,"∡","\\measuredangle",!0);y(v,$,W,"∄","\\nexists");y(v,$,W,"℧","\\mho");y(v,$,W,"Ⅎ","\\Finv",!0);y(v,$,W,"⅁","\\Game",!0);y(v,$,W,"‵","\\backprime");y(v,$,W,"▲","\\blacktriangle");y(v,$,W,"▼","\\blacktriangledown");y(v,$,W,"■","\\blacksquare");y(v,$,W,"⧫","\\blacklozenge");y(v,$,W,"★","\\bigstar");y(v,$,W,"∢","\\sphericalangle",!0);y(v,$,W,"∁","\\complement",!0);y(v,$,W,"ð","\\eth",!0);y(ne,S,W,"ð","ð");y(v,$,W,"╱","\\diagup");y(v,$,W,"╲","\\diagdown");y(v,$,W,"□","\\square");y(v,$,W,"□","\\Box");y(v,$,W,"◊","\\Diamond");y(v,$,W,"¥","\\yen",!0);y(ne,$,W,"¥","\\yen",!0);y(v,$,W,"✓","\\checkmark",!0);y(ne,$,W,"✓","\\checkmark");y(v,$,W,"ℶ","\\beth",!0);y(v,$,W,"ℸ","\\daleth",!0);y(v,$,W,"ℷ","\\gimel",!0);y(v,$,W,"ϝ","\\digamma",!0);y(v,$,W,"ϰ","\\varkappa");y(v,$,Kt,"┌","\\@ulcorner",!0);y(v,$,Rt,"┐","\\@urcorner",!0);y(v,$,Kt,"└","\\@llcorner",!0);y(v,$,Rt,"┘","\\@lrcorner",!0);y(v,$,F,"≦","\\leqq",!0);y(v,$,F,"⩽","\\leqslant",!0);y(v,$,F,"⪕","\\eqslantless",!0);y(v,$,F,"≲","\\lesssim",!0);y(v,$,F,"⪅","\\lessapprox",!0);y(v,$,F,"≊","\\approxeq",!0);y(v,$,ge,"⋖","\\lessdot");y(v,$,F,"⋘","\\lll",!0);y(v,$,F,"≶","\\lessgtr",!0);y(v,$,F,"⋚","\\lesseqgtr",!0);y(v,$,F,"⪋","\\lesseqqgtr",!0);y(v,$,F,"≑","\\doteqdot");y(v,$,F,"≓","\\risingdotseq",!0);y(v,$,F,"≒","\\fallingdotseq",!0);y(v,$,F,"∽","\\backsim",!0);y(v,$,F,"⋍","\\backsimeq",!0);y(v,$,F,"⫅","\\subseteqq",!0);y(v,$,F,"⋐","\\Subset",!0);y(v,$,F,"⊏","\\sqsubset",!0);y(v,$,F,"≼","\\preccurlyeq",!0);y(v,$,F,"⋞","\\curlyeqprec",!0);y(v,$,F,"≾","\\precsim",!0);y(v,$,F,"⪷","\\precapprox",!0);y(v,$,F,"⊲","\\vartriangleleft");y(v,$,F,"⊴","\\trianglelefteq");y(v,$,F,"⊨","\\vDash",!0);y(v,$,F,"⊪","\\Vvdash",!0);y(v,$,F,"⌣","\\smallsmile");y(v,$,F,"⌢","\\smallfrown");y(v,$,F,"≏","\\bumpeq",!0);y(v,$,F,"≎","\\Bumpeq",!0);y(v,$,F,"≧","\\geqq",!0);y(v,$,F,"⩾","\\geqslant",!0);y(v,$,F,"⪖","\\eqslantgtr",!0);y(v,$,F,"≳","\\gtrsim",!0);y(v,$,F,"⪆","\\gtrapprox",!0);y(v,$,ge,"⋗","\\gtrdot");y(v,$,F,"⋙","\\ggg",!0);y(v,$,F,"≷","\\gtrless",!0);y(v,$,F,"⋛","\\gtreqless",!0);y(v,$,F,"⪌","\\gtreqqless",!0);y(v,$,F,"≖","\\eqcirc",!0);y(v,$,F,"≗","\\circeq",!0);y(v,$,F,"≜","\\triangleq",!0);y(v,$,F,"∼","\\thicksim");y(v,$,F,"≈","\\thickapprox");y(v,$,F,"⫆","\\supseteqq",!0);y(v,$,F,"⋑","\\Supset",!0);y(v,$,F,"⊐","\\sqsupset",!0);y(v,$,F,"≽","\\succcurlyeq",!0);y(v,$,F,"⋟","\\curlyeqsucc",!0);y(v,$,F,"≿","\\succsim",!0);y(v,$,F,"⪸","\\succapprox",!0);y(v,$,F,"⊳","\\vartriangleright");y(v,$,F,"⊵","\\trianglerighteq");y(v,$,F,"⊩","\\Vdash",!0);y(v,$,F,"∣","\\shortmid");y(v,$,F,"∥","\\shortparallel");y(v,$,F,"≬","\\between",!0);y(v,$,F,"⋔","\\pitchfork",!0);y(v,$,F,"∝","\\varpropto");y(v,$,F,"◀","\\blacktriangleleft");y(v,$,F,"∴","\\therefore",!0);y(v,$,F,"∍","\\backepsilon");y(v,$,F,"▶","\\blacktriangleright");y(v,$,F,"∵","\\because",!0);y(v,$,F,"⋘","\\llless");y(v,$,F,"⋙","\\gggtr");y(v,$,ge,"⊲","\\lhd");y(v,$,ge,"⊳","\\rhd");y(v,$,F,"≂","\\eqsim",!0);y(v,S,F,"⋈","\\Join");y(v,$,F,"≑","\\Doteq",!0);y(v,$,ge,"∔","\\dotplus",!0);y(v,$,ge,"∖","\\smallsetminus");y(v,$,ge,"⋒","\\Cap",!0);y(v,$,ge,"⋓","\\Cup",!0);y(v,$,ge,"⩞","\\doublebarwedge",!0);y(v,$,ge,"⊟","\\boxminus",!0);y(v,$,ge,"⊞","\\boxplus",!0);y(v,$,ge,"⋇","\\divideontimes",!0);y(v,$,ge,"⋉","\\ltimes",!0);y(v,$,ge,"⋊","\\rtimes",!0);y(v,$,ge,"⋋","\\leftthreetimes",!0);y(v,$,ge,"⋌","\\rightthreetimes",!0);y(v,$,ge,"⋏","\\curlywedge",!0);y(v,$,ge,"⋎","\\curlyvee",!0);y(v,$,ge,"⊝","\\circleddash",!0);y(v,$,ge,"⊛","\\circledast",!0);y(v,$,ge,"⋅","\\centerdot");y(v,$,ge,"⊺","\\intercal",!0);y(v,$,ge,"⋒","\\doublecap");y(v,$,ge,"⋓","\\doublecup");y(v,$,ge,"⊠","\\boxtimes",!0);y(v,$,F,"⇢","\\dashrightarrow",!0);y(v,$,F,"⇠","\\dashleftarrow",!0);y(v,$,F,"⇇","\\leftleftarrows",!0);y(v,$,F,"⇆","\\leftrightarrows",!0);y(v,$,F,"⇚","\\Lleftarrow",!0);y(v,$,F,"↞","\\twoheadleftarrow",!0);y(v,$,F,"↢","\\leftarrowtail",!0);y(v,$,F,"↫","\\looparrowleft",!0);y(v,$,F,"⇋","\\leftrightharpoons",!0);y(v,$,F,"↶","\\curvearrowleft",!0);y(v,$,F,"↺","\\circlearrowleft",!0);y(v,$,F,"↰","\\Lsh",!0);y(v,$,F,"⇈","\\upuparrows",!0);y(v,$,F,"↿","\\upharpoonleft",!0);y(v,$,F,"⇃","\\downharpoonleft",!0);y(v,S,F,"⊶","\\origof",!0);y(v,S,F,"⊷","\\imageof",!0);y(v,$,F,"⊸","\\multimap",!0);y(v,$,F,"↭","\\leftrightsquigarrow",!0);y(v,$,F,"⇉","\\rightrightarrows",!0);y(v,$,F,"⇄","\\rightleftarrows",!0);y(v,$,F,"↠","\\twoheadrightarrow",!0);y(v,$,F,"↣","\\rightarrowtail",!0);y(v,$,F,"↬","\\looparrowright",!0);y(v,$,F,"↷","\\curvearrowright",!0);y(v,$,F,"↻","\\circlearrowright",!0);y(v,$,F,"↱","\\Rsh",!0);y(v,$,F,"⇊","\\downdownarrows",!0);y(v,$,F,"↾","\\upharpoonright",!0);y(v,$,F,"⇂","\\downharpoonright",!0);y(v,$,F,"⇝","\\rightsquigarrow",!0);y(v,$,F,"⇝","\\leadsto");y(v,$,F,"⇛","\\Rrightarrow",!0);y(v,$,F,"↾","\\restriction");y(v,S,W,"‘","`");y(v,S,W,"$","\\$");y(ne,S,W,"$","\\$");y(ne,S,W,"$","\\textdollar");y(v,S,W,"%","\\%");y(ne,S,W,"%","\\%");y(v,S,W,"_","\\_");y(ne,S,W,"_","\\_");y(ne,S,W,"_","\\textunderscore");y(v,S,W,"∠","\\angle",!0);y(v,S,W,"∞","\\infty",!0);y(v,S,W,"′","\\prime");y(v,S,W,"△","\\triangle");y(v,S,W,"Γ","\\Gamma",!0);y(v,S,W,"Δ","\\Delta",!0);y(v,S,W,"Θ","\\Theta",!0);y(v,S,W,"Λ","\\Lambda",!0);y(v,S,W,"Ξ","\\Xi",!0);y(v,S,W,"Π","\\Pi",!0);y(v,S,W,"Σ","\\Sigma",!0);y(v,S,W,"Υ","\\Upsilon",!0);y(v,S,W,"Φ","\\Phi",!0);y(v,S,W,"Ψ","\\Psi",!0);y(v,S,W,"Ω","\\Omega",!0);y(v,S,W,"A","Α");y(v,S,W,"B","Β");y(v,S,W,"E","Ε");y(v,S,W,"Z","Ζ");y(v,S,W,"H","Η");y(v,S,W,"I","Ι");y(v,S,W,"K","Κ");y(v,S,W,"M","Μ");y(v,S,W,"N","Ν");y(v,S,W,"O","Ο");y(v,S,W,"P","Ρ");y(v,S,W,"T","Τ");y(v,S,W,"X","Χ");y(v,S,W,"¬","\\neg",!0);y(v,S,W,"¬","\\lnot");y(v,S,W,"⊤","\\top");y(v,S,W,"⊥","\\bot");y(v,S,W,"∅","\\emptyset");y(v,$,W,"∅","\\varnothing");y(v,S,Me,"α","\\alpha",!0);y(v,S,Me,"β","\\beta",!0);y(v,S,Me,"γ","\\gamma",!0);y(v,S,Me,"δ","\\delta",!0);y(v,S,Me,"ϵ","\\epsilon",!0);y(v,S,Me,"ζ","\\zeta",!0);y(v,S,Me,"η","\\eta",!0);y(v,S,Me,"θ","\\theta",!0);y(v,S,Me,"ι","\\iota",!0);y(v,S,Me,"κ","\\kappa",!0);y(v,S,Me,"λ","\\lambda",!0);y(v,S,Me,"μ","\\mu",!0);y(v,S,Me,"ν","\\nu",!0);y(v,S,Me,"ξ","\\xi",!0);y(v,S,Me,"ο","\\omicron",!0);y(v,S,Me,"π","\\pi",!0);y(v,S,Me,"ρ","\\rho",!0);y(v,S,Me,"σ","\\sigma",!0);y(v,S,Me,"τ","\\tau",!0);y(v,S,Me,"υ","\\upsilon",!0);y(v,S,Me,"ϕ","\\phi",!0);y(v,S,Me,"χ","\\chi",!0);y(v,S,Me,"ψ","\\psi",!0);y(v,S,Me,"ω","\\omega",!0);y(v,S,Me,"ε","\\varepsilon",!0);y(v,S,Me,"ϑ","\\vartheta",!0);y(v,S,Me,"ϖ","\\varpi",!0);y(v,S,Me,"ϱ","\\varrho",!0);y(v,S,Me,"ς","\\varsigma",!0);y(v,S,Me,"φ","\\varphi",!0);y(v,S,ge,"∗","*",!0);y(v,S,ge,"+","+");y(v,S,ge,"−","-",!0);y(v,S,ge,"⋅","\\cdot",!0);y(v,S,ge,"∘","\\circ",!0);y(v,S,ge,"÷","\\div",!0);y(v,S,ge,"±","\\pm",!0);y(v,S,ge,"×","\\times",!0);y(v,S,ge,"∩","\\cap",!0);y(v,S,ge,"∪","\\cup",!0);y(v,S,ge,"∖","\\setminus",!0);y(v,S,ge,"∧","\\land");y(v,S,ge,"∨","\\lor");y(v,S,ge,"∧","\\wedge",!0);y(v,S,ge,"∨","\\vee",!0);y(v,S,W,"√","\\surd");y(v,S,Kt,"⟨","\\langle",!0);y(v,S,Kt,"∣","\\lvert");y(v,S,Kt,"∥","\\lVert");y(v,S,Rt,"?","?");y(v,S,Rt,"!","!");y(v,S,Rt,"⟩","\\rangle",!0);y(v,S,Rt,"∣","\\rvert");y(v,S,Rt,"∥","\\rVert");y(v,S,F,"=","=");y(v,S,F,":",":");y(v,S,F,"≈","\\approx",!0);y(v,S,F,"≅","\\cong",!0);y(v,S,F,"≥","\\ge");y(v,S,F,"≥","\\geq",!0);y(v,S,F,"←","\\gets");y(v,S,F,">","\\gt",!0);y(v,S,F,"∈","\\in",!0);y(v,S,F,"","\\@not");y(v,S,F,"⊂","\\subset",!0);y(v,S,F,"⊃","\\supset",!0);y(v,S,F,"⊆","\\subseteq",!0);y(v,S,F,"⊇","\\supseteq",!0);y(v,$,F,"⊈","\\nsubseteq",!0);y(v,$,F,"⊉","\\nsupseteq",!0);y(v,S,F,"⊨","\\models");y(v,S,F,"←","\\leftarrow",!0);y(v,S,F,"≤","\\le");y(v,S,F,"≤","\\leq",!0);y(v,S,F,"<","\\lt",!0);y(v,S,F,"→","\\rightarrow",!0);y(v,S,F,"→","\\to");y(v,$,F,"≱","\\ngeq",!0);y(v,$,F,"≰","\\nleq",!0);y(v,S,Pn," ","\\ ");y(v,S,Pn," ","\\space");y(v,S,Pn," ","\\nobreakspace");y(ne,S,Pn," ","\\ ");y(ne,S,Pn," "," ");y(ne,S,Pn," ","\\space");y(ne,S,Pn," ","\\nobreakspace");y(v,S,Pn,null,"\\nobreak");y(v,S,Pn,null,"\\allowbreak");y(v,S,Ao,",",",");y(v,S,Ao,";",";");y(v,$,ge,"⊼","\\barwedge",!0);y(v,$,ge,"⊻","\\veebar",!0);y(v,S,ge,"⊙","\\odot",!0);y(v,S,ge,"⊕","\\oplus",!0);y(v,S,ge,"⊗","\\otimes",!0);y(v,S,W,"∂","\\partial",!0);y(v,S,ge,"⊘","\\oslash",!0);y(v,$,ge,"⊚","\\circledcirc",!0);y(v,$,ge,"⊡","\\boxdot",!0);y(v,S,ge,"△","\\bigtriangleup");y(v,S,ge,"▽","\\bigtriangledown");y(v,S,ge,"†","\\dagger");y(v,S,ge,"⋄","\\diamond");y(v,S,ge,"⋆","\\star");y(v,S,ge,"◃","\\triangleleft");y(v,S,ge,"▹","\\triangleright");y(v,S,Kt,"{","\\{");y(ne,S,W,"{","\\{");y(ne,S,W,"{","\\textbraceleft");y(v,S,Rt,"}","\\}");y(ne,S,W,"}","\\}");y(ne,S,W,"}","\\textbraceright");y(v,S,Kt,"{","\\lbrace");y(v,S,Rt,"}","\\rbrace");y(v,S,Kt,"[","\\lbrack",!0);y(ne,S,W,"[","\\lbrack",!0);y(v,S,Rt,"]","\\rbrack",!0);y(ne,S,W,"]","\\rbrack",!0);y(v,S,Kt,"(","\\lparen",!0);y(v,S,Rt,")","\\rparen",!0);y(ne,S,W,"<","\\textless",!0);y(ne,S,W,">","\\textgreater",!0);y(v,S,Kt,"⌊","\\lfloor",!0);y(v,S,Rt,"⌋","\\rfloor",!0);y(v,S,Kt,"⌈","\\lceil",!0);y(v,S,Rt,"⌉","\\rceil",!0);y(v,S,W,"\\","\\backslash");y(v,S,W,"∣","|");y(v,S,W,"∣","\\vert");y(ne,S,W,"|","\\textbar",!0);y(v,S,W,"∥","\\|");y(v,S,W,"∥","\\Vert");y(ne,S,W,"∥","\\textbardbl");y(ne,S,W,"~","\\textasciitilde");y(ne,S,W,"\\","\\textbackslash");y(ne,S,W,"^","\\textasciicircum");y(v,S,F,"↑","\\uparrow",!0);y(v,S,F,"⇑","\\Uparrow",!0);y(v,S,F,"↓","\\downarrow",!0);y(v,S,F,"⇓","\\Downarrow",!0);y(v,S,F,"↕","\\updownarrow",!0);y(v,S,F,"⇕","\\Updownarrow",!0);y(v,S,pt,"∐","\\coprod");y(v,S,pt,"⋁","\\bigvee");y(v,S,pt,"⋀","\\bigwedge");y(v,S,pt,"⨄","\\biguplus");y(v,S,pt,"⋂","\\bigcap");y(v,S,pt,"⋃","\\bigcup");y(v,S,pt,"∫","\\int");y(v,S,pt,"∫","\\intop");y(v,S,pt,"∬","\\iint");y(v,S,pt,"∭","\\iiint");y(v,S,pt,"∏","\\prod");y(v,S,pt,"∑","\\sum");y(v,S,pt,"⨂","\\bigotimes");y(v,S,pt,"⨁","\\bigoplus");y(v,S,pt,"⨀","\\bigodot");y(v,S,pt,"∮","\\oint");y(v,S,pt,"∯","\\oiint");y(v,S,pt,"∰","\\oiiint");y(v,S,pt,"⨆","\\bigsqcup");y(v,S,pt,"∫","\\smallint");y(ne,S,Kr,"…","\\textellipsis");y(v,S,Kr,"…","\\mathellipsis");y(ne,S,Kr,"…","\\ldots",!0);y(v,S,Kr,"…","\\ldots",!0);y(v,S,Kr,"⋯","\\@cdots",!0);y(v,S,Kr,"⋱","\\ddots",!0);y(v,S,W,"⋮","\\varvdots");y(v,S,tt,"ˊ","\\acute");y(v,S,tt,"ˋ","\\grave");y(v,S,tt,"¨","\\ddot");y(v,S,tt,"~","\\tilde");y(v,S,tt,"ˉ","\\bar");y(v,S,tt,"˘","\\breve");y(v,S,tt,"ˇ","\\check");y(v,S,tt,"^","\\hat");y(v,S,tt,"⃗","\\vec");y(v,S,tt,"˙","\\dot");y(v,S,tt,"˚","\\mathring");y(v,S,Me,"","\\@imath");y(v,S,Me,"","\\@jmath");y(v,S,W,"ı","ı");y(v,S,W,"ȷ","ȷ");y(ne,S,W,"ı","\\i",!0);y(ne,S,W,"ȷ","\\j",!0);y(ne,S,W,"ß","\\ss",!0);y(ne,S,W,"æ","\\ae",!0);y(ne,S,W,"œ","\\oe",!0);y(ne,S,W,"ø","\\o",!0);y(ne,S,W,"Æ","\\AE",!0);y(ne,S,W,"Œ","\\OE",!0);y(ne,S,W,"Ø","\\O",!0);y(ne,S,tt,"ˊ","\\'");y(ne,S,tt,"ˋ","\\`");y(ne,S,tt,"ˆ","\\^");y(ne,S,tt,"˜","\\~");y(ne,S,tt,"ˉ","\\=");y(ne,S,tt,"˘","\\u");y(ne,S,tt,"˙","\\.");y(ne,S,tt,"¸","\\c");y(ne,S,tt,"˚","\\r");y(ne,S,tt,"ˇ","\\v");y(ne,S,tt,"¨",'\\"');y(ne,S,tt,"˝","\\H");y(ne,S,tt,"◯","\\textcircled");var x6={"--":!0,"---":!0,"``":!0,"''":!0};y(ne,S,W,"–","--",!0);y(ne,S,W,"–","\\textendash");y(ne,S,W,"—","---",!0);y(ne,S,W,"—","\\textemdash");y(ne,S,W,"‘","`",!0);y(ne,S,W,"‘","\\textquoteleft");y(ne,S,W,"’","'",!0);y(ne,S,W,"’","\\textquoteright");y(ne,S,W,"“","``",!0);y(ne,S,W,"“","\\textquotedblleft");y(ne,S,W,"”","''",!0);y(ne,S,W,"”","\\textquotedblright");y(v,S,W,"°","\\degree",!0);y(ne,S,W,"°","\\degree");y(ne,S,W,"°","\\textdegree",!0);y(v,S,W,"£","\\pounds");y(v,S,W,"£","\\mathsterling",!0);y(ne,S,W,"£","\\pounds");y(ne,S,W,"£","\\textsterling",!0);y(v,$,W,"✠","\\maltese");y(ne,$,W,"✠","\\maltese");var zm='0123456789/@."';for(var Ns=0;Ns<zm.length;Ns++){var $m=zm.charAt(Ns);y(v,S,W,$m,$m)}var Fm='0123456789!@*()-=+";:?/.,';for(var As=0;As<Fm.length;As++){var Pm=Fm.charAt(As);y(ne,S,W,Pm,Pm)}var Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Ts=0;Ts<Gi.length;Ts++){var ei=Gi.charAt(Ts);y(v,S,Me,ei,ei),y(ne,S,W,ei,ei)}y(v,$,W,"C","ℂ");y(ne,$,W,"C","ℂ");y(v,$,W,"H","ℍ");y(ne,$,W,"H","ℍ");y(v,$,W,"N","ℕ");y(ne,$,W,"N","ℕ");y(v,$,W,"P","ℙ");y(ne,$,W,"P","ℙ");y(v,$,W,"Q","ℚ");y(ne,$,W,"Q","ℚ");y(v,$,W,"R","ℝ");y(ne,$,W,"R","ℝ");y(v,$,W,"Z","ℤ");y(ne,$,W,"Z","ℤ");y(v,S,Me,"h","ℎ");y(ne,S,Me,"h","ℎ");var Ne="";for(var Mt=0;Mt<Gi.length;Mt++){var ot=Gi.charAt(Mt);Ne=String.fromCharCode(55349,56320+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56372+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56424+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56580+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56684+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56736+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56788+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56840+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56944+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Mt<26&&(Ne=String.fromCharCode(55349,56632+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne),Ne=String.fromCharCode(55349,56476+Mt),y(v,S,Me,ot,Ne),y(ne,S,W,ot,Ne))}Ne="𝕜";y(v,S,Me,"k",Ne);y(ne,S,W,"k",Ne);for(var cr=0;cr<10;cr++){var jn=cr.toString();Ne=String.fromCharCode(55349,57294+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne),Ne=String.fromCharCode(55349,57314+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne),Ne=String.fromCharCode(55349,57324+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne),Ne=String.fromCharCode(55349,57334+cr),y(v,S,Me,jn,Ne),y(ne,S,W,jn,Ne)}var Rd="ÐÞþ";for(var Cs=0;Cs<Rd.length;Cs++){var ti=Rd.charAt(Cs);y(v,S,Me,ti,ti),y(ne,S,W,ti,ti)}var ni=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],qm=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],YAe=function(t,n){var r=t.charCodeAt(0),a=t.charCodeAt(1),i=(r-55296)*1024+(a-56320)+65536,o=n==="math"?0:1;if(119808<=i&&i<120484){var s=Math.floor((i-119808)/26);return[ni[s][2],ni[s][o]]}else if(120782<=i&&i<=120831){var l=Math.floor((i-120782)/10);return[qm[l][2],qm[l][o]]}else{if(i===120485||i===120486)return[ni[0][2],ni[0][o]];if(120486<i&&i<120782)return["",""];throw new ce("Unsupported character: "+t)}},To=function(t,n,r){return Qe[r][t]&&Qe[r][t].replace&&(t=Qe[r][t].replace),{value:t,metrics:Hp(t,n,r)}},ln=function(t,n,r,a,i){var o=To(t,n,r),s=o.metrics;t=o.value;var l;if(s){var u=s.italic;(r==="text"||a&&a.font==="mathit")&&(u=0),l=new rn(t,s.height,s.depth,u,s.skew,s.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+r+"'")),l=new rn(t,0,0,0,0,0,i);if(a){l.maxFontSize=a.sizeMultiplier,a.style.isTight()&&l.classes.push("mtight");var d=a.getColor();d&&(l.style.color=d)}return l},ZAe=function(t,n,r,a){return a===void 0&&(a=[]),r.font==="boldsymbol"&&To(t,"Main-Bold",n).metrics?ln(t,"Main-Bold",n,r,a.concat(["mathbf"])):t==="\\"||Qe[n][t].font==="main"?ln(t,"Main-Regular",n,r,a):ln(t,"AMS-Regular",n,r,a.concat(["amsrm"]))},XAe=function(t,n,r,a,i){return i!=="textord"&&To(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},QAe=function(t,n,r){var a=t.mode,i=t.text,o=["mord"],s=a==="math"||a==="text"&&n.font,l=s?n.font:n.fontFamily,u="",d="";if(i.charCodeAt(0)===55349&&([u,d]=YAe(i,a)),u.length>0)return ln(i,u,a,n,o.concat(d));if(l){var p,h;if(l==="boldsymbol"){var m=XAe(i,a,n,o,r);p=m.fontName,h=[m.fontClass]}else s?(p=M6[l].fontName,h=[l]):(p=ri(l,n.fontWeight,n.fontShape),h=[l,n.fontWeight,n.fontShape]);if(To(i,p,a).metrics)return ln(i,p,a,n,o.concat(h));if(x6.hasOwnProperty(i)&&p.slice(0,10)==="Typewriter"){for(var f=[],g=0;g<i.length;g++)f.push(ln(i[g],p,a,n,o.concat(h)));return E6(f)}}if(r==="mathord")return ln(i,"Math-Italic",a,n,o.concat(["mathnormal"]));if(r==="textord"){var _=Qe[a][i]&&Qe[a][i].font;if(_==="ams"){var k=ri("amsrm",n.fontWeight,n.fontShape);return ln(i,k,a,n,o.concat("amsrm",n.fontWeight,n.fontShape))}else if(_==="main"||!_){var b=ri("textrm",n.fontWeight,n.fontShape);return ln(i,b,a,n,o.concat(n.fontWeight,n.fontShape))}else{var x=ri(_,n.fontWeight,n.fontShape);return ln(i,x,a,n,o.concat(x,n.fontWeight,n.fontShape))}}else throw new Error("unexpected type: "+r+" in makeOrd")},JAe=(e,t)=>{if(tr(e.classes)!==tr(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var a in t.style)if(t.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;return!0},eTe=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof rn&&r instanceof rn&&JAe(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},Vp=function(t){for(var n=0,r=0,a=0,i=0;i<t.children.length;i++){var o=t.children[i];o.height>n&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>a&&(a=o.maxFontSize)}t.height=n,t.depth=r,t.maxFontSize=a},zt=function(t,n,r,a){var i=new Pa(t,n,r,a);return Vp(i),i},w6=(e,t,n,r)=>new Pa(e,t,n,r),tTe=function(t,n,r){var a=zt([t],[],n);return a.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),a.style.borderBottomWidth=de(a.height),a.maxFontSize=1,a},nTe=function(t,n,r,a){var i=new jp(t,n,r,a);return Vp(i),i},E6=function(t){var n=new Fa(t);return Vp(n),n},rTe=function(t,n){return t instanceof Fa?zt([],[t],n):t},aTe=function(t){if(t.positionType==="individualShift"){for(var n=t.children,r=[n[0]],a=-n[0].shift-n[0].elem.depth,i=a,o=1;o<n.length;o++){var s=-n[o].shift-i-n[o].elem.depth,l=s-(n[o-1].elem.height+n[o-1].elem.depth);i=i+s,r.push({type:"kern",size:l}),r.push(n[o])}return{children:r,depth:a}}var u;if(t.positionType==="top"){for(var d=t.positionData,p=0;p<t.children.length;p++){var h=t.children[p];d-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}u=d}else if(t.positionType==="bottom")u=-t.positionData;else{var m=t.children[0];if(m.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")u=-m.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")u=-m.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:u}},iTe=function(t,n){for(var{children:r,depth:a}=aTe(t),i=0,o=0;o<r.length;o++){var s=r[o];if(s.type==="elem"){var l=s.elem;i=Math.max(i,l.maxFontSize,l.height)}}i+=2;var u=zt(["pstrut"],[]);u.style.height=de(i);for(var d=[],p=a,h=a,m=a,f=0;f<r.length;f++){var g=r[f];if(g.type==="kern")m+=g.size;else{var _=g.elem,k=g.wrapperClasses||[],b=g.wrapperStyle||{},x=zt(k,[u,_],void 0,b);x.style.top=de(-i-m-_.depth),g.marginLeft&&(x.style.marginLeft=g.marginLeft),g.marginRight&&(x.style.marginRight=g.marginRight),d.push(x),m+=_.height+_.depth}p=Math.min(p,m),h=Math.max(h,m)}var M=zt(["vlist"],d);M.style.height=de(h);var N;if(p<0){var E=zt([],[]),D=zt(["vlist"],[E]);D.style.height=de(-p);var P=zt(["vlist-s"],[new rn("")]);N=[zt(["vlist-r"],[M,P]),zt(["vlist-r"],[D])]}else N=[zt(["vlist-r"],[M])];var C=zt(["vlist-t"],N);return N.length===2&&C.classes.push("vlist-t2"),C.height=h,C.depth=-p,C},oTe=(e,t)=>{var n=zt(["mspace"],[],t),r=at(e,t);return n.style.marginRight=de(r),n},ri=function(t,n,r){var a="";switch(t){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=t}var i;return n==="textbf"&&r==="textit"?i="BoldItalic":n==="textbf"?i="Bold":n==="textit"?i="Italic":i="Regular",a+"-"+i},M6={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},S6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},sTe=function(t,n){var[r,a,i]=S6[t],o=new nr(r),s=new Ln([o],{width:de(a),height:de(i),style:"width:"+de(a),viewBox:"0 0 "+1e3*a+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),l=w6(["overlay"],[s],n);return l.height=i,l.style.height=de(i),l.style.width=de(a),l},J={fontMap:M6,makeSymbol:ln,mathsym:ZAe,makeSpan:zt,makeSvgSpan:w6,makeLineSpan:tTe,makeAnchor:nTe,makeFragment:E6,wrapFragment:rTe,makeVList:iTe,makeOrd:QAe,makeGlue:oTe,staticSvg:sTe,svgData:S6,tryCombineChars:eTe},rt={number:3,unit:"mu"},ur={number:4,unit:"mu"},Sn={number:5,unit:"mu"},lTe={mord:{mop:rt,mbin:ur,mrel:Sn,minner:rt},mop:{mord:rt,mop:rt,mrel:Sn,minner:rt},mbin:{mord:ur,mop:ur,mopen:ur,minner:ur},mrel:{mord:Sn,mop:Sn,mopen:Sn,minner:Sn},mopen:{},mclose:{mop:rt,mbin:ur,mrel:Sn,minner:rt},mpunct:{mord:rt,mop:rt,mrel:Sn,mopen:rt,mclose:rt,mpunct:rt,minner:rt},minner:{mord:rt,mop:rt,mbin:ur,mrel:Sn,mopen:rt,mpunct:rt,minner:rt}},cTe={mord:{mop:rt},mop:{mord:rt,mop:rt},mbin:{},mrel:{},mopen:{},mclose:{mop:rt},mpunct:{},minner:{mop:rt}},N6={},Wi={},Ki={};function me(e){for(var{type:t,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:a},l=0;l<n.length;++l)N6[n[l]]=s;t&&(i&&(Wi[t]=i),o&&(Ki[t]=o))}function vr(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;me({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Yi=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},st=function(t){return t.type==="ordgroup"?t.body:[t]},Dn=J.makeSpan,uTe=["leftmost","mbin","mopen","mrel","mop","mpunct"],dTe=["rightmost","mrel","mclose","mpunct"],pTe={display:Se.DISPLAY,text:Se.TEXT,script:Se.SCRIPT,scriptscript:Se.SCRIPTSCRIPT},hTe={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},ht=function(t,n,r,a){a===void 0&&(a=[null,null]);for(var i=[],o=0;o<t.length;o++){var s=je(t[o],n);if(s instanceof Fa){var l=s.children;i.push(...l)}else i.push(s)}if(J.tryCombineChars(i),!r)return i;var u=n;if(t.length===1){var d=t[0];d.type==="sizing"?u=n.havingSize(d.size):d.type==="styling"&&(u=n.havingStyle(pTe[d.style]))}var p=Dn([a[0]||"leftmost"],[],n),h=Dn([a[1]||"rightmost"],[],n),m=r==="root";return Bm(i,(f,g)=>{var _=g.classes[0],k=f.classes[0];_==="mbin"&&Ee.contains(dTe,k)?g.classes[0]="mord":k==="mbin"&&Ee.contains(uTe,_)&&(f.classes[0]="mord")},{node:p},h,m),Bm(i,(f,g)=>{var _=Id(g),k=Id(f),b=_&&k?f.hasClass("mtight")?cTe[_][k]:lTe[_][k]:null;if(b)return J.makeGlue(b,u)},{node:p},h,m),i},Bm=function e(t,n,r,a,i){a&&t.push(a);for(var o=0;o<t.length;o++){var s=t[o],l=A6(s);if(l){e(l.children,n,r,null,i);continue}var u=!s.hasClass("mspace");if(u){var d=n(s,r.node);d&&(r.insertAfter?r.insertAfter(d):(t.unshift(d),o++))}u?r.node=s:i&&s.hasClass("newline")&&(r.node=Dn(["leftmost"])),r.insertAfter=(p=>h=>{t.splice(p+1,0,h),o++})(o)}a&&t.pop()},A6=function(t){return t instanceof Fa||t instanceof jp||t instanceof Pa&&t.hasClass("enclosing")?t:null},mTe=function e(t,n){var r=A6(t);if(r){var a=r.children;if(a.length){if(n==="right")return e(a[a.length-1],"right");if(n==="left")return e(a[0],"left")}}return t},Id=function(t,n){return t?(n&&(t=mTe(t,n)),hTe[t.classes[0]]||null):null},Ma=function(t,n){var r=["nulldelimiter"].concat(t.baseSizingClasses());return Dn(n.concat(r))},je=function(t,n,r){if(!t)return Dn();if(Wi[t.type]){var a=Wi[t.type](t,n);if(r&&n.size!==r.size){a=Dn(n.sizingClasses(r),[a],n);var i=n.sizeMultiplier/r.sizeMultiplier;a.height*=i,a.depth*=i}return a}else throw new ce("Got group of unknown type: '"+t.type+"'")};function ai(e,t){var n=Dn(["base"],e,t),r=Dn(["strut"]);return r.style.height=de(n.height+n.depth),n.depth&&(r.style.verticalAlign=de(-n.depth)),n.children.unshift(r),n}function Od(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var r=ht(e,t,"root"),a;r.length===2&&r[1].hasClass("tag")&&(a=r.pop());for(var i=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass("mbin")||r[s].hasClass("mrel")||r[s].hasClass("allowbreak")){for(var l=!1;s<r.length-1&&r[s+1].hasClass("mspace")&&!r[s+1].hasClass("newline");)s++,o.push(r[s]),r[s].hasClass("nobreak")&&(l=!0);l||(i.push(ai(o,t)),o=[])}else r[s].hasClass("newline")&&(o.pop(),o.length>0&&(i.push(ai(o,t)),o=[]),i.push(r[s]));o.length>0&&i.push(ai(o,t));var u;n?(u=ai(ht(n,t,!0)),u.classes=["tag"],i.push(u)):a&&i.push(a);var d=Dn(["katex-html"],i);if(d.setAttribute("aria-hidden","true"),u){var p=u.children[0];p.style.height=de(d.height+d.depth),d.depth&&(p.style.verticalAlign=de(-d.depth))}return d}function T6(e){return new Fa(e)}class en{constructor(t,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=tr(this.classes));for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=Ee.escape(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+Ee.escape(tr(this.classes))+'"'),t+=">";for(var r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class pa{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ee.escape(this.toText())}toText(){return this.text}}class fTe{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",de(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+de(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var ae={MathNode:en,TextNode:pa,SpaceNode:fTe,newDocumentFragment:T6},an=function(t,n,r){return Qe[n][t]&&Qe[n][t].replace&&t.charCodeAt(0)!==55349&&!(x6.hasOwnProperty(t)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(t=Qe[n][t].replace),new ae.TextNode(t)},Gp=function(t){return t.length===1?t[0]:new ae.MathNode("mrow",t)},Wp=function(t,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var a=t.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var i=t.text;if(Ee.contains(["\\imath","\\jmath"],i))return null;Qe[a][i]&&Qe[a][i].replace&&(i=Qe[a][i].replace);var o=J.fontMap[r].fontName;return Hp(i,o,a)?J.fontMap[r].variant:null},Pt=function(t,n,r){if(t.length===1){var a=Xe(t[0],n);return r&&a instanceof en&&a.type==="mo"&&(a.setAttribute("lspace","0em"),a.setAttribute("rspace","0em")),[a]}for(var i=[],o,s=0;s<t.length;s++){var l=Xe(t[s],n);if(l instanceof en&&o instanceof en){if(l.type==="mtext"&&o.type==="mtext"&&l.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...l.children);continue}else if(l.type==="mn"&&o.type==="mn"){o.children.push(...l.children);continue}else if(l.type==="mi"&&l.children.length===1&&o.type==="mn"){var u=l.children[0];if(u instanceof pa&&u.text==="."){o.children.push(...l.children);continue}}else if(o.type==="mi"&&o.children.length===1){var d=o.children[0];if(d instanceof pa&&d.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var p=l.children[0];p instanceof pa&&p.text.length>0&&(p.text=p.text.slice(0,1)+"̸"+p.text.slice(1),i.pop())}}}i.push(l),o=l}return i},rr=function(t,n,r){return Gp(Pt(t,n,r))},Xe=function(t,n){if(!t)return new ae.MathNode("mrow");if(Ki[t.type]){var r=Ki[t.type](t,n);return r}else throw new ce("Got group of unknown type: '"+t.type+"'")};function Um(e,t,n,r,a){var i=Pt(e,n),o;i.length===1&&i[0]instanceof en&&Ee.contains(["mrow","mtable"],i[0].type)?o=i[0]:o=new ae.MathNode("mrow",i);var s=new ae.MathNode("annotation",[new ae.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new ae.MathNode("semantics",[o,s]),u=new ae.MathNode("math",[l]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var d=a?"katex":"katex-mathml";return J.makeSpan([d],[u])}var C6=function(t){return new Nn({style:t.displayMode?Se.DISPLAY:Se.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},R6=function(t,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),t=J.makeSpan(r,[t])}return t},gTe=function(t,n,r){var a=C6(r),i;if(r.output==="mathml")return Um(t,n,a,r.displayMode,!0);if(r.output==="html"){var o=Od(t,a);i=J.makeSpan(["katex"],[o])}else{var s=Um(t,n,a,r.displayMode,!1),l=Od(t,a);i=J.makeSpan(["katex"],[s,l])}return R6(i,r)},yTe=function(t,n,r){var a=C6(r),i=Od(t,a),o=J.makeSpan(["katex"],[i]);return R6(o,r)},bTe={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},kTe=function(t){var n=new ae.MathNode("mo",[new ae.TextNode(bTe[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},vTe={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},_Te=function(t){return t.type==="ordgroup"?t.body.length:1},xTe=function(t,n){function r(){var s=4e5,l=t.label.slice(1);if(Ee.contains(["widehat","widecheck","widetilde","utilde"],l)){var u=t,d=_Te(u.base),p,h,m;if(d>5)l==="widehat"||l==="widecheck"?(p=420,s=2364,m=.42,h=l+"4"):(p=312,s=2340,m=.34,h="tilde4");else{var f=[1,1,2,2,3,3][d];l==="widehat"||l==="widecheck"?(s=[0,1062,2364,2364,2364][f],p=[0,239,300,360,420][f],m=[0,.24,.3,.3,.36,.42][f],h=l+f):(s=[0,600,1033,2339,2340][f],p=[0,260,286,306,312][f],m=[0,.26,.286,.3,.306,.34][f],h="tilde"+f)}var g=new nr(h),_=new Ln([g],{width:"100%",height:de(m),viewBox:"0 0 "+s+" "+p,preserveAspectRatio:"none"});return{span:J.makeSvgSpan([],[_],n),minWidth:0,height:m}}else{var k=[],b=vTe[l],[x,M,N]=b,E=N/1e3,D=x.length,P,C;if(D===1){var I=b[3];P=["hide-tail"],C=[I]}else if(D===2)P=["halfarrow-left","halfarrow-right"],C=["xMinYMin","xMaxYMin"];else if(D===3)P=["brace-left","brace-center","brace-right"],C=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
8583
|
+
`+D+" children.");for(var q=0;q<D;q++){var Z=new nr(x[q]),X=new Ln([Z],{width:"400em",height:de(E),viewBox:"0 0 "+s+" "+N,preserveAspectRatio:C[q]+" slice"}),K=J.makeSvgSpan([P[q]],[X],n);if(D===1)return{span:K,minWidth:M,height:E};K.style.height=de(E),k.push(K)}return{span:J.makeSpan(["stretchy"],k,n),minWidth:M,height:E}}}var{span:a,minWidth:i,height:o}=r();return a.height=o,a.style.height=de(o),i>0&&(a.style.minWidth=de(i)),a},wTe=function(t,n,r,a,i){var o,s=t.height+t.depth+r+a;if(/fbox|color|angl/.test(n)){if(o=J.makeSpan(["stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();l&&(o.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new Cd({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new Cd({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var d=new Ln(u,{width:"100%",height:de(s)});o=J.makeSvgSpan([],[d],i)}return o.height=s,o.style.height=de(s),o},zn={encloseSpan:wTe,mathMLnode:kTe,svgSpan:xTe};function Oe(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Kp(e){var t=Co(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Co(e){return e&&(e.type==="atom"||KAe.hasOwnProperty(e.type))?e:null}var Yp=(e,t)=>{var n,r,a;e&&e.type==="supsub"?(r=Oe(e.base,"accent"),n=r.base,e.base=n,a=GAe(je(e,t)),e.base=r):(r=Oe(e,"accent"),n=r.base);var i=je(n,t.havingCrampedStyle()),o=r.isShifty&&Ee.isCharacterBox(n),s=0;if(o){var l=Ee.getBaseElem(n),u=je(l,t.havingCrampedStyle());s=Dm(u).skew}var d=r.label==="\\c",p=d?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),h;if(r.isStretchy)h=zn.svgSpan(r,t),h=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:s>0?{width:"calc(100% - "+de(2*s)+")",marginLeft:de(2*s)}:void 0}]},t);else{var m,f;r.label==="\\vec"?(m=J.staticSvg("vec",t),f=J.svgData.vec[1]):(m=J.makeOrd({mode:r.mode,text:r.label},t,"textord"),m=Dm(m),m.italic=0,f=m.width,d&&(p+=m.depth)),h=J.makeSpan(["accent-body"],[m]);var g=r.label==="\\textcircled";g&&(h.classes.push("accent-full"),p=i.height);var _=s;g||(_-=f/2),h.style.left=de(_),r.label==="\\textcircled"&&(h.style.top=".2em"),h=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-p},{type:"elem",elem:h}]},t)}var k=J.makeSpan(["mord","accent"],[h],t);return a?(a.children[0]=k,a.height=Math.max(k.height,a.height),a.classes[0]="mord",a):k},I6=(e,t)=>{var n=e.isStretchy?zn.mathMLnode(e.label):new ae.MathNode("mo",[an(e.label,e.mode)]),r=new ae.MathNode("mover",[Xe(e.base,t),n]);return r.setAttribute("accent","true"),r},ETe=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));me({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Yi(t[0]),r=!ETe.test(e.funcName),a=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:Yp,mathmlBuilder:I6});me({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Yp,mathmlBuilder:I6});me({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:a}},htmlBuilder:(e,t)=>{var n=je(e.base,t),r=zn.svgSpan(e,t),a=e.label==="\\utilde"?.12:0,i=J.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:n}]},t);return J.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=zn.mathMLnode(e.label),r=new ae.MathNode("munder",[Xe(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var ii=e=>{var t=new ae.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};me({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:a}=e;return{type:"xArrow",mode:r.mode,label:a,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),a=J.wrapFragment(je(e.body,r,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";a.classes.push(i+"-arrow-pad");var o;e.below&&(r=t.havingStyle(n.sub()),o=J.wrapFragment(je(e.below,r,t),t),o.classes.push(i+"-arrow-pad"));var s=zn.svgSpan(e,t),l=-t.fontMetrics().axisHeight+.5*s.height,u=-t.fontMetrics().axisHeight-.5*s.height-.111;(a.depth>.25||e.label==="\\xleftequilibrium")&&(u-=a.depth);var d;if(o){var p=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;d=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:s,shift:l},{type:"elem",elem:o,shift:p}]},t)}else d=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u},{type:"elem",elem:s,shift:l}]},t);return d.children[0].children[0].children[1].classes.push("svg-align"),J.makeSpan(["mrel","x-arrow"],[d],t)},mathmlBuilder(e,t){var n=zn.mathMLnode(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var a=ii(Xe(e.body,t));if(e.below){var i=ii(Xe(e.below,t));r=new ae.MathNode("munderover",[n,i,a])}else r=new ae.MathNode("mover",[n,a])}else if(e.below){var o=ii(Xe(e.below,t));r=new ae.MathNode("munder",[n,o])}else r=ii(),r=new ae.MathNode("mover",[n,r]);return r}});var MTe=J.makeSpan;function O6(e,t){var n=ht(e.body,t,!0);return MTe([e.mclass],n,t)}function L6(e,t){var n,r=Pt(e.body,t);return e.mclass==="minner"?n=new ae.MathNode("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(n=r[0],n.type="mi"):n=new ae.MathNode("mi",r):(e.isCharacterBox?(n=r[0],n.type="mo"):n=new ae.MathNode("mo",r),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}me({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:st(a),isCharacterBox:Ee.isCharacterBox(a)}},htmlBuilder:O6,mathmlBuilder:L6});var Ro=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};me({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Ro(t[0]),body:st(t[1]),isCharacterBox:Ee.isCharacterBox(t[1])}}});me({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,a=t[1],i=t[0],o;r!=="\\stackrel"?o=Ro(a):o="mrel";var s={type:"op",mode:a.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:st(a)},l={type:"supsub",mode:i.mode,base:s,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:n.mode,mclass:o,body:[l],isCharacterBox:Ee.isCharacterBox(l)}},htmlBuilder:O6,mathmlBuilder:L6});me({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Ro(t[0]),body:st(t[0])}},htmlBuilder(e,t){var n=ht(e.body,t,!0),r=J.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=Pt(e.body,t),r=new ae.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var STe={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Hm=()=>({type:"styling",body:[],mode:"math",style:"display"}),jm=e=>e.type==="textord"&&e.text==="@",NTe=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function ATe(e,t,n){var r=STe[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var a=n.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[i],[]),s=n.callFunction("\\\\cdright",[t[1]],[]),l={type:"ordgroup",mode:"math",body:[a,o,s]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function TTe(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ce("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],a=[r],i=0;i<t.length;i++){for(var o=t[i],s=Hm(),l=0;l<o.length;l++)if(!jm(o[l]))s.body.push(o[l]);else{r.push(s),l+=1;var u=Kp(o[l]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(u)>-1))if("<>AV".indexOf(u)>-1)for(var p=0;p<2;p++){for(var h=!0,m=l+1;m<o.length;m++){if(NTe(o[m],u)){h=!1,l=m;break}if(jm(o[m]))throw new ce("Missing a "+u+" character to complete a CD arrow.",o[m]);d[p].body.push(o[m])}if(h)throw new ce("Missing a "+u+" character to complete a CD arrow.",o[l])}else throw new ce('Expected one of "<>AV=|." after @',o[l]);var f=ATe(u,d,e),g={type:"styling",body:[f],mode:"math",style:"display"};r.push(g),s=Hm()}i%2===0?r.push(s):r.shift(),r=[],a.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var _=new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:_,colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}me({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=J.wrapFragment(je(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=de(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ae.MathNode("mrow",[Xe(e.label,t)]);return n=new ae.MathNode("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new ae.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});me({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=J.wrapFragment(je(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new ae.MathNode("mrow",[Xe(e.fragment,t)])}});me({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Oe(t[0],"ordgroup"),a=r.body,i="",o=0;o<a.length;o++){var s=Oe(a[o],"textord");i+=s.text}var l=parseInt(i),u;if(isNaN(l))throw new ce("\\@char has non-numeric argument "+i);if(l<0||l>=1114111)throw new ce("\\@char with invalid code point "+i);return l<=65535?u=String.fromCharCode(l):(l-=65536,u=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:u}}});var D6=(e,t)=>{var n=ht(e.body,t.withColor(e.color),!1);return J.makeFragment(n)},z6=(e,t)=>{var n=Pt(e.body,t.withColor(e.color)),r=new ae.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};me({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=Oe(t[0],"color-token").color,a=t[1];return{type:"color",mode:n.mode,color:r,body:st(a)}},htmlBuilder:D6,mathmlBuilder:z6});me({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,a=Oe(t[0],"color-token").color;n.gullet.macros.set("\\current@color",a);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:a,body:i}},htmlBuilder:D6,mathmlBuilder:z6});me({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,a=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:a&&Oe(a,"size").value}},htmlBuilder(e,t){var n=J.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=de(at(e.size,t)))),n},mathmlBuilder(e,t){var n=new ae.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",de(at(e.size,t)))),n}});var Ld={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},$6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ce("Expected a control sequence",e);return t},CTe=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},F6=(e,t,n,r)=>{var a=e.gullet.macros.get(n.text);a==null&&(n.noexpand=!0,a={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,a,r)};me({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Ld[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Ld[r.text]),Oe(t.parseFunction(),"internal");throw new ce("Invalid token after macro prefix",r)}});me({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),a=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(a))throw new ce("Expected a control sequence",r);for(var i=0,o,s=[[]];t.gullet.future().text!=="{";)if(r=t.gullet.popToken(),r.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),s[i].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new ce('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new ce('Argument number "'+r.text+'" out of order');i++,s.push([])}else{if(r.text==="EOF")throw new ce("Expected a macro definition");s[i].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return o&&l.unshift(o),(n==="\\edef"||n==="\\xdef")&&(l=t.gullet.expandTokens(l),l.reverse()),t.gullet.macros.set(a,{tokens:l,numArgs:i,delimiters:s},n===Ld[n]),{type:"internal",mode:t.mode}}});me({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=$6(t.gullet.popToken());t.gullet.consumeSpaces();var a=CTe(t);return F6(t,r,a,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});me({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=$6(t.gullet.popToken()),a=t.gullet.popToken(),i=t.gullet.popToken();return F6(t,r,i,n==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var ia=function(t,n,r){var a=Qe.math[t]&&Qe.math[t].replace,i=Hp(a||t,n,r);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return i},Zp=function(t,n,r,a){var i=r.havingBaseStyle(n),o=J.makeSpan(a.concat(i.sizingClasses(r)),[t],r),s=i.sizeMultiplier/r.sizeMultiplier;return o.height*=s,o.depth*=s,o.maxFontSize=i.sizeMultiplier,o},P6=function(t,n,r){var a=n.havingBaseStyle(r),i=(1-n.sizeMultiplier/a.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=de(i),t.height-=i,t.depth+=i},RTe=function(t,n,r,a,i,o){var s=J.makeSymbol(t,"Main-Regular",i,a),l=Zp(s,n,a,o);return r&&P6(l,a,n),l},ITe=function(t,n,r,a){return J.makeSymbol(t,"Size"+n+"-Regular",r,a)},q6=function(t,n,r,a,i,o){var s=ITe(t,n,i,a),l=Zp(J.makeSpan(["delimsizing","size"+n],[s],a),Se.TEXT,a,o);return r&&P6(l,a,Se.TEXT),l},Rs=function(t,n,r){var a;n==="Size1-Regular"?a="delim-size1":a="delim-size4";var i=J.makeSpan(["delimsizinginner",a],[J.makeSpan([],[J.makeSymbol(t,n,r)])]);return{type:"elem",elem:i}},Is=function(t,n,r){var a=bn["Size4-Regular"][t.charCodeAt(0)]?bn["Size4-Regular"][t.charCodeAt(0)][4]:bn["Size1-Regular"][t.charCodeAt(0)][4],i=new nr("inner",FAe(t,Math.round(1e3*n))),o=new Ln([i],{width:de(a),height:de(n),style:"width:"+de(a),viewBox:"0 0 "+1e3*a+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),s=J.makeSvgSpan([],[o],r);return s.height=n,s.style.height=de(n),s.style.width=de(a),{type:"elem",elem:s}},Dd=.008,oi={type:"kern",size:-1*Dd},OTe=["|","\\lvert","\\rvert","\\vert"],LTe=["\\|","\\lVert","\\rVert","\\Vert"],B6=function(t,n,r,a,i,o){var s,l,u,d,p="",h=0;s=u=d=t,l=null;var m="Size1-Regular";t==="\\uparrow"?u=d="⏐":t==="\\Uparrow"?u=d="‖":t==="\\downarrow"?s=u="⏐":t==="\\Downarrow"?s=u="‖":t==="\\updownarrow"?(s="\\uparrow",u="⏐",d="\\downarrow"):t==="\\Updownarrow"?(s="\\Uparrow",u="‖",d="\\Downarrow"):Ee.contains(OTe,t)?(u="∣",p="vert",h=333):Ee.contains(LTe,t)?(u="∥",p="doublevert",h=556):t==="["||t==="\\lbrack"?(s="⎡",u="⎢",d="⎣",m="Size4-Regular",p="lbrack",h=667):t==="]"||t==="\\rbrack"?(s="⎤",u="⎥",d="⎦",m="Size4-Regular",p="rbrack",h=667):t==="\\lfloor"||t==="⌊"?(u=s="⎢",d="⎣",m="Size4-Regular",p="lfloor",h=667):t==="\\lceil"||t==="⌈"?(s="⎡",u=d="⎢",m="Size4-Regular",p="lceil",h=667):t==="\\rfloor"||t==="⌋"?(u=s="⎥",d="⎦",m="Size4-Regular",p="rfloor",h=667):t==="\\rceil"||t==="⌉"?(s="⎤",u=d="⎥",m="Size4-Regular",p="rceil",h=667):t==="("||t==="\\lparen"?(s="⎛",u="⎜",d="⎝",m="Size4-Regular",p="lparen",h=875):t===")"||t==="\\rparen"?(s="⎞",u="⎟",d="⎠",m="Size4-Regular",p="rparen",h=875):t==="\\{"||t==="\\lbrace"?(s="⎧",l="⎨",d="⎩",u="⎪",m="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(s="⎫",l="⎬",d="⎭",u="⎪",m="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(s="⎧",d="⎩",u="⎪",m="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(s="⎫",d="⎭",u="⎪",m="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(s="⎧",d="⎭",u="⎪",m="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(s="⎫",d="⎩",u="⎪",m="Size4-Regular");var f=ia(s,m,i),g=f.height+f.depth,_=ia(u,m,i),k=_.height+_.depth,b=ia(d,m,i),x=b.height+b.depth,M=0,N=1;if(l!==null){var E=ia(l,m,i);M=E.height+E.depth,N=2}var D=g+x+M,P=Math.max(0,Math.ceil((n-D)/(N*k))),C=D+P*N*k,I=a.fontMetrics().axisHeight;r&&(I*=a.sizeMultiplier);var q=C/2-I,Z=[];if(p.length>0){var X=C-g-x,K=Math.round(C*1e3),R=PAe(p,Math.round(X*1e3)),H=new nr(p,R),G=(h/1e3).toFixed(3)+"em",z=(K/1e3).toFixed(3)+"em",V=new Ln([H],{width:G,height:z,viewBox:"0 0 "+h+" "+K}),A=J.makeSvgSpan([],[V],a);A.height=K/1e3,A.style.width=G,A.style.height=z,Z.push({type:"elem",elem:A})}else{if(Z.push(Rs(d,m,i)),Z.push(oi),l===null){var Y=C-g-x+2*Dd;Z.push(Is(u,Y,a))}else{var ee=(C-g-x-M)/2+2*Dd;Z.push(Is(u,ee,a)),Z.push(oi),Z.push(Rs(l,m,i)),Z.push(oi),Z.push(Is(u,ee,a))}Z.push(oi),Z.push(Rs(s,m,i))}var L=a.havingBaseStyle(Se.TEXT),se=J.makeVList({positionType:"bottom",positionData:q,children:Z},L);return Zp(J.makeSpan(["delimsizing","mult"],[se],L),Se.TEXT,a,o)},Os=80,Ls=.08,Ds=function(t,n,r,a,i){var o=$Ae(t,a,r),s=new nr(t,o),l=new Ln([s],{width:"400em",height:de(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return J.makeSvgSpan(["hide-tail"],[l],i)},DTe=function(t,n){var r=n.havingBaseSizing(),a=V6("\\surd",t*r.sizeMultiplier,j6,r),i=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),s,l=0,u=0,d=0,p;return a.type==="small"?(d=1e3+1e3*o+Os,t<1?i=1:t<1.4&&(i=.7),l=(1+o+Ls)/i,u=(1+o)/i,s=Ds("sqrtMain",l,d,o,n),s.style.minWidth="0.853em",p=.833/i):a.type==="large"?(d=(1e3+Os)*ha[a.size],u=(ha[a.size]+o)/i,l=(ha[a.size]+o+Ls)/i,s=Ds("sqrtSize"+a.size,l,d,o,n),s.style.minWidth="1.02em",p=1/i):(l=t+o+Ls,u=t+o,d=Math.floor(1e3*t+o)+Os,s=Ds("sqrtTall",l,d,o,n),s.style.minWidth="0.742em",p=1.056),s.height=u,s.style.height=de(l),{span:s,advanceWidth:p,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*i}},U6=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],zTe=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],H6=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],ha=[0,1.2,1.8,2.4,3],$Te=function(t,n,r,a,i){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),Ee.contains(U6,t)||Ee.contains(H6,t))return q6(t,n,!1,r,a,i);if(Ee.contains(zTe,t))return B6(t,ha[n],!1,r,a,i);throw new ce("Illegal delimiter: '"+t+"'")},FTe=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],PTe=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"stack"}],j6=[{type:"small",style:Se.SCRIPTSCRIPT},{type:"small",style:Se.SCRIPT},{type:"small",style:Se.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],qTe=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},V6=function(t,n,r,a){for(var i=Math.min(2,3-a.style.size),o=i;o<r.length&&r[o].type!=="stack";o++){var s=ia(t,qTe(r[o]),"math"),l=s.height+s.depth;if(r[o].type==="small"){var u=a.havingBaseStyle(r[o].style);l*=u.sizeMultiplier}if(l>n)return r[o]}return r[r.length-1]},G6=function(t,n,r,a,i,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var s;Ee.contains(H6,t)?s=FTe:Ee.contains(U6,t)?s=j6:s=PTe;var l=V6(t,n,s,a);return l.type==="small"?RTe(t,l.style,r,a,i,o):l.type==="large"?q6(t,l.size,r,a,i,o):B6(t,n,r,a,i,o)},BTe=function(t,n,r,a,i,o){var s=a.fontMetrics().axisHeight*a.sizeMultiplier,l=901,u=5/a.fontMetrics().ptPerEm,d=Math.max(n-s,r+s),p=Math.max(d/500*l,2*d-u);return G6(t,p,!0,a,i,o)},On={sqrtImage:DTe,sizedDelim:$Te,sizeToMaxHeight:ha,customSizedDelim:G6,leftRightDelim:BTe},Vm={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},UTe=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Io(e,t){var n=Co(e);if(n&&Ee.contains(UTe,n.text))return n;throw n?new ce("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new ce("Invalid delimiter type '"+e.type+"'",e)}me({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Io(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Vm[e.funcName].size,mclass:Vm[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?J.makeSpan([e.mclass]):On.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(an(e.delim,e.mode));var n=new ae.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=de(On.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function Gm(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}me({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new ce("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Io(t[0],e).text,color:n}}});me({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Io(t[0],e),r=e.parser;++r.leftrightDepth;var a=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Oe(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:a,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{Gm(e);for(var n=ht(e.body,t,!0,["mopen","mclose"]),r=0,a=0,i=!1,o=0;o<n.length;o++)n[o].isMiddle?i=!0:(r=Math.max(n[o].height,r),a=Math.max(n[o].depth,a));r*=t.sizeMultiplier,a*=t.sizeMultiplier;var s;if(e.left==="."?s=Ma(t,["mopen"]):s=On.leftRightDelim(e.left,r,a,t,e.mode,["mopen"]),n.unshift(s),i)for(var l=1;l<n.length;l++){var u=n[l],d=u.isMiddle;d&&(n[l]=On.leftRightDelim(d.delim,r,a,d.options,e.mode,[]))}var p;if(e.right===".")p=Ma(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;p=On.leftRightDelim(e.right,r,a,h,e.mode,["mclose"])}return n.push(p),J.makeSpan(["minner"],n,t)},mathmlBuilder:(e,t)=>{Gm(e);var n=Pt(e.body,t);if(e.left!=="."){var r=new ae.MathNode("mo",[an(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(e.right!=="."){var a=new ae.MathNode("mo",[an(e.right,e.mode)]);a.setAttribute("fence","true"),e.rightColor&&a.setAttribute("mathcolor",e.rightColor),n.push(a)}return Gp(n)}});me({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Io(t[0],e);if(!e.parser.leftrightDepth)throw new ce("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if(e.delim===".")n=Ma(t,[]);else{n=On.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?an("|","text"):an(e.delim,e.mode),r=new ae.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Xp=(e,t)=>{var n=J.wrapFragment(je(e.body,t),t),r=e.label.slice(1),a=t.sizeMultiplier,i,o=0,s=Ee.isCharacterBox(e.body);if(r==="sout")i=J.makeSpan(["stretchy","sout"]),i.height=t.fontMetrics().defaultRuleThickness/a,o=-.5*t.fontMetrics().xHeight;else if(r==="phase"){var l=at({number:.6,unit:"pt"},t),u=at({number:.35,unit:"ex"},t),d=t.havingBaseSizing();a=a/d.sizeMultiplier;var p=n.height+n.depth+l+u;n.style.paddingLeft=de(p/2+l);var h=Math.floor(1e3*p*a),m=DAe(h),f=new Ln([new nr("phase",m)],{width:"400em",height:de(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});i=J.makeSvgSpan(["hide-tail"],[f],t),i.style.height=de(p),o=n.depth+l+u}else{/cancel/.test(r)?s||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var g=0,_=0,k=0;/box/.test(r)?(k=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=t.fontMetrics().fboxsep+(r==="colorbox"?0:k),_=g):r==="angl"?(k=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),g=4*k,_=Math.max(0,.25-n.depth)):(g=s?.2:0,_=g),i=zn.encloseSpan(n,r,g,_,t),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=de(k)):r==="angl"&&k!==.049&&(i.style.borderTopWidth=de(k),i.style.borderRightWidth=de(k)),o=n.depth+_,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var b;if(e.backgroundColor)b=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:o},{type:"elem",elem:n,shift:0}]},t);else{var x=/cancel|phase/.test(r)?["svg-align"]:[];b=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:i,shift:o,wrapperClasses:x}]},t)}return/cancel/.test(r)&&(b.height=n.height,b.depth=n.depth),/cancel/.test(r)&&!s?J.makeSpan(["mord","cancel-lap"],[b],t):J.makeSpan(["mord"],[b],t)},Qp=(e,t)=>{var n=0,r=new ae.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Xe(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};me({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:a}=e,i=Oe(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:r.mode,label:a,backgroundColor:i,body:o}},htmlBuilder:Xp,mathmlBuilder:Qp});me({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:a}=e,i=Oe(t[0],"color-token").color,o=Oe(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:a,backgroundColor:o,borderColor:i,body:s}},htmlBuilder:Xp,mathmlBuilder:Qp});me({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});me({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"enclose",mode:n.mode,label:r,body:a}},htmlBuilder:Xp,mathmlBuilder:Qp});me({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var W6={};function xn(e){for(var{type:t,names:n,props:r,handler:a,htmlBuilder:i,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},l=0;l<n.length;++l)W6[n[l]]=s;i&&(Wi[t]=i),o&&(Ki[t]=o)}var K6={};function T(e,t){K6[e]=t}function Wm(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Oo=e=>{var t=e.parser.settings;if(!t.displayMode)throw new ce("{"+e.envName+"} can be used only in display mode.")};function Jp(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function ir(e,t,n){var{hskipBeforeAndAfter:r,addJot:a,cols:i,arraystretch:o,colSeparationType:s,autoTag:l,singleRow:u,emptySingleRow:d,maxNumCols:p,leqno:h}=t;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)o=1;else if(o=parseFloat(m),!o||o<0)throw new ce("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var f=[],g=[f],_=[],k=[],b=l!=null?[]:void 0;function x(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function M(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new nn("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!l&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(x(),k.push(Wm(e));;){var N=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),N={type:"ordgroup",mode:e.mode,body:N},n&&(N={type:"styling",mode:e.mode,style:n,body:[N]}),f.push(N);var E=e.fetch().text;if(E==="&"){if(p&&f.length===p){if(u||s)throw new ce("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(E==="\\end"){M(),f.length===1&&N.type==="styling"&&N.body[0].body.length===0&&(g.length>1||!d)&&g.pop(),k.length<g.length+1&&k.push([]);break}else if(E==="\\\\"){e.consume();var D=void 0;e.gullet.future().text!==" "&&(D=e.parseSizeGroup(!0)),_.push(D?D.value:null),M(),k.push(Wm(e)),f=[],g.push(f),x()}else throw new ce("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:a,arraystretch:o,body:g,cols:i,rowGaps:_,hskipBeforeAndAfter:r,hLinesBeforeRow:k,colSeparationType:s,tags:b,leqno:h}}function eh(e){return e.slice(0,1)==="d"?"display":"text"}var wn=function(t,n){var r,a,i=t.body.length,o=t.hLinesBeforeRow,s=0,l=new Array(i),u=[],d=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),p=1/n.fontMetrics().ptPerEm,h=5*p;if(t.colSeparationType&&t.colSeparationType==="small"){var m=n.havingStyle(Se.SCRIPT).sizeMultiplier;h=.2778*(m/n.sizeMultiplier)}var f=t.colSeparationType==="CD"?at({number:3,unit:"ex"},n):12*p,g=3*p,_=t.arraystretch*f,k=.7*_,b=.3*_,x=0;function M(ue){for(var Le=0;Le<ue.length;++Le)Le>0&&(x+=.25),u.push({pos:x,isDashed:ue[Le]})}for(M(o[0]),r=0;r<t.body.length;++r){var N=t.body[r],E=k,D=b;s<N.length&&(s=N.length);var P=new Array(N.length);for(a=0;a<N.length;++a){var C=je(N[a],n);D<C.depth&&(D=C.depth),E<C.height&&(E=C.height),P[a]=C}var I=t.rowGaps[r],q=0;I&&(q=at(I,n),q>0&&(q+=b,D<q&&(D=q),q=0)),t.addJot&&(D+=g),P.height=E,P.depth=D,x+=E,P.pos=x,x+=D+q,l[r]=P,M(o[r+1])}var Z=x/2+n.fontMetrics().axisHeight,X=t.cols||[],K=[],R,H,G=[];if(t.tags&&t.tags.some(ue=>ue))for(r=0;r<i;++r){var z=l[r],V=z.pos-Z,A=t.tags[r],Y=void 0;A===!0?Y=J.makeSpan(["eqn-num"],[],n):A===!1?Y=J.makeSpan([],[],n):Y=J.makeSpan([],ht(A,n,!0),n),Y.depth=z.depth,Y.height=z.height,G.push({type:"elem",elem:Y,shift:V})}for(a=0,H=0;a<s||H<X.length;++a,++H){for(var ee=X[H]||{},L=!0;ee.type==="separator";){if(L||(R=J.makeSpan(["arraycolsep"],[]),R.style.width=de(n.fontMetrics().doubleRuleSep),K.push(R)),ee.separator==="|"||ee.separator===":"){var se=ee.separator==="|"?"solid":"dashed",ye=J.makeSpan(["vertical-separator"],[],n);ye.style.height=de(x),ye.style.borderRightWidth=de(d),ye.style.borderRightStyle=se,ye.style.margin="0 "+de(-d/2);var ke=x-Z;ke&&(ye.style.verticalAlign=de(-ke)),K.push(ye)}else throw new ce("Invalid separator type: "+ee.separator);H++,ee=X[H]||{},L=!1}if(!(a>=s)){var Ie=void 0;(a>0||t.hskipBeforeAndAfter)&&(Ie=Ee.deflt(ee.pregap,h),Ie!==0&&(R=J.makeSpan(["arraycolsep"],[]),R.style.width=de(Ie),K.push(R)));var Pe=[];for(r=0;r<i;++r){var Ke=l[r],Ge=Ke[a];if(Ge){var nt=Ke.pos-Z;Ge.depth=Ke.depth,Ge.height=Ke.height,Pe.push({type:"elem",elem:Ge,shift:nt})}}Pe=J.makeVList({positionType:"individualShift",children:Pe},n),Pe=J.makeSpan(["col-align-"+(ee.align||"c")],[Pe]),K.push(Pe),(a<s-1||t.hskipBeforeAndAfter)&&(Ie=Ee.deflt(ee.postgap,h),Ie!==0&&(R=J.makeSpan(["arraycolsep"],[]),R.style.width=de(Ie),K.push(R)))}}if(l=J.makeSpan(["mtable"],K),u.length>0){for(var mt=J.makeLineSpan("hline",n,d),Ye=J.makeLineSpan("hdashline",n,d),ie=[{type:"elem",elem:l,shift:0}];u.length>0;){var xe=u.pop(),we=xe.pos-Z;xe.isDashed?ie.push({type:"elem",elem:Ye,shift:we}):ie.push({type:"elem",elem:mt,shift:we})}l=J.makeVList({positionType:"individualShift",children:ie},n)}if(G.length===0)return J.makeSpan(["mord"],[l],n);var Ve=J.makeVList({positionType:"individualShift",children:G},n);return Ve=J.makeSpan(["tag"],[Ve],n),J.makeFragment([l,Ve])},HTe={c:"center ",l:"left ",r:"right "},En=function(t,n){for(var r=[],a=new ae.MathNode("mtd",[],["mtr-glue"]),i=new ae.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<t.body.length;o++){for(var s=t.body[o],l=[],u=0;u<s.length;u++)l.push(new ae.MathNode("mtd",[Xe(s[u],n)]));t.tags&&t.tags[o]&&(l.unshift(a),l.push(a),t.leqno?l.unshift(i):l.push(i)),r.push(new ae.MathNode("mtr",l))}var d=new ae.MathNode("mtable",r),p=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);d.setAttribute("rowspacing",de(p));var h="",m="";if(t.cols&&t.cols.length>0){var f=t.cols,g="",_=!1,k=0,b=f.length;f[0].type==="separator"&&(h+="top ",k=1),f[f.length-1].type==="separator"&&(h+="bottom ",b-=1);for(var x=k;x<b;x++)f[x].type==="align"?(m+=HTe[f[x].align],_&&(g+="none "),_=!0):f[x].type==="separator"&&_&&(g+=f[x].separator==="|"?"solid ":"dashed ",_=!1);d.setAttribute("columnalign",m.trim()),/[sd]/.test(g)&&d.setAttribute("columnlines",g.trim())}if(t.colSeparationType==="align"){for(var M=t.cols||[],N="",E=1;E<M.length;E++)N+=E%2?"0em ":"1em ";d.setAttribute("columnspacing",N.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?d.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?d.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?d.setAttribute("columnspacing","0.5em"):d.setAttribute("columnspacing","1em");var D="",P=t.hLinesBeforeRow;h+=P[0].length>0?"left ":"",h+=P[P.length-1].length>0?"right ":"";for(var C=1;C<P.length-1;C++)D+=P[C].length===0?"none ":P[C][0]?"dashed ":"solid ";return/[sd]/.test(D)&&d.setAttribute("rowlines",D.trim()),h!==""&&(d=new ae.MathNode("menclose",[d]),d.setAttribute("notation",h.trim())),t.arraystretch&&t.arraystretch<1&&(d=new ae.MathNode("mstyle",[d]),d.setAttribute("scriptlevel","1")),d},Y6=function(t,n){t.envName.indexOf("ed")===-1&&Oo(t);var r=[],a=t.envName.indexOf("at")>-1?"alignat":"align",i=t.envName==="split",o=ir(t.parser,{cols:r,addJot:!0,autoTag:i?void 0:Jp(t.envName),emptySingleRow:!0,colSeparationType:a,maxNumCols:i?2:void 0,leqno:t.parser.settings.leqno},"display"),s,l=0,u={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var d="",p=0;p<n[0].body.length;p++){var h=Oe(n[0].body[p],"textord");d+=h.text}s=Number(d),l=s*2}var m=!l;o.body.forEach(function(k){for(var b=1;b<k.length;b+=2){var x=Oe(k[b],"styling"),M=Oe(x.body[0],"ordgroup");M.body.unshift(u)}if(m)l<k.length&&(l=k.length);else{var N=k.length/2;if(s<N)throw new ce("Too many math in a row: "+("expected "+s+", but got "+N),k[0])}});for(var f=0;f<l;++f){var g="r",_=0;f%2===1?g="l":f>0&&m&&(_=1),r[f]={type:"align",align:g,pregap:_,postgap:0}}return o.colSeparationType=m?"align":"alignat",o};xn({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Co(t[0]),r=n?[t[0]]:Oe(t[0],"ordgroup").body,a=r.map(function(o){var s=Kp(o),l=s.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new ce("Unknown column alignment: "+l,o)}),i={cols:a,hskipBeforeAndAfter:!0,maxNumCols:a.length};return ir(e.parser,i,eh(e.envName))},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var a=e.parser;if(a.consumeSpaces(),a.fetch().text==="["){if(a.consume(),a.consumeSpaces(),n=a.fetch().text,"lcr".indexOf(n)===-1)throw new ce("Expected l or c or r",a.nextToken);a.consume(),a.consumeSpaces(),a.expect("]"),a.consume(),r.cols=[{type:"align",align:n}]}}var i=ir(e.parser,r,eh(e.envName)),o=Math.max(0,...i.body.map(s=>s.length));return i.cols=new Array(o).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=ir(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Co(t[0]),r=n?[t[0]]:Oe(t[0],"ordgroup").body,a=r.map(function(o){var s=Kp(o),l=s.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new ce("Unknown column alignment: "+l,o)});if(a.length>1)throw new ce("{subarray} can contain only one column");var i={cols:a,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=ir(e.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new ce("{subarray} can contain only one column");return i},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ir(e.parser,t,eh(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Y6,htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Ee.contains(["gather","gather*"],e.envName)&&Oo(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Jp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ir(e.parser,t,"display")},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Y6,htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Oo(e);var t={autoTag:Jp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ir(e.parser,t,"display")},htmlBuilder:wn,mathmlBuilder:En});xn({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Oo(e),TTe(e.parser)},htmlBuilder:wn,mathmlBuilder:En});T("\\nonumber","\\gdef\\@eqnsw{0}");T("\\notag","\\nonumber");me({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new ce(e.funcName+" valid only within array environment")}});var Km=W6;me({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];if(a.type!=="ordgroup")throw new ce("Invalid environment name",a);for(var i="",o=0;o<a.body.length;++o)i+=Oe(a.body[o],"textord").text;if(r==="\\begin"){if(!Km.hasOwnProperty(i))throw new ce("No such environment: "+i,a);var s=Km[i],{args:l,optArgs:u}=n.parseArguments("\\begin{"+i+"}",s),d={mode:n.mode,envName:i,parser:n},p=s.handler(d,l,u);n.expect("\\end",!1);var h=n.nextToken,m=Oe(n.parseFunction(),"environment");if(m.name!==i)throw new ce("Mismatch: \\begin{"+i+"} matched by \\end{"+m.name+"}",h);return p}return{type:"environment",mode:n.mode,name:i,nameGroup:a}}});var Z6=(e,t)=>{var n=e.font,r=t.withFont(n);return je(e.body,r)},X6=(e,t)=>{var n=e.font,r=t.withFont(n);return Xe(e.body,r)},Ym={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};me({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=Yi(t[0]),i=r;return i in Ym&&(i=Ym[i]),{type:"font",mode:n.mode,font:i.slice(1),body:a}},htmlBuilder:Z6,mathmlBuilder:X6});me({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],a=Ee.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Ro(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:a}}});me({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:a}=e,{mode:i}=n,o=n.parseExpression(!0,a),s="math"+r.slice(1);return{type:"font",mode:i,font:s,body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Z6,mathmlBuilder:X6});var Q6=(e,t)=>{var n=t;return e==="display"?n=n.id>=Se.SCRIPT.id?n.text():Se.DISPLAY:e==="text"&&n.size===Se.DISPLAY.size?n=Se.TEXT:e==="script"?n=Se.SCRIPT:e==="scriptscript"&&(n=Se.SCRIPTSCRIPT),n},th=(e,t)=>{var n=Q6(e.size,t.style),r=n.fracNum(),a=n.fracDen(),i;i=t.havingStyle(r);var o=je(e.numer,i,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<l?l:o.depth}i=t.havingStyle(a);var u=je(e.denom,i,t),d,p,h;e.hasBarLine?(e.barSize?(p=at(e.barSize,t),d=J.makeLineSpan("frac-line",t,p)):d=J.makeLineSpan("frac-line",t),p=d.height,h=d.height):(d=null,p=0,h=t.fontMetrics().defaultRuleThickness);var m,f,g;n.size===Se.DISPLAY.size||e.size==="display"?(m=t.fontMetrics().num1,p>0?f=3*h:f=7*h,g=t.fontMetrics().denom1):(p>0?(m=t.fontMetrics().num2,f=h):(m=t.fontMetrics().num3,f=3*h),g=t.fontMetrics().denom2);var _;if(d){var b=t.fontMetrics().axisHeight;m-o.depth-(b+.5*p)<f&&(m+=f-(m-o.depth-(b+.5*p))),b-.5*p-(u.height-g)<f&&(g+=f-(b-.5*p-(u.height-g)));var x=-(b-.5*p);_=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:d,shift:x},{type:"elem",elem:o,shift:-m}]},t)}else{var k=m-o.depth-(u.height-g);k<f&&(m+=.5*(f-k),g+=.5*(f-k)),_=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:u,shift:g},{type:"elem",elem:o,shift:-m}]},t)}i=t.havingStyle(n),_.height*=i.sizeMultiplier/t.sizeMultiplier,_.depth*=i.sizeMultiplier/t.sizeMultiplier;var M;n.size===Se.DISPLAY.size?M=t.fontMetrics().delim1:n.size===Se.SCRIPTSCRIPT.size?M=t.havingStyle(Se.SCRIPT).fontMetrics().delim2:M=t.fontMetrics().delim2;var N,E;return e.leftDelim==null?N=Ma(t,["mopen"]):N=On.customSizedDelim(e.leftDelim,M,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?E=J.makeSpan([]):e.rightDelim==null?E=Ma(t,["mclose"]):E=On.customSizedDelim(e.rightDelim,M,!0,t.havingStyle(n),e.mode,["mclose"]),J.makeSpan(["mord"].concat(i.sizingClasses(t)),[N,J.makeSpan(["mfrac"],[_]),E],t)},nh=(e,t)=>{var n=new ae.MathNode("mfrac",[Xe(e.numer,t),Xe(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var r=at(e.barSize,t);n.setAttribute("linethickness",de(r))}var a=Q6(e.size,t.style);if(a.size!==t.style.size){n=new ae.MathNode("mstyle",[n]);var i=a.size===Se.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var o=[];if(e.leftDelim!=null){var s=new ae.MathNode("mo",[new ae.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),o.push(s)}if(o.push(n),e.rightDelim!=null){var l=new ae.MathNode("mo",[new ae.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Gp(o)}return n};me({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=t[1],o,s=null,l=null,u="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,s="(",l=")";break;case"\\\\bracefrac":o=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:a,denom:i,hasBarLine:o,leftDelim:s,rightDelim:l,size:u,barSize:null}},htmlBuilder:th,mathmlBuilder:nh});me({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:a,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});me({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,a;switch(n){case"\\over":a="\\frac";break;case"\\choose":a="\\binom";break;case"\\atop":a="\\\\atopfrac";break;case"\\brace":a="\\\\bracefrac";break;case"\\brack":a="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:a,token:r}}});var Zm=["display","text","script","scriptscript"],Xm=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};me({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,r=t[4],a=t[5],i=Yi(t[0]),o=i.type==="atom"&&i.family==="open"?Xm(i.text):null,s=Yi(t[1]),l=s.type==="atom"&&s.family==="close"?Xm(s.text):null,u=Oe(t[2],"size"),d,p=null;u.isBlank?d=!0:(p=u.value,d=p.number>0);var h="auto",m=t[3];if(m.type==="ordgroup"){if(m.body.length>0){var f=Oe(m.body[0],"textord");h=Zm[Number(f.text)]}}else m=Oe(m,"textord"),h=Zm[Number(m.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:d,barSize:p,leftDelim:o,rightDelim:l,size:h}},htmlBuilder:th,mathmlBuilder:nh});me({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:a}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Oe(t[0],"size").value,token:a}}});me({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0],i=vAe(Oe(t[1],"infix").size),o=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:a,denom:o,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:th,mathmlBuilder:nh});var J6=(e,t)=>{var n=t.style,r,a;e.type==="supsub"?(r=e.sup?je(e.sup,t.havingStyle(n.sup()),t):je(e.sub,t.havingStyle(n.sub()),t),a=Oe(e.base,"horizBrace")):a=Oe(e,"horizBrace");var i=je(a.base,t.havingBaseStyle(Se.DISPLAY)),o=zn.svgSpan(a,t),s;if(a.isOver?(s=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:o}]},t),s.children[0].children[0].children[1].classes.push("svg-align")):(s=J.makeVList({positionType:"bottom",positionData:i.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:i}]},t),s.children[0].children[0].children[0].classes.push("svg-align")),r){var l=J.makeSpan(["mord",a.isOver?"mover":"munder"],[s],t);a.isOver?s=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):s=J.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return J.makeSpan(["mord",a.isOver?"mover":"munder"],[s],t)},jTe=(e,t)=>{var n=zn.mathMLnode(e.label);return new ae.MathNode(e.isOver?"mover":"munder",[Xe(e.base,t),n])};me({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:J6,mathmlBuilder:jTe});me({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],a=Oe(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:n.mode,href:a,body:st(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=ht(e.body,t,!1);return J.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=rr(e.body,t);return n instanceof en||(n=new en("mrow",[n])),n.setAttribute("href",e.href),n}});me({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Oe(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var a=[],i=0;i<r.length;i++){var o=r[i];o==="~"&&(o="\\textasciitilde"),a.push({type:"textord",mode:"text",text:o})}var s={type:"text",mode:n.mode,font:"\\texttt",body:a};return{type:"href",mode:n.mode,href:r,body:st(s)}}});me({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:st(t[0])}},htmlBuilder(e,t){var n=ht(e.body,t,!1);return J.makeFragment(n)},mathmlBuilder(e,t){return new ae.MathNode("mrow",Pt(e.body,t))}});me({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:a}=e,i=Oe(t[0],"raw").string,o=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var s,l={};switch(r){case"\\htmlClass":l.class=i,s={command:"\\htmlClass",class:i};break;case"\\htmlId":l.id=i,s={command:"\\htmlId",id:i};break;case"\\htmlStyle":l.style=i,s={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),d=0;d<u.length;d++){var p=u[d].split("=");if(p.length!==2)throw new ce("Error parsing key-value for \\htmlData");l["data-"+p[0].trim()]=p[1].trim()}s={command:"\\htmlData",attributes:l};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(s)?{type:"html",mode:n.mode,attributes:l,body:st(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=ht(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var a=J.makeSpan(r,n,t);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&a.setAttribute(i,e.attributes[i]);return a},mathmlBuilder:(e,t)=>rr(e.body,t)});me({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:st(t[0]),mathml:st(t[1])}},htmlBuilder:(e,t)=>{var n=ht(e.html,t,!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>rr(e.mathml,t)});var zs=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new ce("Invalid size: '"+t+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!b6(r))throw new ce("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};me({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,a={number:0,unit:"em"},i={number:.9,unit:"em"},o={number:0,unit:"em"},s="";if(n[0])for(var l=Oe(n[0],"raw").string,u=l.split(","),d=0;d<u.length;d++){var p=u[d].split("=");if(p.length===2){var h=p[1].trim();switch(p[0].trim()){case"alt":s=h;break;case"width":a=zs(h);break;case"height":i=zs(h);break;case"totalheight":o=zs(h);break;default:throw new ce("Invalid key: '"+p[0]+"' in \\includegraphics.")}}}var m=Oe(t[0],"url").url;return s===""&&(s=m,s=s.replace(/^.*[\\/]/,""),s=s.substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:m})?{type:"includegraphics",mode:r.mode,alt:s,width:a,height:i,totalheight:o,src:m}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=at(e.height,t),r=0;e.totalheight.number>0&&(r=at(e.totalheight,t)-n);var a=0;e.width.number>0&&(a=at(e.width,t));var i={height:de(n+r)};a>0&&(i.width=de(a)),r>0&&(i.verticalAlign=de(-r));var o=new jAe(e.src,e.alt,i);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new ae.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=at(e.height,t),a=0;if(e.totalheight.number>0&&(a=at(e.totalheight,t)-r,n.setAttribute("valign",de(-a))),n.setAttribute("height",de(r+a)),e.width.number>0){var i=at(e.width,t);n.setAttribute("width",de(i))}return n.setAttribute("src",e.src),n}});me({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,a=Oe(t[0],"size");if(n.settings.strict){var i=r[1]==="m",o=a.value.unit==="mu";i?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+a.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:a.value}},htmlBuilder(e,t){return J.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var n=at(e.dimension,t);return new ae.SpaceNode(n)}});me({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:a}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=J.makeSpan([],[je(e.body,t)]),n=J.makeSpan(["inner"],[n],t)):n=J.makeSpan(["inner"],[je(e.body,t)]);var r=J.makeSpan(["fix"],[]),a=J.makeSpan([e.alignment],[n,r],t),i=J.makeSpan(["strut"]);return i.style.height=de(a.height+a.depth),a.depth&&(i.style.verticalAlign=de(-a.depth)),a.children.unshift(i),a=J.makeSpan(["thinbox"],[a],t),J.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:(e,t)=>{var n=new ae.MathNode("mpadded",[Xe(e.body,t)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});me({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,a=r.mode;r.switchMode("math");var i=n==="\\("?"\\)":"$",o=r.parseExpression(!1,i);return r.expect(i),r.switchMode(a),{type:"styling",mode:r.mode,style:"text",body:o}}});me({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new ce("Mismatched "+e.funcName)}});var Qm=(e,t)=>{switch(t.style.size){case Se.DISPLAY.size:return e.display;case Se.TEXT.size:return e.text;case Se.SCRIPT.size:return e.script;case Se.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};me({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:st(t[0]),text:st(t[1]),script:st(t[2]),scriptscript:st(t[3])}},htmlBuilder:(e,t)=>{var n=Qm(e,t),r=ht(n,t,!1);return J.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Qm(e,t);return rr(n,t)}});var e8=(e,t,n,r,a,i,o)=>{e=J.makeSpan([],[e]);var s=n&&Ee.isCharacterBox(n),l,u;if(t){var d=je(t,r.havingStyle(a.sup()),r);u={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var p=je(n,r.havingStyle(a.sub()),r);l={elem:p,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-p.height)}}var h;if(u&&l){var m=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+e.depth+o;h=J.makeVList({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:de(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:de(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(l){var f=e.height-o;h=J.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:de(-i)},{type:"kern",size:l.kern},{type:"elem",elem:e}]},r)}else if(u){var g=e.depth+o;h=J.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:de(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return e;var _=[h];if(l&&i!==0&&!s){var k=J.makeSpan(["mspace"],[],r);k.style.marginRight=de(i),_.unshift(k)}return J.makeSpan(["mop","op-limits"],_,r)},t8=["\\smallint"],Yr=(e,t)=>{var n,r,a=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Oe(e.base,"op"),a=!0):i=Oe(e,"op");var o=t.style,s=!1;o.size===Se.DISPLAY.size&&i.symbol&&!Ee.contains(t8,i.name)&&(s=!0);var l;if(i.symbol){var u=s?"Size2-Regular":"Size1-Regular",d="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(d=i.name.slice(1),i.name=d==="oiint"?"\\iint":"\\iiint"),l=J.makeSymbol(i.name,u,"math",t,["mop","op-symbol",s?"large-op":"small-op"]),d.length>0){var p=l.italic,h=J.staticSvg(d+"Size"+(s?"2":"1"),t);l=J.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:h,shift:s?.08:0}]},t),i.name="\\"+d,l.classes.unshift("mop"),l.italic=p}}else if(i.body){var m=ht(i.body,t,!0);m.length===1&&m[0]instanceof rn?(l=m[0],l.classes[0]="mop"):l=J.makeSpan(["mop"],m,t)}else{for(var f=[],g=1;g<i.name.length;g++)f.push(J.mathsym(i.name[g],i.mode,t));l=J.makeSpan(["mop"],f,t)}var _=0,k=0;return(l instanceof rn||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(_=(l.height-l.depth)/2-t.fontMetrics().axisHeight,k=l.italic),a?e8(l,n,r,t,o,k,_):(_&&(l.style.position="relative",l.style.top=de(_)),l)},qa=(e,t)=>{var n;if(e.symbol)n=new en("mo",[an(e.name,e.mode)]),Ee.contains(t8,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new en("mo",Pt(e.body,t));else{n=new en("mi",[new pa(e.name.slice(1))]);var r=new en("mo",[an("","text")]);e.parentIsSupSub?n=new en("mrow",[n,r]):n=T6([n,r])}return n},VTe={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};me({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=r;return a.length===1&&(a=VTe[a]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:Yr,mathmlBuilder:qa});me({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:st(r)}},htmlBuilder:Yr,mathmlBuilder:qa});var GTe={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};me({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Yr,mathmlBuilder:qa});me({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Yr,mathmlBuilder:qa});me({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=GTe[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Yr,mathmlBuilder:qa});var n8=(e,t)=>{var n,r,a=!1,i;e.type==="supsub"?(n=e.sup,r=e.sub,i=Oe(e.base,"operatorname"),a=!0):i=Oe(e,"operatorname");var o;if(i.body.length>0){for(var s=i.body.map(p=>{var h=p.text;return typeof h=="string"?{type:"textord",mode:p.mode,text:h}:p}),l=ht(s,t.withFont("mathrm"),!0),u=0;u<l.length;u++){var d=l[u];d instanceof rn&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=J.makeSpan(["mop"],l,t)}else o=J.makeSpan(["mop"],[],t);return a?e8(o,n,r,t,t.style,0,0):o},WTe=(e,t)=>{for(var n=Pt(e.body,t.withFont("mathrm")),r=!0,a=0;a<n.length;a++){var i=n[a];if(!(i instanceof ae.SpaceNode))if(i instanceof ae.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=i.children[0];i.children.length===1&&o instanceof ae.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break}default:r=!1}else r=!1}if(r){var s=n.map(d=>d.toText()).join("");n=[new ae.TextNode(s)]}var l=new ae.MathNode("mi",n);l.setAttribute("mathvariant","normal");var u=new ae.MathNode("mo",[an("","text")]);return e.parentIsSupSub?new ae.MathNode("mrow",[l,u]):ae.newDocumentFragment([l,u])};me({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"operatorname",mode:n.mode,body:st(a),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:n8,mathmlBuilder:WTe});T("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");vr({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?J.makeFragment(ht(e.body,t,!1)):J.makeSpan(["mord"],ht(e.body,t,!0),t)},mathmlBuilder(e,t){return rr(e.body,t,!0)}});me({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=je(e.body,t.havingCrampedStyle()),r=J.makeLineSpan("overline-line",t),a=t.fontMetrics().defaultRuleThickness,i=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r},{type:"kern",size:a}]},t);return J.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new ae.MathNode("mo",[new ae.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ae.MathNode("mover",[Xe(e.body,t),n]);return r.setAttribute("accent","true"),r}});me({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:st(r)}},htmlBuilder:(e,t)=>{var n=ht(e.body,t.withPhantom(),!1);return J.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Pt(e.body,t);return new ae.MathNode("mphantom",n)}});me({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=J.makeSpan([],[je(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0;return n=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),J.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Pt(st(e.body),t),r=new ae.MathNode("mphantom",n),a=new ae.MathNode("mpadded",[r]);return a.setAttribute("height","0px"),a.setAttribute("depth","0px"),a}});me({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=J.makeSpan(["inner"],[je(e.body,t.withPhantom())]),r=J.makeSpan(["fix"],[]);return J.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Pt(st(e.body),t),r=new ae.MathNode("mphantom",n),a=new ae.MathNode("mpadded",[r]);return a.setAttribute("width","0px"),a}});me({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Oe(t[0],"size").value,a=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:a}},htmlBuilder(e,t){var n=je(e.body,t),r=at(e.dy,t);return J.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new ae.MathNode("mpadded",[Xe(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}});me({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});me({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,a=n[0],i=Oe(t[0],"size"),o=Oe(t[1],"size");return{type:"rule",mode:r.mode,shift:a&&Oe(a,"size").value,width:i.value,height:o.value}},htmlBuilder(e,t){var n=J.makeSpan(["mord","rule"],[],t),r=at(e.width,t),a=at(e.height,t),i=e.shift?at(e.shift,t):0;return n.style.borderRightWidth=de(r),n.style.borderTopWidth=de(a),n.style.bottom=de(i),n.width=r,n.height=a+i,n.depth=-i,n.maxFontSize=a*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=at(e.width,t),r=at(e.height,t),a=e.shift?at(e.shift,t):0,i=t.color&&t.getColor()||"black",o=new ae.MathNode("mspace");o.setAttribute("mathbackground",i),o.setAttribute("width",de(n)),o.setAttribute("height",de(r));var s=new ae.MathNode("mpadded",[o]);return a>=0?s.setAttribute("height",de(a)):(s.setAttribute("height",de(a)),s.setAttribute("depth",de(-a))),s.setAttribute("voffset",de(a)),s}});function r8(e,t,n){for(var r=ht(e,t,!1),a=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var o=r[i].classes.indexOf("sizing");o<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[o+1]==="reset-size"+t.size&&(r[i].classes[o+1]="reset-size"+n.size),r[i].height*=a,r[i].depth*=a}return J.makeFragment(r)}var Jm=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],KTe=(e,t)=>{var n=t.havingSize(e.size);return r8(e.body,n,t)};me({type:"sizing",names:Jm,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:a}=e,i=a.parseExpression(!1,n);return{type:"sizing",mode:a.mode,size:Jm.indexOf(r)+1,body:i}},htmlBuilder:KTe,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Pt(e.body,n),a=new ae.MathNode("mstyle",r);return a.setAttribute("mathsize",de(n.sizeMultiplier)),a}});me({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,a=!1,i=!1,o=n[0]&&Oe(n[0],"ordgroup");if(o)for(var s="",l=0;l<o.body.length;++l){var u=o.body[l];if(s=u.text,s==="t")a=!0;else if(s==="b")i=!0;else{a=!1,i=!1;break}}else a=!0,i=!0;var d=t[0];return{type:"smash",mode:r.mode,body:d,smashHeight:a,smashDepth:i}},htmlBuilder:(e,t)=>{var n=J.makeSpan([],[je(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var a=0;a<n.children.length;a++)n.children[a].depth=0;var i=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return J.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new ae.MathNode("mpadded",[Xe(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});me({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,a=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:a}},htmlBuilder(e,t){var n=je(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=J.wrapFragment(n,t);var r=t.fontMetrics(),a=r.defaultRuleThickness,i=a;t.style.id<Se.TEXT.id&&(i=t.fontMetrics().xHeight);var o=a+i/4,s=n.height+n.depth+o+a,{span:l,ruleWidth:u,advanceWidth:d}=On.sqrtImage(s,t),p=l.height-u;p>n.height+n.depth+o&&(o=(o+p-n.height-n.depth)/2);var h=l.height-n.height-o-u;n.style.paddingLeft=de(d);var m=J.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:l},{type:"kern",size:u}]},t);if(e.index){var f=t.havingStyle(Se.SCRIPTSCRIPT),g=je(e.index,f,t),_=.6*(m.height-m.depth),k=J.makeVList({positionType:"shift",positionData:-_,children:[{type:"elem",elem:g}]},t),b=J.makeSpan(["root"],[k]);return J.makeSpan(["mord","sqrt"],[b,m],t)}else return J.makeSpan(["mord","sqrt"],[m],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new ae.MathNode("mroot",[Xe(n,t),Xe(r,t)]):new ae.MathNode("msqrt",[Xe(n,t)])}});var ef={display:Se.DISPLAY,text:Se.TEXT,script:Se.SCRIPT,scriptscript:Se.SCRIPTSCRIPT};me({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:a}=e,i=a.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:a.mode,style:o,body:i}},htmlBuilder(e,t){var n=ef[e.style],r=t.havingStyle(n).withFont("");return r8(e.body,r,t)},mathmlBuilder(e,t){var n=ef[e.style],r=t.havingStyle(n),a=Pt(e.body,r),i=new ae.MathNode("mstyle",a),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},s=o[e.style];return i.setAttribute("scriptlevel",s[0]),i.setAttribute("displaystyle",s[1]),i}});var YTe=function(t,n){var r=t.base;if(r)if(r.type==="op"){var a=r.limits&&(n.style.size===Se.DISPLAY.size||r.alwaysHandleSupSub);return a?Yr:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(n.style.size===Se.DISPLAY.size||r.limits);return i?n8:null}else{if(r.type==="accent")return Ee.isCharacterBox(r.base)?Yp:null;if(r.type==="horizBrace"){var o=!t.sub;return o===r.isOver?J6:null}else return null}else return null};vr({type:"supsub",htmlBuilder(e,t){var n=YTe(e,t);if(n)return n(e,t);var{base:r,sup:a,sub:i}=e,o=je(r,t),s,l,u=t.fontMetrics(),d=0,p=0,h=r&&Ee.isCharacterBox(r);if(a){var m=t.havingStyle(t.style.sup());s=je(a,m,t),h||(d=o.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(i){var f=t.havingStyle(t.style.sub());l=je(i,f,t),h||(p=o.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}var g;t.style===Se.DISPLAY?g=u.sup1:t.style.cramped?g=u.sup3:g=u.sup2;var _=t.sizeMultiplier,k=de(.5/u.ptPerEm/_),b=null;if(l){var x=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(o instanceof rn||x)&&(b=de(-o.italic))}var M;if(s&&l){d=Math.max(d,g,s.depth+.25*u.xHeight),p=Math.max(p,u.sub2);var N=u.defaultRuleThickness,E=4*N;if(d-s.depth-(l.height-p)<E){p=E-(d-s.depth)+l.height;var D=.8*u.xHeight-(d-s.depth);D>0&&(d+=D,p-=D)}var P=[{type:"elem",elem:l,shift:p,marginRight:k,marginLeft:b},{type:"elem",elem:s,shift:-d,marginRight:k}];M=J.makeVList({positionType:"individualShift",children:P},t)}else if(l){p=Math.max(p,u.sub1,l.height-.8*u.xHeight);var C=[{type:"elem",elem:l,marginLeft:b,marginRight:k}];M=J.makeVList({positionType:"shift",positionData:p,children:C},t)}else if(s)d=Math.max(d,g,s.depth+.25*u.xHeight),M=J.makeVList({positionType:"shift",positionData:-d,children:[{type:"elem",elem:s,marginRight:k}]},t);else throw new Error("supsub must have either sup or sub.");var I=Id(o,"right")||"mord";return J.makeSpan([I],[o,J.makeSpan(["msupsub"],[M])],t)},mathmlBuilder(e,t){var n=!1,r,a;e.base&&e.base.type==="horizBrace"&&(a=!!e.sup,a===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[Xe(e.base,t)];e.sub&&i.push(Xe(e.sub,t)),e.sup&&i.push(Xe(e.sup,t));var o;if(n)o=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&t.style===Se.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(t.style===Se.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Se.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Se.DISPLAY)?o="munder":o="msub"}else{var s=e.base;s&&s.type==="op"&&s.limits&&(t.style===Se.DISPLAY||s.alwaysHandleSupSub)||s&&s.type==="operatorname"&&s.alwaysHandleSupSub&&(s.limits||t.style===Se.DISPLAY)?o="mover":o="msup"}return new ae.MathNode(o,i)}});vr({type:"atom",htmlBuilder(e,t){return J.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new ae.MathNode("mo",[an(e.text,e.mode)]);if(e.family==="bin"){var r=Wp(e,t);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var a8={mi:"italic",mn:"normal",mtext:"normal"};vr({type:"mathord",htmlBuilder(e,t){return J.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var n=new ae.MathNode("mi",[an(e.text,e.mode,t)]),r=Wp(e,t)||"italic";return r!==a8[n.type]&&n.setAttribute("mathvariant",r),n}});vr({type:"textord",htmlBuilder(e,t){return J.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var n=an(e.text,e.mode,t),r=Wp(e,t)||"normal",a;return e.mode==="text"?a=new ae.MathNode("mtext",[n]):/[0-9]/.test(e.text)?a=new ae.MathNode("mn",[n]):e.text==="\\prime"?a=new ae.MathNode("mo",[n]):a=new ae.MathNode("mi",[n]),r!==a8[a.type]&&a.setAttribute("mathvariant",r),a}});var $s={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Fs={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};vr({type:"spacing",htmlBuilder(e,t){if(Fs.hasOwnProperty(e.text)){var n=Fs[e.text].className||"";if(e.mode==="text"){var r=J.makeOrd(e,t,"textord");return r.classes.push(n),r}else return J.makeSpan(["mspace",n],[J.mathsym(e.text,e.mode,t)],t)}else{if($s.hasOwnProperty(e.text))return J.makeSpan(["mspace",$s[e.text]],[],t);throw new ce('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Fs.hasOwnProperty(e.text))n=new ae.MathNode("mtext",[new ae.TextNode(" ")]);else{if($s.hasOwnProperty(e.text))return new ae.MathNode("mspace");throw new ce('Unknown type of space "'+e.text+'"')}return n}});var tf=()=>{var e=new ae.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};vr({type:"tag",mathmlBuilder(e,t){var n=new ae.MathNode("mtable",[new ae.MathNode("mtr",[tf(),new ae.MathNode("mtd",[rr(e.body,t)]),tf(),new ae.MathNode("mtd",[rr(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var nf={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},rf={"\\textbf":"textbf","\\textmd":"textmd"},ZTe={"\\textit":"textit","\\textup":"textup"},af=(e,t)=>{var n=e.font;if(n){if(nf[n])return t.withTextFontFamily(nf[n]);if(rf[n])return t.withTextFontWeight(rf[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(ZTe[n])};me({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,a=t[0];return{type:"text",mode:n.mode,body:st(a),font:r}},htmlBuilder(e,t){var n=af(e,t),r=ht(e.body,n,!0);return J.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=af(e,t);return rr(e.body,n)}});me({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=je(e.body,t),r=J.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=J.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:a},{type:"elem",elem:r},{type:"kern",size:3*a},{type:"elem",elem:n}]},t);return J.makeSpan(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new ae.MathNode("mo",[new ae.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ae.MathNode("munder",[Xe(e.body,t),n]);return r.setAttribute("accentunder","true"),r}});me({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=je(e.body,t),r=t.fontMetrics().axisHeight,a=.5*(n.height-r-(n.depth+r));return J.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){return new ae.MathNode("mpadded",[Xe(e.body,t)],["vcenter"])}});me({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new ce("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=of(e),r=[],a=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var o=n[i];o==="~"&&(o="\\textasciitilde"),r.push(J.makeSymbol(o,"Typewriter-Regular",e.mode,a,["mord","texttt"]))}return J.makeSpan(["mord","text"].concat(a.sizingClasses(t)),J.tryCombineChars(r),a)},mathmlBuilder(e,t){var n=new ae.TextNode(of(e)),r=new ae.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var of=e=>e.body.replace(/ /g,e.star?"␣":" "),Wn=N6,i8=`[ \r
|
|
8584
8584
|
]`,XTe="\\\\[a-zA-Z@]+",QTe="\\\\[^\uD800-\uDFFF]",JTe="("+XTe+")"+i8+"*",eCe=`\\\\(
|
|
8585
8585
|
|[ \r ]+
|
|
8586
8586
|
?)[ \r ]*`,zd="[̀-ͯ]",tCe=new RegExp(zd+"+$"),nCe="("+i8+"+)|"+(eCe+"|")+"([!-\\[\\]-‧-豈-]"+(zd+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(zd+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+JTe)+("|"+QTe+")");class sf{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(nCe,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new nn("EOF",new jt(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new ce("Unexpected character: '"+t[n]+"'",new nn(t[n],new jt(this,n,n+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=t.indexOf(`
|
|
@@ -8615,5 +8615,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
8615
8615
|
`).slice(0,100).map(n=>n.length)))<=GHe}function YHe(e){const t=e.split(`
|
|
8616
8616
|
`),n=t.length;return n>Ji?{truncated:t.slice(0,Ji).join(`
|
|
8617
8617
|
`),isTruncated:!0,totalLines:n}:e.length>Hd?{truncated:e.slice(0,Hd),isTruncated:!0,totalLines:n}:{truncated:e,isTruncated:!1,totalLines:n}}const ZHe={margin:0,padding:"12px 16px",background:"var(--mp-agents-surface)",fontSize:"13px",lineHeight:"1.5",overflowX:"auto"},I7=j.memo(({code:e,lang:t,highlight:n,prismStyle:r})=>n?w.jsx(R7,{language:t,style:r,PreTag:WHe,customStyle:ZHe,children:e}):w.jsx("pre",{className:"mp-agent-code-block-pre",children:w.jsx("code",{children:e})}));I7.displayName="CodeContent";const O7=j.memo(({lang:e="text",codeChildren:t,allowExecution:n=!1})=>{const{colorMode:r}=O3(),a=jd(t).replace(/\n$/,""),i=r==="light"?jHe:HHe,{truncated:o,isTruncated:s,totalLines:l}=j.useMemo(()=>YHe(a),[a]),[u,d]=j.useState(!1),p=j.useCallback(()=>d(f=>!f),[]),h=u?a:o,m=j.useMemo(()=>KHe(h),[h]);return w.jsxs("div",{className:"mp-agent-code-block-wrapper",children:[w.jsxs("div",{className:"mp-agent-code-block-header",children:[w.jsx("span",{className:"mp-agent-code-block-language",children:e}),w.jsx(dp,{text:a})]}),w.jsx("div",{className:"mp-agent-code-block-body",children:w.jsx(I7,{code:h,lang:e,highlight:m,prismStyle:i})}),s&&w.jsx("button",{type:"button",className:"mp-agent-code-block-toggle",onClick:p,children:u?"Show less":`Show more (${l>Ji?`${l-Ji} more lines`:`${a.length-Hd} more chars`})`})]})});O7.displayName="CodeBlock";const XHe=e=>j.isValidElement(e)?e.key?.startsWith("code-")??!1:!1,QHe=j.memo(({className:e,children:t})=>{const n=/language-(\w+)/.exec(e??""),r=n&&n[1],a=r==="math",i=typeof t=="string"&&t.split(`
|
|
8618
|
-
`).length===1;if(a)return w.jsx(w.Fragment,{children:t});if(i||!n){const o=s=>{const l=window.getSelection();if(l){const u=document.createRange();u.selectNodeContents(s.currentTarget),l.removeAllRanges(),l.addRange(u)}};return w.jsx("code",{onDoubleClick:o,className:e||"mp-agent-inline-code",children:t})}return w.jsx(O7,{lang:r||void 0,codeChildren:t,allowExecution:!1})}),JHe=j.memo(({children:e,...t})=>{const r=(Array.isArray(e)?e:[e]).find(XHe);return r?w.jsx(w.Fragment,{children:r}):w.jsx("pre",{className:"mp-agent-markdown-pre",...t,children:e})}),eje=j.memo(({children:e,...t})=>w.jsx("div",{className:"mp-agent-markdown-p",...t,children:e})),tje=j.memo(({href:e,children:t,...n})=>{const r=e?.startsWith("http"),a=r?"_blank":void 0,i=r?"noopener noreferrer":void 0;return w.jsx("a",{href:e||void 0,target:a,rel:i,className:"mp-agent-markdown-link",...n,children:t})}),nje=j.memo(({src:e,alt:t,title:n,className:r,style:a,...i})=>e?w.jsx("img",{src:e||void 0,alt:t,title:n,style:a,loading:"lazy",className:r||"mp-agent-markdown-img",...i}):null),rje={code:QHe,pre:JHe,p:eje,a:tje,img:nje},aje=[kCe,nAe,mRe,[uCe,{singleDollarTextMath:!1}]],ije=[VRe,[hLe,{detect:!0,ignoreMissing:!0}]],Uo=j.memo(({text:e,className:t="mp-agent-message-markdown"})=>w.jsx(WMe,{className:t,remarkPlugins:aje,rehypePlugins:ije,components:rje,children:e}));Uo.displayName="MarkdownMessage";const L7=({content:e,role:t})=>{const n=t===exports.MessageRole.User,r=t===exports.MessageRole.Error,a=t===exports.MessageRole.Reasoning;return n?w.jsx("p",{style:{margin:0,whiteSpace:"pre-wrap"},children:e.trim()}):r?w.jsx("p",{style:{margin:0,whiteSpace:"pre-wrap"},children:e.trim()}):a?w.jsx("pre",{style:{margin:0,fontSize:"13px",opacity:.8},children:e}):w.jsx(Uo,{text:e})},D7=({text:e,isReasoning:t})=>t?null:w.jsx("div",{className:"mp-agent-message-actions",children:w.jsx(dp,{text:e})}),Bh=({message:e})=>{const t=e.role===exports.MessageRole.User,n=e.role===exports.MessageRole.Error,r=e.role===exports.MessageRole.Reasoning,a=!!e.content,i=(e.attachments?.length??0)>0;return w.jsx("div",{className:`mp-agent-message-wrapper ${t?"mp-agent-message-user":n?"mp-agent-message-error":"mp-agent-message-assistant"}`,children:w.jsx("div",{className:"mp-agent-message-content-wrapper",children:w.jsxs("div",{className:`mp-agent-message-bubble ${t?"mp-agent-message-bubble-user":n?"mp-agent-message-bubble-error":"mp-agent-message-bubble-assistant"}`,children:[w.jsxs("div",{className:"mp-agent-message-text",children:[i&&w.jsx(T_e,{attachments:e.attachments??[]}),a&&w.jsx(L7,{content:e.content,role:e.role})]}),!t&&a&&w.jsx(D7,{text:e.content,isReasoning:r})]})})})},Ho=j.memo(({reasoning:e,isStreaming:t})=>{const[n,r]=j.useState(!0),a=j.useRef(null);if(j.useEffect(()=>{if(n)return;const o=a.current;o&&(o.scrollTop=o.scrollHeight)},[e,n,a]),!e||!e.trim())return null;const i=o=>{o.preventDefault(),o.stopPropagation(),r(s=>!s)};return w.jsxs("div",{className:`mp-agent-reasoning-panel ${n?"mp-agent-reasoning-collapsed":""}`,children:[w.jsxs("div",{className:"mp-agent-reasoning-header",children:[w.jsx("span",{className:`mp-agent-reasoning-label ${t?"mp-agent-reasoning-label-streaming":""}`,children:"Thinking"}),w.jsx(un,{icon:n?"ChevronDown":"ChevronUp",size:"sm",onClick:i})]}),!n&&w.jsx("div",{className:"mp-agent-reasoning-body",children:w.jsx("div",{className:"mp-agent-reasoning-content",ref:a,children:w.jsx(Uo,{text:e,className:"mp-agent-message-markdown mp-agent-reasoning-markdown"})})})]})});Ho.displayName="ReasoningPanel";const Uh=()=>w.jsxs("span",{className:"mp-agent-message-typing-bubble",children:[w.jsx("span",{className:"mp-agent-message-typing-dot"}),w.jsx("span",{className:"mp-agent-message-typing-dot"}),w.jsx("span",{className:"mp-agent-message-typing-dot"})]}),oje=e=>{if(e.length<=1)return e;const t=new Map;for(const n of e)t.set(n.id,n);return Array.from(t.values())},sje=({message:e,contextKey:t,isStreaming:n,reasoningEnabled:r})=>{const a=new Map((e.toolCalls??[]).map(i=>[i.id,i]));return w.jsxs(w.Fragment,{children:[(e.parts??[]).map((i,o)=>{if(i.type==="reasoning")return!r||!i.text.trim()?null:w.jsx(Ho,{reasoning:i.text,isStreaming:n},o);if(i.type==="text")return i.text.trim()?w.jsx(Bh,{message:{...e,content:i.text,reasoning:void 0,toolCalls:[]}},o):null;const s=a.get(i.toolCallId);return s?w.jsx(xp,{call:s,contextKey:t,messageId:e.id,chatId:e.chat},o):null}),n&&(e.parts?.length??0)===0&&w.jsx(Uh,{})]})},lje=({message:e,contextKey:t,isStreaming:n,reasoningEnabled:r})=>{const a=r&&e.role===exports.MessageRole.Assistant&&!!e.reasoning,i=e.role===exports.MessageRole.Assistant&&typeof e.content=="string"&&e.content.trim().length>0,o=!!(n&&!a&&!i),s=typeof e.content=="string"&&e.content.trim().length>0||(e.attachments?.length??0)>0,l=oje(e.toolCalls??[]);return w.jsxs(w.Fragment,{children:[a&&w.jsx(Ho,{reasoning:e.reasoning,isStreaming:n}),o&&w.jsx(Uh,{}),s&&w.jsx(Bh,{message:e}),!n&&l.length>0&&w.jsx("div",{className:"mp-agent-tool-calls",children:l.map(u=>w.jsx(xp,{call:u,contextKey:t,messageId:e.id,chatId:e.chat},u.id))})]})},cje=({message:e,contextKey:t,isStreaming:n,showParticipantChrome:r=!1})=>{const i=$e().config.features?.reasoning!==!1,o=r&&!!(e.sender||e.agentName),s=e.role===exports.MessageRole.User,l=e.role===exports.MessageRole.Assistant&&(e.parts?.length??0)>0?w.jsx(sje,{message:e,contextKey:t,isStreaming:n,reasoningEnabled:i}):w.jsx(lje,{message:e,contextKey:t,isStreaming:n,reasoningEnabled:i}),u=["mp-agent-message-group",o?"mp-agent-message-group-with-chrome":"",s?"mp-agent-message-group-user":""].filter(Boolean).join(" ");return w.jsxs("div",{className:u,children:[o&&w.jsxs("div",{className:"mp-agent-message-group-header",children:[w.jsx(wp,{message:e}),w.jsx(Ep,{message:e})]}),w.jsx("div",{className:"mp-agent-message-group-body",children:l})]})},eo=j.memo(cje),c5=[],uje=120,dje=e=>{const t=e.activeChatId;return t?e.chatState[t]?.messages??c5:c5},z7=({showParticipantChrome:e=!1})=>{const t=Wt(),n=fe(N=>N.contextKey),r=fe(N=>N.draftChatKey),a=fe(N=>N.activeChatId),i=fe(dje),o=a??r,s=mp(a),l=fe(N=>De(N,o).pendingAssistant?.content?.length),u=fe(N=>De(N,o).pendingAssistant?.id),d=fe(N=>De(N,o).status),p=d===st.Sending||d===st.Streaming,h=j.useRef(null),m=j.useRef(!0),f=j.useRef(!1),g=j.useRef(!1),_=j.useRef(null),k=cxe({count:i.length,getScrollElement:()=>h.current,estimateSize:()=>uje,overscan:8,gap:16,getItemKey:N=>i[N]?.id??N}),b=k.getVirtualItems(),x=j.useCallback(()=>{const N=h.current;N&&(N.scrollTop=N.scrollHeight)},[]);j.useEffect(()=>{if(i.length!==0){if(!f.current){f.current=!0,g.current=!0,k.scrollToIndex(i.length-1,{align:"end"}),requestAnimationFrame(()=>{x(),requestAnimationFrame(()=>{x(),g.current=!1})});return}m.current&&requestAnimationFrame(x)}},[i.length,k,x]),j.useLayoutEffect(()=>{const N=_.current,E=h.current;!N||!E||s.isFetchingNextPage||i.length<=N.count||(g.current=!0,N.wasAtBottom?E.scrollTop=E.scrollHeight:E.scrollTop=N.scrollTop+(E.scrollHeight-N.scrollHeight),_.current=null,requestAnimationFrame(()=>{g.current=!1}))},[i.length,s.isFetchingNextPage]),j.useEffect(()=>{p&&m.current&&x()},[l,p,x]),j.useEffect(()=>{const N=h.current;if(!N)return;const E=()=>{if(g.current)return;const{scrollTop:D,scrollHeight:P,clientHeight:C}=N;m.current=P-D-C<150};return N.addEventListener("scroll",E,{passive:!0}),()=>N.removeEventListener("scroll",E)},[]);const M=b[0]?.index??Number.POSITIVE_INFINITY;return j.useEffect(()=>{if(!s.hasNextPage||s.isFetchingNextPage||M>1)return;const N=h.current;N&&(_.current={scrollHeight:N.scrollHeight,scrollTop:N.scrollTop,count:i.length,wasAtBottom:m.current}),s.fetchNextPage()},[M,s.hasNextPage,s.isFetchingNextPage,s.fetchNextPage,i.length]),!a&&i.length===0&&!u?w.jsx("div",{className:"mp-agent-messages-empty",children:w.jsxs("div",{className:"mp-agent-messages-empty-content",children:[w.jsx("h4",{children:t.helloThere}),w.jsx("p",{children:t.howCanIHelpYou})]})}):a&&i.length===0&&s.isLoading?w.jsx("div",{className:"mp-agent-messages-empty",children:w.jsx("div",{className:"mp-agent-messages-empty-content",children:w.jsx("p",{children:t.fetchingChats})})}):w.jsxs("div",{className:"mp-agent-messages",ref:h,children:[s.isFetchingNextPage&&w.jsx("div",{className:"mp-agent-messages-load-more",children:w.jsx("div",{className:"mp-agent-messages-load-more-text",children:t.fetchingChats})}),w.jsx("div",{className:"mp-agent-messages-virtual-list",style:{height:k.getTotalSize()},children:b.map(N=>{const E=i[N.index];return E?w.jsx("div",{ref:k.measureElement,"data-index":N.index,className:"mp-agent-messages-virtual-item",style:{transform:`translateY(${N.start}px)`},children:w.jsx(eo,{message:E,contextKey:n,showParticipantChrome:e})},N.key):null})}),!!u&&w.jsx(pje,{pendingKey:o,contextKey:n,showParticipantChrome:e}),w.jsx(nv,{})]})},pje=j.memo(({pendingKey:e,contextKey:t,showParticipantChrome:n})=>{const r=fe(s=>De(s,e)),a=r.pendingAssistant,i=r.status;if(!a)return null;const o=i===st.Sending||i===st.Streaming;return w.jsx(eo,{message:a,contextKey:t,isStreaming:o,showParticipantChrome:n},a.id)});function hje(e,t,n){const r=[...e].sort((a,i)=>a.createdAt.localeCompare(i.createdAt));t&&r.push(t);for(let a=r.length-1;a>=0;a--){const i=r[a].toolCalls??[];for(let o=i.length-1;o>=0;o--)try{const s=n(i[o]);if(s&&Array.isArray(s.tasks)&&s.tasks.length>0)return s}catch{}}}const mje=({status:e,generating:t})=>{switch(e){case"done":return w.jsx(_5,{size:13,className:"mp-agent-plan-task-icon mp-agent-plan-task-icon-done"});case"in_progress":return t?w.jsx(ma,{size:13,className:"mp-agent-plan-task-icon mp-agent-subagent-spinner"}):w.jsx(Kd,{size:13,className:"mp-agent-plan-task-icon"});case"skipped":return w.jsx(x5,{size:13,className:"mp-agent-plan-task-icon"});default:return w.jsx(w5,{size:13,className:"mp-agent-plan-task-icon"})}},Hh=j.memo(()=>{const t=$e().config.planExtractor,n=fe(h=>h.activeChatId),r=fe(h=>n?De(h,n).messages:void 0),a=fe(h=>n?De(h,n).pendingAssistant:void 0),i=fe(h=>n?De(h,n).status===st.Streaming:!1),[o,s]=j.useState(!1),l=j.useMemo(()=>t&&r?hje(r,a,t):void 0,[t,r,a]);if(!l)return null;const u=l.tasks.filter(h=>h.status==="done"||h.status==="skipped").length,d=l.tasks.find(h=>h.status==="in_progress"),p=u===l.tasks.length;return w.jsx("div",{className:"mp-agent-plan-panel-wrapper",children:w.jsxs("div",{className:"mp-agent-plan-panel",children:[w.jsxs("button",{type:"button",className:"mp-agent-plan-header",onClick:()=>s(h=>!h),"aria-expanded":o,children:[w.jsx("span",{className:"mp-agent-plan-header-icon",children:p?w.jsx(Gd,{size:14}):w.jsx(T5,{size:14})}),w.jsx("span",{className:"mp-agent-plan-title",children:l.title||"Plan"}),w.jsxs("span",{className:"mp-agent-plan-progress",children:[u,"/",l.tasks.length]}),!o&&d&&w.jsxs("span",{className:"mp-agent-plan-current",children:[i?w.jsx(ma,{size:12,className:"mp-agent-subagent-spinner"}):w.jsx(Kd,{size:12}),w.jsxs("span",{className:"mp-agent-plan-current-title",children:[d.title,!i&&" (paused)"]})]}),w.jsx("span",{className:"mp-agent-plan-chevron",children:o?w.jsx(no,{size:14}):w.jsx(Wd,{size:14})})]}),o&&w.jsx("ul",{className:"mp-agent-plan-tasks",children:l.tasks.map(h=>w.jsxs("li",{className:`mp-agent-plan-task mp-agent-plan-task-${h.status}`,children:[w.jsx(mje,{status:h.status,generating:i}),w.jsx("span",{className:"mp-agent-plan-task-title",children:h.title})]},h.id))})]})})});Hh.displayName="PlanProgressPanel";const $7=({onClose:e,agentLogo:t})=>{const n=Wt(),a=$e().config.features?.historySidebar!==!1,i=fe(u=>u.isChatHistoryOpen),o=fe(u=>u.setChatHistoryOpen),s=fe(u=>u.setActiveChat),l=()=>{s(void 0)};return w.jsxs("div",{className:"mp-agent-agent-controls",children:[w.jsxs("div",{className:"mp-agent-agent-controls-left",children:[a&&w.jsx(un,{onClick:()=>o(!i),icon:i?"PanelLeftClose":"PanelLeftOpen",tooltip:i?n.hideChatHistory:n.showChatHistory,"aria-label":i?n.hideChatHistory:n.showChatHistory}),w.jsx(un,{onClick:l,icon:"SquarePen","aria-label":n.newChat,tooltip:n.newChat})]}),t&&w.jsx("div",{className:"mp-agent-agent-controls-logo",children:t}),n.panelTitle&&w.jsx("div",{className:"mp-agent-agent-controls-title",children:w.jsx("h4",{children:n.panelTitle})}),e&&w.jsx("div",{className:"mp-agent-agent-controls-right",children:w.jsx(un,{onClick:e,icon:"X","aria-label":n.close,tooltip:n.close})})]})},F7=({fetchNextPage:e,hasNextPage:t,isFetchingNextPage:n,itemRenderer:r}={})=>{const a=Wt(),{deleteChat:i,isDeleting:o}=E3(),s=fe(m=>m.chats),l=fe(m=>m.activeChatId),u=fe(m=>m.setActiveChat),d=j.useRef(null),p=j.useRef(null),h=j.useMemo(()=>Object.values(s).filter(m=>m.sessionKind!==exports.AgentSessionKind.SUBAGENT).sort((m,f)=>m.updatedAt===f.updatedAt?0:m.updatedAt<f.updatedAt?1:-1),[s]);return j.useEffect(()=>{const m=d.current,f=p.current;if(!m||!f||!e||!t)return;const g=new IntersectionObserver(_=>{_[0]?.isIntersecting&&t&&!n&&e()},{root:m,rootMargin:"100px",threshold:0});return g.observe(f),()=>g.disconnect()},[e,t,n]),w.jsxs("section",{className:"mp-agent-chat-history",children:[w.jsx("h4",{children:a.chats}),h.length===0?w.jsx("div",{className:"mp-agent-chat-history-empty",children:a.noChatsYet}):w.jsxs("ul",{ref:d,className:"mp-agent-chat-history-list",children:[h.map(m=>{const f=m.id===l;return r?w.jsx("li",{onClick:()=>u(m.id),className:`mp-agent-chat-history-item${f?" active":""}`,children:r(m)},m.id):w.jsxs("li",{onClick:()=>u(m.id),className:`mp-agent-chat-history-item${f?" active":""}`,children:[w.jsxs("div",{className:"mp-agent-chat-history-item-content",children:[w.jsx("span",{className:"mp-agent-chat-history-item-title",children:m.title||a.untitledChat}),w.jsx("span",{className:"mp-agent-chat-history-item-meta",children:new Date(m.updatedAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),w.jsx("div",{className:"mp-agent-chat-history-item-actions",children:w.jsx(Tn,{content:a.deleteChat,children:w.jsx(un,{size:"sm",icon:"Archive","aria-label":a.deleteChat,disabled:o(m.id),onClick:g=>{g.stopPropagation(),i(m.id)}})})})]},m.id)}),t&&w.jsxs("li",{className:"mp-agent-chat-history-sentinel","aria-hidden":!0,children:[w.jsx("div",{ref:p,className:"mp-agent-chat-history-sentinel-inner"}),n&&w.jsx("div",{className:"mp-agent-chat-history-loading",children:a.fetchingChats})]})]})]})},P7=({loadChats:e=!0,multiUser:t=!1})=>{const n=$e(),r=fe(o=>o.isChatHistoryOpen),a=n.config.features?.historySidebar!==!1,i=hp({enabled:e&&a,multiUser:t});return!a||!r?null:w.jsx("div",{className:"mp-agent-chat-history-panel",children:w.jsx(F7,{fetchNextPage:i.fetchNextPage,hasNextPage:i.hasNextPage,isFetchingNextPage:i.isFetchingNextPage})})},fje=({children:e})=>{const t=fe(n=>n.isChatHistoryOpen);return w.jsx("section",{className:`mp-agent-main ${t?"with-chat-history":""}`,children:e})},q7=({onToolSelected:e,onClose:t,agentLogo:n,multiUser:r=!1,participantIds:a,loadChats:i=!0,restoreLastActiveChat:o=!0})=>{const s=Wt(),l=$e(),u=fe(f=>f.activeChatId),d=fe(f=>f.setActiveChat),{isLoading:p}=x3(),{isLoading:h,error:m}=hp({enabled:i,multiUser:r});return j.useLayoutEffect(()=>{if(!o)return;const f=l.config.user?.id??jr(),g=E7e(f);g&&d(g)},[o,l.config.user?.id,d]),w.jsxs("div",{className:"mp-agent-shell mp-agent-shell-panel",children:[w.jsx(P7,{loadChats:i,multiUser:r}),w.jsxs(fje,{children:[w.jsx($7,{onClose:t,agentLogo:n}),w.jsx("div",{className:"mp-agent-main-content",children:h||p?w.jsx("div",{style:{padding:24},children:s.fetchingChats}):m?w.jsx("div",{style:{padding:24,color:"var(--mp-agents-danger)"},children:s.fetchingChatError}):w.jsx(z7,{showParticipantChrome:r},u)}),w.jsx(Hh,{},`plan-${u}`),w.jsx(ev,{onToolSelected:e,multiUser:r,participantIds:a})]})]})},gje=e=>w.jsx(q7,{...e,multiUser:!0}),B7=j.forwardRef(({attachment:e,context:t,onAdded:n,onClick:r,...a},i)=>{const{addAttachments:o}=y3(),s=l=>{if(r?.(l),l.defaultPrevented)return;const d=(typeof e=="function"?e():e)??(()=>{const p=typeof t=="function"?t():t;return p?yo(p):void 0})();d&&(o([d]),n?.(d))};return w.jsx("button",{ref:i,type:"button",...a,onClick:s})});B7.displayName="AttachContextButton";exports.AgentAttachmentSchema=b5;exports.AgentControls=$7;exports.AgentPreferencesPanel=J3;exports.AgentProvider=__e;exports.AgentRuntime=T3;exports.AgentThemeProvider=I3;exports.AttachContextButton=B7;exports.BuiltinContextAttachmentKinds=g5;exports.CHATS_PAGE_SIZE=pp;exports.ChatHistory=F7;exports.ChatHistoryPanel=P7;exports.ChatWindow=q7;exports.Composer=ev;exports.ContextAttachmentMetadataSchemaV1=y5;exports.DEFAULT_MESSAGES_PAGE_SIZE=w3;exports.FormApplyRequestedEventType=Xd;exports.FormProposalToolRenderer=M3;exports.HttpError=nd;exports.ImageToolRenderer=S3;exports.MarkdownMessage=Uo;exports.MessageActions=D7;exports.MessageAvatar=wp;exports.MessageBubble=Bh;exports.MessageContent=L7;exports.MessageHeader=Ep;exports.MessageList=z7;exports.MessageTypingAnimation=Uh;exports.MultiUserChatWindow=gje;exports.PlanProgressPanel=Hh;exports.ReasoningPanel=Ho;exports.SendMessagePayloadSchema=Q7;exports.SocketIOConfig=Ri;exports.SocketIOEvents=yi;exports.activityKeys=Ht;exports.captureTextSelectionTarget=A3;exports.chatKeys=Vn;exports.contextKeySchema=f5;exports.createContextAttachment=yo;exports.createPageContextAttachment=N3;exports.defaultTranslations=Ci;exports.flattenInfiniteActivities=J8e;exports.flattenInfiniteChats=i7e;exports.frontendConfigSchema=rd;exports.themeTokenSchema=m5;exports.translationsSchema=H7;exports.useActivitiesInfiniteList=e7e;exports.useActivitiesList=t7e;exports.useActivity=n7e;exports.useActivitySourceTypes=a7e;exports.useActivitySummary=r7e;exports.useAgentConfigurations=b3;exports.useAgentPreferences=_3;exports.useAgentRuntime=$e;exports.useAgentStore=fe;exports.useAgentTheme=O3;exports.useAutoScroll=s7e;exports.useChatBootstrap=hp;exports.useChatMetadata=d7e;exports.useChats=m3;exports.useChatsInfiniteList=h3;exports.useChatsList=o7e;exports.useComposerDraft=y3;exports.useDeleteChat=E3;exports.useEnsureActiveChat=x3;exports.useMessagesInfinite=mp;exports.useModels=f3;exports.usePageContext=u7e;exports.useProposeFormValues=p7e;exports.useRuntimeEventEmitter=k3;exports.useRuntimeEventListener=v3;exports.useTranslations=Wt;
|
|
8618
|
+
`).length===1;if(a)return w.jsx(w.Fragment,{children:t});if(i||!n){const o=s=>{const l=window.getSelection();if(l){const u=document.createRange();u.selectNodeContents(s.currentTarget),l.removeAllRanges(),l.addRange(u)}};return w.jsx("code",{onDoubleClick:o,className:e||"mp-agent-inline-code",children:t})}return w.jsx(O7,{lang:r||void 0,codeChildren:t,allowExecution:!1})}),JHe=j.memo(({children:e,...t})=>{const r=(Array.isArray(e)?e:[e]).find(XHe);return r?w.jsx(w.Fragment,{children:r}):w.jsx("pre",{className:"mp-agent-markdown-pre",...t,children:e})}),eje=j.memo(({children:e,...t})=>w.jsx("div",{className:"mp-agent-markdown-p",...t,children:e})),tje=j.memo(({href:e,children:t,...n})=>{const r=e?.startsWith("http"),a=r?"_blank":void 0,i=r?"noopener noreferrer":void 0;return w.jsx("a",{href:e||void 0,target:a,rel:i,className:"mp-agent-markdown-link",...n,children:t})}),nje=j.memo(({src:e,alt:t,title:n,className:r,style:a,...i})=>e?w.jsx("img",{src:e||void 0,alt:t,title:n,style:a,loading:"lazy",className:r||"mp-agent-markdown-img",...i}):null),rje={code:QHe,pre:JHe,p:eje,a:tje,img:nje},aje=[kCe,nAe,mRe,[uCe,{singleDollarTextMath:!1}]],ije=[VRe,[hLe,{detect:!0,ignoreMissing:!0}]],Uo=j.memo(({text:e,className:t="mp-agent-message-markdown"})=>w.jsx(WMe,{className:t,remarkPlugins:aje,rehypePlugins:ije,components:rje,children:e}));Uo.displayName="MarkdownMessage";const L7=({content:e,role:t})=>{const n=t===exports.MessageRole.User,r=t===exports.MessageRole.Error,a=t===exports.MessageRole.Reasoning;return n?w.jsx("p",{style:{margin:0,whiteSpace:"pre-wrap"},children:e.trim()}):r?w.jsx("p",{style:{margin:0,whiteSpace:"pre-wrap"},children:e.trim()}):a?w.jsx("pre",{style:{margin:0,fontSize:"13px",opacity:.8},children:e}):w.jsx(Uo,{text:e})},D7=({text:e,isReasoning:t})=>t?null:w.jsx("div",{className:"mp-agent-message-actions",children:w.jsx(dp,{text:e})}),Bh=({message:e})=>{const t=e.role===exports.MessageRole.User,n=e.role===exports.MessageRole.Error,r=e.role===exports.MessageRole.Reasoning,a=!!e.content,i=(e.attachments?.length??0)>0;return w.jsx("div",{className:`mp-agent-message-wrapper ${t?"mp-agent-message-user":n?"mp-agent-message-error":"mp-agent-message-assistant"}`,children:w.jsx("div",{className:"mp-agent-message-content-wrapper",children:w.jsxs("div",{className:`mp-agent-message-bubble ${t?"mp-agent-message-bubble-user":n?"mp-agent-message-bubble-error":"mp-agent-message-bubble-assistant"}`,children:[w.jsxs("div",{className:"mp-agent-message-text",children:[i&&w.jsx(T_e,{attachments:e.attachments??[]}),a&&w.jsx(L7,{content:e.content,role:e.role})]}),!t&&a&&w.jsx(D7,{text:e.content,isReasoning:r})]})})})},Ho=j.memo(({reasoning:e,isStreaming:t})=>{const[n,r]=j.useState(!0),a=j.useRef(null);if(j.useEffect(()=>{if(n)return;const o=a.current;o&&(o.scrollTop=o.scrollHeight)},[e,n,a]),!e||!e.trim())return null;const i=o=>{o.preventDefault(),o.stopPropagation(),r(s=>!s)};return w.jsxs("div",{className:`mp-agent-reasoning-panel ${n?"mp-agent-reasoning-collapsed":""}`,children:[w.jsxs("div",{className:"mp-agent-reasoning-header",children:[w.jsx("span",{className:`mp-agent-reasoning-label ${t?"mp-agent-reasoning-label-streaming":""}`,children:"Thinking"}),w.jsx(un,{icon:n?"ChevronDown":"ChevronUp",size:"sm",onClick:i})]}),!n&&w.jsx("div",{className:"mp-agent-reasoning-body",children:w.jsx("div",{className:"mp-agent-reasoning-content",ref:a,children:w.jsx(Uo,{text:e,className:"mp-agent-message-markdown mp-agent-reasoning-markdown"})})})]})});Ho.displayName="ReasoningPanel";const Uh=()=>w.jsxs("span",{className:"mp-agent-message-typing-bubble",children:[w.jsx("span",{className:"mp-agent-message-typing-dot"}),w.jsx("span",{className:"mp-agent-message-typing-dot"}),w.jsx("span",{className:"mp-agent-message-typing-dot"})]}),oje=e=>{if(e.length<=1)return e;const t=new Map;for(const n of e)t.set(n.id,n);return Array.from(t.values())},sje=({message:e,contextKey:t,isStreaming:n,reasoningEnabled:r})=>{const a=new Map((e.toolCalls??[]).map(i=>[i.id,i]));return w.jsxs(w.Fragment,{children:[(e.parts??[]).map((i,o)=>{if(i.type==="reasoning")return!r||!i.text.trim()?null:w.jsx(Ho,{reasoning:i.text,isStreaming:n},o);if(i.type==="text")return i.text.trim()?w.jsx(Bh,{message:{...e,content:i.text,reasoning:void 0,toolCalls:[]}},o):null;const s=a.get(i.toolCallId);return s?w.jsx(xp,{call:s,contextKey:t,messageId:e.id,chatId:e.chat},o):null}),n&&(e.parts?.length??0)===0&&w.jsx(Uh,{})]})},lje=({message:e,contextKey:t,isStreaming:n,reasoningEnabled:r})=>{const a=r&&e.role===exports.MessageRole.Assistant&&!!e.reasoning,i=e.role===exports.MessageRole.Assistant&&typeof e.content=="string"&&e.content.trim().length>0,o=!!(n&&!a&&!i),s=typeof e.content=="string"&&e.content.trim().length>0||(e.attachments?.length??0)>0,l=oje(e.toolCalls??[]);return w.jsxs(w.Fragment,{children:[a&&w.jsx(Ho,{reasoning:e.reasoning,isStreaming:n}),o&&w.jsx(Uh,{}),s&&w.jsx(Bh,{message:e}),!n&&l.length>0&&w.jsx("div",{className:"mp-agent-tool-calls",children:l.map(u=>w.jsx(xp,{call:u,contextKey:t,messageId:e.id,chatId:e.chat},u.id))})]})},cje=({message:e,contextKey:t,isStreaming:n,showParticipantChrome:r=!1})=>{const i=$e().config.features?.reasoning!==!1,o=r&&!!(e.sender||e.agentName),s=e.role===exports.MessageRole.User,l=e.role===exports.MessageRole.Assistant&&(e.parts?.length??0)>0?w.jsx(sje,{message:e,contextKey:t,isStreaming:n,reasoningEnabled:i}):w.jsx(lje,{message:e,contextKey:t,isStreaming:n,reasoningEnabled:i}),u=["mp-agent-message-group",o?"mp-agent-message-group-with-chrome":"",s?"mp-agent-message-group-user":""].filter(Boolean).join(" ");return w.jsxs("div",{className:u,children:[o&&w.jsxs("div",{className:"mp-agent-message-group-header",children:[w.jsx(wp,{message:e}),w.jsx(Ep,{message:e})]}),w.jsx("div",{className:"mp-agent-message-group-body",children:l})]})},eo=j.memo(cje),c5=[],uje=120,dje=e=>{const t=e.activeChatId;return t?e.chatState[t]?.messages??c5:c5},z7=({showParticipantChrome:e=!1})=>{const t=Wt(),n=fe(N=>N.contextKey),r=fe(N=>N.draftChatKey),a=fe(N=>N.activeChatId),i=fe(dje),o=a??r,s=mp(a),l=fe(N=>De(N,o).pendingAssistant?.content?.length),u=fe(N=>De(N,o).pendingAssistant?.id),d=fe(N=>De(N,o).status),p=d===ct.Sending||d===ct.Streaming,h=j.useRef(null),m=j.useRef(!0),f=j.useRef(!1),g=j.useRef(!1),_=j.useRef(null),k=cxe({count:i.length,getScrollElement:()=>h.current,estimateSize:()=>uje,overscan:8,gap:16,getItemKey:N=>i[N]?.id??N}),b=k.getVirtualItems(),x=j.useCallback(()=>{const N=h.current;N&&(N.scrollTop=N.scrollHeight)},[]);j.useEffect(()=>{if(i.length!==0){if(!f.current){f.current=!0,g.current=!0,k.scrollToIndex(i.length-1,{align:"end"}),requestAnimationFrame(()=>{x(),requestAnimationFrame(()=>{x(),g.current=!1})});return}m.current&&requestAnimationFrame(x)}},[i.length,k,x]),j.useLayoutEffect(()=>{const N=_.current,E=h.current;!N||!E||s.isFetchingNextPage||i.length<=N.count||(g.current=!0,N.wasAtBottom?E.scrollTop=E.scrollHeight:E.scrollTop=N.scrollTop+(E.scrollHeight-N.scrollHeight),_.current=null,requestAnimationFrame(()=>{g.current=!1}))},[i.length,s.isFetchingNextPage]),j.useEffect(()=>{p&&m.current&&x()},[l,p,x]),j.useEffect(()=>{const N=h.current;if(!N)return;const E=()=>{if(g.current)return;const{scrollTop:D,scrollHeight:P,clientHeight:C}=N;m.current=P-D-C<150};return N.addEventListener("scroll",E,{passive:!0}),()=>N.removeEventListener("scroll",E)},[]);const M=b[0]?.index??Number.POSITIVE_INFINITY;return j.useEffect(()=>{if(!s.hasNextPage||s.isFetchingNextPage||M>1)return;const N=h.current;N&&(_.current={scrollHeight:N.scrollHeight,scrollTop:N.scrollTop,count:i.length,wasAtBottom:m.current}),s.fetchNextPage()},[M,s.hasNextPage,s.isFetchingNextPage,s.fetchNextPage,i.length]),!a&&i.length===0&&!u?w.jsx("div",{className:"mp-agent-messages-empty",children:w.jsxs("div",{className:"mp-agent-messages-empty-content",children:[w.jsx("h4",{children:t.helloThere}),w.jsx("p",{children:t.howCanIHelpYou})]})}):a&&i.length===0&&s.isLoading?w.jsx("div",{className:"mp-agent-messages-empty",children:w.jsx("div",{className:"mp-agent-messages-empty-content",children:w.jsx("p",{children:t.fetchingChats})})}):w.jsxs("div",{className:"mp-agent-messages",ref:h,children:[s.isFetchingNextPage&&w.jsx("div",{className:"mp-agent-messages-load-more",children:w.jsx("div",{className:"mp-agent-messages-load-more-text",children:t.fetchingChats})}),w.jsx("div",{className:"mp-agent-messages-virtual-list",style:{height:k.getTotalSize()},children:b.map(N=>{const E=i[N.index];return E?w.jsx("div",{ref:k.measureElement,"data-index":N.index,className:"mp-agent-messages-virtual-item",style:{transform:`translateY(${N.start}px)`},children:w.jsx(eo,{message:E,contextKey:n,showParticipantChrome:e})},N.key):null})}),!!u&&w.jsx(pje,{pendingKey:o,contextKey:n,showParticipantChrome:e}),w.jsx(nv,{})]})},pje=j.memo(({pendingKey:e,contextKey:t,showParticipantChrome:n})=>{const r=fe(s=>De(s,e)),a=r.pendingAssistant,i=r.status;if(!a)return null;const o=i===ct.Sending||i===ct.Streaming;return w.jsx(eo,{message:a,contextKey:t,isStreaming:o,showParticipantChrome:n},a.id)});function hje(e,t,n){const r=[...e].sort((a,i)=>a.createdAt.localeCompare(i.createdAt));t&&r.push(t);for(let a=r.length-1;a>=0;a--){const i=r[a].toolCalls??[];for(let o=i.length-1;o>=0;o--)try{const s=n(i[o]);if(s&&Array.isArray(s.tasks)&&s.tasks.length>0)return s}catch{}}}const mje=({status:e,generating:t})=>{switch(e){case"done":return w.jsx(_5,{size:13,className:"mp-agent-plan-task-icon mp-agent-plan-task-icon-done"});case"in_progress":return t?w.jsx(ma,{size:13,className:"mp-agent-plan-task-icon mp-agent-subagent-spinner"}):w.jsx(Kd,{size:13,className:"mp-agent-plan-task-icon"});case"skipped":return w.jsx(x5,{size:13,className:"mp-agent-plan-task-icon"});default:return w.jsx(w5,{size:13,className:"mp-agent-plan-task-icon"})}},Hh=j.memo(()=>{const t=$e().config.planExtractor,n=fe(h=>h.activeChatId),r=fe(h=>n?De(h,n).messages:void 0),a=fe(h=>n?De(h,n).pendingAssistant:void 0),i=fe(h=>n?De(h,n).status===ct.Streaming:!1),[o,s]=j.useState(!1),l=j.useMemo(()=>t&&r?hje(r,a,t):void 0,[t,r,a]);if(!l)return null;const u=l.tasks.filter(h=>h.status==="done"||h.status==="skipped").length,d=l.tasks.find(h=>h.status==="in_progress"),p=u===l.tasks.length;return w.jsx("div",{className:"mp-agent-plan-panel-wrapper",children:w.jsxs("div",{className:"mp-agent-plan-panel",children:[w.jsxs("button",{type:"button",className:"mp-agent-plan-header",onClick:()=>s(h=>!h),"aria-expanded":o,children:[w.jsx("span",{className:"mp-agent-plan-header-icon",children:p?w.jsx(Gd,{size:14}):w.jsx(T5,{size:14})}),w.jsx("span",{className:"mp-agent-plan-title",children:l.title||"Plan"}),w.jsxs("span",{className:"mp-agent-plan-progress",children:[u,"/",l.tasks.length]}),!o&&d&&w.jsxs("span",{className:"mp-agent-plan-current",children:[i?w.jsx(ma,{size:12,className:"mp-agent-subagent-spinner"}):w.jsx(Kd,{size:12}),w.jsxs("span",{className:"mp-agent-plan-current-title",children:[d.title,!i&&" (paused)"]})]}),w.jsx("span",{className:"mp-agent-plan-chevron",children:o?w.jsx(no,{size:14}):w.jsx(Wd,{size:14})})]}),o&&w.jsx("ul",{className:"mp-agent-plan-tasks",children:l.tasks.map(h=>w.jsxs("li",{className:`mp-agent-plan-task mp-agent-plan-task-${h.status}`,children:[w.jsx(mje,{status:h.status,generating:i}),w.jsx("span",{className:"mp-agent-plan-task-title",children:h.title})]},h.id))})]})})});Hh.displayName="PlanProgressPanel";const $7=({onClose:e,agentLogo:t})=>{const n=Wt(),a=$e().config.features?.historySidebar!==!1,i=fe(u=>u.isChatHistoryOpen),o=fe(u=>u.setChatHistoryOpen),s=fe(u=>u.setActiveChat),l=()=>{s(void 0)};return w.jsxs("div",{className:"mp-agent-agent-controls",children:[w.jsxs("div",{className:"mp-agent-agent-controls-left",children:[a&&w.jsx(un,{onClick:()=>o(!i),icon:i?"PanelLeftClose":"PanelLeftOpen",tooltip:i?n.hideChatHistory:n.showChatHistory,"aria-label":i?n.hideChatHistory:n.showChatHistory}),w.jsx(un,{onClick:l,icon:"SquarePen","aria-label":n.newChat,tooltip:n.newChat})]}),t&&w.jsx("div",{className:"mp-agent-agent-controls-logo",children:t}),n.panelTitle&&w.jsx("div",{className:"mp-agent-agent-controls-title",children:w.jsx("h4",{children:n.panelTitle})}),e&&w.jsx("div",{className:"mp-agent-agent-controls-right",children:w.jsx(un,{onClick:e,icon:"X","aria-label":n.close,tooltip:n.close})})]})},F7=({fetchNextPage:e,hasNextPage:t,isFetchingNextPage:n,itemRenderer:r}={})=>{const a=Wt(),{deleteChat:i,isDeleting:o}=E3(),s=fe(m=>m.chats),l=fe(m=>m.activeChatId),u=fe(m=>m.setActiveChat),d=j.useRef(null),p=j.useRef(null),h=j.useMemo(()=>Object.values(s).filter(m=>m.sessionKind!==exports.AgentSessionKind.SUBAGENT).sort((m,f)=>m.updatedAt===f.updatedAt?0:m.updatedAt<f.updatedAt?1:-1),[s]);return j.useEffect(()=>{const m=d.current,f=p.current;if(!m||!f||!e||!t)return;const g=new IntersectionObserver(_=>{_[0]?.isIntersecting&&t&&!n&&e()},{root:m,rootMargin:"100px",threshold:0});return g.observe(f),()=>g.disconnect()},[e,t,n]),w.jsxs("section",{className:"mp-agent-chat-history",children:[w.jsx("h4",{children:a.chats}),h.length===0?w.jsx("div",{className:"mp-agent-chat-history-empty",children:a.noChatsYet}):w.jsxs("ul",{ref:d,className:"mp-agent-chat-history-list",children:[h.map(m=>{const f=m.id===l;return r?w.jsx("li",{onClick:()=>u(m.id),className:`mp-agent-chat-history-item${f?" active":""}`,children:r(m)},m.id):w.jsxs("li",{onClick:()=>u(m.id),className:`mp-agent-chat-history-item${f?" active":""}`,children:[w.jsxs("div",{className:"mp-agent-chat-history-item-content",children:[w.jsx("span",{className:"mp-agent-chat-history-item-title",children:m.title||a.untitledChat}),w.jsx("span",{className:"mp-agent-chat-history-item-meta",children:new Date(m.updatedAt).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),w.jsx("div",{className:"mp-agent-chat-history-item-actions",children:w.jsx(Tn,{content:a.deleteChat,children:w.jsx(un,{size:"sm",icon:"Archive","aria-label":a.deleteChat,disabled:o(m.id),onClick:g=>{g.stopPropagation(),i(m.id)}})})})]},m.id)}),t&&w.jsxs("li",{className:"mp-agent-chat-history-sentinel","aria-hidden":!0,children:[w.jsx("div",{ref:p,className:"mp-agent-chat-history-sentinel-inner"}),n&&w.jsx("div",{className:"mp-agent-chat-history-loading",children:a.fetchingChats})]})]})]})},P7=({loadChats:e=!0,multiUser:t=!1})=>{const n=$e(),r=fe(o=>o.isChatHistoryOpen),a=n.config.features?.historySidebar!==!1,i=hp({enabled:e&&a,multiUser:t});return!a||!r?null:w.jsx("div",{className:"mp-agent-chat-history-panel",children:w.jsx(F7,{fetchNextPage:i.fetchNextPage,hasNextPage:i.hasNextPage,isFetchingNextPage:i.isFetchingNextPage})})},fje=({children:e})=>{const t=fe(n=>n.isChatHistoryOpen);return w.jsx("section",{className:`mp-agent-main ${t?"with-chat-history":""}`,children:e})},q7=({onToolSelected:e,onClose:t,agentLogo:n,multiUser:r=!1,participantIds:a,loadChats:i=!0,restoreLastActiveChat:o=!0})=>{const s=Wt(),l=$e(),u=fe(f=>f.activeChatId),d=fe(f=>f.setActiveChat),{isLoading:p}=x3(),{isLoading:h,error:m}=hp({enabled:i,multiUser:r});return j.useLayoutEffect(()=>{if(!o)return;const f=l.config.user?.id??jr(),g=E7e(f);g&&d(g)},[o,l.config.user?.id,d]),w.jsxs("div",{className:"mp-agent-shell mp-agent-shell-panel",children:[w.jsx(P7,{loadChats:i,multiUser:r}),w.jsxs(fje,{children:[w.jsx($7,{onClose:t,agentLogo:n}),w.jsx("div",{className:"mp-agent-main-content",children:h||p?w.jsx("div",{style:{padding:24},children:s.fetchingChats}):m?w.jsx("div",{style:{padding:24,color:"var(--mp-agents-danger)"},children:s.fetchingChatError}):w.jsx(z7,{showParticipantChrome:r},u)}),w.jsx(Hh,{},`plan-${u}`),w.jsx(ev,{onToolSelected:e,multiUser:r,participantIds:a})]})]})},gje=e=>w.jsx(q7,{...e,multiUser:!0}),B7=j.forwardRef(({attachment:e,context:t,onAdded:n,onClick:r,...a},i)=>{const{addAttachments:o}=y3(),s=l=>{if(r?.(l),l.defaultPrevented)return;const d=(typeof e=="function"?e():e)??(()=>{const p=typeof t=="function"?t():t;return p?yo(p):void 0})();d&&(o([d]),n?.(d))};return w.jsx("button",{ref:i,type:"button",...a,onClick:s})});B7.displayName="AttachContextButton";exports.AgentAttachmentSchema=b5;exports.AgentControls=$7;exports.AgentPreferencesPanel=J3;exports.AgentProvider=__e;exports.AgentRuntime=T3;exports.AgentThemeProvider=I3;exports.AttachContextButton=B7;exports.BuiltinContextAttachmentKinds=g5;exports.CHATS_PAGE_SIZE=pp;exports.ChatHistory=F7;exports.ChatHistoryPanel=P7;exports.ChatWindow=q7;exports.Composer=ev;exports.ContextAttachmentMetadataSchemaV1=y5;exports.DEFAULT_MESSAGES_PAGE_SIZE=w3;exports.FormApplyRequestedEventType=Xd;exports.FormProposalToolRenderer=M3;exports.HttpError=nd;exports.ImageToolRenderer=S3;exports.MarkdownMessage=Uo;exports.MessageActions=D7;exports.MessageAvatar=wp;exports.MessageBubble=Bh;exports.MessageContent=L7;exports.MessageHeader=Ep;exports.MessageList=z7;exports.MessageTypingAnimation=Uh;exports.MultiUserChatWindow=gje;exports.PlanProgressPanel=Hh;exports.ReasoningPanel=Ho;exports.SendMessagePayloadSchema=Q7;exports.SocketIOConfig=Ri;exports.SocketIOEvents=yi;exports.activityKeys=Ht;exports.captureTextSelectionTarget=A3;exports.chatKeys=Vn;exports.contextKeySchema=f5;exports.createContextAttachment=yo;exports.createPageContextAttachment=N3;exports.defaultTranslations=Ci;exports.flattenInfiniteActivities=J8e;exports.flattenInfiniteChats=i7e;exports.frontendConfigSchema=rd;exports.themeTokenSchema=m5;exports.translationsSchema=H7;exports.useActivitiesInfiniteList=e7e;exports.useActivitiesList=t7e;exports.useActivity=n7e;exports.useActivitySourceTypes=a7e;exports.useActivitySummary=r7e;exports.useAgentConfigurations=b3;exports.useAgentPreferences=_3;exports.useAgentRuntime=$e;exports.useAgentStore=fe;exports.useAgentTheme=O3;exports.useAutoScroll=s7e;exports.useChatBootstrap=hp;exports.useChatMetadata=d7e;exports.useChats=m3;exports.useChatsInfiniteList=h3;exports.useChatsList=o7e;exports.useComposerDraft=y3;exports.useDeleteChat=E3;exports.useEnsureActiveChat=x3;exports.useMessagesInfinite=mp;exports.useModels=f3;exports.usePageContext=u7e;exports.useProposeFormValues=p7e;exports.useRuntimeEventEmitter=k3;exports.useRuntimeEventListener=v3;exports.useTranslations=Wt;
|
|
8619
8619
|
//# sourceMappingURL=ai-agent-react.cjs.js.map
|