{"ScriptPreparationCode":"const modifierKeys = [\r\n \u0027Alt\u0027,\r\n \u0027AltGraph\u0027,\r\n \u0027CapsLock\u0027,\r\n \u0027Control\u0027,\r\n \u0027Fn\u0027,\r\n \u0027FnLock\u0027,\r\n \u0027Meta\u0027,\r\n \u0027NumLock\u0027,\r\n \u0027ScrollLock\u0027,\r\n \u0027Shift\u0027,\r\n \u0027Symbol\u0027,\r\n \u0027SymbolLock\u0027,\r\n \u0027Hyper\u0027,\r\n \u0027Super\u0027,\r\n \u0027OS\u0027, // https://bugzilla.mozilla.org/show_bug.cgi?id=1232918)\r\n];\r\n\r\nconst whitespaceKeys = [\u0027Enter\u0027, \u0027Tab\u0027];\r\n\r\nconst navigationKeys = [\r\n \u0027ArrowDown\u0027,\r\n \u0027ArrowLeft\u0027,\r\n \u0027ArrowRight\u0027,\r\n \u0027ArrowUp\u0027,\r\n \u0027End\u0027,\r\n \u0027Home\u0027,\r\n \u0027PageDown\u0027,\r\n \u0027PageUp\u0027,\r\n];\r\n\r\nconst editingKeys = [\r\n \u0027Backspace\u0027,\r\n \u0027Clear\u0027,\r\n \u0027Copy\u0027,\r\n \u0027CrSel\u0027,\r\n \u0027Cut\u0027,\r\n \u0027Delete\u0027,\r\n \u0027EraseEof\u0027,\r\n \u0027ExSel\u0027,\r\n \u0027Insert\u0027,\r\n \u0027Paste\u0027,\r\n \u0027Redo\u0027,\r\n \u0027Undo\u0027,\r\n];\r\n\r\nconst uiKeys = [\r\n \u0027Accept\u0027,\r\n \u0027Again\u0027,\r\n \u0027Attn\u0027,\r\n \u0027Cancel\u0027,\r\n \u0027ContextMenu\u0027,\r\n \u0027Escape\u0027,\r\n \u0027Execute\u0027,\r\n \u0027Find\u0027,\r\n \u0027Help\u0027,\r\n \u0027Pause\u0027,\r\n \u0027Play\u0027,\r\n \u0027Props\u0027,\r\n \u0027Select\u0027,\r\n \u0027ZoomIn\u0027,\r\n \u0027ZoomOut\u0027,\r\n];\r\n\r\nconst deviceKeys = [\r\n \u0027BrightnessDown\u0027,\r\n \u0027BrightnessUp\u0027,\r\n \u0027Eject\u0027,\r\n \u0027LogOff\u0027,\r\n \u0027Power\u0027,\r\n \u0027PowerOff\u0027,\r\n \u0027PrintScreen\u0027,\r\n \u0027Hibernate\u0027,\r\n \u0027Standby\u0027,\r\n \u0027WakeUp\u0027,\r\n];\r\n\r\nconst compositionKeys = [\r\n \u0027AllCandidates\u0027,\r\n \u0027Alphanumeric\u0027,\r\n \u0027CodeInput\u0027,\r\n \u0027Compose\u0027,\r\n \u0027Convert\u0027,\r\n // When a user presses alt\u002Be, alt\u002Bu, etc on a Mac, the key value is \u0022Dead\u0022\r\n // i.e, a dead character for an accent that\u0027ll be used next\r\n \u0027Dead\u0027,\r\n \u0027FinalMode\u0027,\r\n \u0027GroupFirst\u0027,\r\n \u0027GroupLast\u0027,\r\n \u0027GroupNext\u0027,\r\n \u0027GroupPrevious\u0027,\r\n \u0027ModeChange\u0027,\r\n \u0027NextCandidate\u0027,\r\n \u0027NonConvert\u0027,\r\n \u0027PreviousCandidate\u0027,\r\n \u0027Process\u0027,\r\n \u0027SingleCandidate\u0027,\r\n \u0027HangulMode\u0027,\r\n \u0027HanjaMode\u0027,\r\n \u0027JunjaMode\u0027,\r\n \u0027Eisu\u0027,\r\n \u0027Hankaku\u0027,\r\n \u0027Hiragana\u0027,\r\n \u0027HiraganaKatakana\u0027,\r\n \u0027KanaMode\u0027,\r\n \u0027KanjiMode\u0027,\r\n \u0027Katakana\u0027,\r\n \u0027Romaji\u0027,\r\n \u0027Zenkaku\u0027,\r\n \u0027ZenkakuHankaku\u0027,\r\n];\r\n\r\nconst fnKeys = [\r\n \u0027F1\u0027,\r\n \u0027F2\u0027,\r\n \u0027F3\u0027,\r\n \u0027F4\u0027,\r\n \u0027F5\u0027,\r\n \u0027F6\u0027,\r\n \u0027F7\u0027,\r\n \u0027F8\u0027,\r\n \u0027F9\u0027,\r\n \u0027F10\u0027,\r\n \u0027F11\u0027,\r\n \u0027F12\u0027,\r\n \u0027Soft1\u0027,\r\n \u0027Soft2\u0027,\r\n \u0027Soft3\u0027,\r\n \u0027Soft4\u0027,\r\n];\r\n\r\nconst multimediaKeys = [\r\n \u0027ChannelDown\u0027,\r\n \u0027ChannelUp\u0027,\r\n \u0027Close\u0027,\r\n \u0027MailForward\u0027,\r\n \u0027MailReply\u0027,\r\n \u0027MailSend\u0027,\r\n \u0027MediaClose\u0027,\r\n \u0027MediaFastForward\u0027,\r\n \u0027MediaPause\u0027,\r\n \u0027MediaPlay\u0027,\r\n \u0027MediaPlayPause\u0027,\r\n \u0027MediaRecord\u0027,\r\n \u0027MediaRewind\u0027,\r\n \u0027MediaStop\u0027,\r\n \u0027MediaTrackNext\u0027,\r\n \u0027MediaTrackPrevious\u0027,\r\n \u0027New\u0027,\r\n \u0027Open\u0027,\r\n \u0027Print\u0027,\r\n \u0027Save\u0027,\r\n \u0027SpellCheck\u0027,\r\n];\r\n\r\nconst audioKeys = [\r\n \u0027AudioBalanceLeft\u0027,\r\n \u0027AudioBalanceRight\u0027,\r\n \u0027AudioBassBoostDown\u0027,\r\n \u0027AudioBassBoostToggle\u0027,\r\n \u0027AudioBassBoostUp\u0027,\r\n \u0027AudioFaderFront\u0027,\r\n \u0027AudioFaderRear\u0027,\r\n \u0027AudioSurroundModeNext\u0027,\r\n \u0027AudioTrebleDown\u0027,\r\n \u0027AudioTrebleUp\u0027,\r\n \u0027AudioVolumeDown\u0027,\r\n \u0027AudioVolumeUp\u0027,\r\n \u0027AudioVolumeMute\u0027,\r\n \u0027MicrophoneToggle\u0027,\r\n \u0027MicrophoneVolumeDown\u0027,\r\n \u0027MicrophoneVolumeUp\u0027,\r\n \u0027MicrophoneVolumeMute\u0027,\r\n];\r\n\r\nconst speechKeys = [\u0027SpeechCorrectionList\u0027, \u0027SpeechInputToggle\u0027];\r\n\r\nconst applicationKeys = [\r\n \u0027LaunchApplication1\u0027,\r\n \u0027LaunchApplication2\u0027,\r\n \u0027LaunchCalendar\u0027,\r\n \u0027LaunchContacts\u0027,\r\n \u0027LaunchMail\u0027,\r\n \u0027LaunchMediaPlayer\u0027,\r\n \u0027LaunchMusicPlayer\u0027,\r\n \u0027LaunchPhone\u0027,\r\n \u0027LaunchScreenSaver\u0027,\r\n \u0027LaunchSpreadsheet\u0027,\r\n \u0027LaunchWebBrowser\u0027,\r\n \u0027LaunchWebCam\u0027,\r\n \u0027LaunchWordProcessor\u0027,\r\n];\r\nconst browserKeys = [\r\n \u0027BrowserBack\u0027,\r\n \u0027BrowserFavorites\u0027,\r\n \u0027BrowserForward\u0027,\r\n \u0027BrowserHome\u0027,\r\n \u0027BrowserRefresh\u0027,\r\n \u0027BrowserSearch\u0027,\r\n \u0027BrowserStop\u0027,\r\n];\r\nconst mobilePhoneKeys = [\r\n \u0027AppSwitch\u0027,\r\n \u0027Call\u0027,\r\n \u0027Camera\u0027,\r\n \u0027CameraFocus\u0027,\r\n \u0027EndCall\u0027,\r\n \u0027GoBack\u0027,\r\n \u0027GoHome\u0027,\r\n \u0027HeadsetHook\u0027,\r\n \u0027LastNumberRedial\u0027,\r\n \u0027Notification\u0027,\r\n \u0027MannerMode\u0027,\r\n \u0027VoiceDial\u0027,\r\n];\r\n\r\nconst tvKeys = [\r\n \u0027TV\u0027,\r\n \u0027TV3DMode\u0027,\r\n \u0027TVAntennaCable\u0027,\r\n \u0027TVAudioDescription\u0027,\r\n \u0027TVAudioDescriptionMixDown\u0027,\r\n \u0027TVAudioDescriptionMixUp\u0027,\r\n \u0027TVContentsMenu\u0027,\r\n \u0027TVDataService\u0027,\r\n \u0027TVInput\u0027,\r\n \u0027TVInputComponent1\u0027,\r\n \u0027TVInputComponent2\u0027,\r\n \u0027TVInputComposite1\u0027,\r\n \u0027TVInputComposite2\u0027,\r\n \u0027TVInputHDMI1\u0027,\r\n \u0027TVInputHDMI2\u0027,\r\n \u0027TVInputHDMI3\u0027,\r\n \u0027TVInputHDMI4\u0027,\r\n \u0027TVInputVGA1\u0027,\r\n \u0027TVMediaContext\u0027,\r\n \u0027TVNetwork\u0027,\r\n \u0027TVNumberEntry\u0027,\r\n \u0027TVPower\u0027,\r\n \u0027TVRadioService\u0027,\r\n \u0027TVSatellite\u0027,\r\n \u0027TVSatelliteBS\u0027,\r\n \u0027TVSatelliteCS\u0027,\r\n \u0027TVSatelliteToggle\u0027,\r\n \u0027TVTerrestrialAnalog\u0027,\r\n \u0027TVTerrestrialDigital\u0027,\r\n \u0027TVTimer\u0027,\r\n];\r\nconst mediaControllerKeys = [\r\n \u0027AVRInput\u0027,\r\n \u0027AVRPower\u0027,\r\n \u0027ColorF0Red\u0027,\r\n \u0027ColorF1Green\u0027,\r\n \u0027ColorF2Yellow\u0027,\r\n \u0027ColorF3Blue\u0027,\r\n \u0027ColorF4Grey\u0027,\r\n \u0027ColorF5Brown\u0027,\r\n \u0027ClosedCaptionToggle\u0027,\r\n \u0027Dimmer\u0027,\r\n \u0027DisplaySwap\u0027,\r\n \u0027DVR\u0027,\r\n \u0027Exit\u0027,\r\n \u0027FavoriteClear0\u0027,\r\n \u0027FavoriteClear1\u0027,\r\n \u0027FavoriteClear2\u0027,\r\n \u0027FavoriteClear3\u0027,\r\n \u0027FavoriteRecall0\u0027,\r\n \u0027FavoriteRecall1\u0027,\r\n \u0027FavoriteRecall2\u0027,\r\n \u0027FavoriteRecall3\u0027,\r\n \u0027FavoriteStore0\u0027,\r\n \u0027FavoriteStore1\u0027,\r\n \u0027FavoriteStore2\u0027,\r\n \u0027FavoriteStore3\u0027,\r\n \u0027Guide\u0027,\r\n \u0027GuideNextDay\u0027,\r\n \u0027GuidePreviousDay\u0027,\r\n \u0027Info\u0027,\r\n \u0027InstantReplay\u0027,\r\n \u0027Link\u0027,\r\n \u0027ListProgram\u0027,\r\n \u0027LiveContent\u0027,\r\n \u0027Lock\u0027,\r\n \u0027MediaApps\u0027,\r\n \u0027MediaAudioTrack\u0027,\r\n \u0027MediaLast\u0027,\r\n \u0027MediaSkipBackward\u0027,\r\n \u0027MediaSkipForward\u0027,\r\n \u0027MediaStepBackward\u0027,\r\n \u0027MediaStepForward\u0027,\r\n \u0027MediaTopMenu\u0027,\r\n \u0027NavigateIn\u0027,\r\n \u0027NavigateNext\u0027,\r\n \u0027NavigateOut\u0027,\r\n \u0027NavigatePrevious\u0027,\r\n \u0027NextFavoriteChannel\u0027,\r\n \u0027NextUserProfile\u0027,\r\n \u0027OnDemand\u0027,\r\n \u0027Pairing\u0027,\r\n \u0027PinPDown\u0027,\r\n \u0027PinPMove\u0027,\r\n \u0027PinPToggle\u0027,\r\n \u0027PinPUp\u0027,\r\n \u0027PlaySpeedDown\u0027,\r\n \u0027PlaySpeedReset\u0027,\r\n \u0027PlaySpeedUp\u0027,\r\n \u0027RandomToggle\u0027,\r\n \u0027RcLowBattery\u0027,\r\n \u0027RecordSpeedNext\u0027,\r\n \u0027RfBypass\u0027,\r\n \u0027ScanChannelsToggle\u0027,\r\n \u0027ScreenModeNext\u0027,\r\n \u0027Settings\u0027,\r\n \u0027SplitScreenToggle\u0027,\r\n \u0027STBInput\u0027,\r\n \u0027STBPower\u0027,\r\n \u0027Subtitle\u0027,\r\n \u0027Teletext\u0027,\r\n \u0027VideoModeNext\u0027,\r\n \u0027Wink\u0027,\r\n \u0027ZoomToggle\u0027,\r\n];\r\n\r\nfunction isText(eventKey) {\r\n return !modifierKeys.includes(eventKey) \u0026\u0026\r\n !whitespaceKeys.includes(eventKey) \u0026\u0026\r\n !navigationKeys.includes(eventKey) \u0026\u0026\r\n !editingKeys.includes(eventKey) \u0026\u0026\r\n !uiKeys.includes(eventKey) \u0026\u0026\r\n !deviceKeys.includes(eventKey) \u0026\u0026\r\n !compositionKeys.includes(eventKey) \u0026\u0026\r\n !fnKeys.includes(eventKey) \u0026\u0026\r\n !multimediaKeys.includes(eventKey) \u0026\u0026\r\n !audioKeys.includes(eventKey) \u0026\u0026\r\n !speechKeys.includes(eventKey) \u0026\u0026\r\n !applicationKeys.includes(eventKey) \u0026\u0026\r\n !browserKeys.includes(eventKey) \u0026\u0026\r\n !mobilePhoneKeys.includes(eventKey) \u0026\u0026\r\n !tvKeys.includes(eventKey) \u0026\u0026\r\n !mediaControllerKeys.includes(eventKey);\r\n}\r\n\r\nconst keysAsSet = new Set([...whitespaceKeys,\r\n ...navigationKeys,\r\n ...editingKeys,\r\n ...uiKeys,\r\n ...deviceKeys,\r\n ...compositionKeys,\r\n ...fnKeys,\r\n ...multimediaKeys,\r\n ...audioKeys,\r\n ...speechKeys,\r\n ...applicationKeys,\r\n ...browserKeys,\r\n ...mobilePhoneKeys,\r\n ...tvKeys,\r\n ...mediaControllerKeys]);\r\n\r\nfunction isTextAsSet(eventKey) {\r\n return keysAsSet.has(eventKey);\r\n}\r\n","TestCases":[{"Name":"isText valid ","Code":"return isText(\u0027BrowserStop\u0027);","IsDeferred":false},{"Name":"isText invalid ","Code":"return isText(\u0027sarasa\u0027);","IsDeferred":false},{"Name":"isText as Set valid ","Code":"return isTextAsSet(\u0027BrowserStop\u0027);","IsDeferred":false},{"Name":"isText as Set invalid","Code":"return isTextAsSet(\u0027sarasa\u0027);","IsDeferred":false}]}