mainstack-design-system 0.7.45 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +702 -15
- package/dist/FormCountryOptionsList-BTIDLbxV.cjs +8 -0
- package/dist/FormCountryOptionsList-BWbi-SZ_.js +1790 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_commonjsHelpers-DwGv2jUC.cjs +1 -0
- package/dist/clsx-C11secjj.cjs +1 -0
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/components/Accordion/AccordionContent.js +1 -0
- package/dist/components/Accordion/AccordionHeader.js +1 -0
- package/dist/components/Accordion/AccordionItem.js +1 -0
- package/dist/components/Accordion/AccordionRoot.js +1 -0
- package/dist/components/Accordion/AccordionSubtitle.js +1 -0
- package/dist/components/Accordion/AccordionTitle.js +1 -0
- package/dist/components/Accordion/AccordionTrigger.js +1 -0
- package/dist/components/Accordion/index.js +1 -0
- package/dist/components/Avatar/Avatar.js +2 -0
- package/dist/components/Avatar/avatarVariants.js +1 -0
- package/dist/components/Avatar/getAvatarSize.js +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/Banner/BannerAction.js +1 -0
- package/dist/components/Banner/BannerContent.js +1 -0
- package/dist/components/Banner/BannerHeader.js +1 -0
- package/dist/components/Banner/BannerIcon.js +1 -0
- package/dist/components/Banner/BannerRoot.js +1 -0
- package/dist/components/Banner/BannerText.js +1 -0
- package/dist/components/Banner/bannerVariants.js +1 -0
- package/dist/components/Banner/index.js +1 -0
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Button/ButtonIcon.js +1 -0
- package/dist/components/Button/ButtonLabel.js +1 -0
- package/dist/components/Button/ButtonRoot.js +1 -0
- package/dist/components/Button/buttonVariants.js +87 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/Checkbox/CheckboxIndicator.js +2 -0
- package/dist/components/Checkbox/CheckboxLabel.js +1 -0
- package/dist/components/Checkbox/CheckboxRoot.js +1 -0
- package/dist/components/Checkbox/CheckboxSubtext.js +1 -0
- package/dist/components/Checkbox/CheckboxTitle.js +1 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/Chip/Chip.js +1 -0
- package/dist/components/Chip/ChipLabel.js +1 -0
- package/dist/components/Chip/ChipRoot.js +1 -0
- package/dist/components/Chip/ChipSlot.js +1 -0
- package/dist/components/Chip/chipVariants.js +1 -0
- package/dist/components/Chip/index.js +1 -0
- package/dist/components/Form/FormCharacterCounter.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountryOptions.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountryOptionsList.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountryOptionsSearchField.js +1 -0
- package/dist/components/Form/FormCountrySelect/FormCountrySelect.js +1 -0
- package/dist/components/Form/FormCountrySelect/constant.js +1 -0
- package/dist/components/Form/FormCountrySelect/getCountryFlagComp.js +1 -0
- package/dist/components/Form/FormItem.js +1 -0
- package/dist/components/Form/FormLabel.js +1 -0
- package/dist/components/Form/FormStatus/FormErrorStatus.js +1 -0
- package/dist/components/Form/FormStatus/FormHintStatus.js +1 -0
- package/dist/components/Form/FormStatus/FormStatusRoot.js +1 -0
- package/dist/components/Form/FormStatus/FormStatusText.js +1 -0
- package/dist/components/Form/FormStatus/FormSuccessStatus.js +1 -0
- package/dist/components/Form/index.js +1 -0
- package/dist/components/Icons/AccountBalanceIcon.js +1 -0
- package/dist/components/Icons/AccountBalanceWalletIcon.js +1 -0
- package/dist/components/Icons/AccountCircleIcon.js +1 -0
- package/dist/components/Icons/AdGroupIcon.js +1 -0
- package/dist/components/Icons/AdaptiveAudioMicIcon.js +1 -0
- package/dist/components/Icons/AddAPhotoIcon.js +1 -0
- package/dist/components/Icons/AddBusinessIcon.js +1 -0
- package/dist/components/Icons/AddCircleIcon.js +1 -0
- package/dist/components/Icons/AddIcon.js +1 -0
- package/dist/components/Icons/AddLinkIcon.js +1 -0
- package/dist/components/Icons/AddPhotoAlternateIcon.js +1 -0
- package/dist/components/Icons/AddShoppingCartIcon.js +1 -0
- package/dist/components/Icons/AdminPanelSettingsIcon.js +1 -0
- package/dist/components/Icons/AdsClickIcon.js +1 -0
- package/dist/components/Icons/AlarmIcon.js +1 -0
- package/dist/components/Icons/AllInboxIcon.js +1 -0
- package/dist/components/Icons/AnimationIcon.js +1 -0
- package/dist/components/Icons/ApartmentIcon.js +1 -0
- package/dist/components/Icons/AppsIcon.js +1 -0
- package/dist/components/Icons/ArchiveIcon.js +1 -0
- package/dist/components/Icons/ArrowBackIcon.js +1 -0
- package/dist/components/Icons/ArrowCircleDownIcon.js +1 -0
- package/dist/components/Icons/ArrowCircleUpIcon.js +1 -0
- package/dist/components/Icons/ArrowDownwardIcon.js +1 -0
- package/dist/components/Icons/ArrowDropDownIcon.js +1 -0
- package/dist/components/Icons/ArrowDropUpIcon.js +1 -0
- package/dist/components/Icons/ArrowForwardIcon.js +1 -0
- package/dist/components/Icons/ArrowUpwardIcon.js +1 -0
- package/dist/components/Icons/ArtTrackIcon.js +1 -0
- package/dist/components/Icons/ArticleIcon.js +1 -0
- package/dist/components/Icons/AttachMoneyIcon.js +1 -0
- package/dist/components/Icons/AttachmentIcon.js +1 -0
- package/dist/components/Icons/AudioFileIcon.js +1 -0
- package/dist/components/Icons/AutoAwesomeMosaic.js +1 -0
- package/dist/components/Icons/AvatarIcon.js +1 -0
- package/dist/components/Icons/AwardStarIcon.js +1 -0
- package/dist/components/Icons/BarChartIcon.js +1 -0
- package/dist/components/Icons/BarcodeScannerIcon.js +1 -0
- package/dist/components/Icons/BlockIcon.js +1 -0
- package/dist/components/Icons/BoltIcon.js +1 -0
- package/dist/components/Icons/Book5Icon.js +1 -0
- package/dist/components/Icons/BookOnlineIcon.js +1 -0
- package/dist/components/Icons/BugReportIcon.js +1 -0
- package/dist/components/Icons/BusinessCenterIcon.js +1 -0
- package/dist/components/Icons/CalendarAddOnIcon.js +1 -0
- package/dist/components/Icons/CalendarClockIcon.js +1 -0
- package/dist/components/Icons/CalendarMonthIcon.js +1 -0
- package/dist/components/Icons/CalendarTodayIcon.js +1 -0
- package/dist/components/Icons/CallIcon.js +1 -0
- package/dist/components/Icons/CallMadeIcon.js +1 -0
- package/dist/components/Icons/CallMissedIcon.js +1 -0
- package/dist/components/Icons/CallMissedOutgoingIcon.js +1 -0
- package/dist/components/Icons/CallReceivedIcon.js +1 -0
- package/dist/components/Icons/CampaignIcon.js +1 -0
- package/dist/components/Icons/CancelIcon.js +1 -0
- package/dist/components/Icons/CancelScheduleSendIcon.js +1 -0
- package/dist/components/Icons/CaptivePortalIcon.js +1 -0
- package/dist/components/Icons/CardLayoutIcon.js +1 -0
- package/dist/components/Icons/CasesIcon.js +1 -0
- package/dist/components/Icons/CategoryIcon.js +1 -0
- package/dist/components/Icons/ChairIcon.js +1 -0
- package/dist/components/Icons/ChangeCircleIcon.js +1 -0
- package/dist/components/Icons/ChatBubbleIcon.js +1 -0
- package/dist/components/Icons/ChatIcon.js +1 -0
- package/dist/components/Icons/CheckBoxIcon.js +1 -0
- package/dist/components/Icons/CheckBoxOutlineBlankIcon.js +1 -0
- package/dist/components/Icons/CheckCircleIcon.js +1 -0
- package/dist/components/Icons/CheckIcon.js +1 -0
- package/dist/components/Icons/ChevronLeftIcon.js +1 -0
- package/dist/components/Icons/ChevronRightIcon.js +1 -0
- package/dist/components/Icons/ClinicalNoteIcon.js +1 -0
- package/dist/components/Icons/CloseIcon.js +1 -0
- package/dist/components/Icons/CloudUploadIcon.js +1 -0
- package/dist/components/Icons/CodeIcon.js +1 -0
- package/dist/components/Icons/CoffeeIcon.js +1 -0
- package/dist/components/Icons/CollectionsBookmarkIcon.js +1 -0
- package/dist/components/Icons/ColorPickerIcon.js +1 -0
- package/dist/components/Icons/CompareArrowsIcon.js +1 -0
- package/dist/components/Icons/ConfirmationNumberIcon.js +1 -0
- package/dist/components/Icons/ContactMailIcon.js +1 -0
- package/dist/components/Icons/ContactPageIcon.js +1 -0
- package/dist/components/Icons/ContactPhoneIcon.js +1 -0
- package/dist/components/Icons/ContactSupportIcon.js +1 -0
- package/dist/components/Icons/ContactsIcon.js +1 -0
- package/dist/components/Icons/ContentCopyIcon.js +1 -0
- package/dist/components/Icons/CreditCardGearIcon.js +1 -0
- package/dist/components/Icons/CreditCardIcon.js +1 -0
- package/dist/components/Icons/CsvIcon.js +1 -0
- package/dist/components/Icons/CurrencyExchangeIcon.js +1 -0
- package/dist/components/Icons/DNSIcon.js +1 -0
- package/dist/components/Icons/DangerousIcon.js +1 -0
- package/dist/components/Icons/DarkModeIcon.js +1 -0
- package/dist/components/Icons/DashboardIcon.js +1 -0
- package/dist/components/Icons/DataCheckIcon.js +1 -0
- package/dist/components/Icons/DataObjectIcon.js +1 -0
- package/dist/components/Icons/DatabaseIcon.js +1 -0
- package/dist/components/Icons/DehazeIcon.js +1 -0
- package/dist/components/Icons/DeployedCodeAccountIcon.js +1 -0
- package/dist/components/Icons/DescriptionIcon.js +1 -0
- package/dist/components/Icons/DesktopMacIcon.js +1 -0
- package/dist/components/Icons/DevicesIcon.js +1 -0
- package/dist/components/Icons/DiamondIcon.js +1 -0
- package/dist/components/Icons/DirectionsWalkIcon.js +1 -0
- package/dist/components/Icons/Diversity1Icon.js +1 -0
- package/dist/components/Icons/Diversity2Icon.js +1 -0
- package/dist/components/Icons/Diversity3Icon.js +1 -0
- package/dist/components/Icons/DoNotDisturbOnIcon.js +1 -0
- package/dist/components/Icons/DomainAddIcon.js +1 -0
- package/dist/components/Icons/DomainIcon.js +1 -0
- package/dist/components/Icons/DomainVerificationIcon.js +1 -0
- package/dist/components/Icons/DownloadIcon.js +1 -0
- package/dist/components/Icons/DraftsIcon.js +1 -0
- package/dist/components/Icons/DragHandleIcon.js +1 -0
- package/dist/components/Icons/DragIndicatorIcon.js +1 -0
- package/dist/components/Icons/DuoIcon.js +1 -0
- package/dist/components/Icons/EarlyOnIcon.js +1 -0
- package/dist/components/Icons/EditIcon.js +1 -0
- package/dist/components/Icons/EmojiFoodBeverageIcon.js +1 -0
- package/dist/components/Icons/EmojiIcon.js +1 -0
- package/dist/components/Icons/EncryptedIcon.js +1 -0
- package/dist/components/Icons/EnterpriseIcon.js +1 -0
- package/dist/components/Icons/EqualIcon.js +1 -0
- package/dist/components/Icons/ErrorIcon.js +1 -0
- package/dist/components/Icons/EventBusyIcon.js +1 -0
- package/dist/components/Icons/EventIcon.js +1 -0
- package/dist/components/Icons/ExpandAllIcon.js +1 -0
- package/dist/components/Icons/FastForwardIcon.js +1 -0
- package/dist/components/Icons/FastRewindIcon.js +1 -0
- package/dist/components/Icons/FavoriteIcon.js +1 -0
- package/dist/components/Icons/FeaturedSeasonalAndGiftsIcon.js +1 -0
- package/dist/components/Icons/FeedIcon.js +1 -0
- package/dist/components/Icons/FilePresentIcon.js +1 -0
- package/dist/components/Icons/FilterListIcon.js +1 -0
- package/dist/components/Icons/FingerPrintIcon.js +1 -0
- package/dist/components/Icons/FlagIcon.js +1 -0
- package/dist/components/Icons/FolderCopyIcon.js +1 -0
- package/dist/components/Icons/FolderIcon.js +1 -0
- package/dist/components/Icons/FolderZipIcon.js +1 -0
- package/dist/components/Icons/FootPrintIcon.js +1 -0
- package/dist/components/Icons/FormatAlignCenterIcon.js +1 -0
- package/dist/components/Icons/FormatAlignJustifyIcon.js +1 -0
- package/dist/components/Icons/FormatAlignLeftIcon.js +1 -0
- package/dist/components/Icons/FormatAlignRightIcon.js +1 -0
- package/dist/components/Icons/FormatBoldIcon.js +1 -0
- package/dist/components/Icons/FormatItalicIcon.js +1 -0
- package/dist/components/Icons/FormatListBulletedIcon.js +1 -0
- package/dist/components/Icons/FormatListNumberedIcon.js +1 -0
- package/dist/components/Icons/FormatSizeIcon.js +1 -0
- package/dist/components/Icons/FormatUnderlinedIcon.js +1 -0
- package/dist/components/Icons/ForumIcon.js +1 -0
- package/dist/components/Icons/ForwardToInboxIcon.js +1 -0
- package/dist/components/Icons/FullScreenIcon.js +1 -0
- package/dist/components/Icons/GalleryThumbnailIcon.js +1 -0
- package/dist/components/Icons/GppBadIcon.js +1 -0
- package/dist/components/Icons/GppMaybeIcon.js +1 -0
- package/dist/components/Icons/GridViewIcon.js +1 -0
- package/dist/components/Icons/GroupIcon.js +1 -0
- package/dist/components/Icons/GroupsTwoIcon.js +1 -0
- package/dist/components/Icons/HandShakeIcon.js +1 -0
- package/dist/components/Icons/HeadphonesIcon.js +1 -0
- package/dist/components/Icons/HelpIcon.js +1 -0
- package/dist/components/Icons/HomeIcon.js +1 -0
- package/dist/components/Icons/HomePinIcon.js +1 -0
- package/dist/components/Icons/HomeRepairServiceIcon.js +1 -0
- package/dist/components/Icons/HourGlassTopIcon.js +1 -0
- package/dist/components/Icons/HourglassEmptyIcon.js +1 -0
- package/dist/components/Icons/HubIcon.js +1 -0
- package/dist/components/Icons/IFrameIcon.js +1 -0
- package/dist/components/Icons/IconWrapper.js +1 -0
- package/dist/components/Icons/IdCardIcon.js +1 -0
- package/dist/components/Icons/IndeterminateCheckBoxIcon.js +1 -0
- package/dist/components/Icons/InfoIcon.js +1 -0
- package/dist/components/Icons/InsertChartIcon.js +1 -0
- package/dist/components/Icons/IntegrationInstructionsIcon.js +1 -0
- package/dist/components/Icons/Inventory2Icon.js +1 -0
- package/dist/components/Icons/IosShareIcon.js +1 -0
- package/dist/components/Icons/KeepIcon.js +1 -0
- package/dist/components/Icons/KeyIcon.js +1 -0
- package/dist/components/Icons/KeyOffIcon.js +1 -0
- package/dist/components/Icons/KeyboardArrowDownIcon.js +1 -0
- package/dist/components/Icons/KeyboardArrowUpIcon.js +1 -0
- package/dist/components/Icons/KeyboardBackSpaceIcon.js +1 -0
- package/dist/components/Icons/KeyboardDoubleArrowDownIcon.js +1 -0
- package/dist/components/Icons/LabProfileIcon.js +1 -0
- package/dist/components/Icons/LabelIcon.js +1 -0
- package/dist/components/Icons/LabelOffIcon.js +1 -0
- package/dist/components/Icons/LanguageIcon.js +1 -0
- package/dist/components/Icons/LeftPanelCloseIcon.js +1 -0
- package/dist/components/Icons/LeftPanelOpenIcon.js +1 -0
- package/dist/components/Icons/LibraryMusicIcon.js +1 -0
- package/dist/components/Icons/LinkIcon.js +1 -0
- package/dist/components/Icons/LinkOffIcon.js +1 -0
- package/dist/components/Icons/LocalActivityIcon.js +1 -0
- package/dist/components/Icons/LocalFloristIcon.js +1 -0
- package/dist/components/Icons/LocalLibraryIcon.js +1 -0
- package/dist/components/Icons/LocationOnIcon.js +1 -0
- package/dist/components/Icons/LockIcon.js +1 -0
- package/dist/components/Icons/LockOpenIcon.js +1 -0
- package/dist/components/Icons/LoginIcon.js +1 -0
- package/dist/components/Icons/LogoutIcon.js +1 -0
- package/dist/components/Icons/MailIcon.js +1 -0
- package/dist/components/Icons/ManageAccountsIcon.js +1 -0
- package/dist/components/Icons/MarkUnreadChatAltIcon.js +1 -0
- package/dist/components/Icons/MediaLinkIcon.js +1 -0
- package/dist/components/Icons/MenuOpenIcon.js +1 -0
- package/dist/components/Icons/MetabolismIcon.js +1 -0
- package/dist/components/Icons/MilitaryTechIcon.js +1 -0
- package/dist/components/Icons/MoneyBagIcon.js +1 -0
- package/dist/components/Icons/MonitorIcon.js +1 -0
- package/dist/components/Icons/MonitoringIcon.js +1 -0
- package/dist/components/Icons/MoreHorizIcon.js +1 -0
- package/dist/components/Icons/MoreVertIcon.js +1 -0
- package/dist/components/Icons/MotionPhotosPausedIcon.js +1 -0
- package/dist/components/Icons/NotificationsIcon.js +1 -0
- package/dist/components/Icons/OpenInNewIcon.js +1 -0
- package/dist/components/Icons/Package2Icon.js +1 -0
- package/dist/components/Icons/PageviewIcon.js +1 -0
- package/dist/components/Icons/PaidIcon.js +1 -0
- package/dist/components/Icons/PaletteIcon.js +1 -0
- package/dist/components/Icons/PatientListIcon.js +1 -0
- package/dist/components/Icons/PauseIcon.js +1 -0
- package/dist/components/Icons/PaymentsIcon.js +1 -0
- package/dist/components/Icons/PendingActionsIcon.js +1 -0
- package/dist/components/Icons/PercentIcon.js +1 -0
- package/dist/components/Icons/PermMediaIcon.js +1 -0
- package/dist/components/Icons/PersonAddIcon.js +1 -0
- package/dist/components/Icons/PersonBookIcon.js +1 -0
- package/dist/components/Icons/PersonIcon.js +1 -0
- package/dist/components/Icons/PhotoCameraIcon.js +1 -0
- package/dist/components/Icons/PhotoIcon.js +1 -0
- package/dist/components/Icons/PhotoLibraryIcon.js +1 -0
- package/dist/components/Icons/PictureAsPdfIcon.js +1 -0
- package/dist/components/Icons/PlayArrowIcon.js +1 -0
- package/dist/components/Icons/PlayCircleIcon.js +1 -0
- package/dist/components/Icons/PolicyIcon.js +1 -0
- package/dist/components/Icons/PowerSettingsCircleIcon.js +1 -0
- package/dist/components/Icons/PowerSettingsNewIcon.js +1 -0
- package/dist/components/Icons/PreviewIcon.js +1 -0
- package/dist/components/Icons/PriorityHighIcon.js +1 -0
- package/dist/components/Icons/PsychologyAltIcon.js +1 -0
- package/dist/components/Icons/PublicIcon.js +1 -0
- package/dist/components/Icons/PublishIcon.js +1 -0
- package/dist/components/Icons/QRCode2Icon.js +1 -0
- package/dist/components/Icons/QuestionMarkIcon.js +1 -0
- package/dist/components/Icons/QuizIcon.js +1 -0
- package/dist/components/Icons/RadioButtonCheckedIcon.js +1 -0
- package/dist/components/Icons/RadioButtonUncheckedIcon.js +1 -0
- package/dist/components/Icons/RateReviewIcon.js +1 -0
- package/dist/components/Icons/ReceiptLongIcon.js +1 -0
- package/dist/components/Icons/RecordVoiceOverIcon.js +1 -0
- package/dist/components/Icons/RedeemIcon.js +1 -0
- package/dist/components/Icons/RedoIcon.js +1 -0
- package/dist/components/Icons/RemoveIcon.js +1 -0
- package/dist/components/Icons/RemoveRoadIcon.js +1 -0
- package/dist/components/Icons/RequestQuoteIcon.js +1 -0
- package/dist/components/Icons/ReviewIcon.js +1 -0
- package/dist/components/Icons/SavingsIcon.js +1 -0
- package/dist/components/Icons/ScheduleIcon.js +1 -0
- package/dist/components/Icons/ScheduleSendIcon.js +1 -0
- package/dist/components/Icons/SearchIcon.js +1 -0
- package/dist/components/Icons/SellIcon.js +1 -0
- package/dist/components/Icons/SendIcon.js +1 -0
- package/dist/components/Icons/SettingsIcon.js +1 -0
- package/dist/components/Icons/ShareIcon.js +1 -0
- package/dist/components/Icons/ShoppingCartIcon.js +1 -0
- package/dist/components/Icons/ShoppingModeIcon.js +1 -0
- package/dist/components/Icons/ShuffleIcon.js +1 -0
- package/dist/components/Icons/SocialLeaderBoardIcon.js +1 -0
- package/dist/components/Icons/Speed15xIcon.js +1 -0
- package/dist/components/Icons/Speed1xIcon.js +1 -0
- package/dist/components/Icons/Speed2xIcon.js +1 -0
- package/dist/components/Icons/StarHalfIcon.js +1 -0
- package/dist/components/Icons/StarIcon.js +1 -0
- package/dist/components/Icons/StorefrontIcon.js +1 -0
- package/dist/components/Icons/StrikethroughSIcon.js +1 -0
- package/dist/components/Icons/SubscriptionsIcon.js +1 -0
- package/dist/components/Icons/SupervisorAccountIcon.js +1 -0
- package/dist/components/Icons/SwitchAccountIcon.js +1 -0
- package/dist/components/Icons/SwitchesIcon.js +1 -0
- package/dist/components/Icons/SyncSavedLocallyIcon.js +1 -0
- package/dist/components/Icons/TabletIcon.js +1 -0
- package/dist/components/Icons/ThumbDownIcon.js +1 -0
- package/dist/components/Icons/ThumbUpIcon.js +1 -0
- package/dist/components/Icons/TocIcon.js +1 -0
- package/dist/components/Icons/TrashDeleteBinIcon.js +1 -0
- package/dist/components/Icons/TrendingUpIcon.js +1 -0
- package/dist/components/Icons/TrophyIcon.js +1 -0
- package/dist/components/Icons/UndoIcon.js +1 -0
- package/dist/components/Icons/UnfoldMoreIcon.js +1 -0
- package/dist/components/Icons/UnsubscribeIcon.js +1 -0
- package/dist/components/Icons/UploadIcon.js +1 -0
- package/dist/components/Icons/VerifiedIcon.js +1 -0
- package/dist/components/Icons/VideoCamIcon.js +1 -0
- package/dist/components/Icons/VideoFileIcon.js +1 -0
- package/dist/components/Icons/ViewAgendaIcon.js +1 -0
- package/dist/components/Icons/ViewArrayIcon.js +1 -0
- package/dist/components/Icons/ViewCarouselIcon.js +1 -0
- package/dist/components/Icons/ViewCozyIcon.js +1 -0
- package/dist/components/Icons/ViewModuleIcon.js +1 -0
- package/dist/components/Icons/VisibilityIcon.js +1 -0
- package/dist/components/Icons/VisibilityOffIcon.js +1 -0
- package/dist/components/Icons/VolumeUpIcon.js +1 -0
- package/dist/components/Icons/VolunteerActivismIcon.js +1 -0
- package/dist/components/Icons/WandStarsGradientIcon.js +1 -0
- package/dist/components/Icons/WandStarsIcon.js +1 -0
- package/dist/components/Icons/WarningIcon.js +1 -0
- package/dist/components/Icons/WbSunnyIcon.js +1 -0
- package/dist/components/Icons/WebAssetIcon.js +1 -0
- package/dist/components/Icons/WebTrafficIcon.js +1 -0
- package/dist/components/Icons/WebhookIcon.js +1 -0
- package/dist/components/Icons/WidgetsIcon.js +1 -0
- package/dist/components/Icons/WorkHistoryIcon.js +1 -0
- package/dist/components/Icons/WorkIcon.js +1 -0
- package/dist/components/Icons/enums.js +1 -0
- package/dist/components/Icons/icons.js +1 -0
- package/dist/components/Icons/index.js +1 -0
- package/dist/components/Icons/types.js +1 -0
- package/dist/components/Input/Input.js +1 -0
- package/dist/components/Input/InputField.js +1 -0
- package/dist/components/Input/InputRoot.js +1 -0
- package/dist/components/Input/index.js +1 -0
- package/dist/components/PasswordField/PasswordField.js +2 -0
- package/dist/components/PasswordField/index.js +1 -0
- package/dist/components/PhoneNumber/PhoneNumberDigitField.js +3 -0
- package/dist/components/PhoneNumber/PhoneNumberFields.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberFlagField.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberInput.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberOptions.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberOptionsList.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberOptionsSearchField.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberPortal.js +2 -0
- package/dist/components/PhoneNumber/PhoneNumberRoot.js +2 -0
- package/dist/components/PhoneNumber/index.js +1 -0
- package/dist/components/PhoneNumber/phoneNumberContext.js +1 -0
- package/dist/components/PriceField/PriceFieldDigitField.js +2 -0
- package/dist/components/PriceField/PriceFieldFields.js +2 -0
- package/dist/components/PriceField/PriceFieldFlagField.js +2 -0
- package/dist/components/PriceField/PriceFieldInput.js +2 -0
- package/dist/components/PriceField/PriceFieldOptions.js +2 -0
- package/dist/components/PriceField/PriceFieldOptionsList.js +2 -0
- package/dist/components/PriceField/PriceFieldOptionsSearchField.js +2 -0
- package/dist/components/PriceField/PriceFieldPortal.js +2 -0
- package/dist/components/PriceField/PriceFieldRoot.js +2 -0
- package/dist/components/PriceField/index.js +1 -0
- package/dist/components/PriceField/priceFieldContext.js +1 -0
- package/dist/components/Provider/MainstackDesignSystemProvider.js +1 -0
- package/dist/components/Provider/index.js +1 -0
- package/dist/components/Provider/providerContext.js +1 -0
- package/dist/components/Provider/useMainstackDesignSystemTheme.js +1 -0
- package/dist/components/Radio/RadioItem.js +1 -0
- package/dist/components/Radio/RadioItemIndicator.js +1 -0
- package/dist/components/Radio/RadioItemLabel.js +1 -0
- package/dist/components/Radio/RadioItemSubtext.js +1 -0
- package/dist/components/Radio/RadioItemTitle.js +1 -0
- package/dist/components/Radio/RadioRoot.js +1 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/SearchField/SearchField.js +2 -0
- package/dist/components/SearchField/index.js +1 -0
- package/dist/components/Select/MultiSelect.js +2 -0
- package/dist/components/Select/Select.js +2 -0
- package/dist/components/Select/SelectInputField.js +2 -0
- package/dist/components/Select/SelectOptionInputPreview.js +2 -0
- package/dist/components/Select/SelectOptionItem.js +2 -0
- package/dist/components/Select/SelectOptionItemWithCheckbox.js +2 -0
- package/dist/components/Select/SelectOptions.js +2 -0
- package/dist/components/Select/SelectPortal.js +2 -0
- package/dist/components/Select/SelectRoot.js +2 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/Select/selectContext.js +1 -0
- package/dist/components/Select/utils.js +1 -0
- package/dist/components/Tab/TabsContent.js +1 -0
- package/dist/components/Tab/TabsContext.js +1 -0
- package/dist/components/Tab/TabsList.js +1 -0
- package/dist/components/Tab/TabsRoot.js +1 -0
- package/dist/components/Tab/TabsTrigger.js +1 -0
- package/dist/components/Tab/index.js +1 -0
- package/dist/components/Tab/tabsVariants.js +1 -0
- package/dist/components/Tag/Tag.js +1 -0
- package/dist/components/Tag/TagIcon.js +1 -0
- package/dist/components/Tag/TagLabel.js +1 -0
- package/dist/components/Tag/TagRoot.js +1 -0
- package/dist/components/Tag/index.js +1 -0
- package/dist/components/Tag/tagVariants.js +1 -0
- package/dist/components/TextEditor/TextEditorField.js +4 -0
- package/dist/components/TextEditor/TextEditorInput.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/BoldMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/CodeMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/ColorPickerMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/GenerateWithAiMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/ImageUploadMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/ItalicMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/LinkMenu.js +6 -0
- package/dist/components/TextEditor/TextEditorMenuBar/OrderedListMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/StrikethroughMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextAlignMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextEditorMenuAction.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextEditorMenuBar.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/TextSizesMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/UnderlineMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorMenuBar/UnorderedListMenu.js +2 -0
- package/dist/components/TextEditor/TextEditorRoot.js +42 -0
- package/dist/components/TextEditor/index.js +1 -0
- package/dist/components/TextEditor/textEditorContext.js +1 -0
- package/dist/components/Textarea/Textarea.js +1 -0
- package/dist/components/Textarea/TextareaField.js +1 -0
- package/dist/components/Textarea/TextareaRoot.js +1 -0
- package/dist/components/Textarea/index.js +1 -0
- package/dist/components/Tile/TileCheckbox.js +1 -0
- package/dist/components/Tile/TileContent.js +1 -0
- package/dist/components/Tile/TileDescription.js +1 -0
- package/dist/components/Tile/TileHeader.js +1 -0
- package/dist/components/Tile/TileMedia.js +3 -0
- package/dist/components/Tile/TileRoot.js +2 -0
- package/dist/components/Tile/TileTitle.js +1 -0
- package/dist/components/Tile/index.js +1 -0
- package/dist/components/Tile/tileVariants.js +1 -0
- package/dist/components/Toggle/Toggle.js +1 -0
- package/dist/components/Toggle/ToggleLabel.js +1 -0
- package/dist/components/Toggle/ToggleRoot.js +1 -0
- package/dist/components/Toggle/ToggleSubtext.js +1 -0
- package/dist/components/Toggle/ToggleSwitch.js +2 -0
- package/dist/components/Toggle/ToggleTitle.js +1 -0
- package/dist/components/Toggle/index.js +1 -0
- package/dist/components/Toggle/toggleVariants.js +1 -0
- package/dist/components/Tooltip/TooltipArrow.js +1 -0
- package/dist/components/Tooltip/TooltipBody.js +1 -0
- package/dist/components/Tooltip/TooltipContent.js +1 -0
- package/dist/components/Tooltip/TooltipContext.js +1 -0
- package/dist/components/Tooltip/TooltipFooter.js +1 -0
- package/dist/components/Tooltip/TooltipHeader.js +1 -0
- package/dist/components/Tooltip/TooltipRoot.js +2 -0
- package/dist/components/Tooltip/TooltipTitle.js +1 -0
- package/dist/components/Tooltip/TooltipTrigger.js +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/Tooltip/useTooltipContext.js +1 -0
- package/dist/components/Typography/BodyText/BodyText.js +1 -0
- package/dist/components/Typography/BodyText/bodyTextVariants.js +1 -0
- package/dist/components/Typography/BodyText/index.js +1 -0
- package/dist/components/Typography/DisplayText/DisplayText.js +1 -0
- package/dist/components/Typography/DisplayText/displayTextVariants.js +1 -0
- package/dist/components/Typography/DisplayText/index.js +1 -0
- package/dist/components/Typography/HeadlineText/HeadlineText.js +1 -0
- package/dist/components/Typography/HeadlineText/headlineTextVariants.js +1 -0
- package/dist/components/Typography/HeadlineText/index.js +1 -0
- package/dist/en.json-BPy-6DYI.cjs +1 -0
- package/dist/en.json-VbJG9vrN.js +263 -0
- package/dist/floating-ui.dom-C224prEy.cjs +1 -0
- package/dist/floating-ui.dom-CauyjNxS.js +1131 -0
- package/dist/fonts/degular/Degular-Black.woff2 +0 -0
- package/dist/fonts/degular/Degular-Black_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Bold.woff2 +0 -0
- package/dist/fonts/degular/Degular-Bold_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Light.woff2 +0 -0
- package/dist/fonts/degular/Degular-Light_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Medium.woff2 +0 -0
- package/dist/fonts/degular/Degular-Medium_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Regular.woff2 +0 -0
- package/dist/fonts/degular/Degular-Semibold.woff2 +0 -0
- package/dist/fonts/degular/Degular-Semibold_Italic.woff2 +0 -0
- package/dist/fonts/degular/Degular-Thin.woff2 +0 -0
- package/dist/fonts/degular/Degular-Thin_Italic.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Black.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-BlackIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Bold.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-BoldIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Book.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-BookIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Medium.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-MediumIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Regular.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-RegularIt.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-Semibold.woff2 +0 -0
- package/dist/fonts/suisseIntl/SuisseIntl-SemiboldIt.woff2 +0 -0
- package/dist/getInternationalPhoneNumberPrefix-C4Qc97tE.cjs +34 -0
- package/dist/getInternationalPhoneNumberPrefix-C8O8VTpp.js +4368 -0
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-437EL2iq.js +52 -0
- package/dist/index-5Bhkapwi.js +82 -0
- package/dist/index-B0dI0L76.cjs +2 -0
- package/dist/index-BGQepRFJ.js +27 -0
- package/dist/index-BGfrl8IX.js +71 -0
- package/dist/index-BI11g55_.cjs +42 -0
- package/dist/index-BRRTyZ1e.js +75 -0
- package/dist/index-BZCybroW.cjs +2 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/index-B_Bwy8wX.cjs +1 -0
- package/dist/index-BbQbyYHN.cjs +2 -0
- package/dist/index-BfKbXbc8.cjs +1 -0
- package/dist/index-BvWMjxZ5.js +675 -0
- package/dist/index-Bx2vBAJ5.cjs +2 -0
- package/dist/index-ByaXH_ih.js +10 -0
- package/dist/index-C2mPf2xD.cjs +1 -0
- package/dist/index-C8aODXfJ.cjs +1 -0
- package/dist/index-CAgJYdlN.cjs +1 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/index-CRDKsB5y.cjs +2 -0
- package/dist/index-CRdNenpR.js +422 -0
- package/dist/index-CajSSBH7.cjs +1 -0
- package/dist/index-Cje7xxa1.cjs +1 -0
- package/dist/index-CpDnqHCm.js +36 -0
- package/dist/index-CsK1LjrZ.cjs +2 -0
- package/dist/index-CvknVH0W.js +754 -0
- package/dist/index-CwR-dC8j.cjs +2 -0
- package/dist/index-CyFz8fal.cjs +131 -0
- package/dist/index-CzY-WZXL.cjs +1 -0
- package/dist/index-D-KHlZ2P.js +20 -0
- package/dist/index-D29mdTf5.js +34 -0
- package/dist/index-D9S-9HH_.js +332 -0
- package/dist/index-DCXkdCW2.js +227 -0
- package/dist/index-DLcgu_3m.js +159 -0
- package/dist/index-DVuTCIJE.cjs +2 -0
- package/dist/index-DWQmix6e.js +234 -0
- package/dist/index-DYxWvftI.cjs +1 -0
- package/dist/index-DgIcguCG.cjs +2 -0
- package/dist/index-DmeJCEwx.js +181 -0
- package/dist/index-Dt3HnaYe.js +48 -0
- package/dist/index-Dz5LHXX9.js +145 -0
- package/dist/index-MQ0c3ZX_.cjs +1 -0
- package/dist/index-ZhUVW4CS.cjs +2 -0
- package/dist/index-bSPhqlcX.cjs +1 -0
- package/dist/index-fw7dUmQl.js +352 -0
- package/dist/index-ojFnBVkh.cjs +2 -0
- package/dist/index-q-4o5Ie4.cjs +2 -0
- package/dist/index-twi8FX77.js +13814 -0
- package/dist/index-xqkGMOJ8.js +13 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +1 -0
- package/dist/lib/useElementWidth.js +1 -0
- package/dist/lib/utils.js +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +89 -66
- package/build/index.css +0 -6
- package/build/index.d.ts +0 -1419
- package/build/mainstack-design-system.js +0 -25463
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ct=require("react/jsx-runtime"),Ut=require("react"),k=require("../../index-CyFz8fal.cjs"),gr=require("../../floating-ui.dom-C224prEy.cjs"),An=require("../../lib/utils.js");require("../Icons/IconWrapper.js");const pr=require("../Icons/DragIndicatorIcon.js"),mr=require("./textEditorContext.js"),Y=()=>new Map,je=n=>{const t=Y();return n.forEach((e,s)=>{t.set(s,e)}),t},rt=(n,t,e)=>{let s=n.get(t);return s===void 0&&n.set(t,s=e()),s},wr=(n,t)=>{const e=[];for(const[s,r]of n)e.push(t(r,s));return e},yr=(n,t)=>{for(const[e,s]of n)if(t(s,e))return!0;return!1},mt=()=>new Set,Me=n=>n[n.length-1],kr=(n,t)=>{for(let e=0;e<t.length;e++)n.push(t[e])},wt=Array.from,br=(n,t)=>{for(let e=0;e<n.length;e++)if(t(n[e],e,n))return!0;return!1},ze=Array.isArray;class os{constructor(){this._observers=Y()}on(t,e){return rt(this._observers,t,mt).add(e),e}once(t,e){const s=(...r)=>{this.off(t,s),e(...r)};this.on(t,s)}off(t,e){const s=this._observers.get(t);s!==void 0&&(s.delete(e),s.size===0&&this._observers.delete(t))}emit(t,e){return wt((this._observers.get(t)||Y()).values()).forEach(s=>s(...e))}destroy(){this._observers=Y()}}const st=Math.floor,ie=Math.abs,Tt=(n,t)=>n<t?n:t,at=(n,t)=>n>t?n:t,ls=n=>n!==0?n<0:1/n<0,Tn=1,vn=2,Re=4,Ne=8,Ft=32,et=64,M=128,_r=1<<29,Se=31,Ye=63,pt=127,Sr=2147483647,cs=Number.MAX_SAFE_INTEGER,Cr=Number.isInteger||(n=>typeof n=="number"&&isFinite(n)&&st(n)===n),Er=String.fromCharCode,Dr=n=>n.toLowerCase(),xr=/^\s*/g,Ar=n=>n.replace(xr,""),Tr=/([A-Z])/g,In=(n,t)=>Ar(n.replace(Tr,e=>`${t}${Dr(e)}`)),vr=n=>{const t=unescape(encodeURIComponent(n)),e=t.length,s=new Uint8Array(e);for(let r=0;r<e;r++)s[r]=t.codePointAt(r);return s},Pt=typeof TextEncoder<"u"?new TextEncoder:null,Ir=n=>Pt.encode(n),Or=Pt?Ir:vr;let Vt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Vt&&Vt.decode(new Uint8Array).length===1&&(Vt=null);class Wt{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const qt=()=>new Wt,Mr=n=>{const t=qt();return n(t),z(t)},Rr=n=>{let t=n.cpos;for(let e=0;e<n.bufs.length;e++)t+=n.bufs[e].length;return t},z=n=>{const t=new Uint8Array(Rr(n));let e=0;for(let s=0;s<n.bufs.length;s++){const r=n.bufs[s];t.set(r,e),e+=r.length}return t.set(new Uint8Array(n.cbuf.buffer,0,n.cpos),e),t},Nr=(n,t)=>{const e=n.cbuf.length;e-n.cpos<t&&(n.bufs.push(new Uint8Array(n.cbuf.buffer,0,n.cpos)),n.cbuf=new Uint8Array(at(e,t)*2),n.cpos=0)},T=(n,t)=>{const e=n.cbuf.length;n.cpos===e&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(e*2),n.cpos=0),n.cbuf[n.cpos++]=t},Je=T,b=(n,t)=>{for(;t>pt;)T(n,M|pt&t),t=st(t/128);T(n,pt&t)},an=(n,t)=>{const e=ls(t);for(e&&(t=-t),T(n,(t>Ye?M:0)|(e?et:0)|Ye&t),t=st(t/64);t>0;)T(n,(t>pt?M:0)|pt&t),t=st(t/128)},Ke=new Uint8Array(3e4),Lr=Ke.length/3,Ur=(n,t)=>{if(t.length<Lr){const e=Pt.encodeInto(t,Ke).written||0;b(n,e);for(let s=0;s<e;s++)T(n,Ke[s])}else F(n,Or(t))},Vr=(n,t)=>{const e=unescape(encodeURIComponent(t)),s=e.length;b(n,s);for(let r=0;r<s;r++)T(n,e.codePointAt(r))},Et=Pt&&Pt.encodeInto?Ur:Vr,Ce=(n,t)=>{const e=n.cbuf.length,s=n.cpos,r=Tt(e-s,t.length),i=t.length-r;n.cbuf.set(t.subarray(0,r),s),n.cpos+=r,i>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(at(e*2,i)),n.cbuf.set(t.subarray(r)),n.cpos=i)},F=(n,t)=>{b(n,t.byteLength),Ce(n,t)},hn=(n,t)=>{Nr(n,t);const e=new DataView(n.cbuf.buffer,n.cpos,t);return n.cpos+=t,e},Fr=(n,t)=>hn(n,4).setFloat32(0,t,!1),Pr=(n,t)=>hn(n,8).setFloat64(0,t,!1),Br=(n,t)=>hn(n,8).setBigInt64(0,t,!1),On=new DataView(new ArrayBuffer(4)),Hr=n=>(On.setFloat32(0,n),On.getFloat32(0)===n),vt=(n,t)=>{switch(typeof t){case"string":T(n,119),Et(n,t);break;case"number":Cr(t)&&ie(t)<=Sr?(T(n,125),an(n,t)):Hr(t)?(T(n,124),Fr(n,t)):(T(n,123),Pr(n,t));break;case"bigint":T(n,122),Br(n,t);break;case"object":if(t===null)T(n,126);else if(ze(t)){T(n,117),b(n,t.length);for(let e=0;e<t.length;e++)vt(n,t[e])}else if(t instanceof Uint8Array)T(n,116),F(n,t);else{T(n,118);const e=Object.keys(t);b(n,e.length);for(let s=0;s<e.length;s++){const r=e[s];Et(n,r),vt(n,t[r])}}break;case"boolean":T(n,t?120:121);break;default:T(n,127)}};class Mn extends Wt{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&b(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}}const Rn=n=>{n.count>0&&(an(n.encoder,n.count===1?n.s:-n.s),n.count>1&&b(n.encoder,n.count-2))};class oe{constructor(){this.encoder=new Wt,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Rn(this),this.count=1,this.s=t)}toUint8Array(){return Rn(this),z(this.encoder)}}const Nn=n=>{if(n.count>0){const t=n.diff*2+(n.count===1?0:1);an(n.encoder,t),n.count>1&&b(n.encoder,n.count-2)}};class Le{constructor(){this.encoder=new Wt,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Nn(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Nn(this),z(this.encoder)}}class $r{constructor(){this.sarr=[],this.s="",this.lensE=new oe}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){const t=new Wt;return this.sarr.push(this.s),this.s="",Et(t,this.sarr.join("")),Ce(t,this.lensE.toUint8Array()),z(t)}}const ht=n=>new Error(n),J=()=>{throw ht("Method unimplemented")},L=()=>{throw ht("Unexpected case")},as=ht("Unexpected end of array"),hs=ht("Integer out of Range");class Ee{constructor(t){this.arr=t,this.pos=0}}const un=n=>new Ee(n),jr=n=>n.pos!==n.arr.length,zr=(n,t)=>{const e=new Uint8Array(n.arr.buffer,n.pos+n.arr.byteOffset,t);return n.pos+=t,e},B=n=>zr(n,E(n)),Bt=n=>n.arr[n.pos++],E=n=>{let t=0,e=1;const s=n.arr.length;for(;n.pos<s;){const r=n.arr[n.pos++];if(t=t+(r&pt)*e,e*=128,r<M)return t;if(t>cs)throw hs}throw as},dn=n=>{let t=n.arr[n.pos++],e=t&Ye,s=64;const r=(t&et)>0?-1:1;if((t&M)===0)return r*e;const i=n.arr.length;for(;n.pos<i;){if(t=n.arr[n.pos++],e=e+(t&pt)*s,s*=128,t<M)return r*e;if(e>cs)throw hs}throw as},Yr=n=>{let t=E(n);if(t===0)return"";{let e=String.fromCodePoint(Bt(n));if(--t<100)for(;t--;)e+=String.fromCodePoint(Bt(n));else for(;t>0;){const s=t<1e4?t:1e4,r=n.arr.subarray(n.pos,n.pos+s);n.pos+=s,e+=String.fromCodePoint.apply(null,r),t-=s}return decodeURIComponent(escape(e))}},Jr=n=>Vt.decode(B(n)),We=Vt?Jr:Yr,fn=(n,t)=>{const e=new DataView(n.arr.buffer,n.arr.byteOffset+n.pos,t);return n.pos+=t,e},Kr=n=>fn(n,4).getFloat32(0,!1),Wr=n=>fn(n,8).getFloat64(0,!1),qr=n=>fn(n,8).getBigInt64(0,!1),Gr=[n=>{},n=>null,dn,Kr,Wr,qr,n=>!1,n=>!0,We,n=>{const t=E(n),e={};for(let s=0;s<t;s++){const r=We(n);e[r]=ue(n)}return e},n=>{const t=E(n),e=[];for(let s=0;s<t;s++)e.push(ue(n));return e},B],ue=n=>Gr[127-Bt(n)](n);class Ln extends Ee{constructor(t,e){super(t),this.reader=e,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),jr(this)?this.count=E(this)+1:this.count=-1),this.count--,this.s}}class le extends Ee{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=dn(this);const t=ls(this.s);this.count=1,t&&(this.s=-this.s,this.count=E(this)+2)}return this.count--,this.s}}class Ue extends Ee{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const t=dn(this),e=t&1;this.diff=st(t/2),this.count=1,e&&(this.count=E(this)+2)}return this.s+=this.diff,this.count--,this.s}}class Xr{constructor(t){this.decoder=new le(t),this.str=We(this.decoder),this.spos=0}read(){const t=this.spos+this.decoder.read(),e=this.str.slice(this.spos,t);return this.spos=t,e}}const Zr=crypto.getRandomValues.bind(crypto),Qr=Math.random,us=()=>Zr(new Uint32Array(1))[0],ti=n=>n[st(Qr()*n.length)],ei="10000000-1000-4000-8000"+-1e11,ni=()=>ei.replace(/[018]/g,n=>(n^us()&15>>n/4).toString(16)),si=Date.now,Un=n=>new Promise(n);Promise.all.bind(Promise);const Vn=n=>n===void 0?null:n;class ri{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}}let ds=new ri,ii=!0;try{typeof localStorage<"u"&&localStorage&&(ds=localStorage,ii=!1)}catch{}const oi=ds,li=Object.assign,fs=Object.keys,ci=(n,t)=>{for(const e in n)t(n[e],e)},Fn=n=>fs(n).length,ai=n=>{for(const t in n)return!1;return!0},gs=(n,t)=>{for(const e in n)if(!t(n[e],e))return!1;return!0},hi=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),ui=(n,t)=>n===t||Fn(n)===Fn(t)&&gs(n,(e,s)=>(e!==void 0||hi(t,s))&&t[s]===e),di=Object.freeze,ps=n=>{for(const t in n){const e=n[t];(typeof e=="object"||typeof e=="function")&&ps(n[t])}return di(n)},gn=(n,t,e=0)=>{try{for(;e<n.length;e++)n[e](...t)}finally{e<n.length&&gn(n,t,e+1)}},fi=(n,t)=>t.includes(n),It=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",ms=typeof window<"u"&&typeof document<"u"&&!It;let X;const gi=()=>{if(X===void 0)if(It){X=Y();const n=process.argv;let t=null;for(let e=0;e<n.length;e++){const s=n[e];s[0]==="-"?(t!==null&&X.set(t,""),t=s):t!==null&&(X.set(t,s),t=null)}t!==null&&X.set(t,"")}else typeof location=="object"?(X=Y(),(location.search||"?").slice(1).split("&").forEach(n=>{if(n.length!==0){const[t,e]=n.split("=");X.set(`--${In(t,"-")}`,e),X.set(`-${In(t,"-")}`,e)}})):X=Y();return X},qe=n=>gi().has(n),de=n=>Vn(It?process.env[n.toUpperCase().replaceAll("-","_")]:oi.getItem(n)),ws=n=>qe("--"+n)||de(n)!==null;ws("production");const pi=It&&fi(process.env.FORCE_COLOR,["true","1","2"]),mi=pi||!qe("--no-colors")&&!ws("no-color")&&(!It||process.stdout.isTTY)&&(!It||qe("--color")||de("COLORTERM")!==null||(de("TERM")||"").includes("color")),wi=n=>{let t="";for(let e=0;e<n.byteLength;e++)t+=Er(n[e]);return btoa(t)},yi=n=>Buffer.from(n.buffer,n.byteOffset,n.byteLength).toString("base64"),ki=ms?wi:yi,bi=n=>Mr(t=>vt(t,n));class _i{constructor(t,e){this.left=t,this.right=e}}const tt=(n,t)=>new _i(n,t),Si=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const Ci=n=>wr(n,(t,e)=>`${e}:${t};`).join(""),Ei=n=>class{constructor(e){this._=e}destroy(){n(this._)}},Di=Ei(clearTimeout),ys=(n,t)=>new Di(setTimeout(t,n)),it=Symbol,ks=it(),bs=it(),xi=it(),Ai=it(),Ti=it(),_s=it(),vi=it(),pn=it(),Ii=it(),Oi=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const t=[],e=[];let s=0;for(;s<n.length;s++){const r=n[s];if(r===void 0)break;if(r.constructor===String||r.constructor===Number)t.push(r);else if(r.constructor===Object)break}for(s>0&&e.push(t.join(""));s<n.length;s++){const r=n[s];r instanceof Symbol||e.push(r)}return e},Mi={[ks]:tt("font-weight","bold"),[bs]:tt("font-weight","normal"),[xi]:tt("color","blue"),[Ti]:tt("color","green"),[Ai]:tt("color","grey"),[_s]:tt("color","red"),[vi]:tt("color","purple"),[pn]:tt("color","orange"),[Ii]:tt("color","black")},Ri=n=>{n.length===1&&n[0]?.constructor===Function&&(n=n[0]());const t=[],e=[],s=Y();let r=[],i=0;for(;i<n.length;i++){const o=n[i],l=Mi[o];if(l!==void 0)s.set(l.left,l.right);else{if(o===void 0)break;if(o.constructor===String||o.constructor===Number){const c=Ci(s);i>0||c.length>0?(t.push("%c"+o),e.push(c)):t.push(o)}else break}}for(i>0&&(r=e,r.unshift(t.join("")));i<n.length;i++){const o=n[i];o instanceof Symbol||r.push(o)}return r},Ss=mi?Ri:Oi,Ni=(...n)=>{console.log(...Ss(n)),Es.forEach(t=>t.print(n))},Cs=(...n)=>{console.warn(...Ss(n)),n.unshift(pn),Es.forEach(t=>t.print(n))},Es=mt(),Ds=n=>({[Symbol.iterator](){return this},next:n}),Li=(n,t)=>Ds(()=>{let e;do e=n.next();while(!e.done&&!t(e.value));return e}),Ve=(n,t)=>Ds(()=>{const{done:e,value:s}=n.next();return{done:e,value:e?void 0:t(s)}});class mn{constructor(t,e){this.clock=t,this.len=e}}class Mt{constructor(){this.clients=new Map}}const ut=(n,t,e)=>t.clients.forEach((s,r)=>{const i=n.doc.store.clients.get(r);if(i!=null){const o=i[i.length-1],l=o.id.clock+o.length;for(let c=0,a=s[c];c<s.length&&a.clock<l;a=s[++c])Rs(n,i,a.clock,a.len,e)}}),Ui=(n,t)=>{let e=0,s=n.length-1;for(;e<=s;){const r=st((e+s)/2),i=n[r],o=i.clock;if(o<=t){if(t<o+i.len)return r;e=r+1}else s=r-1}return null},Rt=(n,t)=>{const e=n.clients.get(t.client);return e!==void 0&&Ui(e,t.clock)!==null},wn=n=>{n.clients.forEach(t=>{t.sort((r,i)=>r.clock-i.clock);let e,s;for(e=1,s=1;e<t.length;e++){const r=t[s-1],i=t[e];r.clock+r.len>=i.clock?r.len=at(r.len,i.clock+i.len-r.clock):(s<e&&(t[s]=i),s++)}t.length=s})},Ge=n=>{const t=new Mt;for(let e=0;e<n.length;e++)n[e].clients.forEach((s,r)=>{if(!t.clients.has(r)){const i=s.slice();for(let o=e+1;o<n.length;o++)kr(i,n[o].clients.get(r)||[]);t.clients.set(r,i)}});return wn(t),t},Ht=(n,t,e,s)=>{rt(n.clients,t,()=>[]).push(new mn(e,s))},xs=()=>new Mt,Vi=n=>{const t=xs();return n.clients.forEach((e,s)=>{const r=[];for(let i=0;i<e.length;i++){const o=e[i];if(o.deleted){const l=o.id.clock;let c=o.length;if(i+1<e.length)for(let a=e[i+1];i+1<e.length&&a.deleted;a=e[++i+1])c+=a.length;r.push(new mn(l,c))}}r.length>0&&t.clients.set(s,r)}),t},yn=(n,t)=>{b(n.restEncoder,t.clients.size),wt(t.clients.entries()).sort((e,s)=>s[0]-e[0]).forEach(([e,s])=>{n.resetDsCurVal(),b(n.restEncoder,e);const r=s.length;b(n.restEncoder,r);for(let i=0;i<r;i++){const o=s[i];n.writeDsClock(o.clock),n.writeDsLen(o.len)}})},Fi=n=>{const t=new Mt,e=E(n.restDecoder);for(let s=0;s<e;s++){n.resetDsCurVal();const r=E(n.restDecoder),i=E(n.restDecoder);if(i>0){const o=rt(t.clients,r,()=>[]);for(let l=0;l<i;l++)o.push(new mn(n.readDsClock(),n.readDsLen()))}}return t},Pn=(n,t,e)=>{const s=new Mt,r=E(n.restDecoder);for(let i=0;i<r;i++){n.resetDsCurVal();const o=E(n.restDecoder),l=E(n.restDecoder),c=e.clients.get(o)||[],a=x(e,o);for(let u=0;u<l;u++){const h=n.readDsClock(),d=h+n.readDsLen();if(h<a){a<d&&Ht(s,o,a,d-a);let f=K(c,h),g=c[f];for(!g.deleted&&g.id.clock<h&&(c.splice(f+1,0,ke(t,g,h-g.id.clock)),f++);f<c.length&&(g=c[f++],g.id.clock<d);)g.deleted||(d<g.id.clock+g.length&&c.splice(f,0,ke(t,g,d-g.id.clock)),g.delete(t))}else Ht(s,o,h,d-h)}}if(s.clients.size>0){const i=new De;return b(i.restEncoder,0),yn(i,s),i.toUint8Array()}return null},As=us;class bt extends os{constructor({guid:t=ni(),collectionid:e=null,gc:s=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=s,this.gcFilter=r,this.clientID=As(),this.guid=t,this.collectionid=e,this.share=new Map,this.store=new Os,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=Un(a=>{this.on("load",()=>{this.isLoaded=!0,a(this)})});const c=()=>Un(a=>{const u=h=>{(h===void 0||h===!0)&&(this.off("sync",u),a())};this.on("sync",u)});this.on("sync",a=>{a===!1&&this.isSynced&&(this.whenSynced=c()),this.isSynced=a===void 0||a===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=c()}load(){const t=this._item;t!==null&&!this.shouldLoad&&C(t.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(wt(this.subdocs).map(t=>t.guid))}transact(t,e=null){return C(this,t,e)}get(t,e=v){const s=rt(this.share,t,()=>{const i=new e;return i._integrate(this,null),i}),r=s.constructor;if(e!==v&&r!==e)if(r===v){const i=new e;i._map=s._map,s._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=s._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=s._length,this.share.set(t,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return s}getArray(t=""){return this.get(t,At)}getText(t=""){return this.get(t,dt)}getMap(t=""){return this.get(t,Ot)}getXmlElement(t=""){return this.get(t,I)}getXmlFragment(t=""){return this.get(t,yt)}toJSON(){const t={};return this.share.forEach((e,s)=>{t[s]=e.toJSON()}),t}destroy(){this.isDestroyed=!0,wt(this.subdocs).forEach(e=>e.destroy());const t=this._item;if(t!==null){this._item=null;const e=t.content;e.doc=new bt({guid:this.guid,...e.opts,shouldLoad:!1}),e.doc._item=t,C(t.parent.doc,s=>{const r=e.doc;t.deleted||s.subdocsAdded.add(r),s.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Pi{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=E(this.restDecoder),this.dsCurrVal}readDsLen(){const t=E(this.restDecoder)+1;return this.dsCurrVal+=t,t}}class fe extends Pi{constructor(t){super(t),this.keys=[],E(t),this.keyClockDecoder=new Ue(B(t)),this.clientDecoder=new le(B(t)),this.leftClockDecoder=new Ue(B(t)),this.rightClockDecoder=new Ue(B(t)),this.infoDecoder=new Ln(B(t),Bt),this.stringDecoder=new Xr(B(t)),this.parentInfoDecoder=new Ln(B(t),Bt),this.typeRefDecoder=new le(B(t)),this.lenDecoder=new le(B(t))}readLeftID(){return new Dt(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Dt(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return ue(this.restDecoder)}readBuf(){return B(this.restDecoder)}readJSON(){return ue(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{const e=this.stringDecoder.read();return this.keys.push(e),e}}}class Bi{constructor(){this.restEncoder=qt()}toUint8Array(){return z(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){b(this.restEncoder,t)}writeDsLen(t){b(this.restEncoder,t)}}class Hi extends Bi{writeLeftID(t){b(this.restEncoder,t.client),b(this.restEncoder,t.clock)}writeRightID(t){b(this.restEncoder,t.client),b(this.restEncoder,t.clock)}writeClient(t){b(this.restEncoder,t)}writeInfo(t){Je(this.restEncoder,t)}writeString(t){Et(this.restEncoder,t)}writeParentInfo(t){b(this.restEncoder,t?1:0)}writeTypeRef(t){b(this.restEncoder,t)}writeLen(t){b(this.restEncoder,t)}writeAny(t){vt(this.restEncoder,t)}writeBuf(t){F(this.restEncoder,t)}writeJSON(t){Et(this.restEncoder,JSON.stringify(t))}writeKey(t){Et(this.restEncoder,t)}}class $i{constructor(){this.restEncoder=qt(),this.dsCurrVal=0}toUint8Array(){return z(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){const e=t-this.dsCurrVal;this.dsCurrVal=t,b(this.restEncoder,e)}writeDsLen(t){t===0&&L(),b(this.restEncoder,t-1),this.dsCurrVal+=t}}class De extends $i{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Le,this.clientEncoder=new oe,this.leftClockEncoder=new Le,this.rightClockEncoder=new Le,this.infoEncoder=new Mn(Je),this.stringEncoder=new $r,this.parentInfoEncoder=new Mn(Je),this.typeRefEncoder=new oe,this.lenEncoder=new oe}toUint8Array(){const t=qt();return b(t,0),F(t,this.keyClockEncoder.toUint8Array()),F(t,this.clientEncoder.toUint8Array()),F(t,this.leftClockEncoder.toUint8Array()),F(t,this.rightClockEncoder.toUint8Array()),F(t,z(this.infoEncoder)),F(t,this.stringEncoder.toUint8Array()),F(t,z(this.parentInfoEncoder)),F(t,this.typeRefEncoder.toUint8Array()),F(t,this.lenEncoder.toUint8Array()),Ce(t,z(this.restEncoder)),z(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){vt(this.restEncoder,t)}writeBuf(t){F(this.restEncoder,t)}writeJSON(t){vt(this.restEncoder,t)}writeKey(t){const e=this.keyMap.get(t);e===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(e)}}const ji=(n,t,e,s)=>{s=at(s,t[0].id.clock);const r=K(t,s);b(n.restEncoder,t.length-r),n.writeClient(e),b(n.restEncoder,s);const i=t[r];i.write(n,s-i.id.clock);for(let o=r+1;o<t.length;o++)t[o].write(n,0)},Ts=(n,t,e)=>{const s=new Map;e.forEach((r,i)=>{x(t,i)>r&&s.set(i,r)}),xe(t).forEach((r,i)=>{e.has(i)||s.set(i,0)}),b(n.restEncoder,s.size),wt(s.entries()).sort((r,i)=>i[0]-r[0]).forEach(([r,i])=>{ji(n,t.clients.get(r),r,i)})},zi=(n,t)=>{const e=Y(),s=E(n.restDecoder);for(let r=0;r<s;r++){const i=E(n.restDecoder),o=new Array(i),l=n.readClient();let c=E(n.restDecoder);e.set(l,{i:0,refs:o});for(let a=0;a<i;a++){const u=n.readInfo();switch(Se&u){case 0:{const h=n.readLen();o[a]=new H(w(l,c),h),c+=h;break}case 10:{const h=E(n.restDecoder);o[a]=new j(w(l,c),h),c+=h;break}default:{const h=(u&(et|M))===0,d=new _(w(l,c),null,(u&M)===M?n.readLeftID():null,null,(u&et)===et?n.readRightID():null,h?n.readParentInfo()?t.get(n.readString()):n.readLeftID():null,h&&(u&Ft)===Ft?n.readString():null,er(n,u));o[a]=d,c+=d.length}}}}return e},Yi=(n,t,e)=>{const s=[];let r=wt(e.keys()).sort((f,g)=>f-g);if(r.length===0)return null;const i=()=>{if(r.length===0)return null;let f=e.get(r[r.length-1]);for(;f.refs.length===f.i;)if(r.pop(),r.length>0)f=e.get(r[r.length-1]);else return null;return f};let o=i();if(o===null)return null;const l=new Os,c=new Map,a=(f,g)=>{const p=c.get(f);(p==null||p>g)&&c.set(f,g)};let u=o.refs[o.i++];const h=new Map,d=()=>{for(const f of s){const g=f.id.client,p=e.get(g);p?(p.i--,l.clients.set(g,p.refs.slice(p.i)),e.delete(g),p.i=0,p.refs=[]):l.clients.set(g,[f]),r=r.filter(m=>m!==g)}s.length=0};for(;;){if(u.constructor!==j){const g=rt(h,u.id.client,()=>x(t,u.id.client))-u.id.clock;if(g<0)s.push(u),a(u.id.client,u.id.clock-1),d();else{const p=u.getMissing(n,t);if(p!==null){s.push(u);const m=e.get(p)||{refs:[],i:0};if(m.refs.length===m.i)a(p,x(t,p)),d();else{u=m.refs[m.i++];continue}}else(g===0||g<u.length)&&(u.integrate(n,g),h.set(u.id.client,u.id.clock+u.length))}}if(s.length>0)u=s.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=i(),o===null)break;u=o.refs[o.i++]}}if(l.clients.size>0){const f=new De;return Ts(f,l,new Map),b(f.restEncoder,0),{missing:c,update:f.toUint8Array()}}return null},Ji=(n,t)=>Ts(n,t.doc.store,t.beforeState),Ki=(n,t,e,s=new fe(n))=>C(t,r=>{r.local=!1;let i=!1;const o=r.doc,l=o.store,c=zi(s,o),a=Yi(r,l,c),u=l.pendingStructs;if(u){for(const[d,f]of u.missing)if(f<x(l,d)){i=!0;break}if(a){for(const[d,f]of a.missing){const g=u.missing.get(d);(g==null||g>f)&&u.missing.set(d,f)}u.update=Wn([u.update,a.update])}}else l.pendingStructs=a;const h=Pn(s,r,l);if(l.pendingDs){const d=new fe(un(l.pendingDs));E(d.restDecoder);const f=Pn(d,r,l);h&&f?l.pendingDs=Wn([h,f]):l.pendingDs=h||f}else l.pendingDs=h;if(i){const d=l.pendingStructs.update;l.pendingStructs=null,Xe(r.doc,d)}},e,!1),Xe=(n,t,e,s=fe)=>{const r=un(t);Ki(r,n,e,new s(r))};class Wi{constructor(){this.l=[]}}const Bn=()=>new Wi,Hn=(n,t)=>n.l.push(t),$n=(n,t)=>{const e=n.l,s=e.length;n.l=e.filter(r=>t!==r),s===n.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},vs=(n,t,e)=>gn(n.l,[t,e]);class Dt{constructor(t,e){this.client=t,this.clock=e}}const Qt=(n,t)=>n===t||n!==null&&t!==null&&n.client===t.client&&n.clock===t.clock,w=(n,t)=>new Dt(n,t),$t=n=>{for(const[t,e]of n.doc.share.entries())if(e===n)return t;throw L()},jt=(n,t)=>{for(;t!==null;){if(t.parent===n)return!0;t=t.parent._item}return!1};class ge{constructor(t,e,s,r=0){this.type=t,this.tname=e,this.item=s,this.assoc=r}}class qi{constructor(t,e,s=0){this.type=t,this.index=e,this.assoc=s}}const Gi=(n,t,e=0)=>new qi(n,t,e),te=(n,t,e)=>{let s=null,r=null;return n._item===null?r=$t(n):s=w(n._item.id.client,n._item.id.clock),new ge(s,r,t,e)},Fe=(n,t,e=0)=>{let s=n._start;if(e<0){if(t===0)return te(n,null,e);t--}for(;s!==null;){if(!s.deleted&&s.countable){if(s.length>t)return te(n,w(s.id.client,s.id.clock+t),e);t-=s.length}if(s.right===null&&e<0)return te(n,s.lastId,e);s=s.right}return te(n,null,e)},Xi=(n,t)=>{const e=xt(n,t),s=t.clock-e.id.clock;return{item:e,diff:s}},Zi=(n,t,e=!0)=>{const s=t.store,r=n.item,i=n.type,o=n.tname,l=n.assoc;let c=null,a=0;if(r!==null){if(x(s,r.client)<=r.clock)return null;const u=e?en(s,r):Xi(s,r),h=u.item;if(!(h instanceof _))return null;if(c=h.parent,c._item===null||!c._item.deleted){a=h.deleted||!h.countable?0:u.diff+(l>=0?0:1);let d=h.left;for(;d!==null;)!d.deleted&&d.countable&&(a+=d.length),d=d.left}}else{if(o!==null)c=t.get(o);else if(i!==null){if(x(s,i.client)<=i.clock)return null;const{item:u}=e?en(s,i):{item:xt(s,i)};if(u instanceof _&&u.content instanceof q)c=u.content.type;else return null}else throw L();l>=0?a=c._length:a=0}return Gi(c,a,n.assoc)};class kn{constructor(t,e){this.ds=t,this.sv=e}}const Is=(n,t)=>new kn(n,t),Pe=n=>Is(Vi(n.store),xe(n.store)),gt=(n,t)=>t===void 0?!n.deleted:t.sv.has(n.id.client)&&(t.sv.get(n.id.client)||0)>n.id.clock&&!Rt(t.ds,n.id),Ze=(n,t)=>{const e=rt(n.meta,Ze,mt),s=n.doc.store;e.has(t)||(t.sv.forEach((r,i)=>{r<x(s,i)&&R(n,w(i,r))}),ut(n,t.ds,r=>{}),e.add(t))};class Os{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const xe=n=>{const t=new Map;return n.clients.forEach((e,s)=>{const r=e[e.length-1];t.set(s,r.id.clock+r.length)}),t},x=(n,t)=>{const e=n.clients.get(t);if(e===void 0)return 0;const s=e[e.length-1];return s.id.clock+s.length},Ms=(n,t)=>{let e=n.clients.get(t.id.client);if(e===void 0)e=[],n.clients.set(t.id.client,e);else{const s=e[e.length-1];if(s.id.clock+s.length!==t.id.clock)throw L()}e.push(t)},K=(n,t)=>{let e=0,s=n.length-1,r=n[s],i=r.id.clock;if(i===t)return s;let o=st(t/(i+r.length-1)*s);for(;e<=s;){if(r=n[o],i=r.id.clock,i<=t){if(t<i+r.length)return o;e=o+1}else s=o-1;o=st((e+s)/2)}throw L()},Qi=(n,t)=>{const e=n.clients.get(t.client);return e[K(e,t.clock)]},xt=Qi,Qe=(n,t,e)=>{const s=K(t,e),r=t[s];return r.id.clock<e&&r instanceof _?(t.splice(s+1,0,ke(n,r,e-r.id.clock)),s+1):s},R=(n,t)=>{const e=n.doc.store.clients.get(t.client);return e[Qe(n,e,t.clock)]},jn=(n,t,e)=>{const s=t.clients.get(e.client),r=K(s,e.clock),i=s[r];return e.clock!==i.id.clock+i.length-1&&i.constructor!==H&&s.splice(r+1,0,ke(n,i,e.clock-i.id.clock+1)),i},to=(n,t,e)=>{const s=n.clients.get(t.id.client);s[K(s,t.id.clock)]=e},Rs=(n,t,e,s,r)=>{if(s===0)return;const i=e+s;let o=Qe(n,t,e),l;do l=t[o++],i<l.id.clock+l.length&&Qe(n,t,i),r(l);while(o<t.length&&t[o].id.clock<i)};class eo{constructor(t,e,s){this.doc=t,this.deleteSet=new Mt,this.beforeState=xe(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=e,this.meta=new Map,this.local=s,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const zn=(n,t)=>t.deleteSet.clients.size===0&&!yr(t.afterState,(e,s)=>t.beforeState.get(s)!==e)?!1:(wn(t.deleteSet),Ji(n,t),yn(n,t.deleteSet),!0),Yn=(n,t,e)=>{const s=t._item;(s===null||s.id.clock<(n.beforeState.get(s.id.client)||0)&&!s.deleted)&&rt(n.changed,t,mt).add(e)},ce=(n,t)=>{let e=n[t],s=n[t-1],r=t;for(;r>0;e=s,s=n[--r-1]){if(s.deleted===e.deleted&&s.constructor===e.constructor&&s.mergeWith(e)){e instanceof _&&e.parentSub!==null&&e.parent._map.get(e.parentSub)===e&&e.parent._map.set(e.parentSub,s);continue}break}const i=t-r;return i&&n.splice(t+1-i,i),i},no=(n,t,e)=>{for(const[s,r]of n.clients.entries()){const i=t.clients.get(s);for(let o=r.length-1;o>=0;o--){const l=r[o],c=l.clock+l.len;for(let a=K(i,l.clock),u=i[a];a<i.length&&u.id.clock<c;u=i[++a]){const h=i[a];if(l.clock+l.len<=h.id.clock)break;h instanceof _&&h.deleted&&!h.keep&&e(h)&&h.gc(t,!1)}}}},so=(n,t)=>{n.clients.forEach((e,s)=>{const r=t.clients.get(s);for(let i=e.length-1;i>=0;i--){const o=e[i],l=Tt(r.length-1,1+K(r,o.clock+o.len-1));for(let c=l,a=r[c];c>0&&a.id.clock>=o.clock;a=r[c])c-=1+ce(r,c)}})},Ns=(n,t)=>{if(t<n.length){const e=n[t],s=e.doc,r=s.store,i=e.deleteSet,o=e._mergeStructs;try{wn(i),e.afterState=xe(e.doc.store),s.emit("beforeObserverCalls",[e,s]);const l=[];e.changed.forEach((c,a)=>l.push(()=>{(a._item===null||!a._item.deleted)&&a._callObserver(e,c)})),l.push(()=>{e.changedParentTypes.forEach((c,a)=>{a._dEH.l.length>0&&(a._item===null||!a._item.deleted)&&(c=c.filter(u=>u.target._item===null||!u.target._item.deleted),c.forEach(u=>{u.currentTarget=a,u._path=null}),c.sort((u,h)=>u.path.length-h.path.length),vs(a._dEH,c,e))})}),l.push(()=>s.emit("afterTransaction",[e,s])),gn(l,[]),e._needFormattingCleanup&&Eo(e)}finally{s.gc&&no(i,r,s.gcFilter),so(i,r),e.afterState.forEach((u,h)=>{const d=e.beforeState.get(h)||0;if(d!==u){const f=r.clients.get(h),g=at(K(f,d),1);for(let p=f.length-1;p>=g;)p-=1+ce(f,p)}});for(let u=o.length-1;u>=0;u--){const{client:h,clock:d}=o[u].id,f=r.clients.get(h),g=K(f,d);g+1<f.length&&ce(f,g+1)>1||g>0&&ce(f,g)}if(!e.local&&e.afterState.get(s.clientID)!==e.beforeState.get(s.clientID)&&(Ni(pn,ks,"[yjs] ",bs,_s,"Changed the client-id because another client seems to be using it."),s.clientID=As()),s.emit("afterTransactionCleanup",[e,s]),s._observers.has("update")){const u=new Hi;zn(u,e)&&s.emit("update",[u.toUint8Array(),e.origin,s,e])}if(s._observers.has("updateV2")){const u=new De;zn(u,e)&&s.emit("updateV2",[u.toUint8Array(),e.origin,s,e])}const{subdocsAdded:l,subdocsLoaded:c,subdocsRemoved:a}=e;(l.size>0||a.size>0||c.size>0)&&(l.forEach(u=>{u.clientID=s.clientID,u.collectionid==null&&(u.collectionid=s.collectionid),s.subdocs.add(u)}),a.forEach(u=>s.subdocs.delete(u)),s.emit("subdocs",[{loaded:c,added:l,removed:a},s,e]),a.forEach(u=>u.destroy())),n.length<=t+1?(s._transactionCleanups=[],s.emit("afterAllTransactions",[s,n])):Ns(n,t+1)}}},C=(n,t,e=null,s=!0)=>{const r=n._transactionCleanups;let i=!1,o=null;n._transaction===null&&(i=!0,n._transaction=new eo(n,e,s),r.push(n._transaction),r.length===1&&n.emit("beforeAllTransactions",[n]),n.emit("beforeTransaction",[n._transaction,n]));try{o=t(n._transaction)}finally{if(i){const l=n._transaction===r[0];n._transaction=null,l&&Ns(r,0)}}return o};class ro{constructor(t,e){this.insertions=e,this.deletions=t,this.meta=new Map}}const Jn=(n,t,e)=>{ut(n,e.deletions,s=>{s instanceof _&&t.scope.some(r=>r===n.doc||jt(r,s))&&En(s,!1)})},Kn=(n,t,e)=>{let s=null;const r=n.doc,i=n.scope;C(r,l=>{for(;t.length>0&&n.currStackItem===null;){const c=r.store,a=t.pop(),u=new Set,h=[];let d=!1;ut(l,a.insertions,f=>{if(f instanceof _){if(f.redone!==null){let{item:g,diff:p}=en(c,f.id);p>0&&(g=R(l,w(g.id.client,g.id.clock+p))),f=g}!f.deleted&&i.some(g=>g===l.doc||jt(g,f))&&h.push(f)}}),ut(l,a.deletions,f=>{f instanceof _&&i.some(g=>g===l.doc||jt(g,f))&&!Rt(a.insertions,f.id)&&u.add(f)}),u.forEach(f=>{d=tr(l,f,u,a.insertions,n.ignoreRemoteMapChanges,n)!==null||d});for(let f=h.length-1;f>=0;f--){const g=h[f];n.deleteFilter(g)&&(g.delete(l),d=!0)}n.currStackItem=d?a:null}l.changed.forEach((c,a)=>{c.has(null)&&a._searchMarker&&(a._searchMarker.length=0)}),s=l},n);const o=n.currStackItem;if(o!=null){const l=s.changedParentTypes;n.emit("stack-item-popped",[{stackItem:o,type:e,changedParentTypes:l,origin:n},n]),n.currStackItem=null}return o};class Ls extends os{constructor(t,{captureTimeout:e=500,captureTransaction:s=c=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:l=ze(t)?t[0].doc:t instanceof bt?t:t.doc}={}){super(),this.scope=[],this.doc=l,this.addToScope(t),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=s,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=e,this.afterTransactionHandler=c=>{if(!this.captureTransaction(c)||!this.scope.some(m=>c.changedParentTypes.has(m)||m===this.doc)||!this.trackedOrigins.has(c.origin)&&(!c.origin||!this.trackedOrigins.has(c.origin.constructor)))return;const a=this.undoing,u=this.redoing,h=a?this.redoStack:this.undoStack;a?this.stopCapturing():u||this.clear(!1,!0);const d=new Mt;c.afterState.forEach((m,y)=>{const $=c.beforeState.get(y)||0,Q=m-$;Q>0&&Ht(d,y,$,Q)});const f=si();let g=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&h.length>0&&!a&&!u){const m=h[h.length-1];m.deletions=Ge([m.deletions,c.deleteSet]),m.insertions=Ge([m.insertions,d])}else h.push(new ro(c.deleteSet,d)),g=!0;!a&&!u&&(this.lastChange=f),ut(c,c.deleteSet,m=>{m instanceof _&&this.scope.some(y=>y===c.doc||jt(y,m))&&En(m,!0)});const p=[{stackItem:h[h.length-1],origin:c.origin,type:a?"redo":"undo",changedParentTypes:c.changedParentTypes},this];g?this.emit("stack-item-added",p):this.emit("stack-item-updated",p)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){const e=new Set(this.scope);t=ze(t)?t:[t],t.forEach(s=>{e.has(s)||(e.add(s),(s instanceof v?s.doc!==this.doc:s!==this.doc)&&Cs("[yjs#509] Not same Y.Doc"),this.scope.push(s))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,e=!0){(t&&this.canUndo()||e&&this.canRedo())&&this.doc.transact(s=>{t&&(this.undoStack.forEach(r=>Jn(s,this,r)),this.undoStack=[]),e&&(this.redoStack.forEach(r=>Jn(s,this,r)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=Kn(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=Kn(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*io(n){const t=E(n.restDecoder);for(let e=0;e<t;e++){const s=E(n.restDecoder),r=n.readClient();let i=E(n.restDecoder);for(let o=0;o<s;o++){const l=n.readInfo();if(l===10){const c=E(n.restDecoder);yield new j(w(r,i),c),i+=c}else if((Se&l)!==0){const c=(l&(et|M))===0,a=new _(w(r,i),null,(l&M)===M?n.readLeftID():null,null,(l&et)===et?n.readRightID():null,c?n.readParentInfo()?n.readString():n.readLeftID():null,c&&(l&Ft)===Ft?n.readString():null,er(n,l));yield a,i+=a.length}else{const c=n.readLen();yield new H(w(r,i),c),i+=c}}}}class oo{constructor(t,e){this.gen=io(t),this.curr=null,this.done=!1,this.filterSkips=e,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===j);return this.curr}}class lo{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}}const co=(n,t)=>{if(n.constructor===H){const{client:e,clock:s}=n.id;return new H(w(e,s+t),n.length-t)}else if(n.constructor===j){const{client:e,clock:s}=n.id;return new j(w(e,s+t),n.length-t)}else{const e=n,{client:s,clock:r}=e.id;return new _(w(s,r+t),null,w(s,r+t-1),null,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t))}},Wn=(n,t=fe,e=De)=>{if(n.length===1)return n[0];const s=n.map(u=>new t(un(u)));let r=s.map(u=>new oo(u,!0)),i=null;const o=new e,l=new lo(o);for(;r=r.filter(d=>d.curr!==null),r.sort((d,f)=>{if(d.curr.id.client===f.curr.id.client){const g=d.curr.id.clock-f.curr.id.clock;return g===0?d.curr.constructor===f.curr.constructor?0:d.curr.constructor===j?1:-1:g}else return f.curr.id.client-d.curr.id.client}),r.length!==0;){const u=r[0],h=u.curr.id.client;if(i!==null){let d=u.curr,f=!1;for(;d!==null&&d.id.clock+d.length<=i.struct.id.clock+i.struct.length&&d.id.client>=i.struct.id.client;)d=u.next(),f=!0;if(d===null||d.id.client!==h||f&&d.id.clock>i.struct.id.clock+i.struct.length)continue;if(h!==i.struct.id.client)Lt(l,i.struct,i.offset),i={struct:d,offset:0},u.next();else if(i.struct.id.clock+i.struct.length<d.id.clock)if(i.struct.constructor===j)i.struct.length=d.id.clock+d.length-i.struct.id.clock;else{Lt(l,i.struct,i.offset);const g=d.id.clock-i.struct.id.clock-i.struct.length;i={struct:new j(w(h,i.struct.id.clock+i.struct.length),g),offset:0}}else{const g=i.struct.id.clock+i.struct.length-d.id.clock;g>0&&(i.struct.constructor===j?i.struct.length-=g:d=co(d,g)),i.struct.mergeWith(d)||(Lt(l,i.struct,i.offset),i={struct:d,offset:0},u.next())}}else i={struct:u.curr,offset:0},u.next();for(let d=u.curr;d!==null&&d.id.client===h&&d.id.clock===i.struct.id.clock+i.struct.length&&d.constructor!==j;d=u.next())Lt(l,i.struct,i.offset),i={struct:d,offset:0}}i!==null&&(Lt(l,i.struct,i.offset),i=null),ao(l);const c=s.map(u=>Fi(u)),a=Ge(c);return yn(o,a),o.toUint8Array()},Us=n=>{n.written>0&&(n.clientStructs.push({written:n.written,restEncoder:z(n.encoder.restEncoder)}),n.encoder.restEncoder=qt(),n.written=0)},Lt=(n,t,e)=>{n.written>0&&n.currClient!==t.id.client&&Us(n),n.written===0&&(n.currClient=t.id.client,n.encoder.writeClient(t.id.client),b(n.encoder.restEncoder,t.id.clock+e)),t.write(n.encoder,e),n.written++},ao=n=>{Us(n);const t=n.encoder.restEncoder;b(t,n.clientStructs.length);for(let e=0;e<n.clientStructs.length;e++){const s=n.clientStructs[e];b(t,s.written),Ce(t,s.restEncoder)}},qn="You must not compute changes after the event-handler fired.";class Ae{constructor(t,e){this.target=t,this.currentTarget=t,this.transaction=e,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=ho(this.currentTarget,this.target))}deletes(t){return Rt(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw ht(qn);const t=new Map,e=this.target;this.transaction.changed.get(e).forEach(r=>{if(r!==null){const i=e._map.get(r);let o,l;if(this.adds(i)){let c=i.left;for(;c!==null&&this.adds(c);)c=c.left;if(this.deletes(i))if(c!==null&&this.deletes(c))o="delete",l=Me(c.content.getContent());else return;else c!==null&&this.deletes(c)?(o="update",l=Me(c.content.getContent())):(o="add",l=void 0)}else if(this.deletes(i))o="delete",l=Me(i.content.getContent());else return;t.set(r,{action:o,oldValue:l})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw ht(qn);const e=this.target,s=mt(),r=mt(),i=[];if(t={added:s,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(e).has(null)){let l=null;const c=()=>{l&&i.push(l)};for(let a=e._start;a!==null;a=a.right)a.deleted?this.deletes(a)&&!this.adds(a)&&((l===null||l.delete===void 0)&&(c(),l={delete:0}),l.delete+=a.length,r.add(a)):this.adds(a)?((l===null||l.insert===void 0)&&(c(),l={insert:[]}),l.insert=l.insert.concat(a.content.getContent()),s.add(a)):((l===null||l.retain===void 0)&&(c(),l={retain:0}),l.retain+=a.length);l!==null&&l.retain===void 0&&c()}this._changes=t}return t}}const ho=(n,t)=>{const e=[];for(;t._item!==null&&t!==n;){if(t._item.parentSub!==null)e.unshift(t._item.parentSub);else{let s=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(s+=r.length),r=r.right;e.unshift(s)}t=t._item.parent}return e},O=()=>{Cs("Invalid access: Add Yjs type to a document before reading data.")},Vs=80;let bn=0;class uo{constructor(t,e){t.marker=!0,this.p=t,this.index=e,this.timestamp=bn++}}const fo=n=>{n.timestamp=bn++},Fs=(n,t,e)=>{n.p.marker=!1,n.p=t,t.marker=!0,n.index=e,n.timestamp=bn++},go=(n,t,e)=>{if(n.length>=Vs){const s=n.reduce((r,i)=>r.timestamp<i.timestamp?r:i);return Fs(s,t,e),s}else{const s=new uo(t,e);return n.push(s),s}},Te=(n,t)=>{if(n._start===null||t===0||n._searchMarker===null)return null;const e=n._searchMarker.length===0?null:n._searchMarker.reduce((i,o)=>ie(t-i.index)<ie(t-o.index)?i:o);let s=n._start,r=0;for(e!==null&&(s=e.p,r=e.index,fo(e));s.right!==null&&r<t;){if(!s.deleted&&s.countable){if(t<r+s.length)break;r+=s.length}s=s.right}for(;s.left!==null&&r>t;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);for(;s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock;)s=s.left,!s.deleted&&s.countable&&(r-=s.length);return e!==null&&ie(e.index-r)<s.parent.length/Vs?(Fs(e,s,r),e):go(n._searchMarker,s,r)},zt=(n,t,e)=>{for(let s=n.length-1;s>=0;s--){const r=n[s];if(e>0){let i=r.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(r.index-=i.length);if(i===null||i.marker===!0){n.splice(s,1);continue}r.p=i,i.marker=!0}(t<r.index||e>0&&t===r.index)&&(r.index=at(t,r.index+e))}},ve=(n,t,e)=>{const s=n,r=t.changedParentTypes;for(;rt(r,n,()=>[]).push(e),n._item!==null;)n=n._item.parent;vs(s._eH,e,t)};class v{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Bn(),this._dEH=Bn(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,e){this.doc=t,this._item=e}_copy(){throw J()}clone(){throw J()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,e){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){Hn(this._eH,t)}observeDeep(t){Hn(this._dEH,t)}unobserve(t){$n(this._eH,t)}unobserveDeep(t){$n(this._dEH,t)}toJSON(){}}const Ps=(n,t,e)=>{n.doc??O(),t<0&&(t=n._length+t),e<0&&(e=n._length+e);let s=e-t;const r=[];let i=n._start;for(;i!==null&&s>0;){if(i.countable&&!i.deleted){const o=i.content.getContent();if(o.length<=t)t-=o.length;else{for(let l=t;l<o.length&&s>0;l++)r.push(o[l]),s--;t=0}}i=i.right}return r},Bs=n=>{n.doc??O();const t=[];let e=n._start;for(;e!==null;){if(e.countable&&!e.deleted){const s=e.content.getContent();for(let r=0;r<s.length;r++)t.push(s[r])}e=e.right}return t},Hs=(n,t)=>{const e=[];let s=n._start;for(;s!==null;){if(s.countable&>(s,t)){const r=s.content.getContent();for(let i=0;i<r.length;i++)e.push(r[i])}s=s.right}return e},Yt=(n,t)=>{let e=0,s=n._start;for(n.doc??O();s!==null;){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let i=0;i<r.length;i++)t(r[i],e++,n)}s=s.right}},$s=(n,t)=>{const e=[];return Yt(n,(s,r)=>{e.push(t(s,r,n))}),e},po=n=>{let t=n._start,e=null,s=0;return{[Symbol.iterator](){return this},next:()=>{if(e===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};e=t.content.getContent(),s=0,t=t.right}const r=e[s++];return e.length<=s&&(e=null),{done:!1,value:r}}}},js=(n,t)=>{n.doc??O();const e=Te(n,t);let s=n._start;for(e!==null&&(s=e.p,t-=e.index);s!==null;s=s.right)if(!s.deleted&&s.countable){if(t<s.length)return s.content.getContent()[t];t-=s.length}},pe=(n,t,e,s)=>{let r=e;const i=n.doc,o=i.clientID,l=i.store,c=e===null?t._start:e.right;let a=[];const u=()=>{a.length>0&&(r=new _(w(o,x(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new kt(a)),r.integrate(n,0),a=[])};s.forEach(h=>{if(h===null)a.push(h);else switch(h.constructor){case Number:case Object:case Boolean:case Array:case String:a.push(h);break;default:switch(u(),h.constructor){case Uint8Array:case ArrayBuffer:r=new _(w(o,x(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new Gt(new Uint8Array(h))),r.integrate(n,0);break;case bt:r=new _(w(o,x(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new Xt(h)),r.integrate(n,0);break;default:if(h instanceof v)r=new _(w(o,x(l,o)),r,r&&r.lastId,c,c&&c.id,t,null,new q(h)),r.integrate(n,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},zs=()=>ht("Length exceeded!"),Ys=(n,t,e,s)=>{if(e>t._length)throw zs();if(e===0)return t._searchMarker&&zt(t._searchMarker,e,s.length),pe(n,t,null,s);const r=e,i=Te(t,e);let o=t._start;for(i!==null&&(o=i.p,e-=i.index,e===0&&(o=o.prev,e+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(e<=o.length){e<o.length&&R(n,w(o.id.client,o.id.clock+e));break}e-=o.length}return t._searchMarker&&zt(t._searchMarker,r,s.length),pe(n,t,o,s)},mo=(n,t,e)=>{let r=(t._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return pe(n,t,r,e)},Js=(n,t,e,s)=>{if(s===0)return;const r=e,i=s,o=Te(t,e);let l=t._start;for(o!==null&&(l=o.p,e-=o.index);l!==null&&e>0;l=l.right)!l.deleted&&l.countable&&(e<l.length&&R(n,w(l.id.client,l.id.clock+e)),e-=l.length);for(;s>0&&l!==null;)l.deleted||(s<l.length&&R(n,w(l.id.client,l.id.clock+s)),l.delete(n),s-=l.length),l=l.right;if(s>0)throw zs();t._searchMarker&&zt(t._searchMarker,r,-i+s)},me=(n,t,e)=>{const s=t._map.get(e);s!==void 0&&s.delete(n)},_n=(n,t,e,s)=>{const r=t._map.get(e)||null,i=n.doc,o=i.clientID;let l;if(s==null)l=new kt([s]);else switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:l=new kt([s]);break;case Uint8Array:l=new Gt(s);break;case bt:l=new Xt(s);break;default:if(s instanceof v)l=new q(s);else throw new Error("Unexpected content type")}new _(w(o,x(i.store,o)),r,r&&r.lastId,null,null,t,e,l).integrate(n,0)},Sn=(n,t)=>{n.doc??O();const e=n._map.get(t);return e!==void 0&&!e.deleted?e.content.getContent()[e.length-1]:void 0},Ks=n=>{const t={};return n.doc??O(),n._map.forEach((e,s)=>{e.deleted||(t[s]=e.content.getContent()[e.length-1])}),t},Ws=(n,t)=>{n.doc??O();const e=n._map.get(t);return e!==void 0&&!e.deleted},wo=(n,t)=>{const e={};return n._map.forEach((s,r)=>{let i=s;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&>(i,t)&&(e[r]=i.content.getContent()[i.length-1])}),e},ee=n=>(n.doc??O(),Li(n._map.entries(),t=>!t[1].deleted));class yo extends Ae{}class At extends v{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){const e=new At;return e.push(t),e}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new At}clone(){const t=new At;return t.insert(0,this.toArray().map(e=>e instanceof v?e.clone():e)),t}get length(){return this.doc??O(),this._length}_callObserver(t,e){super._callObserver(t,e),ve(this,t,new yo(this,t))}insert(t,e){this.doc!==null?C(this.doc,s=>{Ys(s,this,t,e)}):this._prelimContent.splice(t,0,...e)}push(t){this.doc!==null?C(this.doc,e=>{mo(e,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,e=1){this.doc!==null?C(this.doc,s=>{Js(s,this,t,e)}):this._prelimContent.splice(t,e)}get(t){return js(this,t)}toArray(){return Bs(this)}slice(t=0,e=this.length){return Ps(this,t,e)}toJSON(){return this.map(t=>t instanceof v?t.toJSON():t)}map(t){return $s(this,t)}forEach(t){Yt(this,t)}[Symbol.iterator](){return po(this)}_write(t){t.writeTypeRef(jo)}}const ko=n=>new At;class bo extends Ae{constructor(t,e,s){super(t,e),this.keysChanged=s}}class Ot extends v{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,e){super._integrate(t,e),this._prelimContent.forEach((s,r)=>{this.set(r,s)}),this._prelimContent=null}_copy(){return new Ot}clone(){const t=new Ot;return this.forEach((e,s)=>{t.set(s,e instanceof v?e.clone():e)}),t}_callObserver(t,e){ve(this,t,new bo(this,t,e))}toJSON(){this.doc??O();const t={};return this._map.forEach((e,s)=>{if(!e.deleted){const r=e.content.getContent()[e.length-1];t[s]=r instanceof v?r.toJSON():r}}),t}get size(){return[...ee(this)].length}keys(){return Ve(ee(this),t=>t[0])}values(){return Ve(ee(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return Ve(ee(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??O(),this._map.forEach((e,s)=>{e.deleted||t(e.content.getContent()[e.length-1],s,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?C(this.doc,e=>{me(e,this,t)}):this._prelimContent.delete(t)}set(t,e){return this.doc!==null?C(this.doc,s=>{_n(s,this,t,e)}):this._prelimContent.set(t,e),e}get(t){return Sn(this,t)}has(t){return Ws(this,t)}clear(){this.doc!==null?C(this.doc,t=>{this.forEach(function(e,s,r){me(t,r,s)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(zo)}}const _o=n=>new Ot,lt=(n,t)=>n===t||typeof n=="object"&&typeof t=="object"&&n&&t&&ui(n,t);class tn{constructor(t,e,s,r){this.left=t,this.right=e,this.index=s,this.currentAttributes=r}forward(){switch(this.right===null&&L(),this.right.content.constructor){case A:this.right.deleted||Nt(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const Gn=(n,t,e)=>{for(;t.right!==null&&e>0;){switch(t.right.content.constructor){case A:t.right.deleted||Nt(t.currentAttributes,t.right.content);break;default:t.right.deleted||(e<t.right.length&&R(n,w(t.right.id.client,t.right.id.clock+e)),t.index+=t.right.length,e-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},ne=(n,t,e,s)=>{const r=new Map,i=s?Te(t,e):null;if(i){const o=new tn(i.p.left,i.p,i.index,r);return Gn(n,o,e-i.index)}else{const o=new tn(null,t._start,0,r);return Gn(n,o,e)}},qs=(n,t,e,s)=>{for(;e.right!==null&&(e.right.deleted===!0||e.right.content.constructor===A&<(s.get(e.right.content.key),e.right.content.value));)e.right.deleted||s.delete(e.right.content.key),e.forward();const r=n.doc,i=r.clientID;s.forEach((o,l)=>{const c=e.left,a=e.right,u=new _(w(i,x(r.store,i)),c,c&&c.lastId,a,a&&a.id,t,null,new A(l,o));u.integrate(n,0),e.right=u,e.forward()})},Nt=(n,t)=>{const{key:e,value:s}=t;s===null?n.delete(e):n.set(e,s)},Gs=(n,t)=>{for(;n.right!==null;){if(!(n.right.deleted||n.right.content.constructor===A&<(t[n.right.content.key]??null,n.right.content.value)))break;n.forward()}},Xs=(n,t,e,s)=>{const r=n.doc,i=r.clientID,o=new Map;for(const l in s){const c=s[l],a=e.currentAttributes.get(l)??null;if(!lt(a,c)){o.set(l,a);const{left:u,right:h}=e;e.right=new _(w(i,x(r.store,i)),u,u&&u.lastId,h,h&&h.id,t,null,new A(l,c)),e.right.integrate(n,0),e.forward()}}return o},Be=(n,t,e,s,r)=>{e.currentAttributes.forEach((d,f)=>{r[f]===void 0&&(r[f]=null)});const i=n.doc,o=i.clientID;Gs(e,r);const l=Xs(n,t,e,r),c=s.constructor===String?new W(s):s instanceof v?new q(s):new _t(s);let{left:a,right:u,index:h}=e;t._searchMarker&&zt(t._searchMarker,e.index,c.getLength()),u=new _(w(o,x(i.store,o)),a,a&&a.lastId,u,u&&u.id,t,null,c),u.integrate(n,0),e.right=u,e.index=h,e.forward(),qs(n,t,e,l)},Xn=(n,t,e,s,r)=>{const i=n.doc,o=i.clientID;Gs(e,r);const l=Xs(n,t,e,r);t:for(;e.right!==null&&(s>0||l.size>0&&(e.right.deleted||e.right.content.constructor===A));){if(!e.right.deleted)switch(e.right.content.constructor){case A:{const{key:c,value:a}=e.right.content,u=r[c];if(u!==void 0){if(lt(u,a))l.delete(c);else{if(s===0)break t;l.set(c,a)}e.right.delete(n)}else e.currentAttributes.set(c,a);break}default:s<e.right.length&&R(n,w(e.right.id.client,e.right.id.clock+s)),s-=e.right.length;break}e.forward()}if(s>0){let c="";for(;s>0;s--)c+=`
|
|
3
|
+
`;e.right=new _(w(o,x(i.store,o)),e.left,e.left&&e.left.lastId,e.right,e.right&&e.right.id,t,null,new W(c)),e.right.integrate(n,0),e.forward()}qs(n,t,e,l)},Zs=(n,t,e,s,r)=>{let i=t;const o=Y();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===A){const a=i.content;o.set(a.key,a)}i=i.right}let l=0,c=!1;for(;t!==i;){if(e===t&&(c=!0),!t.deleted){const a=t.content;switch(a.constructor){case A:{const{key:u,value:h}=a,d=s.get(u)??null;(o.get(u)!==a||d===h)&&(t.delete(n),l++,!c&&(r.get(u)??null)===h&&d!==h&&(d===null?r.delete(u):r.set(u,d))),!c&&!t.deleted&&Nt(r,a);break}}}t=t.right}return l},So=(n,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;const e=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===A){const s=t.content.key;e.has(s)?t.delete(n):e.add(s)}t=t.left}},Co=n=>{let t=0;return C(n.doc,e=>{let s=n._start,r=n._start,i=Y();const o=je(i);for(;r;){if(r.deleted===!1)switch(r.content.constructor){case A:Nt(o,r.content);break;default:t+=Zs(e,s,r,i,o),i=je(o),s=r;break}r=r.right}}),t},Eo=n=>{const t=new Set,e=n.doc;for(const[s,r]of n.afterState.entries()){const i=n.beforeState.get(s)||0;r!==i&&Rs(n,e.store.clients.get(s),i,r,o=>{!o.deleted&&o.content.constructor===A&&o.constructor!==H&&t.add(o.parent)})}C(e,s=>{ut(n,n.deleteSet,r=>{if(r instanceof H||!r.parent._hasFormatting||t.has(r.parent))return;const i=r.parent;r.content.constructor===A?t.add(i):So(s,r)});for(const r of t)Co(r)})},Zn=(n,t,e)=>{const s=e,r=je(t.currentAttributes),i=t.right;for(;e>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case q:case _t:case W:e<t.right.length&&R(n,w(t.right.id.client,t.right.id.clock+e)),e-=t.right.length,t.right.delete(n);break}t.forward()}i&&Zs(n,i,t.right,r,t.currentAttributes);const o=(t.left||t.right).parent;return o._searchMarker&&zt(o._searchMarker,t.index,-s+e),t};class Do extends Ae{constructor(t,e,s){super(t,e),this.childListChanged=!1,this.keysChanged=new Set,s.forEach(r=>{r===null?this.childListChanged=!0:this.keysChanged.add(r)})}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc,e=[];C(t,s=>{const r=new Map,i=new Map;let o=this.target._start,l=null;const c={};let a="",u=0,h=0;const d=()=>{if(l!==null){let f=null;switch(l){case"delete":h>0&&(f={delete:h}),h=0;break;case"insert":(typeof a=="object"||a.length>0)&&(f={insert:a},r.size>0&&(f.attributes={},r.forEach((g,p)=>{g!==null&&(f.attributes[p]=g)}))),a="";break;case"retain":u>0&&(f={retain:u},ai(c)||(f.attributes=li({},c))),u=0;break}f&&e.push(f),l=null}};for(;o!==null;){switch(o.content.constructor){case q:case _t:this.adds(o)?this.deletes(o)||(d(),l="insert",a=o.content.getContent()[0],d()):this.deletes(o)?(l!=="delete"&&(d(),l="delete"),h+=1):o.deleted||(l!=="retain"&&(d(),l="retain"),u+=1);break;case W:this.adds(o)?this.deletes(o)||(l!=="insert"&&(d(),l="insert"),a+=o.content.str):this.deletes(o)?(l!=="delete"&&(d(),l="delete"),h+=o.length):o.deleted||(l!=="retain"&&(d(),l="retain"),u+=o.length);break;case A:{const{key:f,value:g}=o.content;if(this.adds(o)){if(!this.deletes(o)){const p=r.get(f)??null;lt(p,g)?g!==null&&o.delete(s):(l==="retain"&&d(),lt(g,i.get(f)??null)?delete c[f]:c[f]=g)}}else if(this.deletes(o)){i.set(f,g);const p=r.get(f)??null;lt(p,g)||(l==="retain"&&d(),c[f]=p)}else if(!o.deleted){i.set(f,g);const p=c[f];p!==void 0&&(lt(p,g)?p!==null&&o.delete(s):(l==="retain"&&d(),g===null?delete c[f]:c[f]=g))}o.deleted||(l==="insert"&&d(),Nt(r,o.content));break}}o=o.right}for(d();e.length>0;){const f=e[e.length-1];if(f.retain!==void 0&&f.attributes===void 0)e.pop();else break}}),this._delta=e}return this._delta}}class dt extends v{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??O(),this._length}_integrate(t,e){super._integrate(t,e);try{this._pending.forEach(s=>s())}catch(s){console.error(s)}this._pending=null}_copy(){return new dt}clone(){const t=new dt;return t.applyDelta(this.toDelta()),t}_callObserver(t,e){super._callObserver(t,e);const s=new Do(this,t,e);ve(this,t,s),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??O();let t="",e=this._start;for(;e!==null;)!e.deleted&&e.countable&&e.content.constructor===W&&(t+=e.content.str),e=e.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:e=!0}={}){this.doc!==null?C(this.doc,s=>{const r=new tn(null,this._start,0,new Map);for(let i=0;i<t.length;i++){const o=t[i];if(o.insert!==void 0){const l=!e&&typeof o.insert=="string"&&i===t.length-1&&r.right===null&&o.insert.slice(-1)===`
|
|
4
|
+
`?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&Be(s,this,r,l,o.attributes||{})}else o.retain!==void 0?Xn(s,this,r,o.retain,o.attributes||{}):o.delete!==void 0&&Zn(s,r,o.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,e,s){this.doc??O();const r=[],i=new Map,o=this.doc;let l="",c=this._start;function a(){if(l.length>0){const h={};let d=!1;i.forEach((g,p)=>{d=!0,h[p]=g});const f={insert:l};d&&(f.attributes=h),r.push(f),l=""}}const u=()=>{for(;c!==null;){if(gt(c,t)||e!==void 0&>(c,e))switch(c.content.constructor){case W:{const h=i.get("ychange");t!==void 0&&!gt(c,t)?(h===void 0||h.user!==c.id.client||h.type!=="removed")&&(a(),i.set("ychange",s?s("removed",c.id):{type:"removed"})):e!==void 0&&!gt(c,e)?(h===void 0||h.user!==c.id.client||h.type!=="added")&&(a(),i.set("ychange",s?s("added",c.id):{type:"added"})):h!==void 0&&(a(),i.delete("ychange")),l+=c.content.str;break}case q:case _t:{a();const h={insert:c.content.getContent()[0]};if(i.size>0){const d={};h.attributes=d,i.forEach((f,g)=>{d[g]=f})}r.push(h);break}case A:gt(c,t)&&(a(),Nt(i,c.content));break}c=c.right}a()};return t||e?C(o,h=>{t&&Ze(h,t),e&&Ze(h,e),u()},"cleanup"):u(),r}insert(t,e,s){if(e.length<=0)return;const r=this.doc;r!==null?C(r,i=>{const o=ne(i,this,t,!s);s||(s={},o.currentAttributes.forEach((l,c)=>{s[c]=l})),Be(i,this,o,e,s)}):this._pending.push(()=>this.insert(t,e,s))}insertEmbed(t,e,s){const r=this.doc;r!==null?C(r,i=>{const o=ne(i,this,t,!s);Be(i,this,o,e,s||{})}):this._pending.push(()=>this.insertEmbed(t,e,s||{}))}delete(t,e){if(e===0)return;const s=this.doc;s!==null?C(s,r=>{Zn(r,ne(r,this,t,!0),e)}):this._pending.push(()=>this.delete(t,e))}format(t,e,s){if(e===0)return;const r=this.doc;r!==null?C(r,i=>{const o=ne(i,this,t,!1);o.right!==null&&Xn(i,this,o,e,s)}):this._pending.push(()=>this.format(t,e,s))}removeAttribute(t){this.doc!==null?C(this.doc,e=>{me(e,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,e){this.doc!==null?C(this.doc,s=>{_n(s,this,t,e)}):this._pending.push(()=>this.setAttribute(t,e))}getAttribute(t){return Sn(this,t)}getAttributes(){return Ks(this)}_write(t){t.writeTypeRef(Yo)}}const xo=n=>new dt;class He{constructor(t,e=()=>!0){this._filter=e,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??O()}[Symbol.iterator](){return this}next(){let t=this._currentNode,e=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(e)))do if(e=t.content.type,!t.deleted&&(e.constructor===I||e.constructor===yt)&&e._start!==null)t=e._start;else for(;t!==null;){const s=t.next;if(s!==null){t=s;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}}class yt extends v{constructor(){super(),this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,e){super._integrate(t,e),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new yt}clone(){const t=new yt;return t.insert(0,this.toArray().map(e=>e instanceof v?e.clone():e)),t}get length(){return this.doc??O(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new He(this,t)}querySelector(t){t=t.toUpperCase();const s=new He(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t).next();return s.done?null:s.value}querySelectorAll(t){return t=t.toUpperCase(),wt(new He(this,e=>e.nodeName&&e.nodeName.toUpperCase()===t))}_callObserver(t,e){ve(this,t,new vo(this,e,t))}toString(){return $s(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,e={},s){const r=t.createDocumentFragment();return s!==void 0&&s._createAssociation(r,this),Yt(this,i=>{r.insertBefore(i.toDOM(t,e,s),null)}),r}insert(t,e){this.doc!==null?C(this.doc,s=>{Ys(s,this,t,e)}):this._prelimContent.splice(t,0,...e)}insertAfter(t,e){if(this.doc!==null)C(this.doc,s=>{const r=t&&t instanceof v?t._item:t;pe(s,this,r,e)});else{const s=this._prelimContent,r=t===null?0:s.findIndex(i=>i===t)+1;if(r===0&&t!==null)throw ht("Reference item not found");s.splice(r,0,...e)}}delete(t,e=1){this.doc!==null?C(this.doc,s=>{Js(s,this,t,e)}):this._prelimContent.splice(t,e)}toArray(){return Bs(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return js(this,t)}slice(t=0,e=this.length){return Ps(this,t,e)}forEach(t){Yt(this,t)}_write(t){t.writeTypeRef(Ko)}}const Ao=n=>new yt;class I extends yt{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,e){super._integrate(t,e),this._prelimAttrs.forEach((s,r)=>{this.setAttribute(r,s)}),this._prelimAttrs=null}_copy(){return new I(this.nodeName)}clone(){const t=new I(this.nodeName),e=this.getAttributes();return ci(e,(s,r)=>{typeof s=="string"&&t.setAttribute(r,s)}),t.insert(0,this.toArray().map(s=>s instanceof v?s.clone():s)),t}toString(){const t=this.getAttributes(),e=[],s=[];for(const l in t)s.push(l);s.sort();const r=s.length;for(let l=0;l<r;l++){const c=s[l];e.push(c+'="'+t[c]+'"')}const i=this.nodeName.toLocaleLowerCase(),o=e.length>0?" "+e.join(" "):"";return`<${i}${o}>${super.toString()}</${i}>`}removeAttribute(t){this.doc!==null?C(this.doc,e=>{me(e,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,e){this.doc!==null?C(this.doc,s=>{_n(s,this,t,e)}):this._prelimAttrs.set(t,e)}getAttribute(t){return Sn(this,t)}hasAttribute(t){return Ws(this,t)}getAttributes(t){return t?wo(this,t):Ks(this)}toDOM(t=document,e={},s){const r=t.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const l=i[o];typeof l=="string"&&r.setAttribute(o,l)}return Yt(this,o=>{r.appendChild(o.toDOM(t,e,s))}),s!==void 0&&s._createAssociation(r,this),r}_write(t){t.writeTypeRef(Jo),t.writeKey(this.nodeName)}}const To=n=>new I(n.readKey());class vo extends Ae{constructor(t,e,s){super(t,s),this.childListChanged=!1,this.attributesChanged=new Set,e.forEach(r=>{r===null?this.childListChanged=!0:this.attributesChanged.add(r)})}}class we extends Ot{constructor(t){super(),this.hookName=t}_copy(){return new we(this.hookName)}clone(){const t=new we(this.hookName);return this.forEach((e,s)=>{t.set(s,e)}),t}toDOM(t=document,e={},s){const r=e[this.hookName];let i;return r!==void 0?i=r.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),s!==void 0&&s._createAssociation(i,this),i}_write(t){t.writeTypeRef(Wo),t.writeKey(this.hookName)}}const Io=n=>new we(n.readKey());class N extends dt{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new N}clone(){const t=new N;return t.applyDelta(this.toDelta()),t}toDOM(t=document,e,s){const r=t.createTextNode(this.toString());return s!==void 0&&s._createAssociation(r,this),r}toString(){return this.toDelta().map(t=>{const e=[];for(const r in t.attributes){const i=[];for(const o in t.attributes[r])i.push({key:o,value:t.attributes[r][o]});i.sort((o,l)=>o.key<l.key?-1:1),e.push({nodeName:r,attrs:i})}e.sort((r,i)=>r.nodeName<i.nodeName?-1:1);let s="";for(let r=0;r<e.length;r++){const i=e[r];s+=`<${i.nodeName}`;for(let o=0;o<i.attrs.length;o++){const l=i.attrs[o];s+=` ${l.key}="${l.value}"`}s+=">"}s+=t.insert;for(let r=e.length-1;r>=0;r--)s+=`</${e[r].nodeName}>`;return s}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(qo)}}const Oo=n=>new N;class Cn{constructor(t,e){this.id=t,this.length=e}get deleted(){throw J()}mergeWith(t){return!1}write(t,e,s){throw J()}integrate(t,e){throw J()}}const Mo=0;class H extends Cn{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,e){e>0&&(this.id.clock+=e,this.length-=e),Ms(t.doc.store,this)}write(t,e){t.writeInfo(Mo),t.writeLen(this.length-e)}getMissing(t,e){return null}}class Gt{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new Gt(this.content)}splice(t){throw J()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeBuf(this.content)}getRef(){return 3}}const Ro=n=>new Gt(n.readBuf());class Jt{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Jt(this.len)}splice(t){const e=new Jt(this.len-t);return this.len=t,e}mergeWith(t){return this.len+=t.len,!0}integrate(t,e){Ht(t.deleteSet,e.id.client,e.id.clock,this.len),e.markDeleted()}delete(t){}gc(t){}write(t,e){t.writeLen(this.len-e)}getRef(){return 1}}const No=n=>new Jt(n.readLen()),Qs=(n,t)=>new bt({guid:n,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class Xt{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;const e={};this.opts=e,t.gc||(e.gc=!1),t.autoLoad&&(e.autoLoad=!0),t.meta!==null&&(e.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new Xt(Qs(this.doc.guid,this.opts))}splice(t){throw J()}mergeWith(t){return!1}integrate(t,e){this.doc._item=e,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,e){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}}const Lo=n=>new Xt(Qs(n.readString(),n.readAny()));class _t{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new _t(this.embed)}splice(t){throw J()}mergeWith(t){return!1}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeJSON(this.embed)}getRef(){return 5}}const Uo=n=>new _t(n.readJSON());class A{constructor(t,e){this.key=t,this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new A(this.key,this.value)}splice(t){throw J()}mergeWith(t){return!1}integrate(t,e){const s=e.parent;s._searchMarker=null,s._hasFormatting=!0}delete(t){}gc(t){}write(t,e){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}}const Vo=n=>new A(n.readKey(),n.readJSON());class ye{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new ye(this.arr)}splice(t){const e=new ye(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){const s=this.arr.length;t.writeLen(s-e);for(let r=e;r<s;r++){const i=this.arr[r];t.writeString(i===void 0?"undefined":JSON.stringify(i))}}getRef(){return 2}}const Fo=n=>{const t=n.readLen(),e=[];for(let s=0;s<t;s++){const r=n.readString();r==="undefined"?e.push(void 0):e.push(JSON.parse(r))}return new ye(e)},Po=de("node_env")==="development";class kt{constructor(t){this.arr=t,Po&&ps(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new kt(this.arr)}splice(t){const e=new kt(this.arr.slice(t));return this.arr=this.arr.slice(0,t),e}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){const s=this.arr.length;t.writeLen(s-e);for(let r=e;r<s;r++){const i=this.arr[r];t.writeAny(i)}}getRef(){return 8}}const Bo=n=>{const t=n.readLen(),e=[];for(let s=0;s<t;s++)e.push(n.readAny());return new kt(e)};class W{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new W(this.str)}splice(t){const e=new W(this.str.slice(t));this.str=this.str.slice(0,t);const s=this.str.charCodeAt(t-1);return s>=55296&&s<=56319&&(this.str=this.str.slice(0,t-1)+"�",e.str="�"+e.str.slice(1)),e}mergeWith(t){return this.str+=t.str,!0}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeString(e===0?this.str:this.str.slice(e))}getRef(){return 4}}const Ho=n=>new W(n.readString()),$o=[ko,_o,xo,To,Ao,Io,Oo],jo=0,zo=1,Yo=2,Jo=3,Ko=4,Wo=5,qo=6;class q{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new q(this.type._copy())}splice(t){throw J()}mergeWith(t){return!1}integrate(t,e){this.type._integrate(t.doc,e)}delete(t){let e=this.type._start;for(;e!==null;)e.deleted?e.id.clock<(t.beforeState.get(e.id.client)||0)&&t._mergeStructs.push(e):e.delete(t),e=e.right;this.type._map.forEach(s=>{s.deleted?s.id.clock<(t.beforeState.get(s.id.client)||0)&&t._mergeStructs.push(s):s.delete(t)}),t.changed.delete(this.type)}gc(t){let e=this.type._start;for(;e!==null;)e.gc(t,!0),e=e.right;this.type._start=null,this.type._map.forEach(s=>{for(;s!==null;)s.gc(t,!0),s=s.left}),this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}const Go=n=>new q($o[n.readTypeRef()](n)),en=(n,t)=>{let e=t,s=0,r;do s>0&&(e=w(e.client,e.clock+s)),r=xt(n,e),s=e.clock-r.id.clock,e=r.redone;while(e!==null&&r instanceof _);return{item:r,diff:s}},En=(n,t)=>{for(;n!==null&&n.keep!==t;)n.keep=t,n=n.parent._item},ke=(n,t,e)=>{const{client:s,clock:r}=t.id,i=new _(w(s,r+e),t,w(s,r+e-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(e));return t.deleted&&i.markDeleted(),t.keep&&(i.keep=!0),t.redone!==null&&(i.redone=w(t.redone.client,t.redone.clock+e)),t.right=i,i.right!==null&&(i.right.left=i),n._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),t.length=e,i},Qn=(n,t)=>br(n,e=>Rt(e.deletions,t)),tr=(n,t,e,s,r,i)=>{const o=n.doc,l=o.store,c=o.clientID,a=t.redone;if(a!==null)return R(n,a);let u=t.parent._item,h=null,d;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!e.has(u)||tr(n,u,e,s,r,i)===null))return null;for(;u.redone!==null;)u=R(n,u.redone)}const f=u===null?t.parent:u.content.type;if(t.parentSub===null){for(h=t.left,d=t;h!==null;){let y=h;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:R(n,y.redone);if(y!==null&&y.parent._item===u){h=y;break}h=h.left}for(;d!==null;){let y=d;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:R(n,y.redone);if(y!==null&&y.parent._item===u){d=y;break}d=d.right}}else if(d=null,t.right&&!r){for(h=t;h!==null&&h.right!==null&&(h.right.redone||Rt(s,h.right.id)||Qn(i.undoStack,h.right.id)||Qn(i.redoStack,h.right.id));)for(h=h.right;h.redone;)h=R(n,h.redone);if(h&&h.right!==null)return null}else h=f._map.get(t.parentSub)||null;const g=x(l,c),p=w(c,g),m=new _(p,h,h&&h.lastId,d,d&&d.id,f,t.parentSub,t.content.copy());return t.redone=p,En(m,!0),m.integrate(n,0),m};class _ extends Cn{constructor(t,e,s,r,i,o,l,c){super(t,c.getLength()),this.origin=s,this.left=e,this.right=r,this.rightOrigin=i,this.parent=o,this.parentSub=l,this.redone=null,this.content=c,this.info=this.content.isCountable()?vn:0}set marker(t){(this.info&Ne)>0!==t&&(this.info^=Ne)}get marker(){return(this.info&Ne)>0}get keep(){return(this.info&Tn)>0}set keep(t){this.keep!==t&&(this.info^=Tn)}get countable(){return(this.info&vn)>0}get deleted(){return(this.info&Re)>0}set deleted(t){this.deleted!==t&&(this.info^=Re)}markDeleted(){this.info|=Re}getMissing(t,e){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=x(e,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=x(e,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Dt&&this.id.client!==this.parent.client&&this.parent.clock>=x(e,this.parent.client))return this.parent.client;if(this.origin&&(this.left=jn(t,e,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=R(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===H||this.right&&this.right.constructor===H)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===_?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===_&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Dt){const s=xt(e,this.parent);s.constructor===H?this.parent=null:this.parent=s.content.type}return null}integrate(t,e){if(e>0&&(this.id.clock+=e,this.left=jn(t,t.doc.store,w(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(e),this.length-=e),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let s=this.left,r;if(s!==null)r=s.right;else if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start;const i=new Set,o=new Set;for(;r!==null&&r!==this.right;){if(o.add(r),i.add(r),Qt(this.origin,r.origin)){if(r.id.client<this.id.client)s=r,i.clear();else if(Qt(this.rightOrigin,r.rightOrigin))break}else if(r.origin!==null&&o.has(xt(t.doc.store,r.origin)))i.has(xt(t.doc.store,r.origin))||(s=r,i.clear());else break;r=r.right}this.left=s}if(this.left!==null){const s=this.left.right;this.right=s,this.left.right=this}else{let s;if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start,this.parent._start=this;this.right=s}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Ms(t.doc.store,this),this.content.integrate(t,this),Yn(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new H(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:w(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&Qt(t.origin,this.lastId)&&this.right===t&&Qt(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){const e=this.parent._searchMarker;return e&&e.forEach(s=>{s.p===t&&(s.p=this,!this.deleted&&this.countable&&(s.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){const e=this.parent;this.countable&&this.parentSub===null&&(e._length-=this.length),this.markDeleted(),Ht(t.deleteSet,this.id.client,this.id.clock,this.length),Yn(t,e,this.parentSub),this.content.delete(t)}}gc(t,e){if(!this.deleted)throw L();this.content.gc(t),e?to(t,this,new H(this.id,this.length)):this.content=new Jt(this.length)}write(t,e){const s=e>0?w(this.id.client,this.id.clock+e-1):this.origin,r=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&Se|(s===null?0:M)|(r===null?0:et)|(i===null?0:Ft);if(t.writeInfo(o),s!==null&&t.writeLeftID(s),r!==null&&t.writeRightID(r),s===null&&r===null){const l=this.parent;if(l._item!==void 0){const c=l._item;if(c===null){const a=$t(l);t.writeParentInfo(!0),t.writeString(a)}else t.writeParentInfo(!1),t.writeLeftID(c.id)}else l.constructor===String?(t.writeParentInfo(!0),t.writeString(l)):l.constructor===Dt?(t.writeParentInfo(!1),t.writeLeftID(l)):L();i!==null&&t.writeString(i)}this.content.write(t,e)}}const er=(n,t)=>Xo[t&Se](n),Xo=[()=>{L()},No,Fo,Ro,Ho,Uo,Vo,Go,Bo,Lo,()=>{L()}],Zo=10;class j extends Cn{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,e){L()}write(t,e){t.writeInfo(Zo),b(t.restEncoder,this.length-e)}getMissing(t,e){return null}}const nr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},sr="__ $YJS$ __";nr[sr]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");nr[sr]=!0;const Qo=()=>{let n=!0;return(t,e)=>{if(n){n=!1;try{t()}finally{n=!0}}else e!==void 0&&e()}},tl=/[\uD800-\uDBFF]/,el=/[\uDC00-\uDFFF]/,nl=(n,t)=>{let e=0,s=0;for(;e<n.length&&e<t.length&&n[e]===t[e];)e++;for(e>0&&tl.test(n[e-1])&&e--;s+e<n.length&&s+e<t.length&&n[n.length-s-1]===t[t.length-s-1];)s++;return s>0&&el.test(n[n.length-s])&&s--,{index:e,remove:n.length-e-s,insert:t.slice(e,t.length-s)}},sl=nl,Z=(n,t)=>n>>>t|n<<32-t,rl=n=>Z(n,2)^Z(n,13)^Z(n,22),il=n=>Z(n,6)^Z(n,11)^Z(n,25),ol=n=>Z(n,7)^Z(n,18)^n>>>3,ll=n=>Z(n,17)^Z(n,19)^n>>>10,cl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),al=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);class hl{constructor(){const t=new ArrayBuffer(320);this._H=new Uint32Array(t,0,8),this._H.set(al),this._W=new Uint32Array(t,64,64)}_updateHash(){const t=this._H,e=this._W;for(let h=16;h<64;h++)e[h]=ll(e[h-2])+e[h-7]+ol(e[h-15])+e[h-16];let s=t[0],r=t[1],i=t[2],o=t[3],l=t[4],c=t[5],a=t[6],u=t[7];for(let h=0,d,f;h<64;h++)d=u+il(l)+(l&c^~l&a)+cl[h]+e[h]>>>0,f=rl(s)+(s&r^s&i^r&i)>>>0,u=a,a=c,c=l,l=o+d>>>0,o=i,i=r,r=s,s=d+f>>>0;t[0]+=s,t[1]+=r,t[2]+=i,t[3]+=o,t[4]+=l,t[5]+=c,t[6]+=a,t[7]+=u}digest(t){let e=0;for(;e+56<=t.length;){let o=0;for(;o<16&&e+3<t.length;o++)this._W[o]=t[e++]<<24|t[e++]<<16|t[e++]<<8|t[e++];if(e%64!==0){for(this._W.fill(0,o,16);e<t.length;)this._W[o]|=t[e]<<(3-e%4)*8,e++;this._W[o]|=M<<(3-e%4)*8}this._updateHash()}const s=e%64!==0;this._W.fill(0,0,16);let r=0;for(;e<t.length;r++)for(let o=3;o>=0&&e<t.length;o--)this._W[r]|=t[e++]<<o*8;s||(this._W[r-(e%4===0?0:1)]|=M<<(3-e%4)*8),this._W[14]=t.byteLength/_r,this._W[15]=t.byteLength*8,this._updateHash();const i=new Uint8Array(32);for(let o=0;o<this._H.length;o++)for(let l=0;l<4;l++)i[o*4+l]=this._H[o]>>>(3-l)*8;return i}}const ul=n=>new hl().digest(n),D=new k.PluginKey("y-sync"),nt=new k.PluginKey("y-undo");new k.PluginKey("yjs-cursor");const dl=n=>{for(let e=6;e<n.length;e++)n[e%6]=n[e%6]^n[e];return n.slice(0,6)},fl=n=>ki(dl(ul(bi(n)))),be=(n,t)=>t===void 0?!n.deleted:t.sv.has(n.id.client)&&t.sv.get(n.id.client)>n.id.clock&&!Rt(t.ds,n.id),gl=[{light:"#ecd44433",dark:"#ecd444"}],pl=(n,t,e)=>{if(!n.has(e)){if(n.size<t.length){const s=mt();n.forEach(r=>s.add(r)),t=t.filter(r=>!s.has(r))}n.set(e,ti(t))}return n.get(e)},ml=(n,{colors:t=gl,colorMapping:e=new Map,permanentUserData:s=null,onFirstRender:r=()=>{},mapping:i}={})=>{let o=!1;const l=new yl(n,i),c=new k.Plugin({props:{editable:a=>{const u=D.getState(a);return u.snapshot==null&&u.prevSnapshot==null}},key:D,state:{init:(a,u)=>({type:n,doc:n.doc,binding:l,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:e,permanentUserData:s}),apply:(a,u)=>{const h=a.getMeta(D);if(h!==void 0){u=Object.assign({},u);for(const d in h)u[d]=h[d]}return u.addToHistory=a.getMeta("addToHistory")!==!1,u.isChangeOrigin=h!==void 0&&!!h.isChangeOrigin,u.isUndoRedoOperation=h!==void 0&&!!h.isChangeOrigin&&!!h.isUndoRedoOperation,l.prosemirrorView!==null&&h!==void 0&&(h.snapshot!=null||h.prevSnapshot!=null)&&ys(0,()=>{l.prosemirrorView!=null&&(h.restore==null?l._renderSnapshot(h.snapshot,h.prevSnapshot,u):(l._renderSnapshot(h.snapshot,h.snapshot,u),delete u.restore,delete u.snapshot,delete u.prevSnapshot,l.mux(()=>{l._prosemirrorChanged(l.prosemirrorView.state.doc)})))}),u}},view:a=>(l.initView(a),i==null&&l._forceRerender(),r(),{update:()=>{const u=c.getState(a.state);if(u.snapshot==null&&u.prevSnapshot==null&&(o||a.state.doc.content.findDiffStart(a.state.doc.type.createAndFill().content)!==null)){if(o=!0,u.addToHistory===!1&&!u.isChangeOrigin){const h=nt.getState(a.state),d=h&&h.undoManager;d&&d.stopCapturing()}l.mux(()=>{u.doc.transact(h=>{h.meta.set("addToHistory",u.addToHistory),l._prosemirrorChanged(a.state.doc)},D)})}},destroy:()=>{l.destroy()}})});return c},wl=(n,t,e)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type==="all")n.setSelection(new k.AllSelection(n.doc));else if(t.type==="node"){const s=he(e.doc,e.type,t.anchor,e.mapping);n.setSelection(k.NodeSelection.create(n.doc,s))}else{const s=he(e.doc,e.type,t.anchor,e.mapping),r=he(e.doc,e.type,t.head,e.mapping);s!==null&&r!==null&&n.setSelection(k.TextSelection.between(n.doc.resolve(s),n.doc.resolve(r)))}},nn=(n,t)=>({type:t.selection.jsonID,anchor:ln(t.selection.anchor,n.type,n.mapping),head:ln(t.selection.head,n.type,n.mapping)});class yl{constructor(t,e=new Map){this.type=t,this.prosemirrorView=null,this.mux=Qo(),this.mapping=e,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=t.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=nn(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(ms&&this._domSelectionInView===null&&(ys(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const t=this.prosemirrorView._root.getSelection();if(t==null||t.anchorNode==null)return!1;const e=this.prosemirrorView._root.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset),e.getClientRects().length===0&&e.startContainer&&e.collapsed&&e.selectNodeContents(e.startContainer);const r=e.getBoundingClientRect(),i=Si.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||i.clientWidth||0)&&r.top<=(window.innerHeight||i.clientHeight||0)}renderSnapshot(t,e){e||(e=Is(xs(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(D,{snapshot:t,prevSnapshot:e}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{const t=this.type.toArray().map(s=>ae(s,this.prosemirrorView.state.schema,this)).filter(s=>s!==null),e=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k.Slice(k.Fragment.from(t),0,0));e.setMeta(D,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(e)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{const t=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,e=this.type.toArray().map(r=>ae(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),s=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k.Slice(k.Fragment.from(e),0,0));if(t){const r=Tt(at(t.anchor,0),s.doc.content.size),i=Tt(at(t.head,0),s.doc.content.size);s.setSelection(k.TextSelection.create(s.doc,r,i))}this.prosemirrorView.dispatch(s.setMeta(D,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(t,e,s){let r=this.doc,i=this.type;if(t||(t=Pe(this.doc)),t instanceof Uint8Array||e instanceof Uint8Array)if((!(t instanceof Uint8Array)||!(e instanceof Uint8Array))&&L(),r=new bt({gc:!1}),Xe(r,e),e=Pe(r),Xe(r,t),t=Pe(r),i._item===null){const o=Array.from(this.doc.share.keys()).find(l=>this.doc.share.get(l)===this.type);i=r.getXmlFragment(o)}else{const o=r.store.clients.get(i._item.id.client)??[],l=K(o,i._item.id.clock);i=o[l].content.type}this.mapping.clear(),this.mux(()=>{r.transact(o=>{const l=s.permanentUserData;l&&l.dss.forEach(h=>{ut(o,h,d=>{})});const c=(h,d)=>{const f=h==="added"?l.getUserByClientId(d.client):l.getUserByDeletedId(d);return{user:f,type:h,color:pl(s.colorMapping,s.colors,f)}},a=Hs(i,new kn(e.ds,t.sv)).map(h=>!h._item.deleted||be(h._item,t)||be(h._item,e)?ae(h,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},t,e,c):null).filter(h=>h!==null),u=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k.Slice(k.Fragment.from(a),0,0));this.prosemirrorView.dispatch(u.setMeta(D,{isChangeOrigin:!0}))},D)})}_typeChanged(t,e){if(this.prosemirrorView==null)return;const s=D.getState(this.prosemirrorView.state);if(t.length===0||s.snapshot!=null||s.prevSnapshot!=null){this.renderSnapshot(s.snapshot,s.prevSnapshot);return}this.mux(()=>{const r=(l,c)=>this.mapping.delete(c);ut(e,e.deleteSet,l=>{if(l.constructor===_){const c=l.content.type;c&&this.mapping.delete(c)}}),e.changed.forEach(r),e.changedParentTypes.forEach(r);const i=this.type.toArray().map(l=>rr(l,this.prosemirrorView.state.schema,this)).filter(l=>l!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new k.Slice(k.Fragment.from(i),0,0));wl(o,this.beforeTransactionSelection,this),o=o.setMeta(D,{isChangeOrigin:!0,isUndoRedoOperation:e.origin instanceof Ls}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(t){this.doc.transact(()=>{rn(this.doc,this.type,t,this),this.beforeTransactionSelection=nn(this,this.prosemirrorView.state)},D)}initView(t){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=t,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}}const rr=(n,t,e,s,r,i)=>{const o=e.mapping.get(n);if(o===void 0){if(n instanceof I)return ae(n,t,e,s,r,i);throw J()}return o},ae=(n,t,e,s,r,i)=>{const o=[],l=c=>{if(c instanceof I){const a=rr(c,t,e,s,r,i);a!==null&&o.push(a)}else{const a=c._item.right?.content?.type;a instanceof dt&&!a._item.deleted&&a._item.id.client===a.doc.clientID&&(c.applyDelta([{retain:c.length},...a.toDelta()]),a.doc.transact(h=>{a._item.delete(h)}));const u=kl(c,t,e,s,r,i);u!==null&&u.forEach(h=>{h!==null&&o.push(h)})}};s===void 0||r===void 0?n.toArray().forEach(l):Hs(n,new kn(r.ds,s.sv)).forEach(l);try{const c=n.getAttributes(s);s!==void 0&&(be(n._item,s)?be(n._item,r)||(c.ychange=i?i("added",n._item.id):{type:"added"}):c.ychange=i?i("removed",n._item.id):{type:"removed"});const a=t.node(n.nodeName,c,o);return e.mapping.set(n,a),a}catch{return n.doc.transact(a=>{n._item.delete(a)},D),e.mapping.delete(n),null}},kl=(n,t,e,s,r,i)=>{const o=[],l=n.toDelta(s,r,i);try{for(let c=0;c<l.length;c++){const a=l[c];o.push(t.text(a.insert,Dl(a.attributes,t)))}}catch{return n.doc.transact(a=>{n._item.delete(a)},D),null}return o},bl=(n,t)=>{const e=new N,s=n.map(r=>({insert:r.text,attributes:or(r.marks,t)}));return e.applyDelta(s),t.mapping.set(e,n),e},_l=(n,t)=>{const e=new I(n.type.name);for(const s in n.attrs){const r=n.attrs[s];r!==null&&s!=="ychange"&&e.setAttribute(s,r)}return e.insert(0,Ie(n).map(s=>sn(s,t))),t.mapping.set(e,n),e},sn=(n,t)=>n instanceof Array?bl(n,t):_l(n,t),ts=n=>typeof n=="object"&&n!==null,Dn=(n,t)=>{const e=Object.keys(n).filter(r=>n[r]!==null);let s=e.length===Object.keys(t).filter(r=>t[r]!==null).length;for(let r=0;r<e.length&&s;r++){const i=e[r],o=n[i],l=t[i];s=i==="ychange"||o===l||ts(o)&&ts(l)&&Dn(o,l)}return s},Ie=n=>{const t=n.content.content,e=[];for(let s=0;s<t.length;s++){const r=t[s];if(r.isText){const i=[];for(let o=t[s];s<t.length&&o.isText;o=t[++s])i.push(o);s--,e.push(i)}else e.push(r)}return e},ir=(n,t)=>{const e=n.toDelta();return e.length===t.length&&e.every((s,r)=>s.insert===t[r].text&&fs(s.attributes||{}).length===t[r].marks.length&&gs(s.attributes,(i,o)=>{const l=xn(o),c=t[r].marks;return Dn(i,c.find(a=>a.type.name===l)?.attrs)}))},Kt=(n,t)=>{if(n instanceof I&&!(t instanceof Array)&&on(n,t)){const e=Ie(t);return n._length===e.length&&Dn(n.getAttributes(),t.attrs)&&n.toArray().every((s,r)=>Kt(s,e[r]))}return n instanceof N&&t instanceof Array&&ir(n,t)},_e=(n,t)=>n===t||n instanceof Array&&t instanceof Array&&n.length===t.length&&n.every((e,s)=>t[s]===e),es=(n,t,e)=>{const s=n.toArray(),r=Ie(t),i=r.length,o=s.length,l=Tt(o,i);let c=0,a=0,u=!1;for(;c<l;c++){const h=s[c],d=r[c];if(_e(e.mapping.get(h),d))u=!0;else if(!Kt(h,d))break}for(;c+a<l;a++){const h=s[o-a-1],d=r[i-a-1];if(_e(e.mapping.get(h),d))u=!0;else if(!Kt(h,d))break}return{equalityFactor:c+a,foundMappedChild:u}},Sl=n=>{let t="",e=n._start;const s={};for(;e!==null;)e.deleted||(e.countable&&e.content instanceof W?t+=e.content.str:e.content instanceof A&&(s[e.content.key]=null)),e=e.right;return{str:t,nAttrs:s}},Cl=(n,t,e)=>{e.mapping.set(n,t);const{nAttrs:s,str:r}=Sl(n),i=t.map(a=>({insert:a.text,attributes:Object.assign({},s,or(a.marks,e))})),{insert:o,remove:l,index:c}=sl(r,i.map(a=>a.insert).join(""));n.delete(c,l),n.insert(c,o),n.applyDelta(i.map(a=>({retain:a.insert.length,attributes:a.attributes})))},El=/(.*)(--[a-zA-Z0-9+/=]{8})$/,xn=n=>El.exec(n)?.[1]??n,Dl=(n,t)=>{const e=[];for(const s in n)e.push(t.mark(xn(s),n[s]));return e},or=(n,t)=>{const e={};return n.forEach(s=>{if(s.type.name!=="ychange"){const r=rt(t.isOMark,s.type,()=>!s.type.excludes(s.type));e[r?`${s.type.name}--${fl(s.toJSON())}`:s.type.name]=s.attrs}}),e},rn=(n,t,e,s)=>{if(t instanceof I&&t.nodeName!==e.type.name)throw new Error("node name mismatch!");if(s.mapping.set(t,e),t instanceof I){const h=t.getAttributes(),d=e.attrs;for(const f in d)d[f]!==null?h[f]!==d[f]&&f!=="ychange"&&t.setAttribute(f,d[f]):t.removeAttribute(f);for(const f in h)d[f]===void 0&&t.removeAttribute(f)}const r=Ie(e),i=r.length,o=t.toArray(),l=o.length,c=Tt(i,l);let a=0,u=0;for(;a<c;a++){const h=o[a],d=r[a];if(!_e(s.mapping.get(h),d))if(Kt(h,d))s.mapping.set(h,d);else break}for(;u+a+1<c;u++){const h=o[l-u-1],d=r[i-u-1];if(!_e(s.mapping.get(h),d))if(Kt(h,d))s.mapping.set(h,d);else break}n.transact(()=>{for(;l-a-u>0&&i-a-u>0;){const d=o[a],f=r[a],g=o[l-u-1],p=r[i-u-1];if(d instanceof N&&f instanceof Array)ir(d,f)||Cl(d,f,s),a+=1;else{let m=d instanceof I&&on(d,f),y=g instanceof I&&on(g,p);if(m&&y){const $=es(d,f,s),Q=es(g,p,s);$.foundMappedChild&&!Q.foundMappedChild?y=!1:!$.foundMappedChild&&Q.foundMappedChild||$.equalityFactor<Q.equalityFactor?m=!1:y=!1}m?(rn(n,d,f,s),a+=1):y?(rn(n,g,p,s),u+=1):(s.mapping.delete(t.get(a)),t.delete(a,1),t.insert(a,[sn(f,s)]),a+=1)}}const h=l-a-u;if(l===1&&i===0&&o[0]instanceof N?(s.mapping.delete(o[0]),o[0].delete(0,o[0].length)):h>0&&(t.slice(a,a+h).forEach(d=>s.mapping.delete(d)),t.delete(a,h)),a+u<i){const d=[];for(let f=a;f<i-u;f++)d.push(sn(r[f],s));t.insert(a,d)}},D)},on=(n,t)=>!(t instanceof Array)&&n.nodeName===t.type.name,ln=(n,t,e)=>{if(n===0)return Fe(t,0,-1);let s=t._first===null?null:t._first.content.type;for(;s!==null&&t!==s;){if(s instanceof N){if(s._length>=n)return Fe(s,n,-1);if(n-=s._length,s._item!==null&&s._item.next!==null)s=s._item.next.content.type;else{do s=s._item===null?null:s._item.parent,n--;while(s!==t&&s!==null&&s._item!==null&&s._item.next===null);s!==null&&s!==t&&(s=s._item===null?null:s._item.next.content.type)}}else{const r=(e.get(s)||{nodeSize:0}).nodeSize;if(s._first!==null&&n<r)s=s._first.content.type,n--;else{if(n===1&&s._length===0&&r>1)return new ge(s._item===null?null:s._item.id,s._item===null?$t(s):null,null);if(n-=r,s._item!==null&&s._item.next!==null)s=s._item.next.content.type;else{if(n===0)return s=s._item===null?s:s._item.parent,new ge(s._item===null?null:s._item.id,s._item===null?$t(s):null,null);do s=s._item.parent,n--;while(s!==t&&s._item.next===null);s!==t&&(s=s._item.next.content.type)}}}if(s===null)throw L();if(n===0&&s.constructor!==N&&s!==t)return xl(s._item.parent,s._item)}return Fe(t,t._length,-1)},xl=(n,t)=>{let e=null,s=null;return n._item===null?s=$t(n):e=w(n._item.id.client,n._item.id.clock),new ge(e,s,t.id)},he=(n,t,e,s)=>{const r=Zi(e,n);if(r===null||r.type!==t&&!jt(t,r.type._item))return null;let i=r.type,o=0;if(i.constructor===N)o=r.index;else if(i._item===null||!i._item.deleted){let l=i._first,c=0;for(;c<i._length&&c<r.index&&l!==null;){if(!l.deleted){const a=l.content.type;c++,a instanceof N?o+=a._length:o+=s.get(a).nodeSize}l=l.right}o+=1}for(;i!==t&&i._item!==null;){const l=i._item.parent;if(l._item===null||!l._item.deleted){o+=1;let c=l._first;for(;c!==null;){const a=c.content.type;if(a===i)break;c.deleted||(a instanceof N?o+=a._length:o+=s.get(a).nodeSize),c=c.right}}i=l}return o-1};function Al(n){const t=n.toArray(),e=s=>{let r;if(s instanceof N)r=s.toDelta().map(o=>{const l={type:"text",text:o.insert};return o.attributes&&(l.marks=Object.keys(o.attributes).map(c=>{const a=o.attributes[c],h={type:xn(c)};return Object.keys(a)&&(h.attrs=a),h})),l});else if(s instanceof I){r={type:s.nodeName};const i=s.getAttributes();Object.keys(i).length&&(r.attrs=i);const o=s.toArray();o.length&&(r.content=o.map(e).flat())}else L();return r};return{type:"doc",content:t.map(e)}}const Tl=n=>{const t=nt.getState(n).undoManager;if(t!=null)return t.undo(),!0},vl=n=>{const t=nt.getState(n).undoManager;if(t!=null)return t.redo(),!0},Il=new Set(["paragraph"]),Ol=(n,t)=>!(n instanceof _)||!(n.content instanceof q)||!(n.content.type instanceof dt||n.content.type instanceof I&&t.has(n.content.type.nodeName))||n.content.type._length===0,Ml=({protectedNodes:n=Il,trackedOrigins:t=[],undoManager:e=null}={})=>new k.Plugin({key:nt,state:{init:(s,r)=>{const i=D.getState(r),o=e||new Ls(i.type,{trackedOrigins:new Set([D].concat(t)),deleteFilter:l=>Ol(l,n),captureTransaction:l=>l.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(s,r,i,o)=>{const l=D.getState(o).binding,c=r.undoManager,a=c.undoStack.length>0,u=c.redoStack.length>0;return l?{undoManager:c,prevSel:nn(l,i),hasUndoOps:a,hasRedoOps:u}:a!==r.hasUndoOps||u!==r.hasRedoOps?Object.assign({},r,{hasUndoOps:c.undoStack.length>0,hasRedoOps:c.redoStack.length>0}):r}},view:s=>{const r=D.getState(s.state),i=nt.getState(s.state).undoManager;return i.on("stack-item-added",({stackItem:o})=>{const l=r.binding;l&&o.meta.set(l,nt.getState(s.state).prevSel)}),i.on("stack-item-popped",({stackItem:o})=>{const l=r.binding;l&&(l.beforeTransactionSelection=o.meta.get(l)||l.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}});k.Extension.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null,provider:null}},addStorage(){return{isDisabled:!1}},onCreate(){this.editor.extensionManager.extensions.find(n=>n.name==="undoRedo")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-undo-redo".')},addCommands(){return{undo:()=>({tr:n,state:t,dispatch:e})=>(n.setMeta("preventDispatch",!0),nt.getState(t).undoManager.undoStack.length===0?!1:e?Tl(t):!0),redo:()=>({tr:n,state:t,dispatch:e})=>(n.setMeta("preventDispatch",!0),nt.getState(t).undoManager.redoStack.length===0?!1:e?vl(t):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){var n;const t=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=Ml(this.options.yUndoOptions),s=e.spec.view;e.spec.view=o=>{const{undoManager:l}=nt.getState(o.state);l.restore&&(l.restore(),l.restore=()=>{});const c=s?s(o):void 0;return{destroy:()=>{const a=l.trackedOrigins.has(l),u=l._observers;l.restore=()=>{a&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=u},c?.destroy&&c.destroy()}}};const r={...this.options.ySyncOptions,onFirstRender:this.options.onFirstRender},i=ml(t,r);return this.editor.options.enableContentCheck&&((n=t.doc)==null||n.on("beforeTransaction",()=>{try{const o=Al(t);if(o.content.length===0)return;this.editor.schema.nodeFromJSON(o).check()}catch(o){return this.editor.emit("contentError",{error:o,editor:this.editor,disableCollaboration:()=>{var l;(l=t.doc)==null||l.destroy(),this.storage.isDisabled=!0}}),!1}})),[i,e,this.editor.options.enableContentCheck&&new k.Plugin({key:new k.PluginKey("filterInvalidContent"),filterTransaction:()=>{var o;return this.storage.isDisabled!==!1&&((o=t.doc)==null||o.destroy()),!0}})].filter(Boolean)}});function Rl(n){return!!n.getMeta(D)}function ns(n){if(!n.length)return k.DecorationSet.empty;const t=[],e=n[0].$from.node(0);return n.forEach(s=>{const r=s.$from.pos,i=s.$from.nodeAfter;i&&t.push(k.Decoration.node(r,r+i.nodeSize,{class:"ProseMirror-selectednoderange"}))}),k.DecorationSet.create(e,t)}function Oe(n,t,e){const s=[],r=n.node(0);typeof e=="number"&&e>=0||(n.sameParent(t)?e=Math.max(0,n.sharedDepth(t.pos)-1):e=n.sharedDepth(t.pos));const i=new k.NodeRange(n,t,e),o=i.depth===0?0:r.resolve(i.start).posAtIndex(0);return i.parent.forEach((l,c)=>{const a=o+c,u=a+l.nodeSize;if(a<i.start||a>=i.end)return;const h=new k.SelectionRange(r.resolve(a),r.resolve(u));s.push(h)}),s}var Nl=class lr{constructor(t,e){this.anchor=t,this.head=e}map(t){return new lr(t.map(this.anchor),t.map(this.head))}resolve(t){const e=t.resolve(this.anchor),s=t.resolve(this.head);return new ct(e,s)}},ct=class ot extends k.Selection{constructor(t,e,s,r=1){const{doc:i}=t,o=t===e,l=t.pos===i.content.size&&e.pos===i.content.size,c=o&&!l?i.resolve(e.pos+(r>0?1:-1)):e,a=o&&l?i.resolve(t.pos-(r>0?1:-1)):t,u=Oe(a.min(c),a.max(c),s),h=c.pos>=t.pos?u[0].$from:u[u.length-1].$to,d=c.pos>=t.pos?u[u.length-1].$to:u[0].$from;super(h,d,u),this.depth=s}get $to(){return this.ranges[this.ranges.length-1].$to}eq(t){return t instanceof ot&&t.$from.pos===this.$from.pos&&t.$to.pos===this.$to.pos}map(t,e){const s=t.resolve(e.map(this.anchor)),r=t.resolve(e.map(this.head));return new ot(s,r)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:t}=this.$from;if(this.isForwards&&this.ranges.length>1){const r=this.ranges.slice(0,-1),i=r[0].$from,o=r[r.length-1].$to;return new ot(i,o,this.depth)}const e=this.ranges[0],s=t.resolve(Math.max(0,e.$from.pos-1));return new ot(this.$anchor,s,this.depth)}extendForwards(){const{doc:t}=this.$from;if(this.isBackwards&&this.ranges.length>1){const r=this.ranges.slice(1),i=r[0].$from,o=r[r.length-1].$to;return new ot(o,i,this.depth)}const e=this.ranges[this.ranges.length-1],s=t.resolve(Math.min(t.content.size,e.$to.pos+1));return new ot(this.$anchor,s,this.depth)}static fromJSON(t,e){return new ot(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,s,r,i=1){return new this(t.resolve(e),t.resolve(s),r,i)}getBookmark(){return new Nl(this.anchor,this.head)}};ct.prototype.visible=!1;function se(n){return n instanceof ct}k.Extension.create({name:"nodeRange",addOptions(){return{depth:void 0,key:"Mod"}},addKeyboardShortcuts(){return{"Shift-ArrowUp":({editor:n})=>{const{depth:t}=this.options,{view:e,state:s}=n,{doc:r,selection:i,tr:o}=s,{anchor:l,head:c}=i;if(!se(i)){const u=ct.create(r,l,c,t,-1);return o.setSelection(u),e.dispatch(o),!0}const a=i.extendBackwards();return o.setSelection(a),e.dispatch(o),!0},"Shift-ArrowDown":({editor:n})=>{const{depth:t}=this.options,{view:e,state:s}=n,{doc:r,selection:i,tr:o}=s,{anchor:l,head:c}=i;if(!se(i)){const u=ct.create(r,l,c,t);return o.setSelection(u),e.dispatch(o),!0}const a=i.extendForwards();return o.setSelection(a),e.dispatch(o),!0},"Mod-a":({editor:n})=>{const{depth:t}=this.options,{view:e,state:s}=n,{doc:r,tr:i}=s,o=ct.create(r,0,r.content.size,t);return i.setSelection(o),e.dispatch(i),!0}}},onSelectionUpdate(){const{selection:n}=this.editor.state;se(n)&&this.editor.view.dom.classList.add("ProseMirror-noderangeselection")},addProseMirrorPlugins(){let n=!1,t=!1;return[new k.Plugin({key:new k.PluginKey("nodeRange"),props:{attributes:()=>n?{class:"ProseMirror-noderangeselection"}:{class:""},handleDOMEvents:{mousedown:(e,s)=>{const{key:r}=this.options,i=/Mac/.test(navigator.platform),o=!!s.shiftKey,l=!!s.ctrlKey,c=!!s.altKey,a=!!s.metaKey,u=i?a:l;return(r==null||r==="Shift"&&o||r==="Control"&&l||r==="Alt"&&c||r==="Meta"&&a||r==="Mod"&&u)&&(t=!0),t&&document.addEventListener("mouseup",()=>{t=!1;const{state:h}=e,{doc:d,selection:f,tr:g}=h,{$anchor:p,$head:m}=f;if(p.sameParent(m))return;const y=ct.create(d,p.pos,m.pos,this.options.depth);g.setSelection(y),e.dispatch(g)},{once:!0}),!1}},decorations:e=>{const{selection:s}=e,r=se(s);if(n=!1,!t)return r?(n=!0,ns(s.ranges)):null;const{$from:i,$to:o}=s;if(!r&&i.sameParent(o))return null;const l=Oe(i,o,this.options.depth);return l.length?(n=!0,ns(l)):null}}})]}});function Ll(n){let t="";const e=getComputedStyle(n);for(let s=0;s<e.length;s+=1)t+=`${e[s]}:${e.getPropertyValue(e[s])};`;return t}function Ul(n){const t=n.cloneNode(!0),e=[n,...Array.from(n.getElementsByTagName("*"))],s=[t,...Array.from(t.getElementsByTagName("*"))];return e.forEach((r,i)=>{s[i].style.cssText=Ll(r)}),t}function Vl(n,t){let e=n;for(;e?.parentElement&&e.parentElement!==t.dom;)e=e.parentElement;return e?.parentElement===t.dom?e:void 0}function Fl(n,t,e,s=5){const r=n.dom,i=r.firstElementChild,o=r.lastElementChild;if(!i||!o)return{x:t,y:e};const l=i.getBoundingClientRect(),c=o.getBoundingClientRect(),a=Math.min(Math.max(l.top+s,e),c.bottom-s),u=.5,h=Math.abs(l.left-c.left)<u,d=Math.abs(l.right-c.right)<u;let f=l;return h&&d&&(f=l),{x:Math.min(Math.max(f.left+s,t),f.right-s),y:a}}var cr=n=>{const{x:t,y:e,editor:s}=n,{view:r,state:i}=s,{x:o,y:l}=Fl(r,t,e,5),c=r.root.elementsFromPoint(o,l);let a;if(Array.prototype.some.call(c,d=>{if(!r.dom.contains(d))return!1;const f=Vl(d,r);return f?(a=f,!0):!1}),!a)return{resultElement:null,resultNode:null,pos:null};let u;try{u=r.posAtDOM(a,0)}catch{return{resultElement:null,resultNode:null,pos:null}}const h=i.doc.nodeAt(u);return{resultElement:a,resultNode:h,pos:u}};function re(n,t){return window.getComputedStyle(n)[t]}function Pl(n=0,t=0,e=0){return Math.min(Math.max(n,t),e)}function Bl(n,t,e){const s=parseInt(re(n.dom,"paddingLeft"),10),r=parseInt(re(n.dom,"paddingRight"),10),i=parseInt(re(n.dom,"borderLeftWidth"),10),o=parseInt(re(n.dom,"borderLeftWidth"),10),l=n.dom.getBoundingClientRect();return{left:Pl(t,l.left+s+i,l.right-r-o),top:e}}function ar(n){var t;(t=n.parentNode)==null||t.removeChild(n)}function Hl(n,t){const{doc:e}=t.view.state,s=cr({editor:t,x:n.clientX,y:n.clientY});if(!s.resultNode||s.pos===null)return[];const r=n.clientX,i=Bl(t.view,r,n.clientY),o=t.view.posAtCoords(i);if(!o)return[];const{pos:l}=o;if(!e.resolve(l).parent)return[];const a=e.resolve(s.pos),u=e.resolve(s.pos+1);return Oe(a,u,0)}function $l(n,t){const{view:e}=t;if(!n.dataTransfer)return;const{empty:s,$from:r,$to:i}=e.state.selection,o=Hl(n,t),l=Oe(r,i,0),c=l.some(m=>o.find(y=>y.$from===m.$from&&y.$to===m.$to)),a=s||!c?o:l;if(!a.length)return;const{tr:u}=e.state,h=document.createElement("div"),d=a[0].$from.pos,f=a[a.length-1].$to.pos,g=ct.create(e.state.doc,d,f),p=g.content();a.forEach(m=>{const y=e.nodeDOM(m.$from.pos),$=Ul(y);h.append($)}),h.style.position="absolute",h.style.top="-10000px",document.body.append(h),n.dataTransfer.clearData(),n.dataTransfer.setDragImage(h,0,0),e.dragging={slice:p,move:!0},u.setSelection(g),e.dispatch(u),document.addEventListener("drop",()=>ar(h),{once:!0})}var ss=(n,t)=>{const e=n.resolve(t),{depth:s}=e;return s===0?t:e.pos-e.parentOffset-1},rs=(n,t)=>{const e=n.nodeAt(t),s=n.resolve(t);let{depth:r}=s,i=e;for(;r>0;){const o=s.node(r);r-=1,r===0&&(i=o)}return i},$e=(n,t)=>{const e=D.getState(n);return e?ln(t,e.type,e.binding.mapping):null},jl=(n,t)=>{const e=D.getState(n);return e?he(e.doc,e.type,t,e.binding.mapping)||0:-1},is=(n,t)=>{let e=t;for(;e?.parentNode&&e.parentNode!==n.dom;)e=e.parentNode;return e},hr=new k.PluginKey("dragHandle"),ur=({pluginKey:n=hr,element:t,editor:e,computePositionConfig:s,getReferencedVirtualElement:r,onNodeChange:i,onElementDragStart:o,onElementDragEnd:l})=>{const c=document.createElement("div");let a=!1,u=null,h=-1,d,f=null,g=null;function p(){t&&(t.style.visibility="hidden",t.style.pointerEvents="none")}function m(){if(t){if(!e.isEditable){p();return}t.style.visibility="",t.style.pointerEvents="auto"}}function y(S){const U=r?.()||{getBoundingClientRect:()=>S.getBoundingClientRect()};gr.computePosition(U,t,s).then(ft=>{Object.assign(t.style,{position:ft.strategy,left:`${ft.x}px`,top:`${ft.y}px`})})}function $(S){o?.(S),$l(S,e),setTimeout(()=>{t&&(t.style.pointerEvents="none")},0)}function Q(S){l?.(S),p(),t&&(t.style.pointerEvents="auto")}return t.addEventListener("dragstart",$),t.addEventListener("dragend",Q),c.appendChild(t),{unbind(){t.removeEventListener("dragstart",$),t.removeEventListener("dragend",Q),f&&(cancelAnimationFrame(f),f=null,g=null)},plugin:new k.Plugin({key:typeof n=="string"?new k.PluginKey(n):n,state:{init(){return{locked:!1}},apply(S,U,ft,St){const V=S.getMeta("lockDragHandle"),P=S.getMeta("hideDragHandle");if(V!==void 0&&(a=V),P)return p(),a=!1,u=null,h=-1,i?.({editor:e,node:null,pos:-1}),U;if(S.docChanged&&h!==-1&&t)if(Rl(S)){const G=jl(St,d);G!==h&&(h=G)}else{const G=S.mapping.map(h);G!==h&&(h=G,d=$e(St,h))}return U}},view:S=>{var U;return t.draggable=!0,t.style.pointerEvents="auto",(U=e.view.dom.parentElement)==null||U.appendChild(c),c.style.pointerEvents="none",c.style.position="absolute",c.style.top="0",c.style.left="0",{update(ft,St){if(!t)return;if(!e.isEditable){p();return}if(a?t.draggable=!1:t.draggable=!0,S.state.doc.eq(St.doc)||h===-1)return;let V=S.nodeDOM(h);if(V=is(S,V),V===S.dom||V?.nodeType!==1)return;const P=S.posAtDOM(V,0),G=rs(e.state.doc,P),Zt=ss(e.state.doc,P);u=G,h=Zt,d=$e(S.state,h),i?.({editor:e,node:u,pos:h}),y(V)},destroy(){f&&(cancelAnimationFrame(f),f=null,g=null),t&&ar(c)}}},props:{handleDOMEvents:{keydown(S){return!t||a||S.hasFocus()&&(p(),u=null,h=-1,i?.({editor:e,node:null,pos:-1})),!1},mouseleave(S,U){return a||U.target&&!c.contains(U.relatedTarget)&&(p(),u=null,h=-1,i?.({editor:e,node:null,pos:-1})),!1},mousemove(S,U){return!t||a||(g={x:U.clientX,y:U.clientY},f)||(f=requestAnimationFrame(()=>{if(f=null,!g)return;const{x:ft,y:St}=g;g=null;const V=cr({x:ft,y:St,editor:e});if(!V.resultElement)return;let P=V.resultElement;if(P=is(S,P),P===S.dom||P?.nodeType!==1)return;const G=S.posAtDOM(P,0),Zt=rs(e.state.doc,G);if(Zt!==u){const fr=ss(e.state.doc,G);u=Zt,h=fr,d=$e(S.state,h),i?.({editor:e,node:u,pos:h}),y(P),m()}})),!1}}}})}},cn={placement:"left-start",strategy:"absolute"};k.Extension.create({name:"dragHandle",addOptions(){return{render(){const n=document.createElement("div");return n.classList.add("drag-handle"),n},computePositionConfig:{},locked:!1,onNodeChange:()=>null,onElementDragStart:void 0,onElementDragEnd:void 0}},addCommands(){return{lockDragHandle:()=>({editor:n})=>(this.options.locked=!0,n.commands.setMeta("lockDragHandle",this.options.locked)),unlockDragHandle:()=>({editor:n})=>(this.options.locked=!1,n.commands.setMeta("lockDragHandle",this.options.locked)),toggleDragHandle:()=>({editor:n})=>(this.options.locked=!this.options.locked,n.commands.setMeta("lockDragHandle",this.options.locked))}},addProseMirrorPlugins(){const n=this.options.render();return[ur({computePositionConfig:{...cn,...this.options.computePositionConfig},getReferencedVirtualElement:this.options.getReferencedVirtualElement,element:n,editor:this.editor,onNodeChange:this.options.onNodeChange,onElementDragStart:this.options.onElementDragStart,onElementDragEnd:this.options.onElementDragEnd}).plugin]}});var zl=n=>{const{className:t="drag-handle",children:e,editor:s,pluginKey:r=hr,onNodeChange:i,onElementDragStart:o,onElementDragEnd:l,computePositionConfig:c=cn}=n,[a,u]=Ut.useState(null),h=Ut.useRef(null);return Ut.useEffect(()=>{let d=null;return a?s.isDestroyed?()=>{h.current=null}:(h.current||(d=ur({editor:s,element:a,pluginKey:r,computePositionConfig:{...cn,...c},onElementDragStart:o,onElementDragEnd:l,onNodeChange:i}),h.current=d.plugin,s.registerPlugin(h.current)),()=>{s.unregisterPlugin(r),h.current=null,d&&(d.unbind(),d=null)}):()=>{h.current=null}},[a,s,i,r,c,o,l]),Ct.jsx("div",{className:t,style:{visibility:"hidden",position:"absolute"},ref:u,children:e})},Yl=zl;const dr=Ut.forwardRef(({className:n,...t},e)=>{const[s,r]=Ut.useState(!1),{editor:i}=k.useCurrentEditor(),{isError:o,isSuccess:l}=mr.useTextEditorContext();return i?Ct.jsxs(Ct.Fragment,{children:[Ct.jsx(Yl,{onElementDragStart:()=>{r(!0)},onElementDragEnd:()=>{r(!1)},editor:i,children:Ct.jsx(pr,{className:An.cn("size-16 cursor-grab",s&&"cursor-grabbing")})}),Ct.jsx(k.EditorContent,{...t,className:An.cn("ms-text-editor-tiptap-render","outline-none overflow-y-auto cursor-text border-none p-16 w-full h-379 max-w-2xl ",n),"data-slot":"text-editor-field","data-error":o,"data-success":l,ref:e,editor:i})]}):null});dr.displayName="TextEditorField";exports.TextEditorField=dr;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),_=require("react"),M=require("./TextEditorRoot.js"),y=require("./TextEditorField.js"),j=require("./TextEditorMenuBar/TextEditorMenuBar.js"),g=require("./TextEditorMenuBar/GenerateWithAiMenu.js");require("react-dom");const S=require("../../index-CajSSBH7.cjs"),h=require("./TextEditorMenuBar/TextSizesMenu.js"),v=require("./TextEditorMenuBar/BoldMenu.js"),b=require("./TextEditorMenuBar/ItalicMenu.js"),O=require("./TextEditorMenuBar/UnderlineMenu.js"),q=require("./TextEditorMenuBar/StrikethroughMenu.js"),B=require("./TextEditorMenuBar/CodeMenu.js"),P=require("./TextEditorMenuBar/TextAlignMenu.js"),R=require("./TextEditorMenuBar/OrderedListMenu.js"),C=require("./TextEditorMenuBar/UnorderedListMenu.js"),I=require("./TextEditorMenuBar/LinkMenu.js"),N=require("./TextEditorMenuBar/ColorPickerMenu.js"),A=require("./TextEditorMenuBar/ImageUploadMenu.js");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const a=w(_);var L=Symbol.for("react.lazy"),p=a[" use ".trim().toString()];function k(e){return typeof e=="object"&&e!==null&&"then"in e}function E(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===L&&"_payload"in e&&k(e._payload)}function $(e){const t=z(e),r=a.forwardRef((n,o)=>{let{children:s,...c}=n;E(s)&&typeof p=="function"&&(s=p(s._payload));const u=a.Children.toArray(s),l=u.find(U);if(l){const d=l.props.children,m=u.map(f=>f===l?a.Children.count(d)>1?a.Children.only(null):a.isValidElement(d)?d.props.children:null:f);return i.jsx(t,{...c,ref:o,children:a.isValidElement(d)?a.cloneElement(d,void 0,m):null})}return i.jsx(t,{...c,ref:o,children:s})});return r.displayName=`${e}.Slot`,r}function z(e){const t=a.forwardRef((r,n)=>{let{children:o,...s}=r;if(E(o)&&typeof p=="function"&&(o=p(o._payload)),a.isValidElement(o)){const c=W(o),u=V(s,o.props);return o.type!==a.Fragment&&(u.ref=n?S.composeRefs(n,c):c),a.cloneElement(o,u)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var D=Symbol("radix.slottable");function U(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D}function V(e,t){const r={...t};for(const n in t){const o=e[n],s=t[n];/^on[A-Z]/.test(n)?o&&s?r[n]=(...u)=>{const l=s(...u);return o(...u),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...s}:n==="className"&&(r[n]=[o,s].filter(Boolean).join(" "))}return{...e,...r}}function W(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var F=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],G=F.reduce((e,t)=>{const r=$(`Primitive.${t}`),n=a.forwardRef((o,s)=>{const{asChild:c,...u}=o,l=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(l,{...u,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),H="Separator",x="horizontal",Y=["horizontal","vertical"],T=a.forwardRef((e,t)=>{const{decorative:r,orientation:n=x,...o}=e,s=Z(n)?n:x,u=r?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return i.jsx(G.div,{"data-orientation":s,...u,...o,ref:t})});T.displayName=H;function Z(e){return Y.includes(e)}const J=_.forwardRef(({defaultContent:e,getEditorRef:t,...r},n)=>i.jsx(i.Fragment,{children:i.jsxs(M.TextEditorRoot,{defaultContent:e,getEditorRef:t,ref:n,...r,children:[i.jsxs(j.TextEditorMenuBar,{children:[i.jsx(g.GenerateWithAiMenu,{}),i.jsx(T,{className:"bg-border-interactive-neutral h-full min-h-30 w-1",orientation:"vertical"}),i.jsx(h.TextSizesMenu,{}),i.jsx(v.BoldMenu,{}),i.jsx(b.ItalicMenu,{}),i.jsx(O.UnderlineMenu,{}),i.jsx(q.StrikethroughMenu,{}),i.jsx(B.CodeMenu,{}),i.jsx(P.TextAlignMenu,{}),i.jsx(R.OrderedListMenu,{}),i.jsx(C.UnorderedListMenu,{}),i.jsx(I.LinkMenu,{}),i.jsx(A.ImageUploadMenu,{}),i.jsx(N.ColorPickerMenu,{})]}),i.jsx(y.TextEditorField,{})]})}));exports.TextEditorInput=J;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react");require("../../Icons/IconWrapper.js");const u=require("../../Icons/FormatBoldIcon.js"),n=require("../../../index-CyFz8fal.cjs"),l=require("./TextEditorMenuAction.js"),i=c.forwardRef(({...s},d)=>{const{editor:o}=n.useCurrentEditor(),t=n.useEditorState({editor:o,selector:e=>e.editor?{isBold:e.editor.isActive("bold")||!1,canBold:e.editor.can().chain().toggleBold().run()||!1}:{}});return r.jsx(l.TextEditorMenuAction,{isActive:t?.isBold,onClick:()=>o?.chain().focus().toggleBold().run(),disabled:!t?.canBold,ref:d,...s,children:r.jsx(u,{className:"size-16"})})});i.displayName="BoldMenu";exports.BoldMenu=i;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("react");require("../../Icons/IconWrapper.js");const u=require("../../Icons/CodeIcon.js"),n=require("../../../index-CyFz8fal.cjs"),a=require("./TextEditorMenuAction.js"),i=c.forwardRef(({...s},d)=>{const{editor:o}=n.useCurrentEditor(),t=n.useEditorState({editor:o,selector:e=>e.editor?{isCode:e.editor.isActive("code")||!1,canCode:e.editor.can().chain().toggleCode().run()||!1}:{}});return r.jsx(a.TextEditorMenuAction,{isActive:t?.isCode,onClick:()=>o?.chain().focus().toggleCode().run(),disabled:!t?.canCode,ref:d,...s,children:r.jsx(u,{className:"size-16"})})});i.displayName="CodeMenu";exports.CodeMenu=i;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react"),o=require("../../../index-CyFz8fal.cjs"),i=require("../../../lib/utils.js"),d=require("./TextEditorMenuAction.js"),n=l.forwardRef(({...s},u)=>{const{editor:t}=o.useCurrentEditor(),c=o.useEditorState({editor:t,selector:e=>e.editor?{color:e.editor.getAttributes("textStyle").color}:{}});return r.jsx(d.TextEditorMenuAction,{ref:u,...s,children:r.jsx("div",{className:i.cn(" p-0 overflow-hidden hover:bg-border-interactive-neutral disabled:text-disabled disabled:cursor-not-allowed rounded-full size-14 min-w-14 ring-2 ring-offset-1 ring-interactive-neutral"),children:r.jsx("input",{type:"color",onInput:e=>t?.chain().focus().setColor(e.currentTarget.value).run(),value:c?.color,className:i.cn("size-[200%] cursor-pointer border-0 p-0 -translate-[25%]")})})})});n.displayName="ColorPickerMenu";exports.ColorPickerMenu=n;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),r=require("../../../lib/utils.js");require("../../Icons/IconWrapper.js");const l=require("../../Icons/WandStarsGradientIcon.js"),c=require("../textEditorContext.js"),t=s.forwardRef(({className:o,...n},i)=>{const{onGenerateWithAi:a}=c.useTextEditorContext();return e.jsxs("button",{onClick:a,ref:i,className:r.cn("flex relative cursor-pointer bg-surface-neutral-l1 items-center gap-4 p-6 pl-10 rounded-full border-solid border-transparent border-1 bg-clip-padding before:content-[''] before:absolute before:top-0 before:right-0 before:left-0 before:bottom-0 before:z-[-1] before:-m-1 before:rounded-full before:bg-linear-[to_right,var(--color-purple-225)_0%,var(--color-azure-275)_30%,var(--color-cobalt-225)_60%,var(--color-persimmon-250)_90%] ",o),...n,children:[e.jsx("p",{className:r.cn("body-tiny-medium"," whitespace-nowrap"),children:"Generate with AI"}),e.jsx(l,{className:"size-16 animate-pulse-wiggle "})]})});t.displayName="GenerateWithAiMenu";exports.GenerateWithAiMenu=t;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),i=require("react");require("../../Icons/IconWrapper.js");const g=require("../../Icons/PhotoIcon.js"),n=require("../../../index-CyFz8fal.cjs"),x=require("./TextEditorMenuAction.js"),s=require("../../../lib/utils.js"),a=i.forwardRef(({className:c,...l},u)=>{const{editor:t}=n.useCurrentEditor(),d=n.useEditorState({editor:t,selector:e=>e.editor?{isImage:t?.isActive("image")}:{}}),f=i.useCallback(e=>{if(e.preventDefault(),e.target.files){const m=e.target.files[0],r=new FileReader;r.onload=()=>{t?.chain().focus().insertContent({type:"image",attrs:{src:r.result}}).run()},r.onerror=p=>{console.error("Error reading file:",p)},r.readAsDataURL(m)}},[t]);return o.jsxs(x.TextEditorMenuAction,{isActive:d?.isImage,ref:u,onClick:()=>{},className:s.cn("relative",c),...l,children:[o.jsx(g,{className:"size-16"}),o.jsx("input",{className:s.cn("absolute file-selector opacity-0 file:cursor-pointer w-full h-full left-0 top-0"),type:"file",accept:"image/*",onChange:f})]})});a.displayName="ImageUploadMenu";exports.ImageUploadMenu=a;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("react");require("../../Icons/IconWrapper.js");const u=require("../../Icons/FormatItalicIcon.js"),n=require("../../../index-CyFz8fal.cjs"),l=require("./TextEditorMenuAction.js"),c=s.forwardRef(({...o},a)=>{const{editor:t}=n.useCurrentEditor(),i=n.useEditorState({editor:t,selector:e=>e.editor?{isItalic:e.editor.isActive("italic")||!1,canItalic:e.editor.can().chain().toggleItalic().run()||!1}:{}});return r.jsx(l.TextEditorMenuAction,{isActive:i?.isItalic,onClick:()=>t?.chain().focus().toggleItalic().run(),disabled:!i?.canItalic,ref:a,...o,children:r.jsx(u,{className:"size-16"})})});c.displayName="ItalicMenu";exports.ItalicMenu=c;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),x=require("react");require("../../Icons/IconWrapper.js");const ne=require("../../Icons/CloseIcon.js"),oe=require("../../Icons/LinkIcon.js"),g=require("../../../index-BfKbXbc8.cjs"),C=require("../../../index-CajSSBH7.cjs"),b=require("../../../index-B_Bwy8wX.cjs"),re=require("../../../index-C8aODXfJ.cjs"),F=require("../../../index-CRDKsB5y.cjs"),D=require("../../../index-BI11g55_.cjs"),y=require("../../../index-q-4o5Ie4.cjs"),h=require("../../../index-C2mPf2xD.cjs"),A=require("../../../index-CyFz8fal.cjs"),se=require("./TextEditorMenuAction.js");require("../../Form/FormCharacterCounter.js");const q=require("../../Form/FormItem.js"),T=require("../../Form/FormLabel.js");require("../../Form/FormStatus/FormErrorStatus.js");require("../../Form/FormStatus/FormHintStatus.js");require("../../Form/FormStatus/FormSuccessStatus.js");require("../../Form/FormStatus/FormStatusRoot.js");require("../../Form/FormStatus/FormStatusText.js");require("../../Input/InputRoot.js");require("../../Input/InputField.js");const M=require("../../Input/Input.js"),ie=require("../../../lib/utils.js"),ae=require("../../Button/ButtonIcon.js");require("../../Button/ButtonLabel.js");const ce=require("../../Button/ButtonRoot.js"),S=require("../../Button/Button.js");function le(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const a=le(x);var j="Dialog",[w]=g.createContextScope(j),[ue,f]=w(j),L=e=>{const{__scopeDialog:n,children:o,open:i,defaultOpen:s,onOpenChange:r,modal:u=!0}=e,c=a.useRef(null),l=a.useRef(null),[m,v]=re.useControllableState({prop:i,defaultProp:s??!1,onChange:r,caller:j});return t.jsx(ue,{scope:n,triggerRef:c,contentRef:l,contentId:b.useId(),titleId:b.useId(),descriptionId:b.useId(),open:m,onOpenChange:v,onOpenToggle:a.useCallback(()=>v(R=>!R),[v]),modal:u,children:o})};L.displayName=j;var B="DialogTrigger",$=a.forwardRef((e,n)=>{const{__scopeDialog:o,...i}=e,s=f(B,o),r=C.useComposedRefs(n,s.triggerRef);return t.jsx(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":k(s.open),...i,ref:r,onClick:g.composeEventHandlers(e.onClick,s.onOpenToggle)})});$.displayName=B;var O="DialogPortal",[de,W]=w(O,{forceMount:void 0}),z=e=>{const{__scopeDialog:n,forceMount:o,children:i,container:s}=e,r=f(O,n);return t.jsx(de,{scope:n,forceMount:o,children:a.Children.map(i,u=>t.jsx(y.Presence,{present:o||r.open,children:t.jsx(F.Portal,{asChild:!0,container:s,children:u})}))})};z.displayName=O;var _="DialogOverlay",H=a.forwardRef((e,n)=>{const o=W(_,e.__scopeDialog),{forceMount:i=o.forceMount,...s}=e,r=f(_,e.__scopeDialog);return r.modal?t.jsx(y.Presence,{present:i||r.open,children:t.jsx(ge,{...s,ref:n})}):null});H.displayName=_;var fe=C.createSlot("DialogOverlay.RemoveScroll"),ge=a.forwardRef((e,n)=>{const{__scopeDialog:o,...i}=e,s=f(_,o);return t.jsx(D.ReactRemoveScroll,{as:fe,allowPinchZoom:!0,shards:[s.contentRef],children:t.jsx(h.Primitive.div,{"data-state":k(s.open),...i,ref:n,style:{pointerEvents:"auto",...i.style}})})}),p="DialogContent",G=a.forwardRef((e,n)=>{const o=W(p,e.__scopeDialog),{forceMount:i=o.forceMount,...s}=e,r=f(p,e.__scopeDialog);return t.jsx(y.Presence,{present:i||r.open,children:r.modal?t.jsx(pe,{...s,ref:n}):t.jsx(me,{...s,ref:n})})});G.displayName=p;var pe=a.forwardRef((e,n)=>{const o=f(p,e.__scopeDialog),i=a.useRef(null),s=C.useComposedRefs(n,o.contentRef,i);return a.useEffect(()=>{const r=i.current;if(r)return D.hideOthers(r)},[]),t.jsx(V,{...e,ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g.composeEventHandlers(e.onCloseAutoFocus,r=>{r.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:g.composeEventHandlers(e.onPointerDownOutside,r=>{const u=r.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0;(u.button===2||c)&&r.preventDefault()}),onFocusOutside:g.composeEventHandlers(e.onFocusOutside,r=>r.preventDefault())})}),me=a.forwardRef((e,n)=>{const o=f(p,e.__scopeDialog),i=a.useRef(!1),s=a.useRef(!1);return t.jsx(V,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(i.current||o.triggerRef.current?.focus(),r.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(i.current=!0,r.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=r.target;o.triggerRef.current?.contains(u)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&s.current&&r.preventDefault()}})}),V=a.forwardRef((e,n)=>{const{__scopeDialog:o,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:r,...u}=e,c=f(p,o),l=a.useRef(null),m=C.useComposedRefs(n,l);return D.useFocusGuards(),t.jsxs(t.Fragment,{children:[t.jsx(D.FocusScope,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:r,children:t.jsx(F.DismissableLayer,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":k(c.open),...u,ref:m,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(ve,{titleId:c.titleId}),t.jsx(De,{contentRef:l,descriptionId:c.descriptionId})]})]})}),P="DialogTitle",K=a.forwardRef((e,n)=>{const{__scopeDialog:o,...i}=e,s=f(P,o);return t.jsx(h.Primitive.h2,{id:s.titleId,...i,ref:n})});K.displayName=P;var U="DialogDescription",xe=a.forwardRef((e,n)=>{const{__scopeDialog:o,...i}=e,s=f(U,o);return t.jsx(h.Primitive.p,{id:s.descriptionId,...i,ref:n})});xe.displayName=U;var Y="DialogClose",N=a.forwardRef((e,n)=>{const{__scopeDialog:o,...i}=e,s=f(Y,o);return t.jsx(h.Primitive.button,{type:"button",...i,ref:n,onClick:g.composeEventHandlers(e.onClick,()=>s.onOpenChange(!1))})});N.displayName=Y;function k(e){return e?"open":"closed"}var Z="DialogTitleWarning",[_e,J]=g.createContext2(Z,{contentName:p,titleName:P,docsSlug:"dialog"}),ve=({titleId:e})=>{const n=J(Z),o=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
3
|
+
|
|
4
|
+
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
5
|
+
|
|
6
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},he="DialogDescriptionWarning",De=({contentRef:e,descriptionId:n})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J(he).contentName}}.`;return a.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");n&&s&&(document.getElementById(n)||console.warn(i))},[i,e,n]),null};const Q=x.forwardRef(({...e},n)=>{const[o,i]=x.useState(""),[s,r]=x.useState(""),[u,c]=x.useState(!1),{editor:l}=A.useCurrentEditor(),m=A.useEditorState({editor:l,selector:d=>d.editor?{isLink:d.editor.isActive("link")||!1,canLink:d.editor.can().chain().toggleLink().run()||!1}:{}}),v=x.useCallback(()=>{if(!l)return;const{view:d,state:E}=l,{from:I,to:X}=d.state.selection,ee=E.doc.textBetween(I,X,"")||"",te=l?.getAttributes("link").href||"";i(ee),r(te)},[l]),R=()=>{if(!s||!l)return;const{view:d}=l,{from:E,to:I}=d.state.selection;l?.chain().focus().extendMarkRange("link").setLink({href:s}).insertContentAt({from:E,to:I},o).run(),c(!1)};return t.jsx(t.Fragment,{children:t.jsxs(L,{open:u,onOpenChange:c,children:[t.jsx($,{asChild:!0,children:t.jsx(se.TextEditorMenuAction,{isActive:m?.isLink,onClick:v,disabled:!m?.canLink,ref:n,...e,children:t.jsx(oe,{className:"size-16"})})}),t.jsxs(z,{children:[t.jsx(H,{className:"fixed opacity-30 z-10 bg-border-interactive-neutral-active-hover inset-0"}),t.jsxs(G,{className:"fixed z-20 top-1/2 left-1/2 -translate-1/2 w-full max-w-500 p-25 rounded-6 shadow-200 bg-surface-neutral-l1",children:[t.jsx(K,{className:ie.cn("headline-large-bold"),children:"Add Link"}),t.jsxs("div",{className:"flex mt-18 flex-col gap-12",children:[t.jsxs(q.FormItem,{children:[t.jsx(T.FormLabel,{children:"Text"}),t.jsx(M.Input,{value:o,onChange:d=>i(d.target.value),placeholder:"Enter text here..."})]}),t.jsxs(q.FormItem,{children:[t.jsx(T.FormLabel,{children:"Link"}),t.jsx(M.Input,{value:s,onChange:d=>r(d.target.value),placeholder:"Enter link here..."})]})]}),t.jsxs("div",{className:"flex mt-24 gap-12 items-center justify-end",children:[t.jsx(N,{asChild:!0,children:t.jsx(S.Button,{variant:"outline",size:"xs",children:"Cancel"})}),t.jsx(S.Button,{disabled:!s,onClick:R,size:"xs",children:"Save"})]}),t.jsx(N,{asChild:!0,children:t.jsx(ce.ButtonRoot,{className:"absolute size-24 top-12 right-12",iconOnly:!0,size:"tiny",rounded:"sm",children:t.jsx(ae.ButtonIcon,{children:t.jsx(ne,{className:"size-18"})})})})]})]})]})})});Q.displayName="LinkMenu";exports.LinkMenu=Q;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react");require("../../Icons/IconWrapper.js");const u=require("../../Icons/FormatListNumberedIcon.js"),s=require("../../../index-CyFz8fal.cjs"),a=require("./TextEditorMenuAction.js"),d=c.forwardRef(({...n},o)=>{const{editor:r}=s.useCurrentEditor(),t=s.useEditorState({editor:r,selector:e=>e.editor?{isOrderedList:e.editor.isActive("orderedList")||!1,canOrderedList:!e.editor.can().chain().toggleOrderedList().run()||!1}:{}});return i.jsx(a.TextEditorMenuAction,{isActive:t?.isOrderedList,disabled:t?.canOrderedList,onClick:()=>r?.chain().focus().toggleOrderedList().run(),ref:o,...n,children:i.jsx(u,{className:"size-16"})})});d.displayName="OrderedListMenu";exports.OrderedListMenu=d;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react");require("../../Icons/IconWrapper.js");const a=require("../../Icons/StrikethroughSIcon.js"),o=require("../../../index-CyFz8fal.cjs"),d=require("./TextEditorMenuAction.js"),n=c.forwardRef(({...s},u)=>{const{editor:t}=o.useCurrentEditor(),r=o.useEditorState({editor:t,selector:e=>e.editor?{isStrike:e.editor.isActive("strike")||!1,canStrike:e.editor.can().chain().toggleStrike().run()||!1}:{}});return i.jsx(d.TextEditorMenuAction,{isActive:r?.isStrike,onClick:()=>t?.chain().focus().toggleStrike().run(),disabled:!r?.canStrike,ref:u,...s,children:i.jsx(a,{className:"size-16"})})});n.displayName="StrikethroughMenu";exports.StrikethroughMenu=n;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("react");require("../../Icons/IconWrapper.js");const u=require("../../Icons/FormatAlignCenterIcon.js"),a=require("../../Icons/FormatAlignJustifyIcon.js"),x=require("../../Icons/FormatAlignLeftIcon.js"),d=require("../../Icons/FormatAlignRightIcon.js"),A=require("../../../index-CyFz8fal.cjs"),t=require("../../../index-DgIcguCG.cjs"),r=require("./TextEditorMenuAction.js"),g=j.forwardRef(({...T},h)=>{const{editor:s}=A.useCurrentEditor(),i=A.useEditorState({editor:s,selector:n=>{if(!n.editor)return{};const o=n.editor.isActive({textAlign:"left"})||!1,l=n.editor.isActive({textAlign:"right"})||!1,c=n.editor.isActive({textAlign:"center"})||!1,f=n.editor.isActive({textAlign:"justify"})||!1;return{isTextAlignLeft:o,isTextAlignRight:l,isTextAlignCenter:c,isTextAlignJustify:f,isTextAlign:o||l||c,canTextAlign:!n?.editor?.can().chain().toggleTextAlign("right").run()||!1}}});return e.jsxs(t.DropdownMenu,{children:[e.jsx(t.DropdownMenuTrigger,{disabled:i?.canTextAlign,asChild:!0,children:e.jsx(r.TextEditorMenuAction,{ref:h,isActive:i?.isTextAlign,disabled:i?.canTextAlign,...T,children:i?.isTextAlignLeft?e.jsx(x,{className:"size-16"}):i?.isTextAlignRight?e.jsx(d,{className:"size-16"}):i?.isTextAlignCenter?e.jsx(u,{className:"size-16"}):e.jsx(a,{className:"size-16"})})}),e.jsx(t.DropdownMenuPortal,{children:e.jsxs(t.DropdownMenuContent,{className:"cursor-pointer flex flex-col gap-4 bg-surface-neutral-l1 shadow-200 p-6 rounded-12",children:[e.jsx(t.DropdownMenuItem,{asChild:!0,children:e.jsx(r.TextEditorMenuAction,{isActive:i?.isTextAlignJustify,onClick:()=>s?.chain().focus().setTextAlign("justify").run(),children:e.jsx(a,{className:"size-16"})})}),e.jsx(t.DropdownMenuItem,{asChild:!0,children:e.jsx(r.TextEditorMenuAction,{isActive:i?.isTextAlignLeft,onClick:()=>s?.chain().focus().setTextAlign("left").run(),children:e.jsx(x,{className:"size-16"})})}),e.jsx(t.DropdownMenuItem,{asChild:!0,children:e.jsx(r.TextEditorMenuAction,{isActive:i?.isTextAlignRight,onClick:()=>s?.chain().focus().setTextAlign("right").run(),children:e.jsx(d,{className:"size-16"})})}),e.jsx(t.DropdownMenuItem,{asChild:!0,children:e.jsx(r.TextEditorMenuAction,{isActive:i?.isTextAlignCenter,onClick:()=>s?.chain().focus().setTextAlign("center").run(),children:e.jsx(u,{className:"size-16"})})}),e.jsx(t.DropdownMenuArrow,{className:"fill-surface-neutral-l1 text-surface-neutral-l1"})]})})]})});g.displayName="TextAlignMenu";exports.TextAlignMenu=g;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react"),d=require("../../../lib/utils.js"),s=require("../../../index-CajSSBH7.cjs"),e=c.forwardRef(({className:t,asChild:r,isActive:o,...n},i)=>{const u=r?s.Slot:"button";return a.jsx(u,{className:d.cn(" outline-none border-none cursor-pointer hover:bg-border-interactive-neutral p-7 rounded-8 disabled:text-disabled disabled:cursor-not-allowed ",o&&"bg-border-interactive-neutral-active text-surface-neutral-l1 hover:bg-border-interactive-neutral-active-hover",t),ref:i,...n})});e.displayName="TextEditorMenuAction";exports.TextEditorMenuAction=e;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),q=require("react"),_=require("../../../index-C2mPf2xD.cjs"),W=require("../../../index-q-4o5Ie4.cjs"),x=require("../../../index-BfKbXbc8.cjs"),T=require("../../../index-CajSSBH7.cjs"),C=require("../../../index-CzY-WZXL.cjs"),ce=require("../../../index-Cje7xxa1.cjs"),ie=require("../../../index-MQ0c3ZX_.cjs"),ae=require("../../../lib/utils.js");function de(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const s=de(q);function ue(e,[o,r]){return Math.min(r,Math.max(o,e))}function fe(e,o){return s.useReducer((r,n)=>o[r][n]??r,e)}var Y="ScrollArea",[F]=x.createContextScope(Y),[he,S]=F(Y),$=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,type:n="hover",dir:t,scrollHideDelay:l=600,...c}=e,[i,a]=s.useState(null),[f,d]=s.useState(null),[b,u]=s.useState(null),[m,w]=s.useState(null),[y,I]=s.useState(null),[P,L]=s.useState(0),[X,j]=s.useState(0),[D,A]=s.useState(!1),[H,N]=s.useState(!1),v=T.useComposedRefs(o,R=>a(R)),p=ce.useDirection(t);return h.jsx(he,{scope:r,type:n,dir:p,scrollHideDelay:l,scrollArea:i,viewport:f,onViewportChange:d,content:b,onContentChange:u,scrollbarX:m,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:A,scrollbarY:y,onScrollbarYChange:I,scrollbarYEnabled:H,onScrollbarYEnabledChange:N,onCornerWidthChange:L,onCornerHeightChange:j,children:h.jsx(_.Primitive.div,{dir:p,...c,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":P+"px","--radix-scroll-area-corner-height":X+"px",...e.style}})})});$.displayName=Y;var G="ScrollAreaViewport",J=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,children:n,nonce:t,...l}=e,c=S(G,r),i=s.useRef(null),a=T.useComposedRefs(o,i,c.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),h.jsx(_.Primitive.div,{"data-radix-scroll-area-viewport":"",...l,ref:a,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});J.displayName=G;var g="ScrollAreaScrollbar",K=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=S(g,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=t,i=e.orientation==="horizontal";return s.useEffect(()=>(i?l(!0):c(!0),()=>{i?l(!1):c(!1)}),[i,l,c]),t.type==="hover"?h.jsx(be,{...n,ref:o,forceMount:r}):t.type==="scroll"?h.jsx(me,{...n,ref:o,forceMount:r}):t.type==="auto"?h.jsx(Q,{...n,ref:o,forceMount:r}):t.type==="always"?h.jsx(B,{...n,ref:o}):null});K.displayName=g;var be=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=S(g,e.__scopeScrollArea),[l,c]=s.useState(!1);return s.useEffect(()=>{const i=t.scrollArea;let a=0;if(i){const f=()=>{window.clearTimeout(a),c(!0)},d=()=>{a=window.setTimeout(()=>c(!1),t.scrollHideDelay)};return i.addEventListener("pointerenter",f),i.addEventListener("pointerleave",d),()=>{window.clearTimeout(a),i.removeEventListener("pointerenter",f),i.removeEventListener("pointerleave",d)}}},[t.scrollArea,t.scrollHideDelay]),h.jsx(W.Presence,{present:r||l,children:h.jsx(Q,{"data-state":l?"visible":"hidden",...n,ref:o})})}),me=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=S(g,e.__scopeScrollArea),l=e.orientation==="horizontal",c=k(()=>a("SCROLL_END"),100),[i,a]=fe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(i==="idle"){const f=window.setTimeout(()=>a("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(f)}},[i,t.scrollHideDelay,a]),s.useEffect(()=>{const f=t.viewport,d=l?"scrollLeft":"scrollTop";if(f){let b=f[d];const u=()=>{const m=f[d];b!==m&&(a("SCROLL"),c()),b=m};return f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[t.viewport,l,a,c]),h.jsx(W.Presence,{present:r||i!=="hidden",children:h.jsx(B,{"data-state":i==="hidden"?"hidden":"visible",...n,ref:o,onPointerEnter:x.composeEventHandlers(e.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:x.composeEventHandlers(e.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Q=s.forwardRef((e,o)=>{const r=S(g,e.__scopeScrollArea),{forceMount:n,...t}=e,[l,c]=s.useState(!1),i=e.orientation==="horizontal",a=k(()=>{if(r.viewport){const f=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;c(i?f:d)}},10);return E(r.viewport,a),E(r.content,a),h.jsx(W.Presence,{present:n||l,children:h.jsx(B,{"data-state":l?"visible":"hidden",...t,ref:o})})}),B=s.forwardRef((e,o)=>{const{orientation:r="vertical",...n}=e,t=S(g,e.__scopeScrollArea),l=s.useRef(null),c=s.useRef(0),[i,a]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=te(i.viewport,i.content),d={...n,sizes:i,onSizesChange:a,hasThumb:f>0&&f<1,onThumbChange:u=>l.current=u,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:u=>c.current=u};function b(u,m){return xe(u,c.current,i,m)}return r==="horizontal"?h.jsx(ve,{...d,ref:o,onThumbPositionChange:()=>{if(t.viewport&&l.current){const u=t.viewport.scrollLeft,m=V(u,i,t.dir);l.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:u=>{t.viewport&&(t.viewport.scrollLeft=u)},onDragScroll:u=>{t.viewport&&(t.viewport.scrollLeft=b(u,t.dir))}}):r==="vertical"?h.jsx(Se,{...d,ref:o,onThumbPositionChange:()=>{if(t.viewport&&l.current){const u=t.viewport.scrollTop,m=V(u,i);l.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:u=>{t.viewport&&(t.viewport.scrollTop=u)},onDragScroll:u=>{t.viewport&&(t.viewport.scrollTop=b(u))}}):null}),ve=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:n,...t}=e,l=S(g,e.__scopeScrollArea),[c,i]=s.useState(),a=s.useRef(null),f=T.useComposedRefs(o,a,l.onScrollbarXChange);return s.useEffect(()=>{a.current&&i(getComputedStyle(a.current))},[a]),h.jsx(ee,{"data-orientation":"horizontal",...t,ref:f,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":M(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,b)=>{if(l.viewport){const u=l.viewport.scrollLeft+d.deltaX;e.onWheelScroll(u),le(u,b)&&d.preventDefault()}},onResize:()=>{a.current&&l.viewport&&c&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:z(c.paddingLeft),paddingEnd:z(c.paddingRight)}})}})}),Se=s.forwardRef((e,o)=>{const{sizes:r,onSizesChange:n,...t}=e,l=S(g,e.__scopeScrollArea),[c,i]=s.useState(),a=s.useRef(null),f=T.useComposedRefs(o,a,l.onScrollbarYChange);return s.useEffect(()=>{a.current&&i(getComputedStyle(a.current))},[a]),h.jsx(ee,{"data-orientation":"vertical",...t,ref:f,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":M(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,b)=>{if(l.viewport){const u=l.viewport.scrollTop+d.deltaY;e.onWheelScroll(u),le(u,b)&&d.preventDefault()}},onResize:()=>{a.current&&l.viewport&&c&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:z(c.paddingTop),paddingEnd:z(c.paddingBottom)}})}})}),[pe,Z]=F(g),ee=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:t,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:i,onThumbPositionChange:a,onDragScroll:f,onWheelScroll:d,onResize:b,...u}=e,m=S(g,r),[w,y]=s.useState(null),I=T.useComposedRefs(o,v=>y(v)),P=s.useRef(null),L=s.useRef(""),X=m.viewport,j=n.content-n.viewport,D=C.useCallbackRef(d),A=C.useCallbackRef(a),H=k(b,10);function N(v){if(P.current){const p=v.clientX-P.current.left,R=v.clientY-P.current.top;f({x:p,y:R})}}return s.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[X,w,j,D]),s.useEffect(A,[n,A]),E(w,H),E(m.content,H),h.jsx(pe,{scope:r,scrollbar:w,hasThumb:t,onThumbChange:C.useCallbackRef(l),onThumbPointerUp:C.useCallbackRef(c),onThumbPositionChange:A,onThumbPointerDown:C.useCallbackRef(i),children:h.jsx(_.Primitive.div,{...u,ref:I,style:{position:"absolute",...u.style},onPointerDown:x.composeEventHandlers(e.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),P.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),N(v))}),onPointerMove:x.composeEventHandlers(e.onPointerMove,N),onPointerUp:x.composeEventHandlers(e.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,m.viewport&&(m.viewport.style.scrollBehavior=""),P.current=null})})})}),O="ScrollAreaThumb",re=s.forwardRef((e,o)=>{const{forceMount:r,...n}=e,t=Z(O,e.__scopeScrollArea);return h.jsx(W.Presence,{present:r||t.hasThumb,children:h.jsx(we,{ref:o,...n})})}),we=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,style:n,...t}=e,l=S(O,r),c=Z(O,r),{onThumbPositionChange:i}=c,a=T.useComposedRefs(o,b=>c.onThumbChange(b)),f=s.useRef(void 0),d=k(()=>{f.current&&(f.current(),f.current=void 0)},100);return s.useEffect(()=>{const b=l.viewport;if(b){const u=()=>{if(d(),!f.current){const m=Pe(b,i);f.current=m,i()}};return i(),b.addEventListener("scroll",u),()=>b.removeEventListener("scroll",u)}},[l.viewport,d,i]),h.jsx(_.Primitive.div,{"data-state":c.hasThumb?"visible":"hidden",...t,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:x.composeEventHandlers(e.onPointerDownCapture,b=>{const m=b.target.getBoundingClientRect(),w=b.clientX-m.left,y=b.clientY-m.top;c.onThumbPointerDown({x:w,y})}),onPointerUp:x.composeEventHandlers(e.onPointerUp,c.onThumbPointerUp)})});re.displayName=O;var U="ScrollAreaCorner",oe=s.forwardRef((e,o)=>{const r=S(U,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?h.jsx(ge,{...e,ref:o}):null});oe.displayName=U;var ge=s.forwardRef((e,o)=>{const{__scopeScrollArea:r,...n}=e,t=S(U,r),[l,c]=s.useState(0),[i,a]=s.useState(0),f=!!(l&&i);return E(t.scrollbarX,()=>{const d=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(d),a(d)}),E(t.scrollbarY,()=>{const d=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(d),c(d)}),f?h.jsx(_.Primitive.div,{...n,ref:o,style:{width:l,height:i,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function z(e){return e?parseInt(e,10):0}function te(e,o){const r=e/o;return isNaN(r)?0:r}function M(e){const o=te(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*o;return Math.max(n,18)}function xe(e,o,r,n="ltr"){const t=M(r),l=t/2,c=o||l,i=t-c,a=r.scrollbar.paddingStart+c,f=r.scrollbar.size-r.scrollbar.paddingEnd-i,d=r.content-r.viewport,b=n==="ltr"?[0,d]:[d*-1,0];return ne([a,f],b)(e)}function V(e,o,r="ltr"){const n=M(o),t=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,l=o.scrollbar.size-t,c=o.content-o.viewport,i=l-n,a=r==="ltr"?[0,c]:[c*-1,0],f=ue(e,a);return ne([0,c],[0,i])(f)}function ne(e,o){return r=>{if(e[0]===e[1]||o[0]===o[1])return o[0];const n=(o[1]-o[0])/(e[1]-e[0]);return o[0]+n*(r-e[0])}}function le(e,o){return e>0&&e<o}var Pe=(e,o=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function t(){const l={left:e.scrollLeft,top:e.scrollTop},c=r.left!==l.left,i=r.top!==l.top;(c||i)&&o(),r=l,n=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(n)};function k(e,o){const r=C.useCallbackRef(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,o)},[r,o])}function E(e,o){const r=C.useCallbackRef(o);ie.useLayoutEffect2(()=>{let n=0;if(e){const t=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return t.observe(e),()=>{window.cancelAnimationFrame(n),t.unobserve(e)}}},[e,r])}const se=q.forwardRef(({className:e,...o},r)=>h.jsxs($,{className:" overflow-hidden z-10 p-6 m-6 mb-0 rounded-full border border-border-interactive-neutral bg-surface-neutral-l1",children:[h.jsx(J,{className:"h-full relative z-10 pb-6 w-full pr-10 ",children:h.jsx("div",{className:ae.cn("flex w-200 items-center gap-8 *:w-full ",e),"data-slot":"text-editor-menu-bar",ref:r,...o})}),h.jsx(K,{orientation:"horizontal",className:" flex select-none cursor-move touch-none p-2 flex-col h-10 hover:bg-border-interactive-neutral-hover",children:h.jsx(re,{className:"flex-1 bg-border-interactive-neutral-inverse-hover rounded-10 relative before:content-[''] before:absolute before:top-1/2 before:left-1/2 before:-translate-1/2 before:size-full before:min-w-44 before:min-h-44"})}),h.jsx(oe,{className:" bg-red-300"})]}));se.displayName="TextEditorMenuBar";exports.TextEditorMenuBar=se;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react");require("../../Icons/IconWrapper.js");const x=require("../../Icons/ExpandAllIcon.js"),s=require("../../../index-CyFz8fal.cjs"),i=require("../../../index-DgIcguCG.cjs"),a=require("../../../lib/utils.js"),o=require("./TextEditorMenuAction.js"),t=p.forwardRef(({className:l,...c},u)=>{const{editor:r}=s.useCurrentEditor(),n=s.useEditorState({editor:r,selector:d=>{if(!d.editor)return{};const g=[1,2,3,4,5,6].find(h=>r?.isActive("heading",{level:h}));return{isParagraph:d.editor.isActive("paragraph")||!1,isHeading1:d.editor.isActive("heading",{level:1})||!1,isHeading2:d.editor.isActive("heading",{level:2})||!1,isHeading3:d.editor.isActive("heading",{level:3})||!1,isHeading4:d.editor.isActive("heading",{level:4})||!1,isHeading5:d.editor.isActive("heading",{level:5})||!1,isHeading6:d.editor.isActive("heading",{level:6})||!1,canHeadingParagraph:!d.editor.can().chain().toggleHeading({level:1}).run()||!1,activeHeading:g}}});return e.jsxs(i.DropdownMenu,{children:[e.jsx(i.DropdownMenuTrigger,{disabled:n?.canHeadingParagraph,asChild:!0,children:e.jsxs(o.TextEditorMenuAction,{ref:u,disabled:n?.canHeadingParagraph,className:a.cn("flex cursor-pointer items-center gap-8 hover:bg-border-interactive-neutral p-7 rounded-8",l),...c,children:[e.jsx("p",{className:"body-tiny-medium",children:n?.activeHeading?`H${n?.activeHeading}`:"Normal"}),e.jsx(x,{className:"size-12"})]})}),e.jsx(i.DropdownMenuPortal,{children:e.jsxs(i.DropdownMenuContent,{className:"cursor-pointer flex flex-col gap-4 bg-surface-neutral-l1 shadow-200 p-6 rounded-12",children:[e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isHeading1,className:a.cn("body-large-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().toggleHeading({level:1}).run(),children:"H1"})}),e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isHeading2,className:a.cn("body-medium-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().toggleHeading({level:2}).run(),children:"H2"})}),e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isHeading3,className:a.cn("body-small-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().toggleHeading({level:3}).run(),children:"H3"})}),e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isHeading4,className:a.cn("body-extrasmall-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().toggleHeading({level:4}).run(),children:"H4"})}),e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isHeading5,className:a.cn("body-tiny-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().toggleHeading({level:5}).run(),children:"H5"})}),e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isHeading6,className:a.cn("body-extratiny-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().toggleHeading({level:6}).run(),children:"H6"})}),e.jsx(i.DropdownMenuItem,{asChild:!0,children:e.jsx(o.TextEditorMenuAction,{isActive:n?.isParagraph,className:a.cn("body-overline-bold","py-2 px-6 rounded-8"),onClick:()=>r?.chain().focus().setParagraph().run(),children:"Normal"})}),e.jsx(i.DropdownMenuArrow,{className:"fill-surface-neutral-l1 text-surface-neutral-l1"})]})})]})});t.displayName="TextSizesMenu";exports.TextSizesMenu=t;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react");require("../../Icons/IconWrapper.js");const u=require("../../Icons/FormatUnderlinedIcon.js"),i=require("../../../index-CyFz8fal.cjs"),a=require("../../../lib/utils.js"),b=require("./TextEditorMenuAction.js"),o=c.forwardRef(({className:d,...s},l)=>{const{editor:r}=i.useCurrentEditor(),n=i.useEditorState({editor:r,selector:e=>e.editor?{isUnderline:e.editor.isActive("underline")||!1,canUnderline:e.editor.can().chain().toggleUnderline().run()||!1}:{}});return t.jsx(b.TextEditorMenuAction,{className:a.cn(" outline-none border-none cursor-pointer hover:bg-border-interactive-neutral p-7 rounded-8 disabled:text-disabled disabled:cursor-not-allowed",n?.isUnderline&&"bg-border-interactive-neutral-active text-surface-neutral-l1 hover:bg-border-interactive-neutral-active-hover",d),onClick:()=>r?.chain().focus().toggleUnderline().run(),disabled:!n?.canUnderline,ref:l,...s,children:t.jsx(u,{className:"size-16"})})});o.displayName="UnderlineMenu";exports.UnderlineMenu=o;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("react");require("../../Icons/IconWrapper.js");const c=require("../../Icons/FormatListBulletedIcon.js"),n=require("../../../index-CyFz8fal.cjs"),d=require("./TextEditorMenuAction.js"),s=l.forwardRef(({...o},u)=>{const{editor:t}=n.useCurrentEditor(),i=n.useEditorState({editor:t,selector:e=>e.editor?{isBulletList:e.editor.isActive("bulletList")||!1,canBulletList:!e.editor.can().chain().toggleBulletList().run()||!1}:{}});return r.jsx(d.TextEditorMenuAction,{isActive:i?.isBulletList,disabled:i?.canBulletList,onClick:()=>t?.chain().focus().toggleBulletList().run(),ref:u,...o,children:r.jsx(c,{className:"size-16"})})});s.displayName="UnorderedListMenu";exports.UnorderedListMenu=s;
|