diff --git a/.gitignore b/.gitignore
index 1279394..656b796 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1 @@
-build/bin/
-node_modules
-frontend/dist
-frontend/wailsjs
-
-.prettierignore
-
-config.json
\ No newline at end of file
+.prettierignore
\ No newline at end of file
diff --git a/app.go b/app.go
deleted file mode 100644
index 5cd7ae8..0000000
--- a/app.go
+++ /dev/null
@@ -1,563 +0,0 @@
-package main
-
-import (
- "context"
- "errors"
- "fmt"
- "log"
- "os"
- "path/filepath"
- "sync"
- "time"
-
- "github.com/tylertravisty/rum-goggles/internal/api"
- "github.com/tylertravisty/rum-goggles/internal/chatbot"
- "github.com/tylertravisty/rum-goggles/internal/config"
- rumblelivestreamlib "github.com/tylertravisty/rumble-livestream-lib-go"
- "github.com/wailsapp/wails/v2/pkg/runtime"
-)
-
-type chat struct {
- username string
- password string
- url string
-}
-
-// App struct
-type App struct {
- ctx context.Context
- cfg *config.App
- cfgMu sync.Mutex
- api *api.Api
- apiMu sync.Mutex
- cb *chatbot.ChatBot
- cbMu sync.Mutex
- logError *log.Logger
- logInfo *log.Logger
-}
-
-// NewApp creates a new App application struct
-func NewApp() *App {
- app := &App{}
- err := app.initLog()
- if err != nil {
- log.Fatal("error initializing log:", err)
- }
-
- app.api = api.NewApi(app.logError, app.logInfo)
-
- return app
-}
-
-// startup is called when the app starts. The context is saved
-// so we can call the runtime methods
-func (a *App) startup(ctx context.Context) {
- a.ctx = ctx
- a.api.Startup(ctx)
-
- err := a.loadConfig()
- if err != nil {
- a.logError.Fatal("error loading config: ", err)
- }
-}
-
-func (a *App) initLog() error {
- f, err := config.LogFile()
- if err != nil {
- return fmt.Errorf("error opening log file: %v", err)
- }
-
- a.logInfo = log.New(f, "[info]", log.LstdFlags|log.Lshortfile)
- a.logError = log.New(f, "[error]", log.LstdFlags|log.Lshortfile)
- return nil
-}
-
-func (a *App) loadConfig() error {
- cfg, err := config.Load()
- if err != nil {
- if !errors.Is(err, os.ErrNotExist) {
- return fmt.Errorf("error loading config: %v", err)
- }
-
- return a.newConfig()
- }
-
- a.cfg = cfg
- return nil
-}
-
-func (a *App) newConfig() error {
- cfg := &config.App{Channels: map[string]config.Channel{}}
- err := cfg.Save()
- if err != nil {
- return fmt.Errorf("error saving new config: %v", err)
- }
-
- a.cfg = cfg
- return nil
-}
-
-func (a *App) Config() *config.App {
- return a.cfg
-}
-
-func (a *App) AddChannel(url string) (*config.App, error) {
- client := rumblelivestreamlib.Client{StreamKey: url}
- resp, err := client.Request()
- if err != nil {
- a.logError.Println("error executing api request:", err)
- return nil, fmt.Errorf("Error querying API. Verify key and try again.")
- }
-
- name := resp.Username
- if resp.ChannelName != "" {
- name = resp.ChannelName
- }
-
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
- _, err = a.cfg.NewChannel(url, name)
- if err != nil {
- a.logError.Println("error creating new channel:", err)
- return nil, fmt.Errorf("Error creating new channel. Try again.")
- }
-
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return nil, fmt.Errorf("Error saving channel information. Try again.")
- }
-
- return a.cfg, nil
-}
-
-func (a *App) ChatBotMessages(cid string) (map[string]config.ChatMessage, error) {
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
- channel, exists := a.cfg.Channels[cid]
- if !exists {
- a.logError.Println("channel does not exist:", cid)
- return nil, fmt.Errorf("Cannot find channel. Try reloading.")
- }
-
- return channel.ChatBot.Messages, nil
-}
-
-func (a *App) AddChatMessage(cid string, cm config.ChatMessage) (map[string]config.ChatMessage, error) {
- var err error
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
- _, err = a.cfg.NewChatMessage(cid, cm)
- if err != nil {
- a.logError.Println("error creating new chat:", err)
- return nil, fmt.Errorf("Error creating new chat message. Try again.")
- }
-
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return nil, fmt.Errorf("Error saving chat message information. Try again.")
- }
-
- a.updateChatBotConfig(a.cfg.Channels[cid].ChatBot)
-
- return a.cfg.Channels[cid].ChatBot.Messages, nil
-}
-
-func (a *App) DeleteChatMessage(cid string, cm config.ChatMessage) (map[string]config.ChatMessage, error) {
- a.cbMu.Lock()
- if a.cb != nil {
- err := a.cb.StopMessage(cm.ID)
- if err != nil {
- a.logError.Println("error stopping chat bot message:", err)
- return nil, fmt.Errorf("Error stopping message. Try Again.")
- }
- }
- a.cbMu.Unlock()
-
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
- err := a.cfg.DeleteChatMessage(cid, cm)
- if err != nil {
- a.logError.Println("error deleting chat message:", err)
- return nil, fmt.Errorf("Error deleting chat message. Try again.")
- }
-
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return nil, fmt.Errorf("Error saving chat message information. Try again.")
- }
-
- a.updateChatBotConfig(a.cfg.Channels[cid].ChatBot)
-
- return a.cfg.Channels[cid].ChatBot.Messages, nil
-}
-
-func (a *App) UpdateChatMessage(cid string, cm config.ChatMessage) (map[string]config.ChatMessage, error) {
- var err error
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
- _, err = a.cfg.UpdateChatMessage(cid, cm)
- if err != nil {
- a.logError.Println("error updating chat message:", err)
- return nil, fmt.Errorf("Error updating chat message. Try again.")
- }
-
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return nil, fmt.Errorf("Error saving chat message information. Try again.")
- }
-
- a.updateChatBotConfig(a.cfg.Channels[cid].ChatBot)
-
- return a.cfg.Channels[cid].ChatBot.Messages, nil
-}
-
-type NewChatBotResponse struct {
- LoggedIn bool `json:"logged_in"`
- StreamUrl string `json:"stream_url"`
- Username string `json:"username"`
-}
-
-func (a *App) GetChatBot(cid string) (NewChatBotResponse, error) {
- if a.cb == nil {
- return NewChatBotResponse{}, fmt.Errorf("Chat bot not initalized.")
- }
-
- loggedIn, err := a.cb.LoggedIn()
- if err != nil {
- a.logError.Println("error checking if chat bot is logged in:", err)
- return NewChatBotResponse{}, fmt.Errorf("Error checking if chat bot is logged in. Try again.")
- }
-
- return NewChatBotResponse{loggedIn, a.cb.Cfg.Session.Client.StreamUrl, a.cb.Cfg.Session.Username}, nil
-}
-
-func (a *App) NewChatBot(cid string) (NewChatBotResponse, error) {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
-
- if a.cb != nil {
- err := a.resetChatBot()
- if err != nil {
- a.logError.Println("error resetting chat bot:", err)
- return NewChatBotResponse{}, fmt.Errorf("Error creating chat bot. Try Again.")
- }
- }
- channel, exists := a.cfg.Channels[cid]
- if !exists {
- a.logError.Println("channel does not exist:", cid)
- return NewChatBotResponse{}, fmt.Errorf("Channel does not exist.")
- }
-
- if channel.ChatBot.Session.Client.StreamUrl == "" {
- return NewChatBotResponse{}, nil
- }
-
- var err error
- a.cb, err = chatbot.NewChatBot(a.ctx, channel.ChatBot, a.logError)
- if err != nil {
- a.logError.Println("error creating new chat bot:", err)
- return NewChatBotResponse{}, fmt.Errorf("Error creating new chat bot. Try again.")
- }
-
- loggedIn, err := a.cb.LoggedIn()
- if err != nil {
- a.logError.Println("error checking if chat bot is logged in:", err)
- return NewChatBotResponse{}, fmt.Errorf("Error checking if chat bot is logged in. Try again.")
- }
-
- if loggedIn {
- err = a.cb.StartChatStream()
- if err != nil {
- a.logError.Println("error starting chat stream:", err)
- return NewChatBotResponse{}, fmt.Errorf("Error connecting to chat. Try again.")
- }
- }
-
- return NewChatBotResponse{loggedIn, channel.ChatBot.Session.Client.StreamUrl, channel.ChatBot.Session.Username}, nil
-}
-
-func (a *App) LoginChatBot(cid string, username string, password string, streamUrl string) error {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
-
- if a.cb != nil {
- err := a.resetChatBot()
- if err != nil {
- a.logError.Println("error resetting chat bot:", err)
- return fmt.Errorf("Error creating chat bot. Try Again.")
- }
- }
- channel, exists := a.cfg.Channels[cid]
- if !exists {
- a.logError.Println("channel does not exist:", cid)
- return fmt.Errorf("Channel does not exist.")
- }
- channel.ChatBot.Session.Client.StreamUrl = streamUrl
-
- var err error
- a.cb, err = chatbot.NewChatBot(a.ctx, channel.ChatBot, a.logError)
- if err != nil {
- a.logError.Println("error creating new chat bot:", err)
- return fmt.Errorf("Error creating new chat bot. Try again.")
- }
-
- cookies, err := a.cb.Login(username, password)
- if err != nil {
- a.logError.Println("error logging into chat bot:", err)
- return fmt.Errorf("Error logging in. Try again.")
- }
-
- channel.ChatBot.Session = config.ChatBotSession{
- Client: rumblelivestreamlib.NewClientOptions{
- Cookies: cookies,
- StreamUrl: streamUrl,
- },
- Username: username,
- }
- a.cfg.Channels[cid] = channel
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return fmt.Errorf("Error saving session information. Try again.")
- }
-
- a.cb.Cfg.Session = channel.ChatBot.Session
-
- err = a.cb.StartChatStream()
- if err != nil {
- a.logError.Println("error starting chat stream:", err)
- return fmt.Errorf("Error connecting to chat. Try again.")
- }
-
- return nil
-}
-
-func (a *App) StopAllChatBot(cid string) error {
- if a.cb == nil {
- return fmt.Errorf("Chat bot not initialized.")
- }
-
- err := a.cb.StopAllMessages()
- if err != nil {
- a.logError.Println("error stopping all chat bot messages:", err)
- return fmt.Errorf("Error stopping messages.")
- }
-
- return nil
-}
-
-func (a *App) StartAllChatBot(cid string) error {
- if a.cb == nil {
- return fmt.Errorf("Chat bot not initialized.")
- }
-
- err := a.cb.StartAllMessages()
- if err != nil {
- a.logError.Println("error starting all chat bot messages:", err)
- return fmt.Errorf("Error starting messages.")
- }
-
- return nil
-}
-
-func (a *App) UpdateChatBotUrl(cid string, streamUrl string) error {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
-
- if a.cb == nil {
- return fmt.Errorf("Chat bot not initialized.")
- }
-
- err := a.resetChatBot()
- if err != nil {
- a.logError.Println("error resetting chat bot:", err)
- return fmt.Errorf("Error creating chat bot. Try Again.")
- }
-
- channel, exists := a.cfg.Channels[cid]
- if !exists {
- a.logError.Println("channel does not exist:", cid)
- return fmt.Errorf("Channel does not exist.")
- }
- channel.ChatBot.Session.Client.StreamUrl = streamUrl
-
- a.cb, err = chatbot.NewChatBot(a.ctx, channel.ChatBot, a.logError)
- if err != nil {
- a.logError.Println("error creating new chat bot:", err)
- return fmt.Errorf("Error creating new chat bot. Try again.")
- }
-
- a.cfg.Channels[cid] = channel
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return fmt.Errorf("Error saving session information. Try again.")
- }
-
- a.cb.Cfg.Session.Client.StreamUrl = streamUrl
-
- err = a.cb.StartChatStream()
- if err != nil {
- a.logError.Println("error starting chat stream:", err)
- return fmt.Errorf("Error connecting to chat. Try again.")
- }
-
- return nil
-}
-
-func (a *App) ResetChatBot(cid string, logout bool) error {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
- a.cfgMu.Lock()
- defer a.cfgMu.Unlock()
-
- if a.cb == nil {
- return nil
- }
-
- err := a.cb.StopAllMessages()
- if err != nil {
- return fmt.Errorf("error stopping all chat bot messages: %v", err)
- }
-
- if logout {
- err := a.cb.Logout()
- if err != nil {
- return fmt.Errorf("error logging out of chat bot: %v", err)
- }
-
- //TODO: reset session in config
- channel, exists := a.cfg.Channels[cid]
- if !exists {
- a.logError.Println("channel does not exist:", cid)
- return fmt.Errorf("Channel does not exist.")
- }
-
- channel.ChatBot.Session = config.ChatBotSession{}
- a.cfg.Channels[cid] = channel
- err = a.cfg.Save()
- if err != nil {
- a.logError.Println("error saving config:", err)
- return fmt.Errorf("Error saving session information. Try again.")
- }
- }
-
- err = a.resetChatBot()
- if err != nil {
- a.logError.Println("error resetting chat bot:", err)
- return fmt.Errorf("Error resetting chat bot. Try Again.")
- }
-
- return nil
-}
-
-func (a *App) resetChatBot() error {
- if a.cb == nil {
- // return fmt.Errorf("chat bot is nil")
- return nil
- }
-
- err := a.cb.StopAllMessages()
- if err != nil {
- return fmt.Errorf("error stopping all chat bot messages: %v", err)
- }
-
- err = a.cb.StopChatStream()
- if err != nil {
- return fmt.Errorf("error stopping chat stream: %v", err)
- }
-
- a.cb = nil
-
- return nil
-}
-
-func (a *App) StartChatBotMessage(mid string) error {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
-
- if a.cb == nil {
- return fmt.Errorf("Chat bot not initialized.")
- }
-
- err := a.cb.StartMessage(mid)
- if err != nil {
- a.logError.Println("error starting chat bot message:", err)
- return fmt.Errorf("Error starting message. Try Again.")
- }
-
- return nil
-}
-
-func (a *App) StopChatBotMessage(mid string) error {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
-
- // If chat bot not initialized, then stop does nothing
- if a.cb == nil {
- return nil
- }
-
- err := a.cb.StopMessage(mid)
- if err != nil {
- a.logError.Println("error stopping chat bot message:", err)
- return fmt.Errorf("Error stopping message. Try Again.")
- }
-
- return nil
-}
-
-func (a *App) StartApi(cid string) error {
- channel, found := a.cfg.Channels[cid]
- if !found {
- a.logError.Println("could not find channel CID:", cid)
- return fmt.Errorf("channel CID not found")
- }
-
- err := a.api.Start(channel.ApiUrl, channel.Interval*time.Second)
- if err != nil {
- a.logError.Println("error starting api:", err)
- return fmt.Errorf("error starting API")
- }
-
- return nil
-}
-
-func (a *App) StopApi() {
- a.api.Stop()
-}
-
-func (a *App) updateChatBotConfig(cfg config.ChatBot) {
- a.cbMu.Lock()
- defer a.cbMu.Unlock()
- if a.cb != nil {
- a.cb.Cfg = cfg
- }
-}
-
-func (a *App) OpenFileDialog() (string, error) {
- home, err := os.UserHomeDir()
- if err != nil {
- a.logError.Println("error getting home directory:", err)
- return "", fmt.Errorf("Error opening file explorer. Try again.")
- }
- filepath, err := runtime.OpenFileDialog(a.ctx, runtime.OpenDialogOptions{DefaultDirectory: home})
- if err != nil {
- a.logError.Println("error opening file dialog:", err)
- return "", fmt.Errorf("Error opening file explorer. Try again.")
- }
-
- return filepath, err
-}
-
-func (a *App) FilepathBase(path string) string {
- return filepath.Base(path)
-}
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
deleted file mode 100644
index 987b323..0000000
--- a/frontend/src/App.jsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { useEffect, useState } from 'react';
-import { MemoryRouter as Router, Route, Routes, Link } from 'react-router-dom';
-
-import './App.css';
-
-import { NavSignIn, NavDashboard } from './screens/Navigation';
-import Dashboard from './screens/Dashboard';
-import SignIn from './screens/SignIn';
-
-function App() {
- return (
-
-
- }>
- }>
-
-
- );
-}
-
-export default App;
diff --git a/frontend/src/assets/icons/eye-slash.png b/frontend/src/assets/icons/eye-slash.png
deleted file mode 100644
index fe97fa0..0000000
Binary files a/frontend/src/assets/icons/eye-slash.png and /dev/null differ
diff --git a/frontend/src/assets/icons/eye.png b/frontend/src/assets/icons/eye.png
deleted file mode 100644
index 5ca94ec..0000000
Binary files a/frontend/src/assets/icons/eye.png and /dev/null differ
diff --git a/frontend/src/assets/icons/gear-fill.png b/frontend/src/assets/icons/gear-fill.png
deleted file mode 100644
index e0bf42b..0000000
Binary files a/frontend/src/assets/icons/gear-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/gear.png b/frontend/src/assets/icons/gear.png
deleted file mode 100644
index c192495..0000000
Binary files a/frontend/src/assets/icons/gear.png and /dev/null differ
diff --git a/frontend/src/assets/icons/hand-thumbs-down.png b/frontend/src/assets/icons/hand-thumbs-down.png
deleted file mode 100644
index 27eace7..0000000
Binary files a/frontend/src/assets/icons/hand-thumbs-down.png and /dev/null differ
diff --git a/frontend/src/assets/icons/hand-thumbs-up.png b/frontend/src/assets/icons/hand-thumbs-up.png
deleted file mode 100644
index 75eddf3..0000000
Binary files a/frontend/src/assets/icons/hand-thumbs-up.png and /dev/null differ
diff --git a/frontend/src/assets/icons/heart-fill.png b/frontend/src/assets/icons/heart-fill.png
deleted file mode 100644
index 293d511..0000000
Binary files a/frontend/src/assets/icons/heart-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/house.png b/frontend/src/assets/icons/house.png
deleted file mode 100644
index 982d5ea..0000000
Binary files a/frontend/src/assets/icons/house.png and /dev/null differ
diff --git a/frontend/src/assets/icons/index.jsx b/frontend/src/assets/icons/index.jsx
deleted file mode 100644
index b814454..0000000
--- a/frontend/src/assets/icons/index.jsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import eye from './eye.png';
-import eye_slash from './eye-slash.png';
-import gear from './gear.png';
-import gear_fill from './gear-fill.png';
-import heart from './heart-fill.png';
-import house from './house.png';
-import pause from './pause-fill.png';
-import play from './play-fill.png';
-import play_green from './play-fill-green.png';
-import plus_circle from './plus-circle-fill.png';
-import star from './star-fill.png';
-import stop from './stop-fill.png';
-import thumbs_down from './hand-thumbs-down.png';
-import thumbs_up from './hand-thumbs-up.png';
-import x_lg from './x-lg.png';
-
-export const Eye = eye;
-export const EyeSlash = eye_slash;
-export const Gear = gear;
-export const GearFill = gear_fill;
-export const Heart = heart;
-export const House = house;
-export const Pause = pause;
-export const Play = play;
-export const PlayGreen = play_green;
-export const PlusCircle = plus_circle;
-export const Star = star;
-export const Stop = stop;
-export const ThumbsDown = thumbs_down;
-export const ThumbsUp = thumbs_up;
-export const XLg = x_lg;
diff --git a/frontend/src/assets/icons/pause-circle.png b/frontend/src/assets/icons/pause-circle.png
deleted file mode 100644
index 686a73d..0000000
Binary files a/frontend/src/assets/icons/pause-circle.png and /dev/null differ
diff --git a/frontend/src/assets/icons/pause-fill.png b/frontend/src/assets/icons/pause-fill.png
deleted file mode 100644
index a54d600..0000000
Binary files a/frontend/src/assets/icons/pause-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/play-circle.png b/frontend/src/assets/icons/play-circle.png
deleted file mode 100644
index def567b..0000000
Binary files a/frontend/src/assets/icons/play-circle.png and /dev/null differ
diff --git a/frontend/src/assets/icons/play-fill-green.png b/frontend/src/assets/icons/play-fill-green.png
deleted file mode 100644
index 6b7294a..0000000
Binary files a/frontend/src/assets/icons/play-fill-green.png and /dev/null differ
diff --git a/frontend/src/assets/icons/play-fill.png b/frontend/src/assets/icons/play-fill.png
deleted file mode 100644
index 2cbb56c..0000000
Binary files a/frontend/src/assets/icons/play-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/plus-circle-fill.png b/frontend/src/assets/icons/plus-circle-fill.png
deleted file mode 100644
index 785e701..0000000
Binary files a/frontend/src/assets/icons/plus-circle-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/star-fill.png b/frontend/src/assets/icons/star-fill.png
deleted file mode 100644
index 3478d59..0000000
Binary files a/frontend/src/assets/icons/star-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/stop-fill.png b/frontend/src/assets/icons/stop-fill.png
deleted file mode 100644
index 6dccccf..0000000
Binary files a/frontend/src/assets/icons/stop-fill.png and /dev/null differ
diff --git a/frontend/src/assets/icons/x-lg.png b/frontend/src/assets/icons/x-lg.png
deleted file mode 100644
index 88a3d2b..0000000
Binary files a/frontend/src/assets/icons/x-lg.png and /dev/null differ
diff --git a/frontend/src/components/ChannelList.css b/frontend/src/components/ChannelList.css
deleted file mode 100644
index 7cbd1a9..0000000
--- a/frontend/src/components/ChannelList.css
+++ /dev/null
@@ -1,66 +0,0 @@
-.channel-list {
- align-items: center;
- display: flex;
- flex-direction: column;
- justify-content: center;
- height: 100%;
- width: 100%;
-}
-
-.channel-list-title {
- color: #85c742;
- font-family: sans-serif;
- font-size: 24px;
- font-weight: bold;
- padding: 5px;
-}
-
-.channels {
- background-color: white;
- border: 1px solid #D6E0EA;
- border-radius: 5px;
- height: 100%;
- overflow: auto;
- width: 100%;
-}
-
-.channel {
- align-items: center;
- /* border-top: 1px solid #D6E0EA; */
- display: flex;
-}
-
-.channel-add {
- background-color: #f3f5f8;
- border: none;
- padding: 10px;
-}
-
-.channel-add:hover {
- cursor: pointer;
-}
-
-.channel-add-icon {
- height: 36px;
- width: 36px;
-}
-
-.channel-button {
- background-color: white;
- border: none;
- border-radius: 5px;
- color: #061726;
- font-family: sans-serif;
- font-size: 24px;
- font-weight: bold;
- overflow: hidden;
- padding: 10px 10px;
- text-align: left;
- white-space: nowrap;
- width: 100%;
-}
-
-.channel-button:hover {
- background-color: #85c742;
- cursor: pointer;
-}
\ No newline at end of file
diff --git a/frontend/src/components/ChannelList.jsx b/frontend/src/components/ChannelList.jsx
deleted file mode 100644
index 8a64348..0000000
--- a/frontend/src/components/ChannelList.jsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { PlusCircle } from '../assets/icons';
-import './ChannelList.css';
-
-function ChannelList(props) {
- const sortChannelsAlpha = () => {
- let keys = Object.keys(props.channels);
- // let sorted = [...props.channels].sort((a, b) =>
- // a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1
- // );
-
- let sorted = [...keys].sort((a, b) =>
- props.channels[a].name.toLowerCase() > props.channels[b].name.toLowerCase() ? 1 : -1
- );
- return sorted;
- };
-
- return (
-
-
Channels
-
- {sortChannelsAlpha().map((channel, index) => (
-
-
-
- ))}
-
- {/*
*/}
-
- );
-}
-
-export default ChannelList;
diff --git a/frontend/src/components/ChatBot.css b/frontend/src/components/ChatBot.css
deleted file mode 100644
index 6b879db..0000000
--- a/frontend/src/components/ChatBot.css
+++ /dev/null
@@ -1,64 +0,0 @@
-.chat-bot-error {
- border: 1px solid red;
- box-sizing: border-box;
- color: red;
- font-family: monospace;
- font-size: 16px;
- padding: 5px;
- text-align: center;
- width: 100%;
-}
-
-.chat-bot-modal {
- align-items: left;
- display: flex;
- flex-direction: column;
- height: 100%;
- justify-content: center;
- width: 100%;
-}
-
-.chat-bot-setting {
- align-items: start;
- display: flex;
- flex-direction: column;
- padding-top: 10px;
- width: 100%;
-}
-
-.chat-bot-setting-label {
- color: white;
- font-family: sans-serif;
- font-size: 20px;
- padding-bottom: 5px;
- width: 100%;
-}
-
-.chat-bot-setting-input {
- border: none;
- border-radius: 5px;
- box-sizing: border-box;
- font-family: monospace;
- font-size: 16px;
- outline: none;
- padding: 10px;
- resize: none;
- width: 100%;
-}
-
-.chat-bot-description {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: start;
- padding-top: 10px;
- width: 100%;
-}
-
-.chat-bot-description-label {
- color: white;
- font-family: sans-serif;
- font-size: 20px;
- padding-bottom: 5px;
- padding-right: 5px;
-}
\ No newline at end of file
diff --git a/frontend/src/components/ChatBot.jsx b/frontend/src/components/ChatBot.jsx
deleted file mode 100644
index 2296f3a..0000000
--- a/frontend/src/components/ChatBot.jsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import { useEffect, useState } from 'react';
-import { Modal, SmallModal } from './Modal';
-import { LoginChatBot, UpdateChatBotUrl } from '../../wailsjs/go/main/App';
-
-import './ChatBot.css';
-
-export function ChatBotModal(props) {
- const [error, setError] = useState('');
- const [loggedIn, setLoggedIn] = useState(props.loggedIn);
- const [password, setPassword] = useState('');
- const [saving, setSaving] = useState(false);
- const updatePassword = (event) => setPassword(event.target.value);
- const [url, setUrl] = useState(props.streamUrl);
- const updateUrl = (event) => setUrl(event.target.value);
- const [username, setUsername] = useState(props.username);
- const updateUsername = (event) => setUsername(event.target.value);
-
- useEffect(() => {
- if (saving) {
- // let user = username;
- // let p = password;
- // let u = url;
- // props.onSubmit(user, p, u);
- // NewChatBot(props.cid, username, password, url)
- if (loggedIn) {
- UpdateChatBotUrl(props.cid, url)
- .then(() => {
- reset();
- props.onUpdate(url);
- })
- .catch((error) => {
- setSaving(false);
- setError(error);
- console.log('Error updating chat bot:', error);
- });
- } else {
- LoginChatBot(props.cid, username, password, url)
- .then(() => {
- reset();
- props.onLogin();
- })
- .catch((error) => {
- setSaving(false);
- setError(error);
- console.log('Error creating new chat bot:', error);
- });
- }
- }
- }, [saving]);
-
- const reset = () => {
- setError('');
- setLoggedIn(false);
- setPassword('');
- setSaving(false);
- setUrl('');
- setUsername('');
- };
-
- const close = () => {
- reset();
- props.onClose();
- };
-
- const logout = () => {
- reset();
- props.onLogout();
- };
-
- const submit = () => {
- if (username === '') {
- setError('Add username');
- return;
- }
-
- if (password === '' && !loggedIn) {
- setError('Add password');
- return;
- }
-
- if (url === '') {
- setError('Add stream URL');
- return;
- }
-
- setSaving(true);
- // let user = username;
- // let p = password;
- // let u = url;
- // reset();
- // props.onSubmit(user, p, u);
- };
-
- return (
- <>
- {
- console.log('Saving');
- }
- : submit
- }
- title={'Chat Bot'}
- >
-
- {loggedIn ? (
-
- Logged in:
-
- {username}
-
-
- ) : (
-
- Username
-
-
- )}
- {!loggedIn && (
-
- Password
-
-
- )}
-
- Stream URL
-
-
-
-
- setError('')}
- show={error !== ''}
- style={{ minWidth: '300px', maxWidth: '300px', maxHeight: '100px' }}
- title={'Error'}
- message={error}
- submitButton={'OK'}
- onSubmit={() => setError('')}
- />
- >
- );
-}
-
-export function StreamChatMessageItem() {}
diff --git a/frontend/src/components/ChatMessage.css b/frontend/src/components/ChatMessage.css
deleted file mode 100644
index 5e5a270..0000000
--- a/frontend/src/components/ChatMessage.css
+++ /dev/null
@@ -1,44 +0,0 @@
-.chat-message {
- align-items: start;
- background-color: rgba(6,23,38,1);
- padding: 10px;
- display: flex;
- flex-direction: row;
-}
-
-.chat-message-user-image {
- border-radius: 50%;
- height: 22px;
- margin-right: 8px;
- width: 22px;
-}
-
-.chat-message-user-initial {
- align-items: center;
- background-color: #37c;
- border: 1px solid #eee;
- border-radius: 50%;
- color: #eee;
- display: flex;
- font-family: sans-serif;
- font-size: 12px;
- font-weight: bold;
- height: 22px;
- justify-content: center;
- margin-right: 8px;
- width: 22px;
-}
-
-.chat-message-username {
- color: white;
- font-family: sans-serif;
- font-size: 14px;
- font-weight: bold;
- margin-right: 3px;
-}
-
-.chat-message-text {
- color: white;
- font-family: sans-serif;
- font-size: 14px;
-}
\ No newline at end of file
diff --git a/frontend/src/components/ChatMessage.jsx b/frontend/src/components/ChatMessage.jsx
deleted file mode 100644
index ca18b71..0000000
--- a/frontend/src/components/ChatMessage.jsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import './ChatMessage.css';
-
-function ChatMessage(props) {
- const upperInitial = () => {
- return props.message.username[0].toUpperCase();
- };
-
- return (
-
- {props.message.image === '' || props.message.image === undefined ? (
-
{upperInitial()}
- ) : (
-
- )}
-
-
- {props.message.username}
-
- {props.message.text}
-
-
- );
-}
-
-export default ChatMessage;
diff --git a/frontend/src/components/Highlight.css b/frontend/src/components/Highlight.css
deleted file mode 100644
index 8a67f50..0000000
--- a/frontend/src/components/Highlight.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.highlight {
- align-items: start;
- color: white;
- display: flex;
- background-color: #75a54b;
- border-radius: 0.5rem;
- flex-direction: column;
- font-family: sans-serif;
- font-weight: bold;
- height: 40px;
- justify-content: center;
- min-width: 90px;
- padding: 5px 10px;
- width: 75px;
-}
-
-.highlight-value {
- font-family: monospace;
- font-size: 20px;
-}
-
-.highlight-description {
- font-size: 12px;
-}
\ No newline at end of file
diff --git a/frontend/src/components/Highlight.jsx b/frontend/src/components/Highlight.jsx
deleted file mode 100644
index 3d00a63..0000000
--- a/frontend/src/components/Highlight.jsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import './Highlight.css';
-
-function Highlight(props) {
- const countString = () => {
- switch (true) {
- case props.value <= 0:
- return '-';
- case props.value < 1000:
- return props.value;
- case props.value < 1000000:
- return (props.value / 1000).toFixed(3).slice(0, -2) + 'K';
- case props.value < 1000000000:
- return (props.value / 1000000).toFixed(6).slice(0, -5) + 'M';
- default:
- return 'Inf';
- }
- };
-
- const stopwatchString = () => {
- if (isNaN(Date.parse(props.value))) {
- return '--:--';
- }
- let now = new Date();
- let date = new Date(props.value);
- let diff = now - date;
-
- let msMinute = 1000 * 60;
- let msHour = msMinute * 60;
- let msDay = msHour * 24;
-
- let days = Math.floor(diff / msDay);
- let hours = Math.floor((diff - days * msDay) / msHour);
- let minutes = Math.floor((diff - days * msDay - hours * msHour) / msMinute);
-
- if (diff >= 100 * msDay) {
- return days + 'd';
- }
- if (diff >= msDay) {
- return days + 'd ' + hours + 'h';
- }
-
- if (hours < 10) {
- hours = '0' + hours;
- }
-
- if (minutes < 10) {
- minutes = '0' + minutes;
- }
-
- return hours + ':' + minutes;
- };
-
- const valueString = () => {
- switch (props.type) {
- case 'count':
- return countString();
- case 'stopwatch':
- return stopwatchString();
- default:
- return props.value;
- }
- };
-
- return (
-
- {valueString()}
- {props.description}
-
- );
-}
-
-export default Highlight;
diff --git a/frontend/src/components/Modal.css b/frontend/src/components/Modal.css
deleted file mode 100644
index d4da5b4..0000000
--- a/frontend/src/components/Modal.css
+++ /dev/null
@@ -1,176 +0,0 @@
-
-.modal-background {
- align-items: center;
- background-color: transparent;
- display: flex;
- height: 100vh;
- justify-content: center;
- left: 0;
- position: absolute;
- top: 0;
- width: 100vw;
-}
-
-.modal-body {
- align-items: center;
- display: flex;
- height: 80%;
- justify-content: center;
- width: 100%;
-}
-
-.modal-button {
- background-color: #85c742;
- border: none;
- border-radius: 5px;
- color: #061726;
- cursor: pointer;
- font-size: 18px;
- font-weight: bold;
- text-decoration: none;
- /* width: 20%; */
- width: 70px;
-}
-
-.modal-button-cancel {
- background-color: transparent;
- border: 1px solid #495a6a;
- border-radius: 5px;
- color: #495a6a;
- cursor: pointer;
- font-size: 18px;
- font-weight: bold;
- text-decoration: none;
- /* width: 20%; */
- width: 70px;
-}
-
-.modal-button-delete {
- background-color: transparent;
- border: 1px solid red;
- border-radius: 5px;
- color: red;
- cursor: pointer;
- font-size: 18px;
- font-weight: bold;
- text-decoration: none;
- /* width: 20%; */
- width: 70px;
-}
-
-.modal-close {
- align-items: center;
- background-color: transparent;
- border: none;
- display: flex;
- flex-direction: center;
- padding: 0px;
-}
-
-.modal-close:hover {
- cursor: pointer;
-}
-
-.modal-close-icon {
- height: 24px;
- padding: 0px;
- width: 24px;
-}
-
-.modal-container {
- align-items: center;
- background-color: rgba(6,23,38,1);
- border: 1px solid #495a6a;
- border-radius: 15px;
- color: black;
- display: flex;
- flex-direction: column;
- height: 50%;
- justify-content: space-between;
- opacity: 1;
- padding: 10px 20px;
- width: 50%;
-}
-
-.modal-footer {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 10%;
- width: 100%;
-}
-
-.modal-header {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 10%;
- width: 100%;
-}
-
-.modal-title {
- color: white;
- font-family: sans-serif;
- font-size: 24px;
-}
-
-.small-modal-button-delete {
- background-color: red;
- border: none;
- border-radius: 5px;
- color: white;
- cursor: pointer;
- font-size: 18px;
- font-weight: bold;
- text-decoration: none;
- /* width: 20%; */
- width: 70px;
-}
-
-.small-modal-container {
- align-items: center;
- /* background-color: rgba(6,23,38,1); */
- background-color: white;
- border: 1px solid #495a6a;
- /* border: 1px solid black; */
- border-radius: 15px;
- color: black;
- display: flex;
- flex-direction: column;
- height: 50%;
- justify-content: space-between;
- opacity: 1;
- padding: 10px 20px;
- width: 50%;
-}
-
-.small-modal-header {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 10%;
- width: 100%;
-}
-
-.small-modal-footer {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 20%;
- width: 100%;
-}
-
-.small-modal-message {
- font-family: sans-serif;
- font-size: 18px;
-}
-
-.small-modal-title {
- color: black;
- font-family: sans-serif;
- font-size: 24px;
-}
\ No newline at end of file
diff --git a/frontend/src/components/Modal.jsx b/frontend/src/components/Modal.jsx
deleted file mode 100644
index 1be4fe8..0000000
--- a/frontend/src/components/Modal.jsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import { XLg } from '../assets/icons';
-import './Modal.css';
-
-export function Modal(props) {
- return (
-
-
event.stopPropagation()}
- style={props.style}
- >
-
-
{props.title}
-
-
-
{props.children}
-
- {props.cancelButton && (
-
- )}
- {props.deleteButton && (
-
- )}
- {props.submitButton && (
-
- )}
-
-
-
- );
-}
-
-export function SmallModal(props) {
- return (
-
-
event.stopPropagation()}
- style={props.style}
- >
-
-
{props.title}
-
-
-
- {props.message}
-
-
- {props.cancelButton && (
-
- )}
- {props.deleteButton && (
-
- )}
- {props.submitButton && (
-
- )}
-
-
-
- );
-}
diff --git a/frontend/src/components/StreamActivity.css b/frontend/src/components/StreamActivity.css
deleted file mode 100644
index 7010da7..0000000
--- a/frontend/src/components/StreamActivity.css
+++ /dev/null
@@ -1,24 +0,0 @@
-.stream-activity {
- width: 100%;
- height: 100%;
-}
-
-.stream-activity-header {
- text-align: left;
- background-color: rgba(6,23,38,1);
- border-bottom: 1px solid #495a6a;
- height: 19px;
- padding: 10px 20px;
-}
-
-.stream-activity-title {
- color: white;
- font-family: sans-serif;
- font-size: 12px;
- font-weight: bold;
-}
-
-.stream-activity-list {
- overflow-y: auto;
- height: calc(100vh - 84px - 40px - 179px);
-}
\ No newline at end of file
diff --git a/frontend/src/components/StreamActivity.jsx b/frontend/src/components/StreamActivity.jsx
deleted file mode 100644
index 30f48f0..0000000
--- a/frontend/src/components/StreamActivity.jsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import StreamEvent from './StreamEvent';
-
-import './StreamActivity.css';
-
-function StreamActivity(props) {
- return (
-
-
- {props.title}
-
-
- {props.events.map((event, index) => (
-
- ))}
-
-
- );
-}
-
-export default StreamActivity;
diff --git a/frontend/src/components/StreamChat.css b/frontend/src/components/StreamChat.css
deleted file mode 100644
index e75b20c..0000000
--- a/frontend/src/components/StreamChat.css
+++ /dev/null
@@ -1,28 +0,0 @@
-.stream-chat {
- width: 100%;
- height: 100%;
-}
-
-.stream-chat-header {
- align-items: center;
- background-color: rgba(6,23,38,1);
- border-bottom: 1px solid #495a6a;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 19px;
- padding: 10px 20px;
- text-align: left;
-}
-
-.stream-chat-list {
- overflow-y: auto;
- height: calc(100vh - 84px - 40px - 179px);
-}
-
-.stream-chat-title {
- color: white;
- font-family: sans-serif;
- font-size: 12px;
- font-weight: bold;
-}
\ No newline at end of file
diff --git a/frontend/src/components/StreamChat.jsx b/frontend/src/components/StreamChat.jsx
deleted file mode 100644
index 3414bb7..0000000
--- a/frontend/src/components/StreamChat.jsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { useState } from 'react';
-import { EventsOn } from '../../wailsjs/runtime/runtime';
-import ChatMessage from './ChatMessage';
-import './StreamChat.css';
-
-function StreamChat(props) {
- const [messages, setMessages] = useState([
- {
- color: '#ec131f',
- image: 'https://ak2.rmbl.ws/z0/V/m/v/E/VmvEe.asF.4-18osof-s35kf7.jpeg',
- username: 'tylertravisty',
- text: 'Hello, world this is si s a a sdf asd f',
- },
- {
- username: 'tylertravisty',
- text: 'Another chat message',
- },
- ]);
-
- EventsOn('ChatMessage', (msg) => {
- setMessages(...messages, msg);
- });
-
- return (
-
-
- {props.title}
-
-
- {messages.map((message, index) => (
-
- ))}
-
-
- );
-}
-
-export default StreamChat;
diff --git a/frontend/src/components/StreamChatBot.css b/frontend/src/components/StreamChatBot.css
deleted file mode 100644
index 3526c82..0000000
--- a/frontend/src/components/StreamChatBot.css
+++ /dev/null
@@ -1,104 +0,0 @@
-.stream-chatbot {
- width: 100%;
- height: 100%;
-}
-
-.stream-chatbot-button {
- align-items: center;
- border: none;
- display: flex;
- justify-content: center;
- padding: 0px;
-}
-
-.stream-chatbot-button:hover {
- cursor: pointer;
-}
-
-.stream-chatbot-button-title {
- background-color: rgba(6,23,38,1);
-}
-
-.stream-chatbot-button-chat {
- align-items: center;
- background-color: #000312;
- display: flex;
- justify-content: center;
- width: 10%;
-}
-
-.stream-chatbot-icon {
- height: 24px;
- width: 24px;
-}
-
-.stream-chatbot-controls {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- width: 55px;
-}
-
-.stream-chatbot-header {
- align-items: center;
- background-color: rgba(6,23,38,1);
- border-bottom: 1px solid #495a6a;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- height: 19px;
- padding: 10px 20px;
- text-align: left;
-}
-
-.stream-chatbot-item {
- border-bottom: 1px solid #82b1ff;
- box-sizing: border-box;
- color: white;
- display: flex;
- flex-direction: row;
- font-family: sans-serif;
- justify-content: space-between;
- padding: 10px 20px;
- width: 100%;
-}
-
-.stream-chatbot-item-sender {
- align-items: center;
- box-sizing: border-box;
- display: flex;
- justify-content: left;
- padding-left: 10px;
- width: 20%;
-}
-
-.stream-chatbot-item-interval {
- align-items: center;
- box-sizing: border-box;
- display: flex;
- justify-content: left;
- padding-left: 10px;
- width: 20%;
-}
-
-.stream-chatbot-item-message {
- align-items: center;
- display: flex;
- justify-content: left;
- overflow: hidden;
- white-space: nowrap;
- width: 50%;
-}
-
-.stream-chatbot-list {
- overflow-y: auto;
- height: calc(100vh - 84px - 40px - 179px);
-}
-
-.stream-chatbot-title {
- color: white;
- font-family: sans-serif;
- font-size: 12px;
- font-weight: bold;
-}
\ No newline at end of file
diff --git a/frontend/src/components/StreamChatBot.jsx b/frontend/src/components/StreamChatBot.jsx
deleted file mode 100644
index 814b119..0000000
--- a/frontend/src/components/StreamChatBot.jsx
+++ /dev/null
@@ -1,237 +0,0 @@
-import { useEffect, useState } from 'react';
-import { FilepathBase, StartChatBotMessage, StopChatBotMessage } from '../../wailsjs/go/main/App';
-import { EventsOn } from '../../wailsjs/runtime/runtime';
-import { GearFill, Pause, Play, PlayGreen, PlusCircle, Stop } from '../assets/icons';
-import './StreamChatBot.css';
-import { SmallModal } from './Modal';
-
-function StreamChatBot(props) {
- const sortChatsAlpha = () => {
- let keys = Object.keys(props.chats);
-
- let sorted = [...keys].sort((a, b) =>
- props.chats[a].text.toLowerCase() > props.chats[b].text.toLowerCase() ? 1 : -1
- );
- return sorted;
- };
-
- return (
-
-
-
{props.title}
-
-
-
-
-
-
-
-
-
-
- {sortChatsAlpha().map((chat, index) => (
-
- ))}
-
-
- );
-}
-
-export default StreamChatBot;
-
-function StreamChatItem(props) {
- // const [active, setActive] = useState(props.isMessageActive(props.chat.id));
- const [active, setActive] = useState(false);
- const [error, setError] = useState('');
- const [filename, setFilename] = useState(props.chat.text_file);
-
- useEffect(() => {
- if (props.chat.text_file !== '') {
- FilepathBase(props.chat.text_file).then((name) => {
- setFilename(name);
- });
- }
- // setActive(props.isMessageActive(props.chat.id));
- }, [props]);
-
- const changeActive = (bool) => {
- // console.log('ChangeActive:', bool);
- // props.chat.active = bool;
- // props.activateMessage(props.chat.id, bool);
- setActive(bool);
- };
-
- useEffect(() => {
- EventsOn('ChatBotCommandActive-' + props.chat.id, (mid) => {
- console.log('ChatBotCommandActive', props.chat.id, mid);
- if (mid === props.chat.id) {
- changeActive(true);
- }
- });
-
- EventsOn('ChatBotCommandError-' + props.chat.id, (mid) => {
- console.log('ChatBotCommandError', props.chat.id, mid);
- if (mid === props.chat.id) {
- changeActive(false);
- }
- });
-
- EventsOn('ChatBotMessageActive-' + props.chat.id, (mid) => {
- console.log('ChatBotMessageActive', props.chat.id, mid);
- if (mid === props.chat.id) {
- changeActive(true);
- }
- });
-
- EventsOn('ChatBotMessageError-' + props.chat.id, (mid) => {
- console.log('ChatBotMessageError', props.chat.id, mid);
- if (mid === props.chat.id) {
- changeActive(false);
- }
- });
- }, []);
-
- const prependZero = (value) => {
- if (value < 10) {
- return '0' + value;
- }
-
- return '' + value;
- };
-
- const printInterval = (interval) => {
- let hours = Math.floor(interval / 3600);
- let minutes = Math.floor(interval / 60 - hours * 60);
- let seconds = Math.floor(interval - hours * 3600 - minutes * 60);
-
- // hours = prependZero(hours);
- // minutes = prependZero(minutes);
- // seconds = prependZero(seconds);
- // return hours + ':' + minutes + ':' + seconds;
-
- return hours + 'h ' + minutes + 'm ' + seconds + 's';
- };
-
- const intervalToTimer = (interval) => {
- let hours = Math.floor(interval / 3600);
- let minutes = Math.floor(interval / 60 - hours * 60);
- let seconds = Math.floor(interval - hours * 3600 - minutes * 60);
-
- if (minutes !== 0) {
- seconds = prependZero(seconds);
- }
- if (hours !== 0) {
- minutes = prependZero(minutes);
- }
- if (hours === 0) {
- hours = '';
- if (minutes === 0) {
- minutes = '';
- if (seconds === 0) {
- seconds = '';
- }
- }
- }
-
- return hours + minutes + seconds;
- };
-
- const openChat = () => {
- props.onItemClick({
- id: props.chat.id,
- as_channel: props.chat.as_channel,
- command: props.chat.command,
- interval: intervalToTimer(props.chat.interval),
- on_command: props.chat.on_command,
- on_command_follower: props.chat.on_command_follower,
- on_command_rant_amount: props.chat.on_command_rant_amount,
- on_command_subscriber: props.chat.on_command_subscriber,
- text: props.chat.text,
- text_file: props.chat.text_file,
- });
- };
-
- const startMessage = () => {
- StartChatBotMessage(props.chat.id)
- .then(() => {
- changeActive(true);
- })
- .catch((error) => {
- setError(error);
- });
- };
-
- const stopMessage = () => {
- StopChatBotMessage(props.chat.id).then(() => {
- changeActive(false);
- });
- };
-
- return (
- <>
- setError('')}
- show={error !== ''}
- style={{ minWidth: '300px', maxWidth: '200px', maxHeight: '200px' }}
- title={'Error'}
- message={error}
- submitButton={'OK'}
- onSubmit={() => setError('')}
- />
- openChat()}>
-
- {props.chat.text_file !== '' ? filename : props.chat.text}
-
-
- {props.chat.on_command
- ? props.chat.command
- : printInterval(props.chat.interval)}
-
-
- {props.chat.as_channel ? 'Channel' : 'User'}
-
-
-
- >
- );
-}
diff --git a/frontend/src/components/StreamChatMessage.css b/frontend/src/components/StreamChatMessage.css
deleted file mode 100644
index edfcc30..0000000
--- a/frontend/src/components/StreamChatMessage.css
+++ /dev/null
@@ -1,358 +0,0 @@
-/* .modal-chat {
- align-items: center;
- background-color: red;
- color: black;
- display: flex;
- height: 50%;
- justify-content: center;
- opacity: 1;
- width: 50%;
-}
-
-.modal-container {
- align-items: center;
- display: flex;
- height: 100vh;
- justify-content: center;
- left: 0;
- position: absolute;
- top: 0;
- width: 100vw;
-} */
-
-.chat-toggle {
- align-items: center;
- display: flex;
- justify-content: space-between;
- padding-top: 10px;
- width: 100%;
-}
-
-.chat-toggle-label {
- color: white;
- font-family: sans-serif;
- padding-right: 10px;
-}
-
-.chat-command {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: center;
- padding-top: 10px;
- width: 100%;
-}
-
-.chat-command-input {
- border: none;
- border-radius: 34px;
- box-sizing: border-box;
- font-family: monospace;
- font-size: 16px;
- outline: none;
- padding: 5px 10px 5px 10px;
- text-align: center;
- width: 100%;
-}
-
-.chat-command-option {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: center;
-}
-
-.chat-command-options {
- align-items: center;
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
-}
-
-.chat-command-label {
- color: white;
- height: 29px;
-}
-
-.chat-command-rant-amount {
- border: none;
- /* border-radius: 34px; */
- box-sizing: border-box;
- font-family: monospace;
- font-size: 16px;
- outline: none;
- /* padding: 5px 10px 5px 10px; */
- padding: 5px;
- text-align: center;
-}
-
-.chat-command-rant-amount-label {
- color: white;
- font-family: sans-serif;
- padding-right: 10px;
-}
-
-.chat-command-rant-amount-symbol {
- color: white;
- font-family: sans-serif;
- font-size: 20px;
- padding-right: 1px;
-}
-
-.chat-interval {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- padding-top: 10px;
- width: 100%;
-}
-
-.chat-interval-input {
- border: none;
- border-radius: 34px;
- box-sizing: border-box;
- font-family: monospace;
- font-size: 16px;
- outline: none;
- padding: 5px 10px 5px 10px;
- text-align: right;
-}
-
-.chat-interval-input-zero::placeholder {
- text-align: center;
-}
-
-.chat-interval-input-value::placeholder {
- color: black;
- opacity: 1;
- text-align: center;
-}
-
-.chat-interval-label {
- color: white;
- font-family: sans-serif;
- padding-right: 10px;
-}
-
-.chat-options {
- display: flex;
- flex-direction: column;
- width: 100%;
-}
-
-.stream-chat-message {
- align-items: center;
- color: white;
- display: flex;
- flex-direction: column;
- font-family: sans-serif;
- justify-content: start;
- width: 100%;
-}
-
-.stream-chat-message-error {
- border: 1px solid red;
- box-sizing: border-box;
- color: red;
- font-family: monospace;
- font-size: 16px;
- padding: 5px;
- text-align: center;
- width: 100%;
-}
-
-.stream-chat-message-label {
- padding: 5px 0px;
- /* width: 50%; */
-}
-
-.stream-chat-message-modal {
- align-items: left;
- display: flex;
- flex-direction: column;
- height: 100%;
- justify-content: center;
- width: 100%;
-}
-
-.stream-chat-message-textarea {
- border: none;
- border-radius: 5px;
- box-sizing: border-box;
- font-family: monospace;
- font-size: 16px;
- outline: none;
- padding: 10px;
- resize: none;
- width: 100%;
-}
-
-.stream-chat-message-title {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- width: 100%;
-}
-
-.stream-chat-message-title-right {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: center;
-}
-
-.chat-toggle-switch {
- position: relative;
- display: inline-block;
- width: 50px;
- height: 24px;
-}
-
-.chat-toggle-switch input {
- opacity: 0;
- width: 0;
- height: 0;
-}
-
-.chat-toggle-slider {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #495a6a;
- -webkit-transition: .4s;
- transition: .4s;
-}
-
-.chat-toggle-slider:before {
- position: absolute;
- content: "";
- height: 16px;
- width: 16px;
- left: 4px;
- bottom: 4px;
- background-color: white;
- -webkit-transition: .4s;
- transition: .4s;
-}
-
-input:checked + .chat-toggle-slider {
- background-color: #85c742;
-}
-
-input:checked + .chat-toggle-slider:before {
- -webkit-transform: translateX(26px);
- -ms-transform: translateX(26px);
- transform: translateX(26px);
-}
-/* Rounded sliders */
-.chat-toggle-slider.round {
- border-radius: 34px;
-}
-
-.chat-toggle-slider.round:before {
- border-radius: 50%;
-}
-
-.chat-toggle-check-container {
- display: block;
- position: relative;
- padding-left: 16px;
- margin-bottom: 15px;
- cursor: pointer;
- font-size: 15px;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.chat-toggle-check-container input {
- position: absolute;
- opacity: 0;
- cursor: pointer;
- height: 0;
- width: 0;
-}
-
-.chat-toggle-check {
- border-radius: 3px;
- position: absolute;
- top: 0;
- left: 0;
- height: 15px;
- width: 15px;
- background-color: #495a6a;
-}
-
-.chat-toggle-check-container:hover input ~ .chat-toggle-check {
- background-color: #495a6a;
-}
-
-.chat-toggle-check-container input:checked ~ .chat-toggle-check {
- background-color: #85c742;
-}
-
-.chat-toggle-check:after {
- content: "";
- position: absolute;
- display: none;
-}
-
-.chat-toggle-check-container input:checked ~ .chat-toggle-check:after {
- display: block;
-}
-
-.chat-toggle-check-container .chat-toggle-check:after {
- left: 4px;
- top: 1px;
- width: 4px;
- height: 8px;
- border: solid white;
- border-width: 0 3px 3px 0;
- -webkit-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- transform: rotate(45deg);
-}
-
-.chat-toggle-check-label {
- color: white;
- font-family: sans-serif;
- padding-right: 5px;
-}
-
-.choose-file {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- width: 100%;
-}
-
-.choose-file-button-box {
- min-width: 100px;
- width: 100px;
-}
-
-.choose-file-button {
- background-color: #85c742;
- border: none;
- border-radius: 5px;
- color: #061726;
- cursor: pointer;
- font-size: 16px;
- text-decoration: none;
- /* width: 200px; */
- width: 100%;
-}
-
-.choose-file-path {
- overflow: scroll;
- margin-left: 5px;
- white-space: nowrap;
-}
-
diff --git a/frontend/src/components/StreamChatMessage.jsx b/frontend/src/components/StreamChatMessage.jsx
deleted file mode 100644
index 774b0b6..0000000
--- a/frontend/src/components/StreamChatMessage.jsx
+++ /dev/null
@@ -1,404 +0,0 @@
-import { useEffect, useState } from 'react';
-
-import { Modal, SmallModal } from './Modal';
-
-import { OpenFileDialog } from '../../wailsjs/go/main/App';
-
-import './StreamChatMessage.css';
-
-export function StreamChatMessageModal(props) {
- const [asChannel, setAsChannel] = useState(props.asChannel);
- const [chatCommand, setChatCommand] = useState(props.chatCommand);
- const [error, setError] = useState('');
- const [onCommand, setOnCommand] = useState(props.onCommand);
- const [onCommandFollower, setOnCommandFollower] = useState(props.onCommandFollower);
- const [onCommandRantAmount, setOnCommandRantAmount] = useState(props.onCommandRantAmount);
- const [onCommandSubscriber, setOnCommandSubscriber] = useState(props.onCommandSubscriber);
- const [openDelete, setOpenDelete] = useState(false);
- const [readFromFile, setReadFromFile] = useState(false);
- const [text, setText] = useState(props.text);
- const [textFile, setTextFile] = useState(props.textFile);
- const updateText = (event) => setText(event.target.value);
- const [timer, setTimer] = useState(props.interval);
-
- useEffect(() => {
- console.log('update chat');
- setAsChannel(props.asChannel);
- setOnCommand(props.onCommand);
- setOnCommandFollower(props.onCommandFollower);
- setOnCommandSubscriber(props.onCommandSubscriber);
- setOnCommandRantAmount(props.onCommandRantAmount);
- setError('');
- setReadFromFile(props.textFile !== '');
- setText(props.text);
- setTextFile(props.textFile);
- setTimer(props.interval);
- }, []);
-
- const reset = () => {
- setAsChannel(false);
- setChatCommand(false);
- setError('');
- setReadFromFile(false);
- setText('');
- setTextFile('');
- setOnCommand(false);
- setOnCommandFollower(false);
- setOnCommandSubscriber(false);
- setOnCommandRantAmount(0);
- setTimer('');
- };
-
- const close = () => {
- reset();
- props.onClose();
- };
-
- const submit = () => {
- if (!readFromFile && text === '') {
- setError('Add message');
- return;
- }
-
- if (readFromFile && textFile === '') {
- setError('Select file containing messages');
- return;
- }
-
- if (timer === '') {
- setError('Set timer');
- return;
- }
-
- if (onCommand && chatCommand === '') {
- setError('Add command');
- return;
- }
-
- let message = {
- id: props.chatID,
- as_channel: asChannel,
- command: chatCommand,
- interval: timerToInterval(),
- on_command: onCommand,
- on_command_follower: onCommandFollower,
- on_command_rant_amount: onCommandRantAmount,
- on_command_subscriber: onCommandSubscriber,
- text: text,
- text_file: textFile,
- };
-
- props.onSubmit(message);
- };
-
- const deleteMessage = () => {
- if (props.chatID === '') {
- close();
- return;
- }
-
- setOpenDelete(true);
- };
-
- const confirmDelete = () => {
- reset();
- setOpenDelete(false);
- props.onDelete(props.chatID);
- };
-
- const updateChatCommand = (e) => {
- let command = e.target.value;
-
- if (command.length === 1) {
- if (command !== '!') {
- command = '!' + command;
- }
- }
- command = command.toLowerCase();
- let postfix = command.replace('!', '');
-
- if (postfix !== '' && !/^[a-z0-9]+$/gi.test(postfix)) {
- return;
- }
-
- setChatCommand(command);
- };
-
- const updateTimerBackspace = (e) => {
- if (timer.length === 0) {
- return;
- }
-
- if (e.keyCode === 8) {
- setTimer(timer.substring(0, timer.length - 1));
- }
- };
-
- const updateTimer = (e) => {
- let nums = '0123456789';
- let digit = e.target.value;
-
- if (!nums.includes(digit)) {
- return;
- }
-
- if (timer.length === 6) {
- return;
- }
-
- if (timer.length === 0 && digit === '0') {
- return;
- }
-
- setTimer(timer + digit);
- };
-
- const timerToInterval = () => {
- let prefix = '0'.repeat(6 - timer.length);
- let t = prefix + timer;
-
- let hours = parseInt(t.substring(0, 2));
- let minutes = parseInt(t.substring(2, 4));
- let seconds = parseInt(t.substring(4, 6));
-
- return hours * 3600 + minutes * 60 + seconds;
- };
-
- const printTimer = () => {
- if (timer === '') {
- return '00:00:00';
- }
-
- let prefix = '0'.repeat(6 - timer.length);
- let t = prefix + timer;
-
- return t.substring(0, 2) + ':' + t.substring(2, 4) + ':' + t.substring(4, 6);
- };
-
- const checkChannelToggle = (e) => {
- setAsChannel(e.target.checked);
- };
-
- const checkCommandToggle = (e) => {
- setOnCommand(e.target.checked);
- };
-
- const checkCommandFollower = (e) => {
- setOnCommandFollower(e.target.checked);
- };
-
- const checkCommandSubscriber = (e) => {
- setOnCommandSubscriber(e.target.checked);
- };
-
- const updateRantAmount = (e) => {
- let amount = parseInt(e.target.value);
- if (isNaN(amount)) {
- amount = 0;
- }
-
- setOnCommandRantAmount(amount);
- };
-
- const checkReadFromFile = (e) => {
- setReadFromFile(e.target.checked);
- if (!e.target.checked) {
- setTextFile('');
- }
- };
-
- const chooseFile = () => {
- OpenFileDialog()
- .then((filepath) => {
- if (filepath !== '') {
- setTextFile(filepath);
- }
- })
- .catch((error) => setError(error));
- };
-
- return (
- <>
-
-
-
- {/* {error &&
{error}} */}
-
-
Message
-
- Read from file
-
-
-
- {readFromFile ? (
-
-
-
-
-
{textFile}
-
- ) : (
-
- )}
-
-
-
-
- {onCommand ? 'Command timeout' : 'Chat interval'}
-
-
-
-
- Chat as channel
-
-
-
- Chat on command
-
-
- {onCommand ? (
-
-
-
-
-
-
- Followers only
-
-
-
- Subscribers only
-
-
-
-
- Minimum rant amount
-
-
-
- $
-
-
-
-
-
-
- ) : (
-
- {'\u00A0'}
-
- )}
-
-
-
- setOpenDelete(false)}
- show={openDelete}
- style={{ minWidth: '300px', maxWidth: '200px', maxHeight: '200px' }}
- cancelButton={'Cancel'}
- onCancel={() => setOpenDelete(false)}
- deleteButton={'Delete'}
- message={
- 'Are you sure you want to delete this message? You cannot undo this action.'
- }
- onDelete={confirmDelete}
- title={'Delete Message'}
- />
- setError('')}
- show={error !== ''}
- style={{ minWidth: '300px', maxWidth: '300px', maxHeight: '100px' }}
- title={'Error'}
- message={error}
- submitButton={'OK'}
- onSubmit={() => setError('')}
- />
- >
- );
-}
-
-export function StreamChatMessageItem() {}
diff --git a/frontend/src/components/StreamEvent.css b/frontend/src/components/StreamEvent.css
deleted file mode 100644
index 0347ea4..0000000
--- a/frontend/src/components/StreamEvent.css
+++ /dev/null
@@ -1,42 +0,0 @@
-.stream-event {
- border-bottom: 1px solid #82b1ff;
- color: white;
- display: flex;
- flex-direction: row;
- font-family: sans-serif;
- justify-content: space-between;
- padding: 10px 20px;
-}
-
-.stream-event-left {
- align-items: center;
- display: flex;
- flex-direction: row;
-}
-
-.stream-event-icon {
- width: 20px;
- height: 20px;
- padding-right: 10px;
-}
-
-.stream-event-left-text {
- display: flex;
- flex-direction: column;
-}
-
-.stream-event-username {
- font-size: 14px;
- font-weight: bold;
-}
-
-.stream-event-description {
- color: #88a0b8;
- font-size: 14px;
-}
-
-.stream-event-date {
- align-items: center;
- display: flex;
- font-family: monospace;
-}
diff --git a/frontend/src/components/StreamEvent.jsx b/frontend/src/components/StreamEvent.jsx
deleted file mode 100644
index ef12103..0000000
--- a/frontend/src/components/StreamEvent.jsx
+++ /dev/null
@@ -1,111 +0,0 @@
-import { Heart, Star } from '../assets/icons';
-
-import './StreamEvent.css';
-
-function StreamEvent(props) {
- const dateDate = (date) => {
- const options = { month: 'short' };
- let month = new Intl.DateTimeFormat('en-US', options).format(date);
- let day = date.getDate();
- return month + ' ' + day;
- };
-
- const dateDay = (date) => {
- let now = new Date();
- let today = now.getDay();
- switch (date.getDay()) {
- case 0:
- return 'Sunday';
- case 1:
- return 'Monday';
- case 2:
- return 'Tuesday';
- case 3:
- return 'Wednesday';
- case 4:
- return 'Thursday';
- case 5:
- return 'Friday';
- case 6:
- return 'Saturday';
- }
- };
-
- const dateTime = (date) => {
- let now = new Date();
- let today = now.getDay();
- let day = date.getDay();
-
- if (today !== day) {
- return dateDay(date);
- }
-
- let hours24 = date.getHours();
- let hours = hours24 % 12 || 12;
-
- let minutes = date.getMinutes();
- if (minutes < 10) {
- minutes = '0' + minutes;
- }
-
- let mer = 'pm';
- if (hours24 < 12) {
- mer = 'am';
- }
-
- return hours + ':' + minutes + ' ' + mer;
- };
-
- const dateString = (d) => {
- if (isNaN(Date.parse(d))) {
- return 'Who knows?';
- }
-
- let now = new Date();
- let date = new Date(d);
- // Fix Rumble's timezone problem
- date.setHours(date.getHours() - 4);
- let diff = now - date;
- switch (true) {
- case diff < 0:
- return 'In the future!?';
- case diff < 60000:
- return 'Now';
- case diff < 3600000:
- let minutes = Math.floor(diff / 1000 / 60);
- let postfix = ' minutes ago';
- if (minutes == 1) {
- postfix = ' minute ago';
- }
- return minutes + postfix;
- case diff < 86400000:
- return dateTime(date);
- case diff < 604800000:
- return dateDay(date);
- default:
- return dateDate(date);
- }
- };
-
- return (
-
-
- {props.event.followed_on &&
}
- {props.event.subscribed_on &&
}
-
- {props.event.username}
-
- {props.event.followed_on && 'Followed you'}
- {props.event.subscribed_on && 'Subscribed'}
-
-
-
-
- {props.event.followed_on && dateString(props.event.followed_on)}
- {props.event.subscribed_on && dateString(props.event.subscribed_on)}
-
-
- );
-}
-
-export default StreamEvent;
diff --git a/frontend/src/components/StreamInfo.css b/frontend/src/components/StreamInfo.css
deleted file mode 100644
index 3cceb22..0000000
--- a/frontend/src/components/StreamInfo.css
+++ /dev/null
@@ -1,120 +0,0 @@
-.stream-info {
- display: flex;
- flex-direction: column;
- /* padding: 20px 0px; */
- width: 100%;
-}
-
-.stream-info-title {
- color: white;
- font-family: sans-serif;
- font-size: 20px;
- font-weight: bold;
-}
-
-.stream-info-categories {
- padding: 5px 0px;
- margin-right: 50px;
-}
-
-.stream-info-category {
- background-color: rgba(6,23,38,1);
- border: 1px solid white;
- border-radius: 30px;
- color: white;
- font-family: sans-serif;
- margin-right: 5px;
- padding: 1px 7px;
-}
-
-.stream-info-channel {
- color: white;
- font-family: sans-serif;
- font-size: 16px;
- font-weight: bold;
- padding: 5px 20px;
-}
-
-.stream-info-controls {
- align-items: center;
- border: 1px solid white;
- border-radius: 5px;
- display: flex;
- justify-content: center;
- margin: 5px 0px 20px 0px;
-}
-
-.stream-info-control {
- height: 32px;
- padding: 5px;
- width: 32px;
-}
-
-.stream-info-control-button {
- background-color: #000312;
- border-radius: 5px;
- cursor: pointer;
- border: none;
- padding: 0px;
-}
-
-.stream-info-control-button:hover {
- background-color: rgba(6,23,38,1);
-}
-
-.stream-info-footer {
- align-items: center;
- display: flex;
- justify-content: center;
-}
-
-.stream-info-likes {
- align-items: center;
- display: flex;
- flex-direction: row;
- padding: 5px 0px;
-}
-
-.stream-info-likes-count {
- color: white;
- font-family: monospace;
- font-size: 16px;
- padding: 0px 5px;
-}
-
-.stream-info-likes-left {
- align-items: center;
- display: flex;
- flex-direction: row;
- background-color: rgba(6,23,38,1);
- border: 1px solid white;
- border-radius: 10rem 0rem 0rem 10rem;
- margin-right: 1px;
-}
-.stream-info-likes-right {
- align-items: center;
- display: flex;
- flex-direction: row;
- background-color: rgba(6,23,38,1);
- border: 1px solid white;
- border-radius: 0rem 10rem 10rem 0rem;
-}
-
-.stream-info-likes-icon {
- align-items: center;
- display: flex;
- flex-direction: row;
- height: 16px;
- padding: 5px;
- width: 16px;
-}
-
-.stream-info-live {
- padding: 10px 20px 5px 20px;
-}
-
-.stream-info-subtitle {
- align-items: center;
- display: flex;
- flex-direction: row;
-}
\ No newline at end of file
diff --git a/frontend/src/components/StreamInfo.jsx b/frontend/src/components/StreamInfo.jsx
deleted file mode 100644
index a25fe9d..0000000
--- a/frontend/src/components/StreamInfo.jsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { Gear, House, Pause, Play, ThumbsDown, ThumbsUp } from '../assets/icons';
-import './StreamInfo.css';
-
-function StreamInfo(props) {
- const likesString = (likes) => {
- switch (true) {
- case likes <= 0:
- return '0';
- case likes < 1000:
- return likes;
- case likes < 1000000:
- return (likes / 1000).toFixed(3).slice(0, -2) + 'K';
- case likes < 1000000000:
- return (likes / 1000000).toFixed(6).slice(0, -5) + 'M';
- default:
- return 'Inf';
- }
- };
-
- return (
-
-
-
- {props.live ? props.title : '-'}
-
-
-
-
- {props.live ? props.categories.primary.title : 'primary'}
-
-
- {props.live ? props.categories.secondary.title : 'secondary'}
-
-
-
-
-
-
- {props.live ? likesString(props.likes) : '-'}
-
-
-
-
-
- {props.live ? likesString(props.dislikes) : '-'}
-
-
-
-
-
-
- Channel: {props.channel}
-
-
-
- );
-}
-
-export default StreamInfo;
diff --git a/frontend/src/screens/Dashboard.css b/frontend/src/screens/Dashboard.css
deleted file mode 100644
index d2ce342..0000000
--- a/frontend/src/screens/Dashboard.css
+++ /dev/null
@@ -1,72 +0,0 @@
-#Dashboard {
- align-items: center;
- background-color: #000312;
- display: flex;
- flex-direction: column;
- height: 100vh;
- width: 100%;
-}
-
-.header {
- align-items: center;
- display: flex;
- flex-direction: row;
- height: 62px;
- justify-content: center;
- padding: 10px 0px;
- width: 100%;
-}
-
-.header-left {
- width: 20%;
-}
-
-.header-right {
- width: 20%;
-}
-
-.main {
- border-bottom: 1px solid #495a6a;
- border-top: 1px solid #495a6a;
- display: flex;
- flex-direction: row;
- height: calc(100vh - 83px - 179px);
- justify-content: space-between;
- width: 100%;
-}
-
-.main-left {
- border-right: 1px solid #495a6a;
- width: 33%;
- height: 100%;
-}
-
-.main-middle {
- border-right: 1px solid #495a6a;
- width: 33%;
- height: 100%;
-}
-
-.main-right {
- width: 67%;
- height: 100%;
-}
-
-.modal {
- background-color: white;
- color: red;
- position: absolute;
- height: 100%;
- width: 100%;
- top: 0;
- left: 0;
-}
-
-.highlights {
- align-items: center;
- display: flex;
- flex-direction: row;
- justify-content: space-evenly;
- height: 50px;
- width: 60%;
-}
diff --git a/frontend/src/screens/Dashboard.jsx b/frontend/src/screens/Dashboard.jsx
deleted file mode 100644
index 166b7d9..0000000
--- a/frontend/src/screens/Dashboard.jsx
+++ /dev/null
@@ -1,449 +0,0 @@
-import { useEffect, useState } from 'react';
-import { Navigate, useLocation, useNavigate } from 'react-router-dom';
-import {
- AddChatMessage,
- ChatBotMessages,
- DeleteChatMessage,
- GetChatBot,
- NewChatBot,
- ResetChatBot,
- StartAllChatBot,
- StartApi,
- StopAllChatBot,
- StopApi,
- StopChatBotMessage,
- UpdateChatBotUrl,
- UpdateChatMessage,
-} from '../../wailsjs/go/main/App';
-
-import './Dashboard.css';
-import { EventsEmit, EventsOn } from '../../wailsjs/runtime/runtime';
-import { Heart, Star } from '../assets/icons';
-import { ChatBotModal } from '../components/ChatBot';
-import Highlight from '../components/Highlight';
-import { SmallModal } from '../components/Modal';
-import StreamEvent from '../components/StreamEvent';
-import StreamActivity from '../components/StreamActivity';
-import StreamChat from '../components/StreamChat';
-import StreamChatBot from '../components/StreamChatBot';
-import StreamInfo from '../components/StreamInfo';
-import { NavSignIn } from './Navigation';
-import { StreamChatMessageModal } from '../components/StreamChatMessage';
-
-function Dashboard() {
- const location = useLocation();
- const navigate = useNavigate();
- const [error, setError] = useState('');
- const [refresh, setRefresh] = useState(false);
- const [active, setActive] = useState(false);
- const [openChatBot, setOpenChatBot] = useState(false);
- const [chatBotMessages, setChatBotMessages] = useState({});
- const [chatBotMessagesActive, setChatBotMessagesActive] = useState({});
- const [chatBotSessionLoggedIn, setChatBotSessionLoggedIn] = useState(false);
- const [chatBotSessionStreamUrl, setChatBotSessionStreamUrl] = useState('');
- const [chatBotSessionUsername, setChatBotSessionUsername] = useState('');
- const [chatAsChannel, setChatAsChannel] = useState(false);
- const [chatCommand, setChatCommand] = useState('');
- const [chatOnCommand, setChatOnCommand] = useState(false);
- const [chatOnCommandFollower, setChatOnCommandFollower] = useState(false);
- const [chatOnCommandRantAmount, setChatOnCommandRantAmount] = useState(0);
- const [chatOnCommandSubscriber, setChatOnCommandSubscriber] = useState(false);
- const [chatID, setChatID] = useState('');
- const [chatInterval, setChatInterval] = useState('');
- const [chatText, setChatText] = useState('');
- const [chatTextFile, setChatTextFile] = useState('');
- const [openChat, setOpenChat] = useState(false);
- const [cid, setCID] = useState(location.state.cid);
- const [username, setUsername] = useState('');
- const [channelName, setChannelName] = useState('');
- const [followers, setFollowers] = useState({});
- const [totalFollowers, setTotalFollowers] = useState(0);
- const [channelFollowers, setChannelFollowers] = useState(0);
- const [recentFollowers, setRecentFollowers] = useState([]);
- const [subscribers, setSubscribers] = useState({});
- const [subscriberCount, setSubscriberCount] = useState(0);
- const [recentSubscribers, setRecentSubscribers] = useState([]);
- const [streamCategories, setStreamCategories] = useState({
- primary: { title: '' },
- secondary: { title: '' },
- });
- const [streamLikes, setStreamLikes] = useState(0);
- const [streamLive, setStreamLive] = useState(false);
- const [streamDislikes, setStreamDislikes] = useState(0);
- const [streamTitle, setStreamTitle] = useState('');
- const [watchingNow, setWatchingNow] = useState(0);
- const [createdOn, setCreatedOn] = useState('');
-
- useEffect(() => {
- console.log('use effect start');
- // TODO: catch error
- StartApi(cid);
- setActive(true);
-
- ChatBotMessages(cid).then((messages) => {
- console.log(messages);
- setChatBotMessages(messages);
- });
-
- NewChatBot(cid).then((response) => {
- setChatBotSessionLoggedIn(response.logged_in);
- setChatBotSessionStreamUrl(response.stream_url);
- setChatBotSessionUsername(response.username);
- });
-
- EventsOn('QueryResponse', (response) => {
- // console.log('query response received');
- setRefresh(!refresh);
- setActive(true);
- setUsername(response.username);
- setChannelName(response.channel_name);
- setFollowers(response.followers);
- setChannelFollowers(response.followers.num_followers);
- setTotalFollowers(response.followers.num_followers_total);
- setRecentFollowers(response.followers.recent_followers);
- setSubscribers(response.subscribers);
- setSubscriberCount(response.subscribers.num_subscribers);
- setRecentSubscribers(response.subscribers.recent_subscribers);
- if (response.livestreams.length > 0) {
- setStreamLive(true);
- setStreamCategories(response.livestreams[0].categories);
- setStreamLikes(response.livestreams[0].likes);
- setStreamDislikes(response.livestreams[0].dislikes);
- setStreamTitle(response.livestreams[0].title);
- setCreatedOn(response.livestreams[0].created_on);
- setWatchingNow(response.livestreams[0].watching_now);
- } else {
- setStreamLive(false);
- }
- });
-
- EventsOn('QueryResponseError', (error) => {
- setError(error);
- // console.log('Query response error:', error);
- setActive(false);
- });
-
- EventsOn('ChatBotChatStreamError', (error) => {
- setError(error);
- });
- }, []);
-
- const home = () => {
- StopApi()
- .then(() => setActive(false))
- .then(() => {
- ResetChatBot(cid, false);
- })
- .then(() => {
- navigate(NavSignIn);
- })
- .catch((error) => {
- setError(error);
- console.log('Stop error:', error);
- });
- };
-
- const startQuery = () => {
- console.log('start');
- StartApi(cid)
- .then(() => {
- setActive(true);
- })
- .catch((error) => {
- setError(error);
- console.log('Start error:', error);
- });
- };
-
- const stopQuery = () => {
- console.log('stop');
- StopApi().then(() => {
- setActive(false);
- });
- };
-
- const activityDate = (activity) => {
- if (activity.followed_on) {
- return activity.followed_on;
- }
- if (activity.subscribed_on) {
- return activity.subscribed_on;
- }
- };
-
- const activityEvents = () => {
- let sorted = [...recentFollowers, ...recentSubscribers].sort((a, b) =>
- activityDate(a) < activityDate(b) ? 1 : -1
- );
- return sorted;
- };
-
- const newChat = () => {
- setChatAsChannel(false);
- setChatCommand('');
- setChatID('');
- setChatInterval('');
- setChatText('');
- setChatTextFile('');
- setChatOnCommand(false);
- setChatOnCommandFollower(false);
- setChatOnCommandRantAmount(0);
- setChatOnCommandSubscriber(false);
- setOpenChat(true);
- };
-
- // const editChat = (id, asChannel, command, interval, onCommand, text, textFile) => {
- const editChat = (message) => {
- setChatAsChannel(message.as_channel);
- setChatCommand(message.command);
- setChatID(message.id);
- setChatInterval(message.interval);
- setChatOnCommand(message.on_command);
- setChatOnCommandFollower(message.on_command_follower);
- setChatOnCommandRantAmount(message.on_command_rant_amount);
- setChatOnCommandSubscriber(message.on_command_subscriber);
- setChatText(message.text);
- setChatTextFile(message.text_file);
- setOpenChat(true);
- };
-
- const deleteChat = (id) => {
- setOpenChat(false);
- if (id === '') {
- return;
- }
-
- let message = { id: id };
- StopChatBotMessage(id)
- .then(() => {
- // DeleteChatMessage(id, cid)
- DeleteChatMessage(cid, message)
- .then((messages) => {
- setChatBotMessages(messages);
- })
- .catch((error) => {
- setError(error);
- // console.log('Error deleting message:', error);
- });
- })
- .catch((error) => {
- setError(error);
- // console.log('Error stopping message:', error);
- });
- };
-
- // const saveChat = (id, asChannel, command, interval, onCommand, text, textFile) => {
- const saveChat = (message) => {
- setOpenChat(false);
- if (message.id === '') {
- // AddChatMessage(cid, asChannel, command, interval, onCommand, text, textFile)
- AddChatMessage(cid, message)
- .then((messages) => {
- setChatBotMessages(messages);
- })
- .catch((error) => {
- setError(error);
- console.log('Error saving chat:', error);
- });
-
- return;
- }
-
- // UpdateChatMessage(id, cid, asChannel, command, interval, onCommand, text, textFile)
- UpdateChatMessage(cid, message)
- .then((messages) => {
- console.log(messages);
- setChatBotMessages(messages);
- })
- .catch((error) => {
- setError(error);
- console.log('Error saving chat:', error);
- });
- };
-
- // TODO: this never gets called - delete
- const saveChatBot = (username, password, url) => {
- NewChatBot(cid, username, password, url)
- .then(() => {
- setOpenChatBot(false);
- })
- .catch((error) => console.log('Error creating new chat bot:', error));
- };
-
- const updateChatBot = (url) => {
- setChatBotSessionStreamUrl(url);
- setOpenChatBot(false);
- };
-
- const loginChatBot = () => {
- GetChatBot(cid)
- .then((response) => {
- setChatBotSessionLoggedIn(response.logged_in);
- setChatBotSessionStreamUrl(response.stream_url);
- setChatBotSessionUsername(response.username);
- })
- .catch((error) => {
- setError(error);
- console.log('Error getting chat bot:', error);
- })
- .finally(() => {
- setOpenChatBot(false);
- });
- };
-
- const logoutChatBot = () => {
- ResetChatBot(cid, true)
- .then(() => {
- NewChatBot(cid).then((response) => {
- console.log('NewChatBot response:', response);
- setChatBotSessionLoggedIn(response.logged_in);
- setChatBotSessionStreamUrl(response.stream_url);
- setChatBotSessionUsername(response.username);
- });
- })
- .catch((error) => {
- setError(error);
- console.log('Error resetting chat bot:', error);
- })
- .finally(() => {
- setOpenChatBot(false);
- });
- };
-
- const chatBotStartAll = () => {
- StartAllChatBot(cid).catch((error) => {
- setError(error);
- console.log('Error starting all chat bot messages:', error);
- });
- };
-
- const chatBotStopAll = () => {
- StopAllChatBot(cid)
- .then(() => {
- setChatBotMessagesActive({});
- })
- .catch((error) => {
- setError(error);
- console.log('Error stopping all chat bot messages:', error);
- });
- };
-
- const activateMessage = (id, active) => {
- // console.log('Dashboard activateMessage:', id, active);
- chatBotMessagesActive[id] = active;
- };
-
- const isMessageActive = (id) => {
- // console.log('is Message active start', id, chatBotMessagesActive[id]);
- if (chatBotMessagesActive[id] === undefined) {
- chatBotMessagesActive[id] = false;
- }
-
- // console.log('is Message active after', id, chatBotMessagesActive[id]);
- return chatBotMessagesActive[id];
- };
-
- return (
- <>
- {openChat && (
- setOpenChat(false)}
- onDelete={deleteChat}
- onSubmit={saveChat}
- show={openChat}
- text={chatText}
- textFile={chatTextFile}
- />
- )}
- {openChatBot && (
- setOpenChatBot(false)}
- onLogin={loginChatBot}
- onLogout={logoutChatBot}
- onSubmit={saveChatBot}
- onUpdate={updateChatBot}
- show={openChatBot}
- streamUrl={chatBotSessionStreamUrl}
- username={chatBotSessionUsername}
- />
- )}
-
-
-
-
- {/* */}
-
-
-
-
-
-
-
-
-
-
- {/*
-
-
*/}
-
- setOpenChatBot(true)}
- onStopAll={chatBotStopAll}
- title={'Chat Bot'}
- isMessageActive={isMessageActive}
- />
-
-
-
-
- {error !== '' && (
- setError('')}
- show={error !== ''}
- style={{ minWidth: '300px', maxWidth: '200px', maxHeight: '200px' }}
- title={'Error'}
- message={error}
- submitButton={'OK'}
- onSubmit={() => setError('')}
- />
- )}
- >
- );
-}
-
-export default Dashboard;
diff --git a/frontend/src/screens/Navigation.jsx b/frontend/src/screens/Navigation.jsx
deleted file mode 100644
index fb82cb3..0000000
--- a/frontend/src/screens/Navigation.jsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export const NavSignIn = '/';
-export const NavDashboard = '/dashboard';
diff --git a/frontend/src/screens/SignIn.css b/frontend/src/screens/SignIn.css
deleted file mode 100644
index 0d08ebe..0000000
--- a/frontend/src/screens/SignIn.css
+++ /dev/null
@@ -1,144 +0,0 @@
-#SignIn {
- align-items: center;
- background-color: #f3f5f8;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- height: 100vh;
-}
-
-.add-channel-description {
- font-family: sans-serif;
- font-size: 12px;
- padding-bottom: 5px;
-}
-
-.add-channel-error {
- color: red;
- font-family: sans-serif;
- font-size: 12px;
- padding-top: 5px;
-}
-
-.signin-input-box {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- padding: 10px 0px;
- width: 50%;
-}
-
-.signin-input-button {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- width: 100%;
-}
-
-.signin-input {
- border-bottom: 2px solid #D6E0EA;
- border-left: 2px solid #D6E0EA;
- border-right: none;
- border-top: 2px solid #D6E0EA;
- border-radius: 10rem 0rem 0rem 10rem;
- background-color: white;
- color: #061726;
- outline: none;
- padding-bottom: 0.5rem;
- padding-left: 1rem;
- padding-right: 0;
- padding-top: 0.5rem;
- width: 70%;
-}
-
-.signin-button {
- background-color: #85c742;
- border: none;
- border-radius: 0rem 10rem 10rem 0rem;
- color: #061726;
- cursor: pointer;
- font-weight: bold;
- text-decoration: none;
- width: 20%;
-}
-
-.signin-button:hover {
- background-color: #77b23b;
-}
-
-.signin-center {
- align-items: center;
- display: flex;
- flex-direction: column;
- justify-content: center;
- height: 50%;
- width: 50%;
-}
-
-.signin-show {
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: white;
- border-bottom: 2px solid #D6E0EA;
- border-left: none;
- border-right: 2px solid #D6E0EA;
- border-top: 2px solid #D6E0EA;
- color: #061726;
- cursor: pointer;
- font-weight: bold;
- text-decoration: none;
- width: 10%;
-}
-
-.signin-show-icon {
- height: 16px;
- width: 16px;
-}
-
-.signin-label {
- color: #061726;
- display: flex;
- font-family: sans-serif;
- font-weight: bold;
- justify-content: center;
- padding: 5px;
- text-transform: uppercase;
- width: 100%;
-}
-
-.signin-header {
- align-items: center;
- color: #061726;
- display: flex;
- flex-direction: column;
- font-family: sans-serif;
- font-weight: bold;
- height: 10%;
- justify-content: center;
- margin: 20px;
- text-align: center;
-}
-
-.signin-footer {
- align-items: center;
- color: #061726;
- display: flex;
- flex-direction: column;
- font-family: sans-serif;
- font-weight: bold;
- height: 10%;
- justify-content: center;
- margin: 20px;
- text-align: center;
-}
-
-.signin-title-text {
- font-size: 20px;
- margin: 0;
-}
-.signin-title-subtext {
- font-size: 12px;
- margin: 0;
-}
\ No newline at end of file
diff --git a/frontend/src/screens/SignIn.jsx b/frontend/src/screens/SignIn.jsx
deleted file mode 100644
index 3aac710..0000000
--- a/frontend/src/screens/SignIn.jsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import { useEffect, useState } from 'react';
-import { Navigate, useNavigate } from 'react-router-dom';
-import { NavDashboard } from './Navigation';
-import { AddChannel, Config } from '../../wailsjs/go/main/App';
-import { Eye, EyeSlash } from '../assets/icons';
-import './SignIn.css';
-import ChannelList from '../components/ChannelList';
-import { SmallModal } from '../components/Modal';
-
-function SignIn() {
- const [error, setError] = useState('');
- const navigate = useNavigate();
- const [config, setConfig] = useState({ channels: {} });
- const [addChannelError, setAddChannelError] = useState('');
- const [streamKey, setStreamKey] = useState('');
- const updateStreamKey = (event) => setStreamKey(event.target.value);
- const [showStreamKey, setShowStreamKey] = useState(false);
- const updateShowStreamKey = () => setShowStreamKey(!showStreamKey);
-
- useEffect(() => {
- Config()
- .then((response) => {
- setConfig(response);
- })
- .catch((error) => {
- // TODO: display error to user
- setError('Error loading config: ' + error);
- console.log('error getting config', error);
- });
- }, []);
-
- const saveStreamKey = () => {
- AddChannel(streamKey)
- .then((response) => {
- console.log(response);
- setConfig(response);
- setStreamKey('');
- })
- .catch((error) => {
- console.log('error adding channel', error);
- setAddChannelError(error);
- });
- };
-
- const openStreamDashboard = (cid) => {
- navigate(NavDashboard, { state: { cid: cid } });
- };
-
- return (
- <>
- {error !== '' && (
- setError('')}
- show={error !== ''}
- style={{ minWidth: '300px', maxWidth: '300px', maxHeight: '200px' }}
- title={'Error'}
- message={error}
- submitButton={'OK'}
- onSubmit={() => setError('')}
- />
- )}
-
-
- Rum Goggles
- Rumble Stream Dashboard
-
-
-
-
-
-
-
- Copy your API key from your Rumble account
-
-
-
-
-
-
-
- {addChannelError ? addChannelError : '\u00A0'}
-
-
-
-
- >
- );
-}
-
-export default SignIn;
diff --git a/frontend/src/style.css b/frontend/src/style.css
deleted file mode 100644
index 16aff13..0000000
--- a/frontend/src/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-html {
-}
-
-body {
- margin: 0;
-}
-
-#app {
- /* height: 100vh; */
-}
diff --git a/internal/api/api.go b/internal/api/api.go
deleted file mode 100644
index 74c12a0..0000000
--- a/internal/api/api.go
+++ /dev/null
@@ -1,107 +0,0 @@
-package api
-
-import (
- "context"
- "fmt"
- "log"
- "sync"
- "time"
-
- rumblelivestreamlib "github.com/tylertravisty/rumble-livestream-lib-go"
- "github.com/wailsapp/wails/v2/pkg/runtime"
-)
-
-type Api struct {
- ctx context.Context
- cancel context.CancelFunc
- cancelMu sync.Mutex
- logError *log.Logger
- logInfo *log.Logger
- querying bool
- queryingMu sync.Mutex
-}
-
-func NewApi(logError *log.Logger, logInfo *log.Logger) *Api {
- return &Api{logError: logError, logInfo: logInfo}
-}
-
-func (a *Api) Startup(ctx context.Context) {
- a.ctx = ctx
-}
-
-func (a *Api) Start(url string, interval time.Duration) error {
- a.logInfo.Println("Api.Start")
- if url == "" {
- return fmt.Errorf("empty stream key")
- }
-
- a.queryingMu.Lock()
- start := !a.querying
- a.querying = true
- a.queryingMu.Unlock()
-
- if start {
- a.logInfo.Println("Start querying")
- ctx, cancel := context.WithCancel(context.Background())
- a.cancelMu.Lock()
- a.cancel = cancel
- a.cancelMu.Unlock()
- go a.start(ctx, url, interval)
- } else {
- a.logInfo.Println("Querying already started")
- }
-
- return nil
-}
-
-func (a *Api) Stop() {
- a.logInfo.Println("Stop querying")
- a.cancelMu.Lock()
- if a.cancel != nil {
- a.cancel()
- }
- a.cancelMu.Unlock()
-}
-
-func (a *Api) start(ctx context.Context, url string, interval time.Duration) {
- for {
- a.query(url)
- timer := time.NewTimer(interval)
- select {
- case <-ctx.Done():
- a.queryingMu.Lock()
- a.querying = false
- a.queryingMu.Unlock()
- timer.Stop()
- return
- case <-timer.C:
- }
- }
-}
-
-func (a *Api) query(url string) {
- // a.logInfo.Println("QueryAPI")
- client := rumblelivestreamlib.Client{StreamKey: url}
- resp, err := client.Request()
- if err != nil {
- a.logError.Println("api: error executing client request:", err)
- a.Stop()
- runtime.EventsEmit(a.ctx, "QueryResponseError", "Failed to query API")
- return
- }
-
- // resp := &rumblelivestreamlib.LivestreamResponse{}
-
- // resp.Followers.RecentFollowers = append(resp.Followers.RecentFollowers, rumblelivestreamlib.Follower{"tyler-follow", "2023-12-12T21:53:34-04:00"})
- // resp.Subscribers.RecentSubscribers = append(resp.Subscribers.RecentSubscribers, rumblelivestreamlib.Subscriber{"tyler-sub", "tyler-sub", 500, 5, "2023-12-14T21:53:34-04:00"})
- // resp.Subscribers.RecentSubscribers = append(resp.Subscribers.RecentSubscribers, rumblelivestreamlib.Subscriber{"tyler-sub", "tyler-sub", 500, 5, "2023-12-13T21:53:34-04:00"})
- // resp.Subscribers.RecentSubscribers = append(resp.Subscribers.RecentSubscribers, rumblelivestreamlib.Subscriber{"tyler-sub", "tyler-sub", 500, 5, "2023-11-13T21:53:34-04:00"})
- // resp.Livestreams = []rumblelivestreamlib.Livestream{
- // {
- // CreatedOn: "2023-12-16T16:13:30+00:00",
- // WatchingNow: 4},
- // }
- runtime.EventsEmit(a.ctx, "QueryResponse", &resp)
-}
-
-// TODO: if start errors, send event
diff --git a/internal/chatbot/chatbot.go b/internal/chatbot/chatbot.go
deleted file mode 100644
index 5dad4a1..0000000
--- a/internal/chatbot/chatbot.go
+++ /dev/null
@@ -1,490 +0,0 @@
-package chatbot
-
-import (
- "bufio"
- "bytes"
- "context"
- "crypto/rand"
- "fmt"
- "html/template"
- "log"
- "math/big"
- "net/http"
- "os"
- "strings"
- "sync"
- "time"
-
- "github.com/tylertravisty/rum-goggles/internal/config"
- rumblelivestreamlib "github.com/tylertravisty/rumble-livestream-lib-go"
- "github.com/wailsapp/wails/v2/pkg/runtime"
-)
-
-type ChatBot struct {
- ctx context.Context
- cancelChatStream context.CancelFunc
- cancelChatStreamMu sync.Mutex
- client *rumblelivestreamlib.Client
- commands map[string]chan rumblelivestreamlib.ChatView
- commandsMu sync.Mutex
- Cfg config.ChatBot
- logError *log.Logger
- messages map[string]*message
- messagesMu sync.Mutex
-}
-
-type message struct {
- cancel context.CancelFunc
- cancelMu sync.Mutex
- asChannel bool
- command string
- id string
- interval time.Duration
- onCommand bool
- onCommandFollower bool
- onCommandRantAmount int
- OnCommandSubscriber bool
- text string
- textFromFile []string
-}
-
-func NewChatBot(ctx context.Context, cfg config.ChatBot, logError *log.Logger) (*ChatBot, error) {
- // client, err := rumblelivestreamlib.NewClient("", validUrl(streamUrl))
- client, err := rumblelivestreamlib.NewClient(cfg.Session.Client)
-
- if err != nil {
- return nil, fmt.Errorf("chatbot: error creating new client: %v", err)
- }
-
- return &ChatBot{ctx: ctx, client: client, Cfg: cfg, commands: map[string]chan rumblelivestreamlib.ChatView{}, logError: logError, messages: map[string]*message{}}, nil
-}
-
-func validUrl(url string) string {
- valid := url
- if !strings.HasPrefix(valid, "https://") {
- valid = "https://" + valid
- }
-
- return valid
-}
-
-func (cb *ChatBot) StartMessage(id string) error {
- msg, exists := cb.Cfg.Messages[id]
- if !exists {
- return fmt.Errorf("chatbot: message does not exist")
- }
-
- cb.messagesMu.Lock()
- defer cb.messagesMu.Unlock()
- m, exists := cb.messages[id]
- if exists {
- m.stop()
- delete(cb.messages, id)
- }
-
- textFromFile := []string{}
- if msg.TextFile != "" {
- file, err := os.Open(msg.TextFile)
- if err != nil {
- return fmt.Errorf("chatbot: error opening file with responses: %v", err)
- }
- defer file.Close()
-
- scanner := bufio.NewScanner(file)
- for scanner.Scan() {
- line := strings.TrimSpace(scanner.Text())
- if line == "" {
- continue
- }
- textFromFile = append(textFromFile, line)
- }
- }
-
- m = &message{
- asChannel: msg.AsChannel,
- command: msg.Command,
- id: msg.ID,
- interval: msg.Interval,
- onCommand: msg.OnCommand,
- onCommandFollower: msg.OnCommandFollower,
- onCommandRantAmount: msg.OnCommandRantAmount,
- OnCommandSubscriber: msg.OnCommandSubscriber,
- text: msg.Text,
- textFromFile: textFromFile,
- }
-
- ctx, cancel := context.WithCancel(context.Background())
- m.cancelMu.Lock()
- m.cancel = cancel
- m.cancelMu.Unlock()
- if msg.OnCommand {
- go cb.startCommand(ctx, m)
- } else {
- go cb.startMessage(ctx, m)
- }
-
- cb.messages[id] = m
-
- return nil
-}
-
-func (cb *ChatBot) startCommand(ctx context.Context, m *message) {
- cb.commandsMu.Lock()
- ch := make(chan rumblelivestreamlib.ChatView)
- cb.commands[m.command] = ch
- cb.commandsMu.Unlock()
-
- var prev time.Time
- for {
- runtime.EventsEmit(cb.ctx, "ChatBotCommandActive-"+m.id, m.id)
- // TODO: if error, emit error to user, stop loop?
- select {
- case <-ctx.Done():
- runtime.EventsEmit(cb.ctx, "ChatBotMessageError-"+m.id, m.id)
- return
- case cv := <-ch:
- if m.onCommandFollower && !cv.IsFollower {
- break
- }
-
- subscriber := false
- for _, badge := range cv.Badges {
- if badge == "recurring_subscription" || badge == "locals_supporter" {
- subscriber = true
- }
- }
-
- if m.OnCommandSubscriber && !subscriber {
- break
- }
-
- // if m.onCommandRantAmount > 0 && cv.Rant < m.onCommandRantAmount * 100 {
- // break
- // }
-
- if cv.Rant < m.onCommandRantAmount*100 {
- break
- }
-
- // TODO: parse !command
- now := time.Now()
- if now.Sub(prev) < m.interval*time.Second {
- break
- }
-
- err := cb.chatCommand(m, cv)
- if err != nil {
- cb.logError.Println("error sending chat:", err)
- cb.StopMessage(m.id)
- runtime.EventsEmit(cb.ctx, "ChatBotCommandError-"+m.id, m.id)
- return
- } else {
- prev = now
- // runtime.EventsEmit(cb.ctx, "ChatBotCommandActive-"+m.id, m.id)
- }
- }
- }
-}
-
-func (cb *ChatBot) startMessage(ctx context.Context, m *message) {
- for {
- // TODO: if error, emit error to user, stop loop?
- err := cb.chat(m)
- if err != nil {
- cb.logError.Println("error sending chat:", err)
- cb.StopMessage(m.id)
- runtime.EventsEmit(cb.ctx, "ChatBotMessageError-"+m.id, m.id)
- // TODO: stop this loop?
- } else {
- runtime.EventsEmit(cb.ctx, "ChatBotMessageActive-"+m.id, m.id)
- }
-
- timer := time.NewTimer(m.interval * time.Second)
- select {
- case <-ctx.Done():
- timer.Stop()
- runtime.EventsEmit(cb.ctx, "ChatBotMessageError-"+m.id, m.id)
- return
- case <-timer.C:
- }
- }
-}
-
-func (cb *ChatBot) chatCommand(m *message, cv rumblelivestreamlib.ChatView) error {
- if cb.client == nil {
- return fmt.Errorf("client is nil")
- }
-
- msgText := m.text
- if len(m.textFromFile) > 0 {
- n, err := rand.Int(rand.Reader, big.NewInt(int64(len(m.textFromFile))))
- if err != nil {
- return fmt.Errorf("error generating random number: %v", err)
- }
-
- msgText = m.textFromFile[n.Int64()]
- }
-
- tmpl, err := template.New("chat").Parse(msgText)
- if err != nil {
- return fmt.Errorf("error creating template: %v", err)
- }
-
- fields := struct {
- ChannelName string
- Username string
- Rant int
- }{
- ChannelName: cv.ChannelName,
- Username: cv.Username,
- Rant: cv.Rant / 100,
- }
-
- var textB bytes.Buffer
- err = tmpl.Execute(&textB, fields)
- if err != nil {
- return fmt.Errorf("error executing template: %v", err)
- }
- text := textB.String()
-
- err = cb.client.Chat(m.asChannel, text)
- if err != nil {
- return fmt.Errorf("error sending chat: %v", err)
- }
-
- return nil
-}
-
-func (cb *ChatBot) chat(m *message) error {
- if cb.client == nil {
- return fmt.Errorf("client is nil")
- }
-
- text := m.text
- if len(m.textFromFile) > 0 {
- n, err := rand.Int(rand.Reader, big.NewInt(int64(len(m.textFromFile))))
- if err != nil {
- return fmt.Errorf("error generating random number: %v", err)
- }
-
- text = m.textFromFile[n.Int64()]
- }
-
- err := cb.client.Chat(m.asChannel, text)
- if err != nil {
- return fmt.Errorf("error sending chat: %v", err)
- }
-
- return nil
-}
-
-func (cb *ChatBot) StartAllMessages() error {
- for _, msg := range cb.Cfg.Messages {
- err := cb.StartMessage(msg.ID)
- if err != nil {
- return fmt.Errorf("error starting message: %v", err)
- }
- }
-
- return nil
-}
-
-func (cb *ChatBot) StopAllMessages() error {
- cb.messagesMu.Lock()
- defer cb.messagesMu.Unlock()
-
- for id, m := range cb.messages {
- m.stop()
- delete(cb.messages, id)
-
- if m.command != "" && m.onCommand {
- cb.commandsMu.Lock()
- ch, exists := cb.commands[m.command]
- if exists {
- close(ch)
- delete(cb.commands, m.command)
- }
- cb.commandsMu.Unlock()
- }
- }
-
- return nil
-}
-
-func (cb *ChatBot) StopMessage(id string) error {
- cb.messagesMu.Lock()
- defer cb.messagesMu.Unlock()
-
- m, exists := cb.messages[id]
- if exists {
- m.stop()
- delete(cb.messages, id)
-
- if m.command != "" && m.onCommand {
- cb.commandsMu.Lock()
- defer cb.commandsMu.Unlock()
- ch, exists := cb.commands[m.command]
- if exists {
- close(ch)
- delete(cb.commands, m.command)
- }
- }
- }
-
- return nil
-}
-
-func (m *message) stop() {
- m.cancelMu.Lock()
- if m.cancel != nil {
- m.cancel()
- }
- m.cancelMu.Unlock()
-}
-
-func (cb *ChatBot) LoggedIn() (bool, error) {
- if cb.client == nil {
- return false, fmt.Errorf("chatbot: client is nil")
- }
-
- loggedIn, err := cb.client.LoggedIn()
- if err != nil {
- return false, fmt.Errorf("chatbot: error checking if chat bot is logged in: %v", err)
- }
-
- return loggedIn, nil
-}
-
-func (cb *ChatBot) Login(username string, password string) ([]*http.Cookie, error) {
- if cb.client == nil {
- return nil, fmt.Errorf("chatbot: client is nil")
- }
-
- cookies, err := cb.client.Login(username, password)
- if err != nil {
- return nil, fmt.Errorf("chatbot: error logging in: %v", err)
- }
-
- return cookies, nil
-}
-
-func (cb *ChatBot) Logout() error {
- if cb.client == nil {
- return fmt.Errorf("chatbot: client is nil")
- }
-
- err := cb.client.Logout()
- if err != nil {
- return fmt.Errorf("chatbot: error logging out: %v", err)
- }
-
- return nil
-}
-
-func (cb *ChatBot) StartChatStream() error {
- if cb.client == nil {
- return fmt.Errorf("chatbot: client is nil")
- }
-
- err := cb.client.ChatInfo()
- if err != nil {
- return fmt.Errorf("chatbot: error getting chat info: %v", err)
- }
-
- ctx, cancel := context.WithCancel(context.Background())
- cb.cancelChatStreamMu.Lock()
- cb.cancelChatStream = cancel
- cb.cancelChatStreamMu.Unlock()
-
- go cb.startChatStream(ctx)
-
- // err = cb.client.StartChatStream(cb.handleChat, cb.handleError)
- // if err != nil {
- // return fmt.Errorf("chatbot: error starting chat stream: %v", err)
- // }
-
- return nil
-}
-
-func (cb *ChatBot) startChatStream(ctx context.Context) {
- for {
- err := cb.client.StartChatStream(cb.handleChat, cb.handleError)
- if err != nil {
- cb.logError.Println("error starting chat stream:", err)
- runtime.EventsEmit(cb.ctx, "ChatBotChatStreamError", "Error starting chat stream.")
- return
- }
- select {
- case <-time.After(90 * time.Minute):
- cb.client.StopChatStream()
- break
- case <-ctx.Done():
- cb.client.StopChatStream()
- return
- }
- }
-}
-
-func (cb *ChatBot) StopChatStream() error {
- if cb.client == nil {
- return fmt.Errorf("chatbot: client is nil")
- }
-
- // TODO: should a panic be caught here?
- cb.cancelChatStreamMu.Lock()
- if cb.cancelChatStream != nil {
- cb.cancelChatStream()
- } else {
- cb.client.StopChatStream()
- }
- cb.cancelChatStreamMu.Unlock()
-
- return nil
-}
-
-func (cb *ChatBot) RestartChatStream() error {
- if cb.client == nil {
- return fmt.Errorf("chatbot: client is nil")
- }
-
- cb.client.StopChatStream()
-
- err := cb.client.StartChatStream(cb.handleChat, cb.handleError)
- if err != nil {
- return fmt.Errorf("chatbot: error starting chat stream: %v", err)
- }
-
- return nil
-}
-
-func (cb *ChatBot) handleChat(cv rumblelivestreamlib.ChatView) {
- // runtime.EventsEmit(cb.ctx, "ChatMessageReceived", cv)
-
- if cv.Type != "init" {
- cb.handleCommand(cv)
- }
-}
-
-func (cb *ChatBot) handleCommand(cv rumblelivestreamlib.ChatView) {
- cb.commandsMu.Lock()
- defer cb.commandsMu.Unlock()
-
- words := strings.Split(cv.Text, " ")
- first := words[0]
- cmd, exists := cb.commands[first]
- if !exists {
- return
- }
-
- select {
- case cmd <- cv:
- return
- default:
- return
- }
-}
-
-func (cb *ChatBot) handleError(err error) {
- cb.logError.Println("error handling chat message:", err)
- // runtime.EventsEmit(cb.ctx, "ChatError", err)
-}
diff --git a/internal/config/config.go b/internal/config/config.go
deleted file mode 100644
index 37d4b88..0000000
--- a/internal/config/config.go
+++ /dev/null
@@ -1,241 +0,0 @@
-package config
-
-import (
- "encoding/json"
- "fmt"
- "os"
- "path/filepath"
- "runtime"
- "time"
-
- "github.com/tylertravisty/go-utils/random"
- rumblelivestreamlib "github.com/tylertravisty/rumble-livestream-lib-go"
-)
-
-const (
- CIDLen = 8
- DefaultInterval = 10
-
- configDir = ".rum-goggles"
- configDirWin = "RumGoggles"
- configFile = "config.json"
- logFile = "logs.txt"
-)
-
-func LogFile() (*os.File, error) {
- dir, err := buildConfigDir()
- if err != nil {
- return nil, fmt.Errorf("config: error getting config directory: %v", err)
- }
-
- err = os.MkdirAll(dir, 0750)
- if err != nil {
- return nil, fmt.Errorf("config: error making config directory: %v", err)
- }
-
- fp := filepath.Join(dir, logFile)
-
- f, err := os.OpenFile(fp, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
- if err != nil {
- return nil, fmt.Errorf("config: error opening log file: %v", err)
- }
-
- return f, nil
-}
-
-func buildConfigDir() (string, error) {
- userDir, err := userDir()
- if err != nil {
- return "", fmt.Errorf("error getting user directory: %v", err)
- }
-
- var dir string
- switch runtime.GOOS {
- case "windows":
- dir = filepath.Join(userDir, configDirWin)
- default:
- dir = filepath.Join(userDir, configDir)
- }
-
- return dir, nil
-}
-
-func userDir() (string, error) {
- var dir string
- var err error
- switch runtime.GOOS {
- case "windows":
- dir, err = os.UserCacheDir()
- default:
- dir, err = os.UserHomeDir()
- }
-
- return dir, err
-}
-
-type ChatMessage struct {
- ID string `json:"id"`
- AsChannel bool `json:"as_channel"`
- Command string `json:"command"`
- Interval time.Duration `json:"interval"`
- OnCommand bool `json:"on_command"`
- OnCommandFollower bool `json:"on_command_follower"`
- OnCommandRantAmount int `json:"on_command_rant_amount"`
- OnCommandSubscriber bool `json:"on_command_subscriber"`
- Text string `json:"text"`
- TextFile string `json:"text_file"`
-}
-
-type ChatBotSession struct {
- Client rumblelivestreamlib.NewClientOptions `json:"client"`
- Username string `json:"username"`
-}
-
-type ChatBot struct {
- Messages map[string]ChatMessage `json:"messages"`
- Session ChatBotSession `json:"session"`
- // Commands []ChatCommand
-}
-
-type Channel struct {
- ID string `json:"id"`
- ApiUrl string `json:"api_url"`
- Name string `json:"name"`
- Interval time.Duration `json:"interval"`
- ChatBot ChatBot `json:"chat_bot"`
-}
-
-func (a *App) NewChannel(url string, name string) (string, error) {
- for {
- id, err := random.String(CIDLen)
- if err != nil {
- return "", fmt.Errorf("config: error generating ID: %v", err)
- }
-
- if _, exists := a.Channels[id]; !exists {
- a.Channels[id] = Channel{id, url, name, DefaultInterval, ChatBot{Messages: map[string]ChatMessage{}}}
- return id, nil
- }
- }
-}
-
-func (a *App) DeleteChatMessage(cid string, cm ChatMessage) error {
- channel, exists := a.Channels[cid]
- if !exists {
- return fmt.Errorf("config: channel does not exist")
- }
-
- _, exists = channel.ChatBot.Messages[cm.ID]
- if !exists {
- return fmt.Errorf("config: message does not exist")
- }
-
- delete(channel.ChatBot.Messages, cm.ID)
-
- return nil
-}
-
-func (a *App) NewChatMessage(cid string, cm ChatMessage) (string, error) {
- if _, exists := a.Channels[cid]; !exists {
- return "", fmt.Errorf("config: channel does not exist")
- }
-
- for {
- id, err := random.String(CIDLen)
- if err != nil {
- return "", fmt.Errorf("config: error generating ID: %v", err)
- }
-
- _, exists := a.Channels[cid].ChatBot.Messages[id]
- if !exists {
- cm.ID = id
- a.Channels[cid].ChatBot.Messages[id] = cm
- return id, nil
- }
- }
-}
-
-func (a *App) UpdateChatMessage(cid string, cm ChatMessage) (string, error) {
- channel, exists := a.Channels[cid]
- if !exists {
- return "", fmt.Errorf("config: channel does not exist")
- }
-
- _, exists = channel.ChatBot.Messages[cm.ID]
- if !exists {
- return "", fmt.Errorf("config: message does not exist")
- }
-
- channel.ChatBot.Messages[cm.ID] = cm
-
- return cm.ID, nil
-}
-
-type App struct {
- Channels map[string]Channel `json:"channels"`
-}
-
-func Load() (*App, error) {
- dir, err := buildConfigDir()
- if err != nil {
- return nil, fmt.Errorf("config: error getting config directory: %v", err)
- }
-
- fp := filepath.Join(dir, configFile)
- app, err := load(fp)
- if err != nil {
- return nil, fmt.Errorf("config: error loading config: %w", err)
- }
-
- return app, nil
-}
-
-func load(filepath string) (*App, error) {
- f, err := os.Open(filepath)
- if err != nil {
- return nil, fmt.Errorf("error opening file: %w", err)
- }
-
- var app App
- decoder := json.NewDecoder(f)
- err = decoder.Decode(&app)
- if err != nil {
- return nil, fmt.Errorf("error decoding file into json: %v", err)
- }
-
- return &app, nil
-}
-
-func (a *App) Save() error {
- dir, err := buildConfigDir()
- if err != nil {
- return fmt.Errorf("config: error getting config directory: %v", err)
- }
-
- err = os.MkdirAll(dir, 0750)
- if err != nil {
- return fmt.Errorf("config: error making config directory: %v", err)
- }
-
- fp := filepath.Join(dir, configFile)
- err = a.save(fp)
- if err != nil {
- return fmt.Errorf("config: error saving config: %v", err)
- }
-
- return nil
-}
-
-func (app *App) save(filepath string) error {
- b, err := json.MarshalIndent(app, "", "\t")
- if err != nil {
- return fmt.Errorf("error encoding config into json: %v", err)
- }
-
- err = os.WriteFile(filepath, b, 0666)
- if err != nil {
- return fmt.Errorf("error writing config file: %v", err)
- }
-
- return nil
-}
diff --git a/package-lock.json b/package-lock.json
deleted file mode 100644
index 5ea10cf..0000000
--- a/package-lock.json
+++ /dev/null
@@ -1,185 +0,0 @@
-{
- "name": "rum-goggles",
- "lockfileVersion": 2,
- "requires": true,
- "packages": {
- "": {
- "devDependencies": {
- "react-router-dom": "^6.20.1"
- }
- },
- "node_modules/@remix-run/router": {
- "version": "1.13.1",
- "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz",
- "integrity": "sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==",
- "dev": true,
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/js-tokens": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
- "dev": true,
- "peer": true
- },
- "node_modules/loose-envify": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
- "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "js-tokens": "^3.0.0 || ^4.0.0"
- },
- "bin": {
- "loose-envify": "cli.js"
- }
- },
- "node_modules/react": {
- "version": "18.2.0",
- "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
- "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "loose-envify": "^1.1.0"
- },
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/react-dom": {
- "version": "18.2.0",
- "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
- "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "loose-envify": "^1.1.0",
- "scheduler": "^0.23.0"
- },
- "peerDependencies": {
- "react": "^18.2.0"
- }
- },
- "node_modules/react-router": {
- "version": "6.20.1",
- "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.20.1.tgz",
- "integrity": "sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==",
- "dev": true,
- "dependencies": {
- "@remix-run/router": "1.13.1"
- },
- "engines": {
- "node": ">=14.0.0"
- },
- "peerDependencies": {
- "react": ">=16.8"
- }
- },
- "node_modules/react-router-dom": {
- "version": "6.20.1",
- "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.20.1.tgz",
- "integrity": "sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==",
- "dev": true,
- "dependencies": {
- "@remix-run/router": "1.13.1",
- "react-router": "6.20.1"
- },
- "engines": {
- "node": ">=14.0.0"
- },
- "peerDependencies": {
- "react": ">=16.8",
- "react-dom": ">=16.8"
- }
- },
- "node_modules/scheduler": {
- "version": "0.23.0",
- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
- "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
- "dev": true,
- "peer": true,
- "dependencies": {
- "loose-envify": "^1.1.0"
- }
- }
- },
- "dependencies": {
- "@remix-run/router": {
- "version": "1.13.1",
- "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.13.1.tgz",
- "integrity": "sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==",
- "dev": true
- },
- "js-tokens": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
- "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
- "dev": true,
- "peer": true
- },
- "loose-envify": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
- "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
- "dev": true,
- "peer": true,
- "requires": {
- "js-tokens": "^3.0.0 || ^4.0.0"
- }
- },
- "react": {
- "version": "18.2.0",
- "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
- "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
- "dev": true,
- "peer": true,
- "requires": {
- "loose-envify": "^1.1.0"
- }
- },
- "react-dom": {
- "version": "18.2.0",
- "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
- "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
- "dev": true,
- "peer": true,
- "requires": {
- "loose-envify": "^1.1.0",
- "scheduler": "^0.23.0"
- }
- },
- "react-router": {
- "version": "6.20.1",
- "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.20.1.tgz",
- "integrity": "sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==",
- "dev": true,
- "requires": {
- "@remix-run/router": "1.13.1"
- }
- },
- "react-router-dom": {
- "version": "6.20.1",
- "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.20.1.tgz",
- "integrity": "sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==",
- "dev": true,
- "requires": {
- "@remix-run/router": "1.13.1",
- "react-router": "6.20.1"
- }
- },
- "scheduler": {
- "version": "0.23.0",
- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
- "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
- "dev": true,
- "peer": true,
- "requires": {
- "loose-envify": "^1.1.0"
- }
- }
- }
-}
diff --git a/package.json b/package.json
deleted file mode 100644
index 10e2c94..0000000
--- a/package.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "devDependencies": {
- "react-router-dom": "^6.20.1"
- }
-}
diff --git a/v1/.gitignore b/v1/.gitignore
new file mode 100644
index 0000000..d992b08
--- /dev/null
+++ b/v1/.gitignore
@@ -0,0 +1,6 @@
+build/bin
+build/darwin
+build/windows
+node_modules
+frontend/dist
+frontend/wailsjs
\ No newline at end of file
diff --git a/v1/README.md b/v1/README.md
new file mode 100644
index 0000000..4db88f6
--- /dev/null
+++ b/v1/README.md
@@ -0,0 +1,19 @@
+# README
+
+## About
+
+This is the official Wails React template.
+
+You can configure the project by editing `wails.json`. More information about the project settings can be found
+here: https://wails.io/docs/reference/project-config
+
+## Live Development
+
+To run in live development mode, run `wails dev` in the project directory. This will run a Vite development
+server that will provide very fast hot reload of your frontend changes. If you want to develop in a browser
+and have access to your Go methods, there is also a dev server that runs on http://localhost:34115. Connect
+to this in your browser, and you can call your Go code from devtools.
+
+## Building
+
+To build a redistributable, production mode package, use `wails build`.
diff --git a/v1/app.go b/v1/app.go
new file mode 100644
index 0000000..a29c6af
--- /dev/null
+++ b/v1/app.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "context"
+)
+
+// App struct
+type App struct {
+ ctx context.Context
+}
+
+// NewApp creates a new App application struct
+func NewApp() *App {
+ return &App{}
+}
+
+// startup is called when the app starts. The context is saved
+// so we can call the runtime methods
+func (a *App) startup(ctx context.Context) {
+ a.ctx = ctx
+}
diff --git a/build/README.md b/v1/build/README.md
similarity index 100%
rename from build/README.md
rename to v1/build/README.md
diff --git a/build/appicon.png b/v1/build/appicon.png
similarity index 100%
rename from build/appicon.png
rename to v1/build/appicon.png
diff --git a/frontend/index.html b/v1/frontend/index.html
similarity index 89%
rename from frontend/index.html
rename to v1/frontend/index.html
index 4ff9f38..5d74a35 100644
--- a/frontend/index.html
+++ b/v1/frontend/index.html
@@ -3,7 +3,7 @@
- Rum Goggles
+ v1
diff --git a/frontend/package-lock.json b/v1/frontend/package-lock.json
similarity index 92%
rename from frontend/package-lock.json
rename to v1/frontend/package-lock.json
index e95ec1e..4b76a67 100644
--- a/frontend/package-lock.json
+++ b/v1/frontend/package-lock.json
@@ -54,9 +54,9 @@
}
},
"node_modules/@babel/core": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz",
- "integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz",
+ "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==",
"dev": true,
"dependencies": {
"@ampproject/remapping": "^2.2.0",
@@ -64,11 +64,11 @@
"@babel/generator": "^7.23.6",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-module-transforms": "^7.23.3",
- "@babel/helpers": "^7.23.6",
- "@babel/parser": "^7.23.6",
- "@babel/template": "^7.22.15",
- "@babel/traverse": "^7.23.6",
- "@babel/types": "^7.23.6",
+ "@babel/helpers": "^7.23.9",
+ "@babel/parser": "^7.23.9",
+ "@babel/template": "^7.23.9",
+ "@babel/traverse": "^7.23.9",
+ "@babel/types": "^7.23.9",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@@ -252,14 +252,14 @@
}
},
"node_modules/@babel/helpers": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.6.tgz",
- "integrity": "sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz",
+ "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==",
"dev": true,
"dependencies": {
- "@babel/template": "^7.22.15",
- "@babel/traverse": "^7.23.6",
- "@babel/types": "^7.23.6"
+ "@babel/template": "^7.23.9",
+ "@babel/traverse": "^7.23.9",
+ "@babel/types": "^7.23.9"
},
"engines": {
"node": ">=6.9.0"
@@ -280,9 +280,9 @@
}
},
"node_modules/@babel/parser": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz",
- "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz",
+ "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -371,23 +371,23 @@
}
},
"node_modules/@babel/template": {
- "version": "7.22.15",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
- "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz",
+ "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==",
"dev": true,
"dependencies": {
- "@babel/code-frame": "^7.22.13",
- "@babel/parser": "^7.22.15",
- "@babel/types": "^7.22.15"
+ "@babel/code-frame": "^7.23.5",
+ "@babel/parser": "^7.23.9",
+ "@babel/types": "^7.23.9"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz",
- "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz",
+ "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.23.5",
@@ -396,8 +396,8 @@
"@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6",
- "@babel/parser": "^7.23.6",
- "@babel/types": "^7.23.6",
+ "@babel/parser": "^7.23.9",
+ "@babel/types": "^7.23.9",
"debug": "^4.3.1",
"globals": "^11.1.0"
},
@@ -406,9 +406,9 @@
}
},
"node_modules/@babel/types": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz",
- "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz",
+ "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==",
"dev": true,
"dependencies": {
"@babel/helper-string-parser": "^7.23.4",
@@ -466,9 +466,9 @@
}
},
"node_modules/@jridgewell/resolve-uri": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
- "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
"dev": true,
"engines": {
"node": ">=6.0.0"
@@ -490,9 +490,9 @@
"dev": true
},
"node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.20",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
- "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
+ "version": "0.3.22",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz",
+ "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
@@ -506,9 +506,9 @@
"dev": true
},
"node_modules/@types/react": {
- "version": "18.2.45",
- "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz",
- "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==",
+ "version": "18.2.58",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.58.tgz",
+ "integrity": "sha512-TaGvMNhxvG2Q0K0aYxiKfNDS5m5ZsoIBBbtfUorxdH4NGSXIlYvZxLJI+9Dd3KjeB3780bciLyAb7ylO8pLhPw==",
"dev": true,
"dependencies": {
"@types/prop-types": "*",
@@ -517,9 +517,9 @@
}
},
"node_modules/@types/react-dom": {
- "version": "18.2.17",
- "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.17.tgz",
- "integrity": "sha512-rvrT/M7Df5eykWFxn6MYt5Pem/Dbyc1N8Y0S9Mrkw2WFCRiqUgw9P7ul2NpwsXCSM1DVdENzdG9J5SreqfAIWg==",
+ "version": "18.2.19",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz",
+ "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==",
"dev": true,
"dependencies": {
"@types/react": "*"
@@ -565,9 +565,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.22.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz",
- "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==",
+ "version": "4.23.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
+ "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",
"dev": true,
"funding": [
{
@@ -584,8 +584,8 @@
}
],
"dependencies": {
- "caniuse-lite": "^1.0.30001565",
- "electron-to-chromium": "^1.4.601",
+ "caniuse-lite": "^1.0.30001587",
+ "electron-to-chromium": "^1.4.668",
"node-releases": "^2.0.14",
"update-browserslist-db": "^1.0.13"
},
@@ -597,9 +597,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001570",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz",
- "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==",
+ "version": "1.0.30001589",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz",
+ "integrity": "sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==",
"dev": true,
"funding": [
{
@@ -675,9 +675,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.4.611",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.611.tgz",
- "integrity": "sha512-ZtRpDxrjHapOwxtv+nuth5ByB8clyn8crVynmRNGO3wG3LOp8RTcyZDqwaI6Ng6y8FCK2hVZmJoqwCskKbNMaw==",
+ "version": "1.4.680",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.680.tgz",
+ "integrity": "sha512-4nToZ5jlPO14W82NkF32wyjhYqQByVaDmLy4J2/tYcAbJfgO2TKJC780Az1V13gzq4l73CJ0yuyalpXvxXXD9A==",
"dev": true
},
"node_modules/esbuild": {
@@ -1038,9 +1038,9 @@
}
},
"node_modules/escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
+ "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
"dev": true,
"engines": {
"node": ">=6"
@@ -1106,9 +1106,9 @@
}
},
"node_modules/hasown": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
- "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz",
+ "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==",
"dev": true,
"dependencies": {
"function-bind": "^1.1.2"
@@ -1233,9 +1233,9 @@
"dev": true
},
"node_modules/postcss": {
- "version": "8.4.32",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz",
- "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==",
+ "version": "8.4.35",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz",
+ "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==",
"dev": true,
"funding": [
{
@@ -1421,9 +1421,9 @@
}
},
"node_modules/vite": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz",
- "integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==",
+ "version": "3.2.8",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz",
+ "integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==",
"dev": true,
"dependencies": {
"esbuild": "^0.15.9",
@@ -1504,9 +1504,9 @@
"dev": true
},
"@babel/core": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz",
- "integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.9.tgz",
+ "integrity": "sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw==",
"dev": true,
"requires": {
"@ampproject/remapping": "^2.2.0",
@@ -1514,11 +1514,11 @@
"@babel/generator": "^7.23.6",
"@babel/helper-compilation-targets": "^7.23.6",
"@babel/helper-module-transforms": "^7.23.3",
- "@babel/helpers": "^7.23.6",
- "@babel/parser": "^7.23.6",
- "@babel/template": "^7.22.15",
- "@babel/traverse": "^7.23.6",
- "@babel/types": "^7.23.6",
+ "@babel/helpers": "^7.23.9",
+ "@babel/parser": "^7.23.9",
+ "@babel/template": "^7.23.9",
+ "@babel/traverse": "^7.23.9",
+ "@babel/types": "^7.23.9",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
"gensync": "^1.0.0-beta.2",
@@ -1650,14 +1650,14 @@
"dev": true
},
"@babel/helpers": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.6.tgz",
- "integrity": "sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.9.tgz",
+ "integrity": "sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ==",
"dev": true,
"requires": {
- "@babel/template": "^7.22.15",
- "@babel/traverse": "^7.23.6",
- "@babel/types": "^7.23.6"
+ "@babel/template": "^7.23.9",
+ "@babel/traverse": "^7.23.9",
+ "@babel/types": "^7.23.9"
}
},
"@babel/highlight": {
@@ -1672,9 +1672,9 @@
}
},
"@babel/parser": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz",
- "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.9.tgz",
+ "integrity": "sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==",
"dev": true
},
"@babel/plugin-syntax-jsx": {
@@ -1727,20 +1727,20 @@
}
},
"@babel/template": {
- "version": "7.22.15",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
- "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.23.9.tgz",
+ "integrity": "sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==",
"dev": true,
"requires": {
- "@babel/code-frame": "^7.22.13",
- "@babel/parser": "^7.22.15",
- "@babel/types": "^7.22.15"
+ "@babel/code-frame": "^7.23.5",
+ "@babel/parser": "^7.23.9",
+ "@babel/types": "^7.23.9"
}
},
"@babel/traverse": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz",
- "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.9.tgz",
+ "integrity": "sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.23.5",
@@ -1749,16 +1749,16 @@
"@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6",
- "@babel/parser": "^7.23.6",
- "@babel/types": "^7.23.6",
+ "@babel/parser": "^7.23.9",
+ "@babel/types": "^7.23.9",
"debug": "^4.3.1",
"globals": "^11.1.0"
}
},
"@babel/types": {
- "version": "7.23.6",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz",
- "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==",
+ "version": "7.23.9",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.9.tgz",
+ "integrity": "sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==",
"dev": true,
"requires": {
"@babel/helper-string-parser": "^7.23.4",
@@ -1792,9 +1792,9 @@
}
},
"@jridgewell/resolve-uri": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz",
- "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
"dev": true
},
"@jridgewell/set-array": {
@@ -1810,9 +1810,9 @@
"dev": true
},
"@jridgewell/trace-mapping": {
- "version": "0.3.20",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
- "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
+ "version": "0.3.22",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz",
+ "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==",
"dev": true,
"requires": {
"@jridgewell/resolve-uri": "^3.1.0",
@@ -1826,9 +1826,9 @@
"dev": true
},
"@types/react": {
- "version": "18.2.45",
- "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.45.tgz",
- "integrity": "sha512-TtAxCNrlrBp8GoeEp1npd5g+d/OejJHFxS3OWmrPBMFaVQMSN0OFySozJio5BHxTuTeug00AVXVAjfDSfk+lUg==",
+ "version": "18.2.58",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.58.tgz",
+ "integrity": "sha512-TaGvMNhxvG2Q0K0aYxiKfNDS5m5ZsoIBBbtfUorxdH4NGSXIlYvZxLJI+9Dd3KjeB3780bciLyAb7ylO8pLhPw==",
"dev": true,
"requires": {
"@types/prop-types": "*",
@@ -1837,9 +1837,9 @@
}
},
"@types/react-dom": {
- "version": "18.2.17",
- "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.17.tgz",
- "integrity": "sha512-rvrT/M7Df5eykWFxn6MYt5Pem/Dbyc1N8Y0S9Mrkw2WFCRiqUgw9P7ul2NpwsXCSM1DVdENzdG9J5SreqfAIWg==",
+ "version": "18.2.19",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.19.tgz",
+ "integrity": "sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==",
"dev": true,
"requires": {
"@types/react": "*"
@@ -1876,21 +1876,21 @@
}
},
"browserslist": {
- "version": "4.22.2",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz",
- "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==",
+ "version": "4.23.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",
+ "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",
"dev": true,
"requires": {
- "caniuse-lite": "^1.0.30001565",
- "electron-to-chromium": "^1.4.601",
+ "caniuse-lite": "^1.0.30001587",
+ "electron-to-chromium": "^1.4.668",
"node-releases": "^2.0.14",
"update-browserslist-db": "^1.0.13"
}
},
"caniuse-lite": {
- "version": "1.0.30001570",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz",
- "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==",
+ "version": "1.0.30001589",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz",
+ "integrity": "sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==",
"dev": true
},
"chalk": {
@@ -1941,9 +1941,9 @@
}
},
"electron-to-chromium": {
- "version": "1.4.611",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.611.tgz",
- "integrity": "sha512-ZtRpDxrjHapOwxtv+nuth5ByB8clyn8crVynmRNGO3wG3LOp8RTcyZDqwaI6Ng6y8FCK2hVZmJoqwCskKbNMaw==",
+ "version": "1.4.680",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.680.tgz",
+ "integrity": "sha512-4nToZ5jlPO14W82NkF32wyjhYqQByVaDmLy4J2/tYcAbJfgO2TKJC780Az1V13gzq4l73CJ0yuyalpXvxXXD9A==",
"dev": true
},
"esbuild": {
@@ -2117,9 +2117,9 @@
"optional": true
},
"escalade": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
- "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz",
+ "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==",
"dev": true
},
"escape-string-regexp": {
@@ -2160,9 +2160,9 @@
"dev": true
},
"hasown": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz",
- "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz",
+ "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==",
"dev": true,
"requires": {
"function-bind": "^1.1.2"
@@ -2251,9 +2251,9 @@
"dev": true
},
"postcss": {
- "version": "8.4.32",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz",
- "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==",
+ "version": "8.4.35",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz",
+ "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==",
"dev": true,
"requires": {
"nanoid": "^3.3.7",
@@ -2362,9 +2362,9 @@
}
},
"vite": {
- "version": "3.2.7",
- "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.7.tgz",
- "integrity": "sha512-29pdXjk49xAP0QBr0xXqu2s5jiQIXNvE/xwd0vUizYT2Hzqe4BksNNoWllFVXJf4eLZ+UlVQmXfB4lWrc+t18g==",
+ "version": "3.2.8",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz",
+ "integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==",
"dev": true,
"requires": {
"esbuild": "^0.15.9",
diff --git a/frontend/package.json b/v1/frontend/package.json
similarity index 100%
rename from frontend/package.json
rename to v1/frontend/package.json
diff --git a/frontend/package.json.md5 b/v1/frontend/package.json.md5
similarity index 100%
rename from frontend/package.json.md5
rename to v1/frontend/package.json.md5
diff --git a/frontend/src/App.css b/v1/frontend/src/App.css
similarity index 67%
rename from frontend/src/App.css
rename to v1/frontend/src/App.css
index 04dff41..f1ff82d 100644
--- a/frontend/src/App.css
+++ b/v1/frontend/src/App.css
@@ -1,3 +1,3 @@
-#App {
+#app {
height: 100vh;
-}
\ No newline at end of file
+}
diff --git a/v1/frontend/src/App.jsx b/v1/frontend/src/App.jsx
new file mode 100644
index 0000000..0580aaf
--- /dev/null
+++ b/v1/frontend/src/App.jsx
@@ -0,0 +1,8 @@
+import { useState } from 'react';
+import './App.css';
+
+function App() {
+ return ;
+}
+
+export default App;
diff --git a/frontend/src/main.jsx b/v1/frontend/src/main.jsx
similarity index 100%
rename from frontend/src/main.jsx
rename to v1/frontend/src/main.jsx
diff --git a/v1/frontend/src/style.css b/v1/frontend/src/style.css
new file mode 100644
index 0000000..699a279
--- /dev/null
+++ b/v1/frontend/src/style.css
@@ -0,0 +1,3 @@
+body {
+ margin: 0;
+}
diff --git a/frontend/vite.config.js b/v1/frontend/vite.config.js
similarity index 100%
rename from frontend/vite.config.js
rename to v1/frontend/vite.config.js
diff --git a/go.mod b/v1/go.mod
similarity index 76%
rename from go.mod
rename to v1/go.mod
index b17c2d8..36d108d 100644
--- a/go.mod
+++ b/v1/go.mod
@@ -1,12 +1,10 @@
-module github.com/tylertravisty/rum-goggles
+module github.com/tylertravisty/rum-goggles/v1
-go 1.19
+go 1.21
-require (
- github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909
- github.com/tylertravisty/rumble-livestream-lib-go v0.3.4
- github.com/wailsapp/wails/v2 v2.7.1
-)
+toolchain go1.22.0
+
+require github.com/wailsapp/wails/v2 v2.8.0
require (
github.com/bep/debounce v1.2.1 // indirect
@@ -24,9 +22,7 @@ require (
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/r3labs/sse/v2 v2.10.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
- github.com/robertkrimen/otto v0.3.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/tkrajina/go-reflector v0.5.6 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
@@ -38,6 +34,6 @@ require (
golang.org/x/net v0.20.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
- gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
- gopkg.in/sourcemap.v1 v1.0.5 // indirect
)
+
+// replace github.com/wailsapp/wails/v2 v2.8.0 => /home/tyler/dev/go/pkg/mod
diff --git a/go.sum b/v1/go.sum
similarity index 81%
rename from go.sum
rename to v1/go.sum
index 392c9e2..6b41c31 100644
--- a/go.sum
+++ b/v1/go.sum
@@ -41,24 +41,17 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
-github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
-github.com/robertkrimen/otto v0.3.0 h1:5RI+8860NSxvXywDY9ddF5HcPw0puRsd8EgbXV0oqRE=
-github.com/robertkrimen/otto v0.3.0/go.mod h1:uW9yN1CYflmUQYvAMS0m+ZiNo3dMzRUDQJX0jWbzgxw=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE=
github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
-github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909 h1:xrjIFqzGQXlCrCdMPpW6+SodGFSlrQ3ZNUCr3f5tF1g=
-github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909/go.mod h1:2W31Jhs9YSy7y500wsCOW0bcamGi9foQV1CKrfvfTxk=
-github.com/tylertravisty/rumble-livestream-lib-go v0.3.4 h1:VPKelrC3hesJlbqdByMkUhbEubFx80T5FNC60JKrEfw=
-github.com/tylertravisty/rumble-livestream-lib-go v0.3.4/go.mod h1:rUET5uInouMfB4ekqdGiYeoN5ibOdzU9cCgRE0i57Wg=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
@@ -68,18 +61,15 @@ github.com/wailsapp/go-webview2 v1.0.10 h1:PP5Hug6pnQEAhfRzLCoOh2jJaPdrqeRgJKZhy
github.com/wailsapp/go-webview2 v1.0.10/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo=
github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs=
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
-github.com/wailsapp/wails/v2 v2.7.1 h1:HAzp2c5ODOzsLC6ZMDVtNOB72ozM7/SJecJPB2Ur+UU=
-github.com/wailsapp/wails/v2 v2.7.1/go.mod h1:oIJVwwso5fdOgprBYWXBBqtx6PaSvxg8/KTQHNGkadc=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+github.com/wailsapp/wails/v2 v2.8.0 h1:b2NNn99uGPiN6P5bDsnPwOJZWtAOUhNLv7Vl+YxMTr4=
+github.com/wailsapp/wails/v2 v2.8.0/go.mod h1:EFUGWkUX3KofO4fmKR/GmsLy3HhPH7NbyOEaMt8lBF0=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc=
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
-golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -93,16 +83,12 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
-gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI=
-gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/main.go b/v1/main.go
similarity index 100%
rename from main.go
rename to v1/main.go
diff --git a/vendor/github.com/bep/debounce/.gitignore b/v1/vendor/github.com/bep/debounce/.gitignore
similarity index 100%
rename from vendor/github.com/bep/debounce/.gitignore
rename to v1/vendor/github.com/bep/debounce/.gitignore
diff --git a/vendor/github.com/bep/debounce/LICENSE b/v1/vendor/github.com/bep/debounce/LICENSE
similarity index 100%
rename from vendor/github.com/bep/debounce/LICENSE
rename to v1/vendor/github.com/bep/debounce/LICENSE
diff --git a/vendor/github.com/bep/debounce/README.md b/v1/vendor/github.com/bep/debounce/README.md
similarity index 100%
rename from vendor/github.com/bep/debounce/README.md
rename to v1/vendor/github.com/bep/debounce/README.md
diff --git a/vendor/github.com/bep/debounce/debounce.go b/v1/vendor/github.com/bep/debounce/debounce.go
similarity index 100%
rename from vendor/github.com/bep/debounce/debounce.go
rename to v1/vendor/github.com/bep/debounce/debounce.go
diff --git a/vendor/github.com/go-ole/go-ole/.travis.yml b/v1/vendor/github.com/go-ole/go-ole/.travis.yml
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/.travis.yml
rename to v1/vendor/github.com/go-ole/go-ole/.travis.yml
diff --git a/vendor/github.com/go-ole/go-ole/ChangeLog.md b/v1/vendor/github.com/go-ole/go-ole/ChangeLog.md
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/ChangeLog.md
rename to v1/vendor/github.com/go-ole/go-ole/ChangeLog.md
diff --git a/vendor/github.com/go-ole/go-ole/LICENSE b/v1/vendor/github.com/go-ole/go-ole/LICENSE
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/LICENSE
rename to v1/vendor/github.com/go-ole/go-ole/LICENSE
diff --git a/vendor/github.com/go-ole/go-ole/README.md b/v1/vendor/github.com/go-ole/go-ole/README.md
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/README.md
rename to v1/vendor/github.com/go-ole/go-ole/README.md
diff --git a/vendor/github.com/go-ole/go-ole/appveyor.yml b/v1/vendor/github.com/go-ole/go-ole/appveyor.yml
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/appveyor.yml
rename to v1/vendor/github.com/go-ole/go-ole/appveyor.yml
diff --git a/vendor/github.com/go-ole/go-ole/com.go b/v1/vendor/github.com/go-ole/go-ole/com.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/com.go
rename to v1/vendor/github.com/go-ole/go-ole/com.go
diff --git a/vendor/github.com/go-ole/go-ole/com_func.go b/v1/vendor/github.com/go-ole/go-ole/com_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/com_func.go
rename to v1/vendor/github.com/go-ole/go-ole/com_func.go
diff --git a/vendor/github.com/go-ole/go-ole/connect.go b/v1/vendor/github.com/go-ole/go-ole/connect.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/connect.go
rename to v1/vendor/github.com/go-ole/go-ole/connect.go
diff --git a/vendor/github.com/go-ole/go-ole/constants.go b/v1/vendor/github.com/go-ole/go-ole/constants.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/constants.go
rename to v1/vendor/github.com/go-ole/go-ole/constants.go
diff --git a/vendor/github.com/go-ole/go-ole/error.go b/v1/vendor/github.com/go-ole/go-ole/error.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/error.go
rename to v1/vendor/github.com/go-ole/go-ole/error.go
diff --git a/vendor/github.com/go-ole/go-ole/error_func.go b/v1/vendor/github.com/go-ole/go-ole/error_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/error_func.go
rename to v1/vendor/github.com/go-ole/go-ole/error_func.go
diff --git a/vendor/github.com/go-ole/go-ole/error_windows.go b/v1/vendor/github.com/go-ole/go-ole/error_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/error_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/error_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/guid.go b/v1/vendor/github.com/go-ole/go-ole/guid.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/guid.go
rename to v1/vendor/github.com/go-ole/go-ole/guid.go
diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint.go b/v1/vendor/github.com/go-ole/go-ole/iconnectionpoint.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iconnectionpoint.go
rename to v1/vendor/github.com/go-ole/go-ole/iconnectionpoint.go
diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go b/v1/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go
rename to v1/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go
diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go b/v1/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go b/v1/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go
rename to v1/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go
diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go b/v1/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go
rename to v1/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go
diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go b/v1/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/idispatch.go b/v1/vendor/github.com/go-ole/go-ole/idispatch.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/idispatch.go
rename to v1/vendor/github.com/go-ole/go-ole/idispatch.go
diff --git a/vendor/github.com/go-ole/go-ole/idispatch_func.go b/v1/vendor/github.com/go-ole/go-ole/idispatch_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/idispatch_func.go
rename to v1/vendor/github.com/go-ole/go-ole/idispatch_func.go
diff --git a/vendor/github.com/go-ole/go-ole/idispatch_windows.go b/v1/vendor/github.com/go-ole/go-ole/idispatch_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/idispatch_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/idispatch_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant.go b/v1/vendor/github.com/go-ole/go-ole/ienumvariant.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/ienumvariant.go
rename to v1/vendor/github.com/go-ole/go-ole/ienumvariant.go
diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant_func.go b/v1/vendor/github.com/go-ole/go-ole/ienumvariant_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/ienumvariant_func.go
rename to v1/vendor/github.com/go-ole/go-ole/ienumvariant_func.go
diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go b/v1/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/ienumvariant_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/iinspectable.go b/v1/vendor/github.com/go-ole/go-ole/iinspectable.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iinspectable.go
rename to v1/vendor/github.com/go-ole/go-ole/iinspectable.go
diff --git a/vendor/github.com/go-ole/go-ole/iinspectable_func.go b/v1/vendor/github.com/go-ole/go-ole/iinspectable_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iinspectable_func.go
rename to v1/vendor/github.com/go-ole/go-ole/iinspectable_func.go
diff --git a/vendor/github.com/go-ole/go-ole/iinspectable_windows.go b/v1/vendor/github.com/go-ole/go-ole/iinspectable_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iinspectable_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/iinspectable_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go b/v1/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iprovideclassinfo.go
rename to v1/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go
diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go b/v1/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go
rename to v1/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go
diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go b/v1/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo.go b/v1/vendor/github.com/go-ole/go-ole/itypeinfo.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/itypeinfo.go
rename to v1/vendor/github.com/go-ole/go-ole/itypeinfo.go
diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo_func.go b/v1/vendor/github.com/go-ole/go-ole/itypeinfo_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/itypeinfo_func.go
rename to v1/vendor/github.com/go-ole/go-ole/itypeinfo_func.go
diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go b/v1/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/itypeinfo_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/iunknown.go b/v1/vendor/github.com/go-ole/go-ole/iunknown.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iunknown.go
rename to v1/vendor/github.com/go-ole/go-ole/iunknown.go
diff --git a/vendor/github.com/go-ole/go-ole/iunknown_func.go b/v1/vendor/github.com/go-ole/go-ole/iunknown_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iunknown_func.go
rename to v1/vendor/github.com/go-ole/go-ole/iunknown_func.go
diff --git a/vendor/github.com/go-ole/go-ole/iunknown_windows.go b/v1/vendor/github.com/go-ole/go-ole/iunknown_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/iunknown_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/iunknown_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/ole.go b/v1/vendor/github.com/go-ole/go-ole/ole.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/ole.go
rename to v1/vendor/github.com/go-ole/go-ole/ole.go
diff --git a/vendor/github.com/go-ole/go-ole/safearray.go b/v1/vendor/github.com/go-ole/go-ole/safearray.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/safearray.go
rename to v1/vendor/github.com/go-ole/go-ole/safearray.go
diff --git a/vendor/github.com/go-ole/go-ole/safearray_func.go b/v1/vendor/github.com/go-ole/go-ole/safearray_func.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/safearray_func.go
rename to v1/vendor/github.com/go-ole/go-ole/safearray_func.go
diff --git a/vendor/github.com/go-ole/go-ole/safearray_windows.go b/v1/vendor/github.com/go-ole/go-ole/safearray_windows.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/safearray_windows.go
rename to v1/vendor/github.com/go-ole/go-ole/safearray_windows.go
diff --git a/vendor/github.com/go-ole/go-ole/safearrayconversion.go b/v1/vendor/github.com/go-ole/go-ole/safearrayconversion.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/safearrayconversion.go
rename to v1/vendor/github.com/go-ole/go-ole/safearrayconversion.go
diff --git a/vendor/github.com/go-ole/go-ole/safearrayslices.go b/v1/vendor/github.com/go-ole/go-ole/safearrayslices.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/safearrayslices.go
rename to v1/vendor/github.com/go-ole/go-ole/safearrayslices.go
diff --git a/vendor/github.com/go-ole/go-ole/utility.go b/v1/vendor/github.com/go-ole/go-ole/utility.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/utility.go
rename to v1/vendor/github.com/go-ole/go-ole/utility.go
diff --git a/vendor/github.com/go-ole/go-ole/variables.go b/v1/vendor/github.com/go-ole/go-ole/variables.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variables.go
rename to v1/vendor/github.com/go-ole/go-ole/variables.go
diff --git a/vendor/github.com/go-ole/go-ole/variant.go b/v1/vendor/github.com/go-ole/go-ole/variant.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant.go
rename to v1/vendor/github.com/go-ole/go-ole/variant.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_386.go b/v1/vendor/github.com/go-ole/go-ole/variant_386.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_386.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_386.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_amd64.go b/v1/vendor/github.com/go-ole/go-ole/variant_amd64.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_amd64.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_amd64.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_arm.go b/v1/vendor/github.com/go-ole/go-ole/variant_arm.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_arm.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_arm.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_arm64.go b/v1/vendor/github.com/go-ole/go-ole/variant_arm64.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_arm64.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_arm64.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_date_386.go b/v1/vendor/github.com/go-ole/go-ole/variant_date_386.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_date_386.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_date_386.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_date_amd64.go b/v1/vendor/github.com/go-ole/go-ole/variant_date_amd64.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_date_amd64.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_date_amd64.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_date_arm.go b/v1/vendor/github.com/go-ole/go-ole/variant_date_arm.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_date_arm.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_date_arm.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_date_arm64.go b/v1/vendor/github.com/go-ole/go-ole/variant_date_arm64.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_date_arm64.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_date_arm64.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_ppc64le.go b/v1/vendor/github.com/go-ole/go-ole/variant_ppc64le.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_ppc64le.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_ppc64le.go
diff --git a/vendor/github.com/go-ole/go-ole/variant_s390x.go b/v1/vendor/github.com/go-ole/go-ole/variant_s390x.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/variant_s390x.go
rename to v1/vendor/github.com/go-ole/go-ole/variant_s390x.go
diff --git a/vendor/github.com/go-ole/go-ole/vt_string.go b/v1/vendor/github.com/go-ole/go-ole/vt_string.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/vt_string.go
rename to v1/vendor/github.com/go-ole/go-ole/vt_string.go
diff --git a/vendor/github.com/go-ole/go-ole/winrt.go b/v1/vendor/github.com/go-ole/go-ole/winrt.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/winrt.go
rename to v1/vendor/github.com/go-ole/go-ole/winrt.go
diff --git a/vendor/github.com/go-ole/go-ole/winrt_doc.go b/v1/vendor/github.com/go-ole/go-ole/winrt_doc.go
similarity index 100%
rename from vendor/github.com/go-ole/go-ole/winrt_doc.go
rename to v1/vendor/github.com/go-ole/go-ole/winrt_doc.go
diff --git a/vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md b/v1/vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md
rename to v1/vendor/github.com/godbus/dbus/v5/CONTRIBUTING.md
diff --git a/vendor/github.com/godbus/dbus/v5/LICENSE b/v1/vendor/github.com/godbus/dbus/v5/LICENSE
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/LICENSE
rename to v1/vendor/github.com/godbus/dbus/v5/LICENSE
diff --git a/vendor/github.com/godbus/dbus/v5/MAINTAINERS b/v1/vendor/github.com/godbus/dbus/v5/MAINTAINERS
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/MAINTAINERS
rename to v1/vendor/github.com/godbus/dbus/v5/MAINTAINERS
diff --git a/vendor/github.com/godbus/dbus/v5/README.md b/v1/vendor/github.com/godbus/dbus/v5/README.md
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/README.md
rename to v1/vendor/github.com/godbus/dbus/v5/README.md
diff --git a/vendor/github.com/godbus/dbus/v5/auth.go b/v1/vendor/github.com/godbus/dbus/v5/auth.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/auth.go
rename to v1/vendor/github.com/godbus/dbus/v5/auth.go
diff --git a/vendor/github.com/godbus/dbus/v5/auth_anonymous.go b/v1/vendor/github.com/godbus/dbus/v5/auth_anonymous.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/auth_anonymous.go
rename to v1/vendor/github.com/godbus/dbus/v5/auth_anonymous.go
diff --git a/vendor/github.com/godbus/dbus/v5/auth_external.go b/v1/vendor/github.com/godbus/dbus/v5/auth_external.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/auth_external.go
rename to v1/vendor/github.com/godbus/dbus/v5/auth_external.go
diff --git a/vendor/github.com/godbus/dbus/v5/auth_sha1.go b/v1/vendor/github.com/godbus/dbus/v5/auth_sha1.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/auth_sha1.go
rename to v1/vendor/github.com/godbus/dbus/v5/auth_sha1.go
diff --git a/vendor/github.com/godbus/dbus/v5/call.go b/v1/vendor/github.com/godbus/dbus/v5/call.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/call.go
rename to v1/vendor/github.com/godbus/dbus/v5/call.go
diff --git a/vendor/github.com/godbus/dbus/v5/conn.go b/v1/vendor/github.com/godbus/dbus/v5/conn.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/conn.go
rename to v1/vendor/github.com/godbus/dbus/v5/conn.go
diff --git a/vendor/github.com/godbus/dbus/v5/conn_darwin.go b/v1/vendor/github.com/godbus/dbus/v5/conn_darwin.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/conn_darwin.go
rename to v1/vendor/github.com/godbus/dbus/v5/conn_darwin.go
diff --git a/vendor/github.com/godbus/dbus/v5/conn_other.go b/v1/vendor/github.com/godbus/dbus/v5/conn_other.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/conn_other.go
rename to v1/vendor/github.com/godbus/dbus/v5/conn_other.go
diff --git a/vendor/github.com/godbus/dbus/v5/conn_unix.go b/v1/vendor/github.com/godbus/dbus/v5/conn_unix.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/conn_unix.go
rename to v1/vendor/github.com/godbus/dbus/v5/conn_unix.go
diff --git a/vendor/github.com/godbus/dbus/v5/conn_windows.go b/v1/vendor/github.com/godbus/dbus/v5/conn_windows.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/conn_windows.go
rename to v1/vendor/github.com/godbus/dbus/v5/conn_windows.go
diff --git a/vendor/github.com/godbus/dbus/v5/dbus.go b/v1/vendor/github.com/godbus/dbus/v5/dbus.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/dbus.go
rename to v1/vendor/github.com/godbus/dbus/v5/dbus.go
diff --git a/vendor/github.com/godbus/dbus/v5/decoder.go b/v1/vendor/github.com/godbus/dbus/v5/decoder.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/decoder.go
rename to v1/vendor/github.com/godbus/dbus/v5/decoder.go
diff --git a/vendor/github.com/godbus/dbus/v5/default_handler.go b/v1/vendor/github.com/godbus/dbus/v5/default_handler.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/default_handler.go
rename to v1/vendor/github.com/godbus/dbus/v5/default_handler.go
diff --git a/vendor/github.com/godbus/dbus/v5/doc.go b/v1/vendor/github.com/godbus/dbus/v5/doc.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/doc.go
rename to v1/vendor/github.com/godbus/dbus/v5/doc.go
diff --git a/vendor/github.com/godbus/dbus/v5/encoder.go b/v1/vendor/github.com/godbus/dbus/v5/encoder.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/encoder.go
rename to v1/vendor/github.com/godbus/dbus/v5/encoder.go
diff --git a/vendor/github.com/godbus/dbus/v5/escape.go b/v1/vendor/github.com/godbus/dbus/v5/escape.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/escape.go
rename to v1/vendor/github.com/godbus/dbus/v5/escape.go
diff --git a/vendor/github.com/godbus/dbus/v5/export.go b/v1/vendor/github.com/godbus/dbus/v5/export.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/export.go
rename to v1/vendor/github.com/godbus/dbus/v5/export.go
diff --git a/vendor/github.com/godbus/dbus/v5/homedir.go b/v1/vendor/github.com/godbus/dbus/v5/homedir.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/homedir.go
rename to v1/vendor/github.com/godbus/dbus/v5/homedir.go
diff --git a/vendor/github.com/godbus/dbus/v5/match.go b/v1/vendor/github.com/godbus/dbus/v5/match.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/match.go
rename to v1/vendor/github.com/godbus/dbus/v5/match.go
diff --git a/vendor/github.com/godbus/dbus/v5/message.go b/v1/vendor/github.com/godbus/dbus/v5/message.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/message.go
rename to v1/vendor/github.com/godbus/dbus/v5/message.go
diff --git a/vendor/github.com/godbus/dbus/v5/object.go b/v1/vendor/github.com/godbus/dbus/v5/object.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/object.go
rename to v1/vendor/github.com/godbus/dbus/v5/object.go
diff --git a/vendor/github.com/godbus/dbus/v5/sequence.go b/v1/vendor/github.com/godbus/dbus/v5/sequence.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/sequence.go
rename to v1/vendor/github.com/godbus/dbus/v5/sequence.go
diff --git a/vendor/github.com/godbus/dbus/v5/sequential_handler.go b/v1/vendor/github.com/godbus/dbus/v5/sequential_handler.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/sequential_handler.go
rename to v1/vendor/github.com/godbus/dbus/v5/sequential_handler.go
diff --git a/vendor/github.com/godbus/dbus/v5/server_interfaces.go b/v1/vendor/github.com/godbus/dbus/v5/server_interfaces.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/server_interfaces.go
rename to v1/vendor/github.com/godbus/dbus/v5/server_interfaces.go
diff --git a/vendor/github.com/godbus/dbus/v5/sig.go b/v1/vendor/github.com/godbus/dbus/v5/sig.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/sig.go
rename to v1/vendor/github.com/godbus/dbus/v5/sig.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_darwin.go b/v1/vendor/github.com/godbus/dbus/v5/transport_darwin.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_darwin.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_darwin.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_generic.go b/v1/vendor/github.com/godbus/dbus/v5/transport_generic.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_generic.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_generic.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go b/v1/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_nonce_tcp.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_tcp.go b/v1/vendor/github.com/godbus/dbus/v5/transport_tcp.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_tcp.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_tcp.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_unix.go b/v1/vendor/github.com/godbus/dbus/v5/transport_unix.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_unix.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_unix.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go b/v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_dragonfly.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go b/v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_freebsd.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go b/v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_linux.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go b/v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_netbsd.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go b/v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_unixcred_openbsd.go
diff --git a/vendor/github.com/godbus/dbus/v5/transport_zos.go b/v1/vendor/github.com/godbus/dbus/v5/transport_zos.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/transport_zos.go
rename to v1/vendor/github.com/godbus/dbus/v5/transport_zos.go
diff --git a/vendor/github.com/godbus/dbus/v5/variant.go b/v1/vendor/github.com/godbus/dbus/v5/variant.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/variant.go
rename to v1/vendor/github.com/godbus/dbus/v5/variant.go
diff --git a/vendor/github.com/godbus/dbus/v5/variant_lexer.go b/v1/vendor/github.com/godbus/dbus/v5/variant_lexer.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/variant_lexer.go
rename to v1/vendor/github.com/godbus/dbus/v5/variant_lexer.go
diff --git a/vendor/github.com/godbus/dbus/v5/variant_parser.go b/v1/vendor/github.com/godbus/dbus/v5/variant_parser.go
similarity index 100%
rename from vendor/github.com/godbus/dbus/v5/variant_parser.go
rename to v1/vendor/github.com/godbus/dbus/v5/variant_parser.go
diff --git a/vendor/github.com/google/uuid/.travis.yml b/v1/vendor/github.com/google/uuid/.travis.yml
similarity index 100%
rename from vendor/github.com/google/uuid/.travis.yml
rename to v1/vendor/github.com/google/uuid/.travis.yml
diff --git a/vendor/github.com/google/uuid/CONTRIBUTING.md b/v1/vendor/github.com/google/uuid/CONTRIBUTING.md
similarity index 100%
rename from vendor/github.com/google/uuid/CONTRIBUTING.md
rename to v1/vendor/github.com/google/uuid/CONTRIBUTING.md
diff --git a/vendor/github.com/google/uuid/CONTRIBUTORS b/v1/vendor/github.com/google/uuid/CONTRIBUTORS
similarity index 100%
rename from vendor/github.com/google/uuid/CONTRIBUTORS
rename to v1/vendor/github.com/google/uuid/CONTRIBUTORS
diff --git a/vendor/github.com/google/uuid/LICENSE b/v1/vendor/github.com/google/uuid/LICENSE
similarity index 100%
rename from vendor/github.com/google/uuid/LICENSE
rename to v1/vendor/github.com/google/uuid/LICENSE
diff --git a/vendor/github.com/google/uuid/README.md b/v1/vendor/github.com/google/uuid/README.md
similarity index 100%
rename from vendor/github.com/google/uuid/README.md
rename to v1/vendor/github.com/google/uuid/README.md
diff --git a/vendor/github.com/google/uuid/dce.go b/v1/vendor/github.com/google/uuid/dce.go
similarity index 100%
rename from vendor/github.com/google/uuid/dce.go
rename to v1/vendor/github.com/google/uuid/dce.go
diff --git a/vendor/github.com/google/uuid/doc.go b/v1/vendor/github.com/google/uuid/doc.go
similarity index 100%
rename from vendor/github.com/google/uuid/doc.go
rename to v1/vendor/github.com/google/uuid/doc.go
diff --git a/vendor/github.com/google/uuid/hash.go b/v1/vendor/github.com/google/uuid/hash.go
similarity index 100%
rename from vendor/github.com/google/uuid/hash.go
rename to v1/vendor/github.com/google/uuid/hash.go
diff --git a/vendor/github.com/google/uuid/marshal.go b/v1/vendor/github.com/google/uuid/marshal.go
similarity index 100%
rename from vendor/github.com/google/uuid/marshal.go
rename to v1/vendor/github.com/google/uuid/marshal.go
diff --git a/vendor/github.com/google/uuid/node.go b/v1/vendor/github.com/google/uuid/node.go
similarity index 100%
rename from vendor/github.com/google/uuid/node.go
rename to v1/vendor/github.com/google/uuid/node.go
diff --git a/vendor/github.com/google/uuid/node_js.go b/v1/vendor/github.com/google/uuid/node_js.go
similarity index 100%
rename from vendor/github.com/google/uuid/node_js.go
rename to v1/vendor/github.com/google/uuid/node_js.go
diff --git a/vendor/github.com/google/uuid/node_net.go b/v1/vendor/github.com/google/uuid/node_net.go
similarity index 100%
rename from vendor/github.com/google/uuid/node_net.go
rename to v1/vendor/github.com/google/uuid/node_net.go
diff --git a/vendor/github.com/google/uuid/null.go b/v1/vendor/github.com/google/uuid/null.go
similarity index 100%
rename from vendor/github.com/google/uuid/null.go
rename to v1/vendor/github.com/google/uuid/null.go
diff --git a/vendor/github.com/google/uuid/sql.go b/v1/vendor/github.com/google/uuid/sql.go
similarity index 100%
rename from vendor/github.com/google/uuid/sql.go
rename to v1/vendor/github.com/google/uuid/sql.go
diff --git a/vendor/github.com/google/uuid/time.go b/v1/vendor/github.com/google/uuid/time.go
similarity index 100%
rename from vendor/github.com/google/uuid/time.go
rename to v1/vendor/github.com/google/uuid/time.go
diff --git a/vendor/github.com/google/uuid/util.go b/v1/vendor/github.com/google/uuid/util.go
similarity index 100%
rename from vendor/github.com/google/uuid/util.go
rename to v1/vendor/github.com/google/uuid/util.go
diff --git a/vendor/github.com/google/uuid/uuid.go b/v1/vendor/github.com/google/uuid/uuid.go
similarity index 100%
rename from vendor/github.com/google/uuid/uuid.go
rename to v1/vendor/github.com/google/uuid/uuid.go
diff --git a/vendor/github.com/google/uuid/version1.go b/v1/vendor/github.com/google/uuid/version1.go
similarity index 100%
rename from vendor/github.com/google/uuid/version1.go
rename to v1/vendor/github.com/google/uuid/version1.go
diff --git a/vendor/github.com/google/uuid/version4.go b/v1/vendor/github.com/google/uuid/version4.go
similarity index 100%
rename from vendor/github.com/google/uuid/version4.go
rename to v1/vendor/github.com/google/uuid/version4.go
diff --git a/vendor/github.com/jchv/go-winloader/LICENSE.md b/v1/vendor/github.com/jchv/go-winloader/LICENSE.md
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/LICENSE.md
rename to v1/vendor/github.com/jchv/go-winloader/LICENSE.md
diff --git a/vendor/github.com/jchv/go-winloader/README.md b/v1/vendor/github.com/jchv/go-winloader/README.md
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/README.md
rename to v1/vendor/github.com/jchv/go-winloader/README.md
diff --git a/vendor/github.com/jchv/go-winloader/common.go b/v1/vendor/github.com/jchv/go-winloader/common.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/common.go
rename to v1/vendor/github.com/jchv/go-winloader/common.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/loader/loader.go b/v1/vendor/github.com/jchv/go-winloader/internal/loader/loader.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/loader/loader.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/loader/loader.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/loader/machine.go b/v1/vendor/github.com/jchv/go-winloader/internal/loader/machine.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/loader/machine.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/loader/machine.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/memloader/cache.go b/v1/vendor/github.com/jchv/go-winloader/internal/memloader/cache.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/memloader/cache.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/memloader/cache.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/memloader/loader.go b/v1/vendor/github.com/jchv/go-winloader/internal/memloader/loader.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/memloader/loader.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/memloader/loader.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/pe/export.go b/v1/vendor/github.com/jchv/go-winloader/internal/pe/export.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/pe/export.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/pe/export.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/pe/format.go b/v1/vendor/github.com/jchv/go-winloader/internal/pe/format.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/pe/format.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/pe/format.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/pe/import.go b/v1/vendor/github.com/jchv/go-winloader/internal/pe/import.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/pe/import.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/pe/import.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/pe/module.go b/v1/vendor/github.com/jchv/go-winloader/internal/pe/module.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/pe/module.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/pe/module.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/pe/reloc.go b/v1/vendor/github.com/jchv/go-winloader/internal/pe/reloc.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/pe/reloc.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/pe/reloc.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/pe/util.go b/v1/vendor/github.com/jchv/go-winloader/internal/pe/util.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/pe/util.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/pe/util.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/vmem/common.go b/v1/vendor/github.com/jchv/go-winloader/internal/vmem/common.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/vmem/common.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/vmem/common.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/vmem/memory_other.go b/v1/vendor/github.com/jchv/go-winloader/internal/vmem/memory_other.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/vmem/memory_other.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/vmem/memory_other.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/vmem/memory_windows.go b/v1/vendor/github.com/jchv/go-winloader/internal/vmem/memory_windows.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/vmem/memory_windows.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/vmem/memory_windows.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/hacks_other.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/hacks_other.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/hacks_other.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/hacks_other.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/hacks_windows.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/hacks_windows.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/hacks_windows.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/hacks_windows.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/loader_windows.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/loader_windows.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/loader_windows.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/loader_windows.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/machine_windows.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/machine_windows.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/machine_windows.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/machine_windows.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_386.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_386.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_386.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_386.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_amd64.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_amd64.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_amd64.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_amd64.go
diff --git a/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_arm64.go b/v1/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_arm64.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_arm64.go
rename to v1/vendor/github.com/jchv/go-winloader/internal/winloader/nativearch_arm64.go
diff --git a/vendor/github.com/jchv/go-winloader/loader_other.go b/v1/vendor/github.com/jchv/go-winloader/loader_other.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/loader_other.go
rename to v1/vendor/github.com/jchv/go-winloader/loader_other.go
diff --git a/vendor/github.com/jchv/go-winloader/loader_windows.go b/v1/vendor/github.com/jchv/go-winloader/loader_windows.go
similarity index 100%
rename from vendor/github.com/jchv/go-winloader/loader_windows.go
rename to v1/vendor/github.com/jchv/go-winloader/loader_windows.go
diff --git a/vendor/github.com/labstack/echo/v4/.editorconfig b/v1/vendor/github.com/labstack/echo/v4/.editorconfig
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/.editorconfig
rename to v1/vendor/github.com/labstack/echo/v4/.editorconfig
diff --git a/vendor/github.com/labstack/echo/v4/.gitattributes b/v1/vendor/github.com/labstack/echo/v4/.gitattributes
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/.gitattributes
rename to v1/vendor/github.com/labstack/echo/v4/.gitattributes
diff --git a/vendor/github.com/labstack/echo/v4/.gitignore b/v1/vendor/github.com/labstack/echo/v4/.gitignore
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/.gitignore
rename to v1/vendor/github.com/labstack/echo/v4/.gitignore
diff --git a/vendor/github.com/labstack/echo/v4/CHANGELOG.md b/v1/vendor/github.com/labstack/echo/v4/CHANGELOG.md
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/CHANGELOG.md
rename to v1/vendor/github.com/labstack/echo/v4/CHANGELOG.md
diff --git a/vendor/github.com/labstack/echo/v4/LICENSE b/v1/vendor/github.com/labstack/echo/v4/LICENSE
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/LICENSE
rename to v1/vendor/github.com/labstack/echo/v4/LICENSE
diff --git a/vendor/github.com/labstack/echo/v4/Makefile b/v1/vendor/github.com/labstack/echo/v4/Makefile
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/Makefile
rename to v1/vendor/github.com/labstack/echo/v4/Makefile
diff --git a/vendor/github.com/labstack/echo/v4/README.md b/v1/vendor/github.com/labstack/echo/v4/README.md
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/README.md
rename to v1/vendor/github.com/labstack/echo/v4/README.md
diff --git a/vendor/github.com/labstack/echo/v4/bind.go b/v1/vendor/github.com/labstack/echo/v4/bind.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/bind.go
rename to v1/vendor/github.com/labstack/echo/v4/bind.go
diff --git a/vendor/github.com/labstack/echo/v4/binder.go b/v1/vendor/github.com/labstack/echo/v4/binder.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/binder.go
rename to v1/vendor/github.com/labstack/echo/v4/binder.go
diff --git a/vendor/github.com/labstack/echo/v4/codecov.yml b/v1/vendor/github.com/labstack/echo/v4/codecov.yml
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/codecov.yml
rename to v1/vendor/github.com/labstack/echo/v4/codecov.yml
diff --git a/vendor/github.com/labstack/echo/v4/context.go b/v1/vendor/github.com/labstack/echo/v4/context.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/context.go
rename to v1/vendor/github.com/labstack/echo/v4/context.go
diff --git a/vendor/github.com/labstack/echo/v4/context_fs.go b/v1/vendor/github.com/labstack/echo/v4/context_fs.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/context_fs.go
rename to v1/vendor/github.com/labstack/echo/v4/context_fs.go
diff --git a/vendor/github.com/labstack/echo/v4/echo.go b/v1/vendor/github.com/labstack/echo/v4/echo.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/echo.go
rename to v1/vendor/github.com/labstack/echo/v4/echo.go
diff --git a/vendor/github.com/labstack/echo/v4/echo_fs.go b/v1/vendor/github.com/labstack/echo/v4/echo_fs.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/echo_fs.go
rename to v1/vendor/github.com/labstack/echo/v4/echo_fs.go
diff --git a/vendor/github.com/labstack/echo/v4/group.go b/v1/vendor/github.com/labstack/echo/v4/group.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/group.go
rename to v1/vendor/github.com/labstack/echo/v4/group.go
diff --git a/vendor/github.com/labstack/echo/v4/group_fs.go b/v1/vendor/github.com/labstack/echo/v4/group_fs.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/group_fs.go
rename to v1/vendor/github.com/labstack/echo/v4/group_fs.go
diff --git a/vendor/github.com/labstack/echo/v4/ip.go b/v1/vendor/github.com/labstack/echo/v4/ip.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/ip.go
rename to v1/vendor/github.com/labstack/echo/v4/ip.go
diff --git a/vendor/github.com/labstack/echo/v4/json.go b/v1/vendor/github.com/labstack/echo/v4/json.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/json.go
rename to v1/vendor/github.com/labstack/echo/v4/json.go
diff --git a/vendor/github.com/labstack/echo/v4/log.go b/v1/vendor/github.com/labstack/echo/v4/log.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/log.go
rename to v1/vendor/github.com/labstack/echo/v4/log.go
diff --git a/vendor/github.com/labstack/echo/v4/response.go b/v1/vendor/github.com/labstack/echo/v4/response.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/response.go
rename to v1/vendor/github.com/labstack/echo/v4/response.go
diff --git a/vendor/github.com/labstack/echo/v4/router.go b/v1/vendor/github.com/labstack/echo/v4/router.go
similarity index 100%
rename from vendor/github.com/labstack/echo/v4/router.go
rename to v1/vendor/github.com/labstack/echo/v4/router.go
diff --git a/vendor/github.com/labstack/gommon/LICENSE b/v1/vendor/github.com/labstack/gommon/LICENSE
similarity index 100%
rename from vendor/github.com/labstack/gommon/LICENSE
rename to v1/vendor/github.com/labstack/gommon/LICENSE
diff --git a/vendor/github.com/labstack/gommon/color/README.md b/v1/vendor/github.com/labstack/gommon/color/README.md
similarity index 100%
rename from vendor/github.com/labstack/gommon/color/README.md
rename to v1/vendor/github.com/labstack/gommon/color/README.md
diff --git a/vendor/github.com/labstack/gommon/color/color.go b/v1/vendor/github.com/labstack/gommon/color/color.go
similarity index 100%
rename from vendor/github.com/labstack/gommon/color/color.go
rename to v1/vendor/github.com/labstack/gommon/color/color.go
diff --git a/vendor/github.com/labstack/gommon/log/README.md b/v1/vendor/github.com/labstack/gommon/log/README.md
similarity index 100%
rename from vendor/github.com/labstack/gommon/log/README.md
rename to v1/vendor/github.com/labstack/gommon/log/README.md
diff --git a/vendor/github.com/labstack/gommon/log/color.go b/v1/vendor/github.com/labstack/gommon/log/color.go
similarity index 100%
rename from vendor/github.com/labstack/gommon/log/color.go
rename to v1/vendor/github.com/labstack/gommon/log/color.go
diff --git a/vendor/github.com/labstack/gommon/log/log.go b/v1/vendor/github.com/labstack/gommon/log/log.go
similarity index 100%
rename from vendor/github.com/labstack/gommon/log/log.go
rename to v1/vendor/github.com/labstack/gommon/log/log.go
diff --git a/vendor/github.com/labstack/gommon/log/white.go b/v1/vendor/github.com/labstack/gommon/log/white.go
similarity index 100%
rename from vendor/github.com/labstack/gommon/log/white.go
rename to v1/vendor/github.com/labstack/gommon/log/white.go
diff --git a/vendor/github.com/leaanthony/go-ansi-parser/LICENSE b/v1/vendor/github.com/leaanthony/go-ansi-parser/LICENSE
similarity index 100%
rename from vendor/github.com/leaanthony/go-ansi-parser/LICENSE
rename to v1/vendor/github.com/leaanthony/go-ansi-parser/LICENSE
diff --git a/vendor/github.com/leaanthony/go-ansi-parser/README.md b/v1/vendor/github.com/leaanthony/go-ansi-parser/README.md
similarity index 100%
rename from vendor/github.com/leaanthony/go-ansi-parser/README.md
rename to v1/vendor/github.com/leaanthony/go-ansi-parser/README.md
diff --git a/vendor/github.com/leaanthony/go-ansi-parser/ansi.go b/v1/vendor/github.com/leaanthony/go-ansi-parser/ansi.go
similarity index 100%
rename from vendor/github.com/leaanthony/go-ansi-parser/ansi.go
rename to v1/vendor/github.com/leaanthony/go-ansi-parser/ansi.go
diff --git a/vendor/github.com/leaanthony/go-ansi-parser/cols.go b/v1/vendor/github.com/leaanthony/go-ansi-parser/cols.go
similarity index 100%
rename from vendor/github.com/leaanthony/go-ansi-parser/cols.go
rename to v1/vendor/github.com/leaanthony/go-ansi-parser/cols.go
diff --git a/vendor/github.com/leaanthony/go-ansi-parser/logo.png b/v1/vendor/github.com/leaanthony/go-ansi-parser/logo.png
similarity index 100%
rename from vendor/github.com/leaanthony/go-ansi-parser/logo.png
rename to v1/vendor/github.com/leaanthony/go-ansi-parser/logo.png
diff --git a/vendor/github.com/leaanthony/go-ansi-parser/options.go b/v1/vendor/github.com/leaanthony/go-ansi-parser/options.go
similarity index 100%
rename from vendor/github.com/leaanthony/go-ansi-parser/options.go
rename to v1/vendor/github.com/leaanthony/go-ansi-parser/options.go
diff --git a/vendor/github.com/leaanthony/gosod/.gitignore b/v1/vendor/github.com/leaanthony/gosod/.gitignore
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/.gitignore
rename to v1/vendor/github.com/leaanthony/gosod/.gitignore
diff --git a/vendor/github.com/leaanthony/gosod/LICENSE b/v1/vendor/github.com/leaanthony/gosod/LICENSE
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/LICENSE
rename to v1/vendor/github.com/leaanthony/gosod/LICENSE
diff --git a/vendor/github.com/leaanthony/gosod/README.md b/v1/vendor/github.com/leaanthony/gosod/README.md
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/README.md
rename to v1/vendor/github.com/leaanthony/gosod/README.md
diff --git a/vendor/github.com/leaanthony/gosod/gosod.go b/v1/vendor/github.com/leaanthony/gosod/gosod.go
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/gosod.go
rename to v1/vendor/github.com/leaanthony/gosod/gosod.go
diff --git a/vendor/github.com/leaanthony/gosod/internal/templatedir/templatedir.go b/v1/vendor/github.com/leaanthony/gosod/internal/templatedir/templatedir.go
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/internal/templatedir/templatedir.go
rename to v1/vendor/github.com/leaanthony/gosod/internal/templatedir/templatedir.go
diff --git a/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/custom.filtername.txt b/v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/custom.filtername.txt
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/custom.filtername.txt
rename to v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/custom.filtername.txt
diff --git a/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/ignored.txt b/v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/ignored.txt
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/ignored.txt
rename to v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/ignored.txt
diff --git a/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/included.txt b/v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/included.txt
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/included.txt
rename to v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/included.txt
diff --git a/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/sub.tmpl.go b/v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/sub.tmpl.go
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/sub.tmpl.go
rename to v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/subdir/sub.tmpl.go
diff --git a/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/test.tmpl.go b/v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/test.tmpl.go
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/test.tmpl.go
rename to v1/vendor/github.com/leaanthony/gosod/internal/templatedir/testdata/embedded/test.tmpl.go
diff --git a/vendor/github.com/leaanthony/gosod/logo.png b/v1/vendor/github.com/leaanthony/gosod/logo.png
similarity index 100%
rename from vendor/github.com/leaanthony/gosod/logo.png
rename to v1/vendor/github.com/leaanthony/gosod/logo.png
diff --git a/vendor/github.com/leaanthony/slicer/.gitignore b/v1/vendor/github.com/leaanthony/slicer/.gitignore
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/.gitignore
rename to v1/vendor/github.com/leaanthony/slicer/.gitignore
diff --git a/vendor/github.com/leaanthony/slicer/CHANGELOG.md b/v1/vendor/github.com/leaanthony/slicer/CHANGELOG.md
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/CHANGELOG.md
rename to v1/vendor/github.com/leaanthony/slicer/CHANGELOG.md
diff --git a/vendor/github.com/leaanthony/slicer/LICENSE b/v1/vendor/github.com/leaanthony/slicer/LICENSE
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/LICENSE
rename to v1/vendor/github.com/leaanthony/slicer/LICENSE
diff --git a/vendor/github.com/leaanthony/slicer/README.md b/v1/vendor/github.com/leaanthony/slicer/README.md
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/README.md
rename to v1/vendor/github.com/leaanthony/slicer/README.md
diff --git a/vendor/github.com/leaanthony/slicer/bool.go b/v1/vendor/github.com/leaanthony/slicer/bool.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/bool.go
rename to v1/vendor/github.com/leaanthony/slicer/bool.go
diff --git a/vendor/github.com/leaanthony/slicer/float32.go b/v1/vendor/github.com/leaanthony/slicer/float32.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/float32.go
rename to v1/vendor/github.com/leaanthony/slicer/float32.go
diff --git a/vendor/github.com/leaanthony/slicer/float64.go b/v1/vendor/github.com/leaanthony/slicer/float64.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/float64.go
rename to v1/vendor/github.com/leaanthony/slicer/float64.go
diff --git a/vendor/github.com/leaanthony/slicer/int.go b/v1/vendor/github.com/leaanthony/slicer/int.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/int.go
rename to v1/vendor/github.com/leaanthony/slicer/int.go
diff --git a/vendor/github.com/leaanthony/slicer/int16.go b/v1/vendor/github.com/leaanthony/slicer/int16.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/int16.go
rename to v1/vendor/github.com/leaanthony/slicer/int16.go
diff --git a/vendor/github.com/leaanthony/slicer/int32.go b/v1/vendor/github.com/leaanthony/slicer/int32.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/int32.go
rename to v1/vendor/github.com/leaanthony/slicer/int32.go
diff --git a/vendor/github.com/leaanthony/slicer/int64.go b/v1/vendor/github.com/leaanthony/slicer/int64.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/int64.go
rename to v1/vendor/github.com/leaanthony/slicer/int64.go
diff --git a/vendor/github.com/leaanthony/slicer/int8.go b/v1/vendor/github.com/leaanthony/slicer/int8.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/int8.go
rename to v1/vendor/github.com/leaanthony/slicer/int8.go
diff --git a/vendor/github.com/leaanthony/slicer/interface.go b/v1/vendor/github.com/leaanthony/slicer/interface.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/interface.go
rename to v1/vendor/github.com/leaanthony/slicer/interface.go
diff --git a/vendor/github.com/leaanthony/slicer/logo.png b/v1/vendor/github.com/leaanthony/slicer/logo.png
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/logo.png
rename to v1/vendor/github.com/leaanthony/slicer/logo.png
diff --git a/vendor/github.com/leaanthony/slicer/string.go b/v1/vendor/github.com/leaanthony/slicer/string.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/string.go
rename to v1/vendor/github.com/leaanthony/slicer/string.go
diff --git a/vendor/github.com/leaanthony/slicer/uint.go b/v1/vendor/github.com/leaanthony/slicer/uint.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/uint.go
rename to v1/vendor/github.com/leaanthony/slicer/uint.go
diff --git a/vendor/github.com/leaanthony/slicer/uint16.go b/v1/vendor/github.com/leaanthony/slicer/uint16.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/uint16.go
rename to v1/vendor/github.com/leaanthony/slicer/uint16.go
diff --git a/vendor/github.com/leaanthony/slicer/uint32.go b/v1/vendor/github.com/leaanthony/slicer/uint32.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/uint32.go
rename to v1/vendor/github.com/leaanthony/slicer/uint32.go
diff --git a/vendor/github.com/leaanthony/slicer/uint64.go b/v1/vendor/github.com/leaanthony/slicer/uint64.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/uint64.go
rename to v1/vendor/github.com/leaanthony/slicer/uint64.go
diff --git a/vendor/github.com/leaanthony/slicer/uint8.go b/v1/vendor/github.com/leaanthony/slicer/uint8.go
similarity index 100%
rename from vendor/github.com/leaanthony/slicer/uint8.go
rename to v1/vendor/github.com/leaanthony/slicer/uint8.go
diff --git a/vendor/github.com/leaanthony/u/.gitignore b/v1/vendor/github.com/leaanthony/u/.gitignore
similarity index 100%
rename from vendor/github.com/leaanthony/u/.gitignore
rename to v1/vendor/github.com/leaanthony/u/.gitignore
diff --git a/vendor/github.com/leaanthony/u/README.md b/v1/vendor/github.com/leaanthony/u/README.md
similarity index 100%
rename from vendor/github.com/leaanthony/u/README.md
rename to v1/vendor/github.com/leaanthony/u/README.md
diff --git a/vendor/github.com/leaanthony/u/u.go b/v1/vendor/github.com/leaanthony/u/u.go
similarity index 100%
rename from vendor/github.com/leaanthony/u/u.go
rename to v1/vendor/github.com/leaanthony/u/u.go
diff --git a/vendor/github.com/mattn/go-colorable/LICENSE b/v1/vendor/github.com/mattn/go-colorable/LICENSE
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/LICENSE
rename to v1/vendor/github.com/mattn/go-colorable/LICENSE
diff --git a/vendor/github.com/mattn/go-colorable/README.md b/v1/vendor/github.com/mattn/go-colorable/README.md
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/README.md
rename to v1/vendor/github.com/mattn/go-colorable/README.md
diff --git a/vendor/github.com/mattn/go-colorable/colorable_appengine.go b/v1/vendor/github.com/mattn/go-colorable/colorable_appengine.go
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/colorable_appengine.go
rename to v1/vendor/github.com/mattn/go-colorable/colorable_appengine.go
diff --git a/vendor/github.com/mattn/go-colorable/colorable_others.go b/v1/vendor/github.com/mattn/go-colorable/colorable_others.go
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/colorable_others.go
rename to v1/vendor/github.com/mattn/go-colorable/colorable_others.go
diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/v1/vendor/github.com/mattn/go-colorable/colorable_windows.go
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/colorable_windows.go
rename to v1/vendor/github.com/mattn/go-colorable/colorable_windows.go
diff --git a/vendor/github.com/mattn/go-colorable/go.test.sh b/v1/vendor/github.com/mattn/go-colorable/go.test.sh
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/go.test.sh
rename to v1/vendor/github.com/mattn/go-colorable/go.test.sh
diff --git a/vendor/github.com/mattn/go-colorable/noncolorable.go b/v1/vendor/github.com/mattn/go-colorable/noncolorable.go
similarity index 100%
rename from vendor/github.com/mattn/go-colorable/noncolorable.go
rename to v1/vendor/github.com/mattn/go-colorable/noncolorable.go
diff --git a/vendor/github.com/mattn/go-isatty/LICENSE b/v1/vendor/github.com/mattn/go-isatty/LICENSE
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/LICENSE
rename to v1/vendor/github.com/mattn/go-isatty/LICENSE
diff --git a/vendor/github.com/mattn/go-isatty/README.md b/v1/vendor/github.com/mattn/go-isatty/README.md
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/README.md
rename to v1/vendor/github.com/mattn/go-isatty/README.md
diff --git a/vendor/github.com/mattn/go-isatty/doc.go b/v1/vendor/github.com/mattn/go-isatty/doc.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/doc.go
rename to v1/vendor/github.com/mattn/go-isatty/doc.go
diff --git a/vendor/github.com/mattn/go-isatty/go.test.sh b/v1/vendor/github.com/mattn/go-isatty/go.test.sh
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/go.test.sh
rename to v1/vendor/github.com/mattn/go-isatty/go.test.sh
diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/v1/vendor/github.com/mattn/go-isatty/isatty_bsd.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/isatty_bsd.go
rename to v1/vendor/github.com/mattn/go-isatty/isatty_bsd.go
diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/v1/vendor/github.com/mattn/go-isatty/isatty_others.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/isatty_others.go
rename to v1/vendor/github.com/mattn/go-isatty/isatty_others.go
diff --git a/vendor/github.com/mattn/go-isatty/isatty_plan9.go b/v1/vendor/github.com/mattn/go-isatty/isatty_plan9.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/isatty_plan9.go
rename to v1/vendor/github.com/mattn/go-isatty/isatty_plan9.go
diff --git a/vendor/github.com/mattn/go-isatty/isatty_solaris.go b/v1/vendor/github.com/mattn/go-isatty/isatty_solaris.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/isatty_solaris.go
rename to v1/vendor/github.com/mattn/go-isatty/isatty_solaris.go
diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/v1/vendor/github.com/mattn/go-isatty/isatty_tcgets.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/isatty_tcgets.go
rename to v1/vendor/github.com/mattn/go-isatty/isatty_tcgets.go
diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/v1/vendor/github.com/mattn/go-isatty/isatty_windows.go
similarity index 100%
rename from vendor/github.com/mattn/go-isatty/isatty_windows.go
rename to v1/vendor/github.com/mattn/go-isatty/isatty_windows.go
diff --git a/vendor/github.com/pkg/browser/LICENSE b/v1/vendor/github.com/pkg/browser/LICENSE
similarity index 100%
rename from vendor/github.com/pkg/browser/LICENSE
rename to v1/vendor/github.com/pkg/browser/LICENSE
diff --git a/vendor/github.com/pkg/browser/README.md b/v1/vendor/github.com/pkg/browser/README.md
similarity index 100%
rename from vendor/github.com/pkg/browser/README.md
rename to v1/vendor/github.com/pkg/browser/README.md
diff --git a/vendor/github.com/pkg/browser/browser.go b/v1/vendor/github.com/pkg/browser/browser.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser.go
rename to v1/vendor/github.com/pkg/browser/browser.go
diff --git a/vendor/github.com/pkg/browser/browser_darwin.go b/v1/vendor/github.com/pkg/browser/browser_darwin.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_darwin.go
rename to v1/vendor/github.com/pkg/browser/browser_darwin.go
diff --git a/vendor/github.com/pkg/browser/browser_freebsd.go b/v1/vendor/github.com/pkg/browser/browser_freebsd.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_freebsd.go
rename to v1/vendor/github.com/pkg/browser/browser_freebsd.go
diff --git a/vendor/github.com/pkg/browser/browser_linux.go b/v1/vendor/github.com/pkg/browser/browser_linux.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_linux.go
rename to v1/vendor/github.com/pkg/browser/browser_linux.go
diff --git a/vendor/github.com/pkg/browser/browser_netbsd.go b/v1/vendor/github.com/pkg/browser/browser_netbsd.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_netbsd.go
rename to v1/vendor/github.com/pkg/browser/browser_netbsd.go
diff --git a/vendor/github.com/pkg/browser/browser_openbsd.go b/v1/vendor/github.com/pkg/browser/browser_openbsd.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_openbsd.go
rename to v1/vendor/github.com/pkg/browser/browser_openbsd.go
diff --git a/vendor/github.com/pkg/browser/browser_unsupported.go b/v1/vendor/github.com/pkg/browser/browser_unsupported.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_unsupported.go
rename to v1/vendor/github.com/pkg/browser/browser_unsupported.go
diff --git a/vendor/github.com/pkg/browser/browser_windows.go b/v1/vendor/github.com/pkg/browser/browser_windows.go
similarity index 100%
rename from vendor/github.com/pkg/browser/browser_windows.go
rename to v1/vendor/github.com/pkg/browser/browser_windows.go
diff --git a/vendor/github.com/pkg/errors/.gitignore b/v1/vendor/github.com/pkg/errors/.gitignore
similarity index 100%
rename from vendor/github.com/pkg/errors/.gitignore
rename to v1/vendor/github.com/pkg/errors/.gitignore
diff --git a/vendor/github.com/pkg/errors/.travis.yml b/v1/vendor/github.com/pkg/errors/.travis.yml
similarity index 100%
rename from vendor/github.com/pkg/errors/.travis.yml
rename to v1/vendor/github.com/pkg/errors/.travis.yml
diff --git a/vendor/github.com/pkg/errors/LICENSE b/v1/vendor/github.com/pkg/errors/LICENSE
similarity index 100%
rename from vendor/github.com/pkg/errors/LICENSE
rename to v1/vendor/github.com/pkg/errors/LICENSE
diff --git a/vendor/github.com/pkg/errors/Makefile b/v1/vendor/github.com/pkg/errors/Makefile
similarity index 100%
rename from vendor/github.com/pkg/errors/Makefile
rename to v1/vendor/github.com/pkg/errors/Makefile
diff --git a/vendor/github.com/pkg/errors/README.md b/v1/vendor/github.com/pkg/errors/README.md
similarity index 100%
rename from vendor/github.com/pkg/errors/README.md
rename to v1/vendor/github.com/pkg/errors/README.md
diff --git a/vendor/github.com/pkg/errors/appveyor.yml b/v1/vendor/github.com/pkg/errors/appveyor.yml
similarity index 100%
rename from vendor/github.com/pkg/errors/appveyor.yml
rename to v1/vendor/github.com/pkg/errors/appveyor.yml
diff --git a/vendor/github.com/pkg/errors/errors.go b/v1/vendor/github.com/pkg/errors/errors.go
similarity index 100%
rename from vendor/github.com/pkg/errors/errors.go
rename to v1/vendor/github.com/pkg/errors/errors.go
diff --git a/vendor/github.com/pkg/errors/go113.go b/v1/vendor/github.com/pkg/errors/go113.go
similarity index 100%
rename from vendor/github.com/pkg/errors/go113.go
rename to v1/vendor/github.com/pkg/errors/go113.go
diff --git a/vendor/github.com/pkg/errors/stack.go b/v1/vendor/github.com/pkg/errors/stack.go
similarity index 100%
rename from vendor/github.com/pkg/errors/stack.go
rename to v1/vendor/github.com/pkg/errors/stack.go
diff --git a/vendor/github.com/rivo/uniseg/LICENSE.txt b/v1/vendor/github.com/rivo/uniseg/LICENSE.txt
similarity index 100%
rename from vendor/github.com/rivo/uniseg/LICENSE.txt
rename to v1/vendor/github.com/rivo/uniseg/LICENSE.txt
diff --git a/vendor/github.com/rivo/uniseg/README.md b/v1/vendor/github.com/rivo/uniseg/README.md
similarity index 100%
rename from vendor/github.com/rivo/uniseg/README.md
rename to v1/vendor/github.com/rivo/uniseg/README.md
diff --git a/vendor/github.com/rivo/uniseg/doc.go b/v1/vendor/github.com/rivo/uniseg/doc.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/doc.go
rename to v1/vendor/github.com/rivo/uniseg/doc.go
diff --git a/vendor/github.com/rivo/uniseg/eastasianwidth.go b/v1/vendor/github.com/rivo/uniseg/eastasianwidth.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/eastasianwidth.go
rename to v1/vendor/github.com/rivo/uniseg/eastasianwidth.go
diff --git a/vendor/github.com/rivo/uniseg/emojipresentation.go b/v1/vendor/github.com/rivo/uniseg/emojipresentation.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/emojipresentation.go
rename to v1/vendor/github.com/rivo/uniseg/emojipresentation.go
diff --git a/vendor/github.com/rivo/uniseg/gen_breaktest.go b/v1/vendor/github.com/rivo/uniseg/gen_breaktest.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/gen_breaktest.go
rename to v1/vendor/github.com/rivo/uniseg/gen_breaktest.go
diff --git a/vendor/github.com/rivo/uniseg/gen_properties.go b/v1/vendor/github.com/rivo/uniseg/gen_properties.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/gen_properties.go
rename to v1/vendor/github.com/rivo/uniseg/gen_properties.go
diff --git a/vendor/github.com/rivo/uniseg/grapheme.go b/v1/vendor/github.com/rivo/uniseg/grapheme.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/grapheme.go
rename to v1/vendor/github.com/rivo/uniseg/grapheme.go
diff --git a/vendor/github.com/rivo/uniseg/graphemeproperties.go b/v1/vendor/github.com/rivo/uniseg/graphemeproperties.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/graphemeproperties.go
rename to v1/vendor/github.com/rivo/uniseg/graphemeproperties.go
diff --git a/vendor/github.com/rivo/uniseg/graphemerules.go b/v1/vendor/github.com/rivo/uniseg/graphemerules.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/graphemerules.go
rename to v1/vendor/github.com/rivo/uniseg/graphemerules.go
diff --git a/vendor/github.com/rivo/uniseg/line.go b/v1/vendor/github.com/rivo/uniseg/line.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/line.go
rename to v1/vendor/github.com/rivo/uniseg/line.go
diff --git a/vendor/github.com/rivo/uniseg/lineproperties.go b/v1/vendor/github.com/rivo/uniseg/lineproperties.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/lineproperties.go
rename to v1/vendor/github.com/rivo/uniseg/lineproperties.go
diff --git a/vendor/github.com/rivo/uniseg/linerules.go b/v1/vendor/github.com/rivo/uniseg/linerules.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/linerules.go
rename to v1/vendor/github.com/rivo/uniseg/linerules.go
diff --git a/vendor/github.com/rivo/uniseg/properties.go b/v1/vendor/github.com/rivo/uniseg/properties.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/properties.go
rename to v1/vendor/github.com/rivo/uniseg/properties.go
diff --git a/vendor/github.com/rivo/uniseg/sentence.go b/v1/vendor/github.com/rivo/uniseg/sentence.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/sentence.go
rename to v1/vendor/github.com/rivo/uniseg/sentence.go
diff --git a/vendor/github.com/rivo/uniseg/sentenceproperties.go b/v1/vendor/github.com/rivo/uniseg/sentenceproperties.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/sentenceproperties.go
rename to v1/vendor/github.com/rivo/uniseg/sentenceproperties.go
diff --git a/vendor/github.com/rivo/uniseg/sentencerules.go b/v1/vendor/github.com/rivo/uniseg/sentencerules.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/sentencerules.go
rename to v1/vendor/github.com/rivo/uniseg/sentencerules.go
diff --git a/vendor/github.com/rivo/uniseg/step.go b/v1/vendor/github.com/rivo/uniseg/step.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/step.go
rename to v1/vendor/github.com/rivo/uniseg/step.go
diff --git a/vendor/github.com/rivo/uniseg/width.go b/v1/vendor/github.com/rivo/uniseg/width.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/width.go
rename to v1/vendor/github.com/rivo/uniseg/width.go
diff --git a/vendor/github.com/rivo/uniseg/word.go b/v1/vendor/github.com/rivo/uniseg/word.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/word.go
rename to v1/vendor/github.com/rivo/uniseg/word.go
diff --git a/vendor/github.com/rivo/uniseg/wordproperties.go b/v1/vendor/github.com/rivo/uniseg/wordproperties.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/wordproperties.go
rename to v1/vendor/github.com/rivo/uniseg/wordproperties.go
diff --git a/vendor/github.com/rivo/uniseg/wordrules.go b/v1/vendor/github.com/rivo/uniseg/wordrules.go
similarity index 100%
rename from vendor/github.com/rivo/uniseg/wordrules.go
rename to v1/vendor/github.com/rivo/uniseg/wordrules.go
diff --git a/vendor/github.com/samber/lo/.gitignore b/v1/vendor/github.com/samber/lo/.gitignore
similarity index 100%
rename from vendor/github.com/samber/lo/.gitignore
rename to v1/vendor/github.com/samber/lo/.gitignore
diff --git a/vendor/github.com/samber/lo/.travis.yml b/v1/vendor/github.com/samber/lo/.travis.yml
similarity index 100%
rename from vendor/github.com/samber/lo/.travis.yml
rename to v1/vendor/github.com/samber/lo/.travis.yml
diff --git a/vendor/github.com/samber/lo/CHANGELOG.md b/v1/vendor/github.com/samber/lo/CHANGELOG.md
similarity index 100%
rename from vendor/github.com/samber/lo/CHANGELOG.md
rename to v1/vendor/github.com/samber/lo/CHANGELOG.md
diff --git a/vendor/github.com/samber/lo/Dockerfile b/v1/vendor/github.com/samber/lo/Dockerfile
similarity index 100%
rename from vendor/github.com/samber/lo/Dockerfile
rename to v1/vendor/github.com/samber/lo/Dockerfile
diff --git a/vendor/github.com/samber/lo/LICENSE b/v1/vendor/github.com/samber/lo/LICENSE
similarity index 100%
rename from vendor/github.com/samber/lo/LICENSE
rename to v1/vendor/github.com/samber/lo/LICENSE
diff --git a/vendor/github.com/samber/lo/Makefile b/v1/vendor/github.com/samber/lo/Makefile
similarity index 100%
rename from vendor/github.com/samber/lo/Makefile
rename to v1/vendor/github.com/samber/lo/Makefile
diff --git a/vendor/github.com/samber/lo/README.md b/v1/vendor/github.com/samber/lo/README.md
similarity index 100%
rename from vendor/github.com/samber/lo/README.md
rename to v1/vendor/github.com/samber/lo/README.md
diff --git a/vendor/github.com/samber/lo/channel.go b/v1/vendor/github.com/samber/lo/channel.go
similarity index 100%
rename from vendor/github.com/samber/lo/channel.go
rename to v1/vendor/github.com/samber/lo/channel.go
diff --git a/vendor/github.com/samber/lo/concurrency.go b/v1/vendor/github.com/samber/lo/concurrency.go
similarity index 100%
rename from vendor/github.com/samber/lo/concurrency.go
rename to v1/vendor/github.com/samber/lo/concurrency.go
diff --git a/vendor/github.com/samber/lo/condition.go b/v1/vendor/github.com/samber/lo/condition.go
similarity index 100%
rename from vendor/github.com/samber/lo/condition.go
rename to v1/vendor/github.com/samber/lo/condition.go
diff --git a/vendor/github.com/samber/lo/constraints.go b/v1/vendor/github.com/samber/lo/constraints.go
similarity index 100%
rename from vendor/github.com/samber/lo/constraints.go
rename to v1/vendor/github.com/samber/lo/constraints.go
diff --git a/vendor/github.com/samber/lo/errors.go b/v1/vendor/github.com/samber/lo/errors.go
similarity index 100%
rename from vendor/github.com/samber/lo/errors.go
rename to v1/vendor/github.com/samber/lo/errors.go
diff --git a/vendor/github.com/samber/lo/find.go b/v1/vendor/github.com/samber/lo/find.go
similarity index 100%
rename from vendor/github.com/samber/lo/find.go
rename to v1/vendor/github.com/samber/lo/find.go
diff --git a/vendor/github.com/samber/lo/func.go b/v1/vendor/github.com/samber/lo/func.go
similarity index 100%
rename from vendor/github.com/samber/lo/func.go
rename to v1/vendor/github.com/samber/lo/func.go
diff --git a/vendor/github.com/samber/lo/intersect.go b/v1/vendor/github.com/samber/lo/intersect.go
similarity index 100%
rename from vendor/github.com/samber/lo/intersect.go
rename to v1/vendor/github.com/samber/lo/intersect.go
diff --git a/vendor/github.com/samber/lo/map.go b/v1/vendor/github.com/samber/lo/map.go
similarity index 100%
rename from vendor/github.com/samber/lo/map.go
rename to v1/vendor/github.com/samber/lo/map.go
diff --git a/vendor/github.com/samber/lo/math.go b/v1/vendor/github.com/samber/lo/math.go
similarity index 100%
rename from vendor/github.com/samber/lo/math.go
rename to v1/vendor/github.com/samber/lo/math.go
diff --git a/vendor/github.com/samber/lo/retry.go b/v1/vendor/github.com/samber/lo/retry.go
similarity index 100%
rename from vendor/github.com/samber/lo/retry.go
rename to v1/vendor/github.com/samber/lo/retry.go
diff --git a/vendor/github.com/samber/lo/slice.go b/v1/vendor/github.com/samber/lo/slice.go
similarity index 100%
rename from vendor/github.com/samber/lo/slice.go
rename to v1/vendor/github.com/samber/lo/slice.go
diff --git a/vendor/github.com/samber/lo/string.go b/v1/vendor/github.com/samber/lo/string.go
similarity index 100%
rename from vendor/github.com/samber/lo/string.go
rename to v1/vendor/github.com/samber/lo/string.go
diff --git a/vendor/github.com/samber/lo/tuples.go b/v1/vendor/github.com/samber/lo/tuples.go
similarity index 100%
rename from vendor/github.com/samber/lo/tuples.go
rename to v1/vendor/github.com/samber/lo/tuples.go
diff --git a/vendor/github.com/samber/lo/type_manipulation.go b/v1/vendor/github.com/samber/lo/type_manipulation.go
similarity index 100%
rename from vendor/github.com/samber/lo/type_manipulation.go
rename to v1/vendor/github.com/samber/lo/type_manipulation.go
diff --git a/vendor/github.com/samber/lo/types.go b/v1/vendor/github.com/samber/lo/types.go
similarity index 100%
rename from vendor/github.com/samber/lo/types.go
rename to v1/vendor/github.com/samber/lo/types.go
diff --git a/vendor/github.com/tkrajina/go-reflector/LICENSE.txt b/v1/vendor/github.com/tkrajina/go-reflector/LICENSE.txt
similarity index 100%
rename from vendor/github.com/tkrajina/go-reflector/LICENSE.txt
rename to v1/vendor/github.com/tkrajina/go-reflector/LICENSE.txt
diff --git a/vendor/github.com/tkrajina/go-reflector/reflector/reflector.go b/v1/vendor/github.com/tkrajina/go-reflector/reflector/reflector.go
similarity index 100%
rename from vendor/github.com/tkrajina/go-reflector/reflector/reflector.go
rename to v1/vendor/github.com/tkrajina/go-reflector/reflector/reflector.go
diff --git a/vendor/github.com/tkrajina/go-reflector/reflector/utils.go b/v1/vendor/github.com/tkrajina/go-reflector/reflector/utils.go
similarity index 100%
rename from vendor/github.com/tkrajina/go-reflector/reflector/utils.go
rename to v1/vendor/github.com/tkrajina/go-reflector/reflector/utils.go
diff --git a/vendor/github.com/valyala/bytebufferpool/.travis.yml b/v1/vendor/github.com/valyala/bytebufferpool/.travis.yml
similarity index 100%
rename from vendor/github.com/valyala/bytebufferpool/.travis.yml
rename to v1/vendor/github.com/valyala/bytebufferpool/.travis.yml
diff --git a/vendor/github.com/valyala/bytebufferpool/LICENSE b/v1/vendor/github.com/valyala/bytebufferpool/LICENSE
similarity index 100%
rename from vendor/github.com/valyala/bytebufferpool/LICENSE
rename to v1/vendor/github.com/valyala/bytebufferpool/LICENSE
diff --git a/vendor/github.com/valyala/bytebufferpool/README.md b/v1/vendor/github.com/valyala/bytebufferpool/README.md
similarity index 100%
rename from vendor/github.com/valyala/bytebufferpool/README.md
rename to v1/vendor/github.com/valyala/bytebufferpool/README.md
diff --git a/vendor/github.com/valyala/bytebufferpool/bytebuffer.go b/v1/vendor/github.com/valyala/bytebufferpool/bytebuffer.go
similarity index 100%
rename from vendor/github.com/valyala/bytebufferpool/bytebuffer.go
rename to v1/vendor/github.com/valyala/bytebufferpool/bytebuffer.go
diff --git a/vendor/github.com/valyala/bytebufferpool/doc.go b/v1/vendor/github.com/valyala/bytebufferpool/doc.go
similarity index 100%
rename from vendor/github.com/valyala/bytebufferpool/doc.go
rename to v1/vendor/github.com/valyala/bytebufferpool/doc.go
diff --git a/vendor/github.com/valyala/bytebufferpool/pool.go b/v1/vendor/github.com/valyala/bytebufferpool/pool.go
similarity index 100%
rename from vendor/github.com/valyala/bytebufferpool/pool.go
rename to v1/vendor/github.com/valyala/bytebufferpool/pool.go
diff --git a/vendor/github.com/valyala/fasttemplate/LICENSE b/v1/vendor/github.com/valyala/fasttemplate/LICENSE
similarity index 100%
rename from vendor/github.com/valyala/fasttemplate/LICENSE
rename to v1/vendor/github.com/valyala/fasttemplate/LICENSE
diff --git a/vendor/github.com/valyala/fasttemplate/README.md b/v1/vendor/github.com/valyala/fasttemplate/README.md
similarity index 100%
rename from vendor/github.com/valyala/fasttemplate/README.md
rename to v1/vendor/github.com/valyala/fasttemplate/README.md
diff --git a/vendor/github.com/valyala/fasttemplate/template.go b/v1/vendor/github.com/valyala/fasttemplate/template.go
similarity index 100%
rename from vendor/github.com/valyala/fasttemplate/template.go
rename to v1/vendor/github.com/valyala/fasttemplate/template.go
diff --git a/vendor/github.com/valyala/fasttemplate/unsafe.go b/v1/vendor/github.com/valyala/fasttemplate/unsafe.go
similarity index 100%
rename from vendor/github.com/valyala/fasttemplate/unsafe.go
rename to v1/vendor/github.com/valyala/fasttemplate/unsafe.go
diff --git a/vendor/github.com/valyala/fasttemplate/unsafe_gae.go b/v1/vendor/github.com/valyala/fasttemplate/unsafe_gae.go
similarity index 100%
rename from vendor/github.com/valyala/fasttemplate/unsafe_gae.go
rename to v1/vendor/github.com/valyala/fasttemplate/unsafe_gae.go
diff --git a/vendor/github.com/wailsapp/go-webview2/LICENSE b/v1/vendor/github.com/wailsapp/go-webview2/LICENSE
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/LICENSE
rename to v1/vendor/github.com/wailsapp/go-webview2/LICENSE
diff --git a/vendor/github.com/wailsapp/go-webview2/internal/w32/w32.go b/v1/vendor/github.com/wailsapp/go-webview2/internal/w32/w32.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/internal/w32/w32.go
rename to v1/vendor/github.com/wailsapp/go-webview2/internal/w32/w32.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/combridge/bridge.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/bridge.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/combridge/bridge.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/bridge.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown_impl.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown_impl.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown_impl.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/iunknown_impl.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/combridge/syscall.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/syscall.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/combridge/syscall.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/syscall.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/combridge/vtables.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/vtables.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/combridge/vtables.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/combridge/vtables.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_BOUNDS_MODE.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_BOUNDS_MODE.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_BOUNDS_MODE.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_BOUNDS_MODE.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_COLOR.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_COLOR.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_COLOR.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_COLOR.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_HOST_RESOURCE_ACCESS_KIND.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_KEY_EVENT_KIND.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_KEY_EVENT_KIND.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_KEY_EVENT_KIND.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_KEY_EVENT_KIND.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_MOVE_FOCUS_REASON.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_MOVE_FOCUS_REASON.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_MOVE_FOCUS_REASON.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_MOVE_FOCUS_REASON.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PHYSICAL_KEY_STATUS.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PHYSICAL_KEY_STATUS.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PHYSICAL_KEY_STATUS.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PHYSICAL_KEY_STATUS.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PROCESS_FAILED_KIND.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PROCESS_FAILED_KIND.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PROCESS_FAILED_KIND.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_PROCESS_FAILED_KIND.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_WEB_RESOURCE_CONTEXT.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_WEB_RESOURCE_CONTEXT.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_WEB_RESOURCE_CONTEXT.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/COREWEBVIEW2_WEB_RESOURCE_CONTEXT.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventArgs.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventArgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventArgs.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventArgs.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2AcceleratorKeyPressedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventArgs.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventArgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventArgs.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventArgs.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ContainsFullScreenElementChangedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller2.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller2.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller2.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller2.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller3.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller3.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller3.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller3.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller4.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller4.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller4.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Controller4.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2CreateCoreWebView2ControllerCompletedHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Deferral.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Deferral.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Deferral.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Deferral.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2File.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2File.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2File.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2File.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpHeadersCollectionIterator.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpHeadersCollectionIterator.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpHeadersCollectionIterator.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpHeadersCollectionIterator.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpRequestHeaders.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpRequestHeaders.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpRequestHeaders.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpRequestHeaders.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpResponseHeaders.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpResponseHeaders.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpResponseHeaders.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2HttpResponseHeaders.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventArgs.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventArgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventArgs.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventArgs.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2NavigationCompletedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ObjectCollectionView.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ObjectCollectionView.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ObjectCollectionView.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ObjectCollectionView.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventArgs.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventArgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventArgs.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventArgs.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2ProcessFailedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2RasterizationScaleChangedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2RasterizationScaleChangedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2RasterizationScaleChangedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2RasterizationScaleChangedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings2.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings2.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings2.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings2.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings3.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings3.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings3.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings3.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings4.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings4.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings4.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings4.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings5.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings5.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings5.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings5.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings6.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings6.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings6.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2Settings6.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventArgs.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventArgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventArgs.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventArgs.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebMessageReceivedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequest.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequest.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequest.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequest.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventArgs.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventArgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventArgs.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventArgs.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventHandler.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventHandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventHandler.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceRequestedEventHandler.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceResponse.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceResponse.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceResponse.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2WebResourceResponse.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_2.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_2.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_2.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_2.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_3.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_3.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_3.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebView2_3.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebViewSettings.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebViewSettings.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebViewSettings.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/ICoreWebViewSettings.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/IStream.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/IStream.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/IStream.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/IStream.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/capabilities.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/capabilities.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/capabilities.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/capabilities.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_386.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_386.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_386.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_386.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_amd64.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_amd64.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_amd64.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_amd64.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_arm64.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_arm64.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_arm64.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/chromium_arm64.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/com.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/com.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/com.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/com.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/corewebview2.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/corewebview2.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/corewebview2.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/corewebview2.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_go.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_go.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_go.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_go.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_native.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_native.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_native.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/create_env_native.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/guid.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/guid.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/guid.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/guid.go
diff --git a/vendor/github.com/wailsapp/go-webview2/pkg/edge/version_map.go b/v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/version_map.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/pkg/edge/version_map.go
rename to v1/vendor/github.com/wailsapp/go-webview2/pkg/edge/version_map.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/LICENSE b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/LICENSE
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/LICENSE
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/LICENSE
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/README.md b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/README.md
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/README.md
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/README.md
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/arm64/WebView2Loader.dll b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/arm64/WebView2Loader.dll
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/arm64/WebView2Loader.dll
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/arm64/WebView2Loader.dll
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/env_create.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_completed.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_completed.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_completed.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_completed.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_options.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_options.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_options.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/env_create_options.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll_installed.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll_installed.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll_installed.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/find_dll_installed.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/native_module.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_386.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_386.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_386.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_386.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_amd64.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_amd64.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_amd64.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_amd64.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_arm64.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_arm64.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_arm64.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/native_module_arm64.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/syscall.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/syscall.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/syscall.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/syscall.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/version.go b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/version.go
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/version.go
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/version.go
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/x64/WebView2Loader.dll b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/x64/WebView2Loader.dll
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/x64/WebView2Loader.dll
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/x64/WebView2Loader.dll
diff --git a/vendor/github.com/wailsapp/go-webview2/webviewloader/x86/WebView2Loader.dll b/v1/vendor/github.com/wailsapp/go-webview2/webviewloader/x86/WebView2Loader.dll
similarity index 100%
rename from vendor/github.com/wailsapp/go-webview2/webviewloader/x86/WebView2Loader.dll
rename to v1/vendor/github.com/wailsapp/go-webview2/webviewloader/x86/WebView2Loader.dll
diff --git a/vendor/github.com/wailsapp/mimetype/.gitattributes b/v1/vendor/github.com/wailsapp/mimetype/.gitattributes
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/.gitattributes
rename to v1/vendor/github.com/wailsapp/mimetype/.gitattributes
diff --git a/vendor/github.com/wailsapp/mimetype/CODE_OF_CONDUCT.md b/v1/vendor/github.com/wailsapp/mimetype/CODE_OF_CONDUCT.md
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/CODE_OF_CONDUCT.md
rename to v1/vendor/github.com/wailsapp/mimetype/CODE_OF_CONDUCT.md
diff --git a/vendor/github.com/wailsapp/mimetype/CONTRIBUTING.md b/v1/vendor/github.com/wailsapp/mimetype/CONTRIBUTING.md
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/CONTRIBUTING.md
rename to v1/vendor/github.com/wailsapp/mimetype/CONTRIBUTING.md
diff --git a/vendor/github.com/wailsapp/mimetype/LICENSE b/v1/vendor/github.com/wailsapp/mimetype/LICENSE
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/LICENSE
rename to v1/vendor/github.com/wailsapp/mimetype/LICENSE
diff --git a/vendor/github.com/wailsapp/mimetype/README.md b/v1/vendor/github.com/wailsapp/mimetype/README.md
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/README.md
rename to v1/vendor/github.com/wailsapp/mimetype/README.md
diff --git a/vendor/github.com/wailsapp/mimetype/internal/charset/charset.go b/v1/vendor/github.com/wailsapp/mimetype/internal/charset/charset.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/charset/charset.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/charset/charset.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/json/json.go b/v1/vendor/github.com/wailsapp/mimetype/internal/json/json.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/json/json.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/json/json.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/archive.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/archive.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/archive.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/archive.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/audio.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/audio.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/audio.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/audio.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/binary.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/binary.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/binary.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/binary.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/database.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/database.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/database.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/database.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/document.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/document.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/document.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/document.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/font.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/font.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/font.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/font.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/ftyp.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/ftyp.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/ftyp.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/ftyp.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/geo.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/geo.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/geo.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/geo.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/image.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/image.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/image.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/image.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/magic.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/magic.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/magic.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/magic.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/ms_office.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/ms_office.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/ms_office.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/ms_office.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/ogg.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/ogg.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/ogg.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/ogg.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/text.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/text.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/text.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/text.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/text_csv.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/text_csv.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/text_csv.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/text_csv.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/video.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/video.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/video.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/video.go
diff --git a/vendor/github.com/wailsapp/mimetype/internal/magic/zip.go b/v1/vendor/github.com/wailsapp/mimetype/internal/magic/zip.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/internal/magic/zip.go
rename to v1/vendor/github.com/wailsapp/mimetype/internal/magic/zip.go
diff --git a/vendor/github.com/wailsapp/mimetype/mime.go b/v1/vendor/github.com/wailsapp/mimetype/mime.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/mime.go
rename to v1/vendor/github.com/wailsapp/mimetype/mime.go
diff --git a/vendor/github.com/wailsapp/mimetype/mimetype.gif b/v1/vendor/github.com/wailsapp/mimetype/mimetype.gif
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/mimetype.gif
rename to v1/vendor/github.com/wailsapp/mimetype/mimetype.gif
diff --git a/vendor/github.com/wailsapp/mimetype/mimetype.go b/v1/vendor/github.com/wailsapp/mimetype/mimetype.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/mimetype.go
rename to v1/vendor/github.com/wailsapp/mimetype/mimetype.go
diff --git a/vendor/github.com/wailsapp/mimetype/supported_mimes.md b/v1/vendor/github.com/wailsapp/mimetype/supported_mimes.md
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/supported_mimes.md
rename to v1/vendor/github.com/wailsapp/mimetype/supported_mimes.md
diff --git a/vendor/github.com/wailsapp/mimetype/tree.go b/v1/vendor/github.com/wailsapp/mimetype/tree.go
similarity index 100%
rename from vendor/github.com/wailsapp/mimetype/tree.go
rename to v1/vendor/github.com/wailsapp/mimetype/tree.go
diff --git a/vendor/github.com/wailsapp/wails/v2/.golangci.yml b/v1/vendor/github.com/wailsapp/wails/v2/.golangci.yml
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/.golangci.yml
rename to v1/vendor/github.com/wailsapp/wails/v2/.golangci.yml
diff --git a/vendor/github.com/wailsapp/wails/v2/.prettierrc.yml b/v1/vendor/github.com/wailsapp/wails/v2/.prettierrc.yml
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/.prettierrc.yml
rename to v1/vendor/github.com/wailsapp/wails/v2/.prettierrc.yml
diff --git a/vendor/github.com/wailsapp/wails/v2/LICENSE b/v1/vendor/github.com/wailsapp/wails/v2/LICENSE
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/LICENSE
rename to v1/vendor/github.com/wailsapp/wails/v2/LICENSE
diff --git a/vendor/github.com/wailsapp/wails/v2/README.md b/v1/vendor/github.com/wailsapp/wails/v2/README.md
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/README.md
rename to v1/vendor/github.com/wailsapp/wails/v2/README.md
diff --git a/vendor/github.com/wailsapp/wails/v2/Taskfile.yaml b/v1/vendor/github.com/wailsapp/wails/v2/Taskfile.yaml
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/Taskfile.yaml
rename to v1/vendor/github.com/wailsapp/wails/v2/Taskfile.yaml
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_bindings.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_bindings.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_bindings.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_bindings.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_debug.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_debug.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_debug.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_debug.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_debug_not.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_debug_not.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_debug_not.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_debug_not.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_default_unix.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_default_unix.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_default_unix.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_default_unix.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_default_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_default_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_default_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_default_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_dev.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_dev.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_dev.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_dev.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools_not.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools_not.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools_not.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_devtools_not.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated_not.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated_not.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated_not.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_obfuscated_not.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_unix.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_unix.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_unix.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_unix.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_preflight_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/app/app_production.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_production.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/app/app_production.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/app/app_production.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/binding/binding.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/binding/binding.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/binding/binding.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/binding/binding.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/binding/boundMethod.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/binding/boundMethod.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/binding/boundMethod.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/binding/boundMethod.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/binding/db.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/binding/db.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/binding/db.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/binding/db.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/binding/generate.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/binding/generate.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/binding/generate.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/binding/generate.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/binding/parameter.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/binding/parameter.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/binding/parameter.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/binding/parameter.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/binding/reflect.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/binding/reflect.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/binding/reflect.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/binding/reflect.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/calls.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/calls.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/calls.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/calls.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.m
similarity index 93%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.m
index 18ecfbc..318c333 100644
--- a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.m
+++ b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/AppDelegate.m
@@ -9,6 +9,7 @@
#import
#import "AppDelegate.h"
+#import "message.h"
@implementation AppDelegate
-(BOOL)application:(NSApplication *)sender openFile:(NSString *)filename
@@ -22,6 +23,11 @@
return NO;
}
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
+ processMessage("Q");
+ return NSTerminateCancel;
+}
+
- (void)applicationWillFinishLaunching:(NSNotification *)aNotification {
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
if (self.alwaysOnTop) {
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Application.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/CustomProtocol.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Role.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Role.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Role.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/Role.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsAlert.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsContext.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenu.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WailsMenuItem.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/WindowDelegate.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/browser.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/browser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/browser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/browser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/callbacks.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/callbacks.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/callbacks.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/callbacks.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/calloc.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/calloc.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/calloc.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/calloc.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/clipboard.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/clipboard.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/clipboard.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/clipboard.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/dialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/dialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/dialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/dialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/frontend.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/frontend.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/frontend.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/frontend.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector_dev.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector_dev.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector_dev.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/inspector_dev.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/main.m b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/main.m
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/main.m
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/main.m
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menuitem.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menuitem.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menuitem.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/menuitem.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/message.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/message.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/message.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/message.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/screen.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/screen.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/screen.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/screen.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/single_instance.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/single_instance.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/single_instance.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/single_instance.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/window.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/window.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/window.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/darwin/window.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_darwin.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_darwin.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_darwin.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_darwin.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_linux.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_linux.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_linux.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_linux.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/desktop_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/browser.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/browser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/browser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/browser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/calloc.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/calloc.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/calloc.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/calloc.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/clipboard.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/clipboard.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/clipboard.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/clipboard.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/dialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/dialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/dialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/dialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/frontend.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/frontend.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/frontend.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/frontend.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/gtk.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/gtk.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/gtk.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/gtk.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/invoke.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/invoke.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/invoke.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/invoke.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/keys.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/keys.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/keys.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/keys.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/menu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/menu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/menu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/menu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/screen.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/screen.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/screen.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/screen.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/single_instance.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/single_instance.go
similarity index 89%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/single_instance.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/single_instance.go
index 9d6426e..0317dee 100644
--- a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/single_instance.go
+++ b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/single_instance.go
@@ -7,6 +7,7 @@ import (
"encoding/json"
"github.com/godbus/dbus/v5"
"github.com/wailsapp/wails/v2/pkg/options"
+ "log"
"os"
"strings"
)
@@ -55,8 +56,15 @@ func SetupSingleInstance(uniqueID string) {
data := options.SecondInstanceData{
Args: os.Args[1:],
}
+ data.WorkingDirectory, err = os.Getwd()
+ if err != nil {
+ log.Printf("Failed to get working directory: %v", err)
+ return
+ }
+
serialized, err := json.Marshal(data)
if err != nil {
+ log.Printf("Failed to marshal data: %v", err)
return
}
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/webkit2.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/webkit2.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/webkit2.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/webkit2.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.c b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.c
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.c
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.c
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.h b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.h
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.h
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/linux/window.h
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/browser.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/browser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/browser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/browser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/clipboard.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/clipboard.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/clipboard.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/clipboard.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/dialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/dialog.go
similarity index 97%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/dialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/dialog.go
index 7aca428..5733258 100644
--- a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/dialog.go
+++ b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/dialog.go
@@ -121,6 +121,10 @@ func (f *Frontend) SaveFileDialog(options frontend.SaveDialogOptions) (string, e
Folder: defaultFolder,
}
+ if len(options.Filters) > 0 {
+ config.DefaultExtension = strings.TrimPrefix(strings.Split(options.Filters[0].Pattern, ";")[0], "*")
+ }
+
result, err := f.showCfdDialog(
func() (cfd.Dialog, error) {
return cfd.NewSaveFileDialog(config)
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/frontend.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/frontend.go
similarity index 99%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/frontend.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/frontend.go
index 7671ad7..97eef74 100644
--- a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/frontend.go
+++ b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/frontend.go
@@ -543,6 +543,10 @@ func (f *Frontend) setupChromium() {
if err != nil {
log.Fatal(err)
}
+ err = settings.PutIsPinchZoomEnabled(!opts.DisablePinchZoom)
+ if err != nil {
+ log.Fatal(err)
+ }
}
err = settings.PutIsStatusBarEnabled(false)
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/keys.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/keys.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/keys.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/keys.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/menu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/menu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/menu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/menu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/screen.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/screen.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/screen.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/screen.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/single_instance.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/single_instance.go
similarity index 91%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/single_instance.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/single_instance.go
index 222d9fe..a02b7ed 100644
--- a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/single_instance.go
+++ b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/single_instance.go
@@ -7,6 +7,7 @@ import (
"github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32"
"github.com/wailsapp/wails/v2/pkg/options"
"golang.org/x/sys/windows"
+ "log"
"os"
"syscall"
"unsafe"
@@ -51,7 +52,16 @@ func SetupSingleInstance(uniqueId string) {
data := options.SecondInstanceData{
Args: os.Args[1:],
}
- serialized, _ := json.Marshal(data)
+ data.WorkingDirectory, err = os.Getwd()
+ if err != nil {
+ log.Printf("Failed to get working directory: %v", err)
+ return
+ }
+ serialized, err := json.Marshal(data)
+ if err != nil {
+ log.Printf("Failed to marshal data: %v", err)
+ return
+ }
SendMessage(hwnd, string(serialized))
// exit second instance of app after sending message
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/theme.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/theme.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/theme.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/theme.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/clipboard.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/clipboard.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/clipboard.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/clipboard.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/consts.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/consts.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/consts.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/consts.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/theme.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/theme.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/theme.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/theme.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/window.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/window.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/window.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/win32/window.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/.gitignore b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/.gitignore
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/.gitignore
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/.gitignore
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/AUTHORS b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/AUTHORS
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/AUTHORS
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/AUTHORS
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/LICENSE b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/LICENSE
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/LICENSE
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/LICENSE
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/README.md b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/README.md
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/README.md
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/README.md
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/app.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/app.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/app.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/app.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/bitmap.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/bitmap.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/bitmap.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/bitmap.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/brush.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/brush.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/brush.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/brush.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/buttons.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/buttons.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/buttons.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/buttons.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/canvas.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/canvas.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/canvas.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/canvas.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/color.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/color.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/color.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/color.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/combobox.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/combobox.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/combobox.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/combobox.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/commondlgs.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/commondlgs.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/commondlgs.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/commondlgs.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controlbase.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controlbase.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controlbase.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controlbase.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controller.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controller.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controller.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/controller.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topbottom.png b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topbottom.png
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topbottom.png
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topbottom.png
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topleft.png b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topleft.png
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topleft.png
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/dock_topleft.png
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/edit.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/edit.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/edit.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/edit.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/event.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/event.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/event.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/event.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventdata.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventdata.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventdata.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventdata.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventmanager.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventmanager.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventmanager.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/eventmanager.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/font.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/font.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/font.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/font.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/form.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/form.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/form.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/form.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/globalvars.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/globalvars.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/globalvars.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/globalvars.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/icon.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/icon.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/icon.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/icon.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imagelist.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imagelist.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imagelist.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imagelist.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageview.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageview.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageview.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageview.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageviewbox.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageviewbox.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageviewbox.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/imageviewbox.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/init.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/init.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/init.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/init.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/keyboard.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/keyboard.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/keyboard.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/keyboard.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/label.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/label.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/label.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/label.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/layout.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/layout.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/layout.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/layout.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/listview.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/listview.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/listview.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/listview.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/menu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/menu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/menu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/menu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/mousecontrol.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/mousecontrol.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/mousecontrol.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/mousecontrol.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/msghandlerregistry.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/msghandlerregistry.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/msghandlerregistry.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/msghandlerregistry.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/panel.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/panel.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/panel.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/panel.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/path.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/path.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/path.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/path.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/pen.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/pen.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/pen.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/pen.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/progressbar.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/progressbar.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/progressbar.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/progressbar.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/rect.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/rect.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/rect.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/rect.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/resizer.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/resizer.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/resizer.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/resizer.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/scrollview.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/scrollview.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/scrollview.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/scrollview.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/slider.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/slider.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/slider.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/slider.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tabview.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tabview.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tabview.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tabview.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/toolbar.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/toolbar.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/toolbar.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/toolbar.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tooltip.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tooltip.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tooltip.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/tooltip.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/treeview.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/treeview.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/treeview.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/treeview.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/utils.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/utils.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/utils.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/utils.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comctl32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comctl32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comctl32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comctl32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comdlg32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comdlg32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comdlg32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/comdlg32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/constants.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/constants.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/constants.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/constants.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/dwmapi.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/dwmapi.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/dwmapi.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/dwmapi.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdi32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdi32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdi32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdi32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdiplus.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdiplus.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdiplus.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/gdiplus.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/idispatch.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/idispatch.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/idispatch.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/idispatch.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/istream.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/istream.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/istream.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/istream.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/iunknown.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/iunknown.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/iunknown.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/iunknown.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/kernel32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/kernel32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/kernel32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/kernel32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/ole32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/ole32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/ole32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/ole32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/oleaut32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/oleaut32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/oleaut32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/oleaut32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shcore.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shcore.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shcore.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shcore.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shell32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shell32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shell32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shell32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shlwapi.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shlwapi.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shlwapi.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/shlwapi.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/toolbar.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/toolbar.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/toolbar.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/toolbar.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/typedef.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/typedef.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/typedef.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/typedef.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/user32.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/user32.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/user32.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/user32.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/utils.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/utils.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/utils.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/utils.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/uxtheme.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/uxtheme.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/uxtheme.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/uxtheme.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/vars.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/vars.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/vars.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/w32/vars.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/wndproc.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/wndproc.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/wndproc.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/winc/wndproc.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/window.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/window.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/window.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/window.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/devserver/devserver.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/devserver/devserver.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/devserver/devserver.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/devserver/devserver.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/browser.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/browser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/browser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/browser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/calls.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/calls.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/calls.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/calls.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/dispatcher.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/dispatcher.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/dispatcher.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/dispatcher.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/events.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/events.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/events.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/events.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/log.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/log.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/log.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/log.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/securecalls.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/securecalls.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/securecalls.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/securecalls.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/systemcalls.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/systemcalls.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/systemcalls.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/systemcalls.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/window.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/window.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/window.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/dispatcher/window.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/events.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/events.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/events.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/events.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/frontend.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/frontend.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/frontend.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/frontend.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets_dev.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets_dev.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets_dev.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/assets_dev.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/events.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/events.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/events.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/events.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.js b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.js
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.js
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc.js
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.js b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.js
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.js
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/ipc_websocket.js
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package-lock.json b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package-lock.json
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package-lock.json
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package-lock.json
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package.json b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package.json
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package.json
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/package.json
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.js b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.js
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.js
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_debug_desktop.js
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.js b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.js
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.js
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/runtime_prod_desktop.js
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/vite.config.ts b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/vite.config.ts
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/vite.config.ts
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/vite.config.ts
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/package.json b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/package.json
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/package.json
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/package.json
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.d.ts b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.d.ts
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.d.ts
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.d.ts
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.js b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.js
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.js
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/runtime.js
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/wrapper.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/wrapper.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/wrapper.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/frontend/runtime/wrapper/wrapper.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/fs/fs.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/fs/fs.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/fs/fs.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/fs/fs.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/LICENSE b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/LICENSE
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/LICENSE
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/LICENSE
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_nonWindows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_nonWindows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_nonWindows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_nonWindows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/CommonFileDialog_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/DialogConfig.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/DialogConfig.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/DialogConfig.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/DialogConfig.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/errors.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/errors.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/errors.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/errors.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileOpenDialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileSaveDialog.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileSaveDialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileSaveDialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iFileSaveDialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItem.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItem.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItem.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItem.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItemArray.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItemArray.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItemArray.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/iShellItemArray.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommon.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommon.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommon.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommon.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommonFunc.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommonFunc.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommonFunc.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/cfd/vtblCommonFunc.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/util/util.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/util/util.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/util/util.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/go-common-file-dialog/util/util.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/goversion/build_constraint.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/goversion/build_constraint.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/goversion/build_constraint.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/goversion/build_constraint.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/goversion/min.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/goversion/min.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/goversion/min.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/goversion/min.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/logger/custom_logger.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/logger/custom_logger.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/logger/custom_logger.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/logger/custom_logger.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/logger/default_logger.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/logger/default_logger.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/logger/default_logger.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/logger/default_logger.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/menumanager/applicationmenu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/applicationmenu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/menumanager/applicationmenu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/applicationmenu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/menumanager/contextmenu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/contextmenu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/menumanager/contextmenu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/contextmenu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/menumanager/menuitemmap.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/menuitemmap.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/menumanager/menuitemmap.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/menuitemmap.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/menumanager/menumanager.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/menumanager.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/menumanager/menumanager.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/menumanager.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/menumanager/processedMenu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/processedMenu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/menumanager/processedMenu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/processedMenu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/menumanager/traymenu.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/traymenu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/menumanager/traymenu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/menumanager/traymenu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/project/project.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/project/project.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/project/project.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/project/project.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/shell/env.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/shell/env.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/shell/env.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/shell/env.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/shell/shell.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/shell/shell.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/shell/shell.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/shell/shell.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/signal/signal.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/signal/signal.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/signal/signal.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/signal/signal.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_darwin.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_darwin.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_darwin.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_darwin.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_linux.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_linux.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_linux.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_linux.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/os_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/version_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/version_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/version_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/system/operatingsystem/version_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/LICENSE.txt b/v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/LICENSE.txt
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/typescriptify/LICENSE.txt
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/LICENSE.txt
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/README.md b/v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/README.md
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/typescriptify/README.md
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/README.md
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/js-reserved-keywords.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/js-reserved-keywords.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/typescriptify/js-reserved-keywords.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/js-reserved-keywords.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/typescriptify.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/typescriptify.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/typescriptify/typescriptify.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/typescriptify/typescriptify.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/MicrosoftEdgeWebview2Setup.exe b/v1/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/MicrosoftEdgeWebview2Setup.exe
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/MicrosoftEdgeWebview2Setup.exe
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/MicrosoftEdgeWebview2Setup.exe
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2installer.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2installer.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2installer.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2installer.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2runtime.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2runtime.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2runtime.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/webview2runtime/webview2runtime.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/browser.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/browser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/wv2installer/browser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/browser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/download.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/download.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/wv2installer/download.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/download.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/embed.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/embed.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/wv2installer/embed.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/embed.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/error.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/error.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/wv2installer/error.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/error.go
diff --git a/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/wv2installer.go b/v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/wv2installer.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/internal/wv2installer/wv2installer.go
rename to v1/vendor/github.com/wailsapp/wails/v2/internal/wv2installer/wv2installer.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/application/application.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/application/application.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/application/application.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/application/application.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/application/events.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/application/events.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/application/events.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/application/events.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/application/init.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/application/init.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/application/init.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/application/init.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/application/init_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/application/init_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/application/init_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/application/init_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler_external.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler_external.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler_external.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assethandler_external.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_dev.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_dev.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_dev.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_dev.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_webview.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_webview.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_webview.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/assetserver_webview.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/body_recorder.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/body_recorder.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/body_recorder.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/body_recorder.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/common.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/common.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/common.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/common.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/content_type_sniffer.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/content_type_sniffer.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/content_type_sniffer.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/content_type_sniffer.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/defaultindex.html b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/defaultindex.html
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/defaultindex.html
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/defaultindex.html
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/fs.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/fs.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/fs.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/fs.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/mimecache.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/mimecache.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/mimecache.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/mimecache.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/ringqueue.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/ringqueue.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/ringqueue.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/ringqueue.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_darwin.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_darwin.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_darwin.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_darwin.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_finalizer.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_finalizer.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_finalizer.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_finalizer.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_linux.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_linux.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_linux.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_linux.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/request_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_darwin.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_darwin.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_darwin.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_darwin.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_linux.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_linux.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_linux.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_linux.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_windows.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/responsewriter_windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36+.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36+.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36+.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36+.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_36.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40+.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40+.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40+.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40+.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_40.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_legacy.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_legacy.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_legacy.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/assetserver/webview/webkit2_legacy.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/logger/default.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/logger/default.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/logger/default.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/logger/default.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/logger/filelogger.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/logger/filelogger.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/logger/filelogger.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/logger/filelogger.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/logger/logger.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/logger/logger.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/logger/logger.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/logger/logger.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/README.md b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/README.md
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/README.md
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/README.md
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/callback.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/callback.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/callback.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/callback.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/cols.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/cols.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/cols.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/cols.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/contextmenu.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/contextmenu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/contextmenu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/contextmenu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/keys.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/keys.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/keys.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/keys.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/macmodifiers.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/macmodifiers.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/macmodifiers.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/macmodifiers.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/parser.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/parser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/parser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/parser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/stringify.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/stringify.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/stringify.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/keys/stringify.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/mac.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/mac.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/mac.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/mac.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/menu.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/menu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/menu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/menu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/menuitem.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/menuitem.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/menuitem.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/menuitem.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/menuroles.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/menuroles.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/menuroles.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/menuroles.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/styledlabel.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/styledlabel.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/styledlabel.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/styledlabel.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/tray.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/tray.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/tray.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/tray.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/type.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/type.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/type.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/type.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/menu/windows.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/windows.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/menu/windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/menu/windows.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/middleware.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/middleware.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/middleware.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/middleware.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/options.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/options.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/options.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/assetserver/options.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/debug.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/debug.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/debug.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/debug.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/linux/linux.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/linux/linux.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/linux/linux.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/linux/linux.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/appearance.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/appearance.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/mac/appearance.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/appearance.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/mac.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/mac.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/mac/mac.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/mac.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/preferences.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/preferences.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/mac/preferences.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/preferences.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/titlebar.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/titlebar.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/mac/titlebar.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/mac/titlebar.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/options.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/options.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/options.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/options.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/options/windows/windows.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/windows/windows.go
similarity index 99%
rename from vendor/github.com/wailsapp/wails/v2/pkg/options/windows/windows.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/options/windows/windows.go
index 073450c..39b91ee 100644
--- a/vendor/github.com/wailsapp/wails/v2/pkg/options/windows/windows.go
+++ b/v1/vendor/github.com/wailsapp/wails/v2/pkg/options/windows/windows.go
@@ -68,6 +68,8 @@ type Options struct {
IsZoomControlEnabled bool
ZoomFactor float64
+ DisablePinchZoom bool
+
// Disable all window decorations in Frameless mode, which means no "Aero Shadow" and no "Rounded Corner" will be shown.
// "Rounded Corners" are only available on Windows 11.
DisableFramelessWindowDecorations bool
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/browser.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/browser.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/browser.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/browser.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/clipboard.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/clipboard.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/clipboard.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/clipboard.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/dialog.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/dialog.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/dialog.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/dialog.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/events.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/events.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/events.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/events.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/log.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/log.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/log.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/log.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/menu.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/menu.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/menu.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/menu.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/runtime.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/runtime.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/runtime.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/runtime.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/screen.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/screen.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/screen.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/screen.go
diff --git a/vendor/github.com/wailsapp/wails/v2/pkg/runtime/window.go b/v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/window.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/pkg/runtime/window.go
rename to v1/vendor/github.com/wailsapp/wails/v2/pkg/runtime/window.go
diff --git a/vendor/github.com/wailsapp/wails/v2/wails.go b/v1/vendor/github.com/wailsapp/wails/v2/wails.go
similarity index 100%
rename from vendor/github.com/wailsapp/wails/v2/wails.go
rename to v1/vendor/github.com/wailsapp/wails/v2/wails.go
diff --git a/vendor/golang.org/x/crypto/LICENSE b/v1/vendor/golang.org/x/crypto/LICENSE
similarity index 100%
rename from vendor/golang.org/x/crypto/LICENSE
rename to v1/vendor/golang.org/x/crypto/LICENSE
diff --git a/vendor/golang.org/x/crypto/PATENTS b/v1/vendor/golang.org/x/crypto/PATENTS
similarity index 100%
rename from vendor/golang.org/x/crypto/PATENTS
rename to v1/vendor/golang.org/x/crypto/PATENTS
diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/v1/vendor/golang.org/x/crypto/acme/acme.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/acme.go
rename to v1/vendor/golang.org/x/crypto/acme/acme.go
diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/v1/vendor/golang.org/x/crypto/acme/autocert/autocert.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/autocert/autocert.go
rename to v1/vendor/golang.org/x/crypto/acme/autocert/autocert.go
diff --git a/vendor/golang.org/x/crypto/acme/autocert/cache.go b/v1/vendor/golang.org/x/crypto/acme/autocert/cache.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/autocert/cache.go
rename to v1/vendor/golang.org/x/crypto/acme/autocert/cache.go
diff --git a/vendor/golang.org/x/crypto/acme/autocert/listener.go b/v1/vendor/golang.org/x/crypto/acme/autocert/listener.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/autocert/listener.go
rename to v1/vendor/golang.org/x/crypto/acme/autocert/listener.go
diff --git a/vendor/golang.org/x/crypto/acme/autocert/renewal.go b/v1/vendor/golang.org/x/crypto/acme/autocert/renewal.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/autocert/renewal.go
rename to v1/vendor/golang.org/x/crypto/acme/autocert/renewal.go
diff --git a/vendor/golang.org/x/crypto/acme/http.go b/v1/vendor/golang.org/x/crypto/acme/http.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/http.go
rename to v1/vendor/golang.org/x/crypto/acme/http.go
diff --git a/vendor/golang.org/x/crypto/acme/jws.go b/v1/vendor/golang.org/x/crypto/acme/jws.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/jws.go
rename to v1/vendor/golang.org/x/crypto/acme/jws.go
diff --git a/vendor/golang.org/x/crypto/acme/rfc8555.go b/v1/vendor/golang.org/x/crypto/acme/rfc8555.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/rfc8555.go
rename to v1/vendor/golang.org/x/crypto/acme/rfc8555.go
diff --git a/vendor/golang.org/x/crypto/acme/types.go b/v1/vendor/golang.org/x/crypto/acme/types.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/types.go
rename to v1/vendor/golang.org/x/crypto/acme/types.go
diff --git a/vendor/golang.org/x/crypto/acme/version_go112.go b/v1/vendor/golang.org/x/crypto/acme/version_go112.go
similarity index 100%
rename from vendor/golang.org/x/crypto/acme/version_go112.go
rename to v1/vendor/golang.org/x/crypto/acme/version_go112.go
diff --git a/vendor/golang.org/x/exp/LICENSE b/v1/vendor/golang.org/x/exp/LICENSE
similarity index 100%
rename from vendor/golang.org/x/exp/LICENSE
rename to v1/vendor/golang.org/x/exp/LICENSE
diff --git a/vendor/golang.org/x/exp/PATENTS b/v1/vendor/golang.org/x/exp/PATENTS
similarity index 100%
rename from vendor/golang.org/x/exp/PATENTS
rename to v1/vendor/golang.org/x/exp/PATENTS
diff --git a/vendor/golang.org/x/exp/constraints/constraints.go b/v1/vendor/golang.org/x/exp/constraints/constraints.go
similarity index 100%
rename from vendor/golang.org/x/exp/constraints/constraints.go
rename to v1/vendor/golang.org/x/exp/constraints/constraints.go
diff --git a/vendor/golang.org/x/net/LICENSE b/v1/vendor/golang.org/x/net/LICENSE
similarity index 100%
rename from vendor/golang.org/x/net/LICENSE
rename to v1/vendor/golang.org/x/net/LICENSE
diff --git a/vendor/golang.org/x/net/PATENTS b/v1/vendor/golang.org/x/net/PATENTS
similarity index 100%
rename from vendor/golang.org/x/net/PATENTS
rename to v1/vendor/golang.org/x/net/PATENTS
diff --git a/vendor/golang.org/x/net/html/atom/atom.go b/v1/vendor/golang.org/x/net/html/atom/atom.go
similarity index 100%
rename from vendor/golang.org/x/net/html/atom/atom.go
rename to v1/vendor/golang.org/x/net/html/atom/atom.go
diff --git a/vendor/golang.org/x/net/html/atom/table.go b/v1/vendor/golang.org/x/net/html/atom/table.go
similarity index 100%
rename from vendor/golang.org/x/net/html/atom/table.go
rename to v1/vendor/golang.org/x/net/html/atom/table.go
diff --git a/vendor/golang.org/x/net/html/const.go b/v1/vendor/golang.org/x/net/html/const.go
similarity index 100%
rename from vendor/golang.org/x/net/html/const.go
rename to v1/vendor/golang.org/x/net/html/const.go
diff --git a/vendor/golang.org/x/net/html/doc.go b/v1/vendor/golang.org/x/net/html/doc.go
similarity index 100%
rename from vendor/golang.org/x/net/html/doc.go
rename to v1/vendor/golang.org/x/net/html/doc.go
diff --git a/vendor/golang.org/x/net/html/doctype.go b/v1/vendor/golang.org/x/net/html/doctype.go
similarity index 100%
rename from vendor/golang.org/x/net/html/doctype.go
rename to v1/vendor/golang.org/x/net/html/doctype.go
diff --git a/vendor/golang.org/x/net/html/entity.go b/v1/vendor/golang.org/x/net/html/entity.go
similarity index 100%
rename from vendor/golang.org/x/net/html/entity.go
rename to v1/vendor/golang.org/x/net/html/entity.go
diff --git a/vendor/golang.org/x/net/html/escape.go b/v1/vendor/golang.org/x/net/html/escape.go
similarity index 100%
rename from vendor/golang.org/x/net/html/escape.go
rename to v1/vendor/golang.org/x/net/html/escape.go
diff --git a/vendor/golang.org/x/net/html/foreign.go b/v1/vendor/golang.org/x/net/html/foreign.go
similarity index 100%
rename from vendor/golang.org/x/net/html/foreign.go
rename to v1/vendor/golang.org/x/net/html/foreign.go
diff --git a/vendor/golang.org/x/net/html/node.go b/v1/vendor/golang.org/x/net/html/node.go
similarity index 100%
rename from vendor/golang.org/x/net/html/node.go
rename to v1/vendor/golang.org/x/net/html/node.go
diff --git a/vendor/golang.org/x/net/html/parse.go b/v1/vendor/golang.org/x/net/html/parse.go
similarity index 100%
rename from vendor/golang.org/x/net/html/parse.go
rename to v1/vendor/golang.org/x/net/html/parse.go
diff --git a/vendor/golang.org/x/net/html/render.go b/v1/vendor/golang.org/x/net/html/render.go
similarity index 100%
rename from vendor/golang.org/x/net/html/render.go
rename to v1/vendor/golang.org/x/net/html/render.go
diff --git a/vendor/golang.org/x/net/html/token.go b/v1/vendor/golang.org/x/net/html/token.go
similarity index 100%
rename from vendor/golang.org/x/net/html/token.go
rename to v1/vendor/golang.org/x/net/html/token.go
diff --git a/vendor/golang.org/x/net/http/httpguts/guts.go b/v1/vendor/golang.org/x/net/http/httpguts/guts.go
similarity index 100%
rename from vendor/golang.org/x/net/http/httpguts/guts.go
rename to v1/vendor/golang.org/x/net/http/httpguts/guts.go
diff --git a/vendor/golang.org/x/net/http/httpguts/httplex.go b/v1/vendor/golang.org/x/net/http/httpguts/httplex.go
similarity index 100%
rename from vendor/golang.org/x/net/http/httpguts/httplex.go
rename to v1/vendor/golang.org/x/net/http/httpguts/httplex.go
diff --git a/vendor/golang.org/x/net/http2/.gitignore b/v1/vendor/golang.org/x/net/http2/.gitignore
similarity index 100%
rename from vendor/golang.org/x/net/http2/.gitignore
rename to v1/vendor/golang.org/x/net/http2/.gitignore
diff --git a/vendor/golang.org/x/net/http2/ascii.go b/v1/vendor/golang.org/x/net/http2/ascii.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/ascii.go
rename to v1/vendor/golang.org/x/net/http2/ascii.go
diff --git a/vendor/golang.org/x/net/http2/ciphers.go b/v1/vendor/golang.org/x/net/http2/ciphers.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/ciphers.go
rename to v1/vendor/golang.org/x/net/http2/ciphers.go
diff --git a/vendor/golang.org/x/net/http2/client_conn_pool.go b/v1/vendor/golang.org/x/net/http2/client_conn_pool.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/client_conn_pool.go
rename to v1/vendor/golang.org/x/net/http2/client_conn_pool.go
diff --git a/vendor/golang.org/x/net/http2/databuffer.go b/v1/vendor/golang.org/x/net/http2/databuffer.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/databuffer.go
rename to v1/vendor/golang.org/x/net/http2/databuffer.go
diff --git a/vendor/golang.org/x/net/http2/errors.go b/v1/vendor/golang.org/x/net/http2/errors.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/errors.go
rename to v1/vendor/golang.org/x/net/http2/errors.go
diff --git a/vendor/golang.org/x/net/http2/flow.go b/v1/vendor/golang.org/x/net/http2/flow.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/flow.go
rename to v1/vendor/golang.org/x/net/http2/flow.go
diff --git a/vendor/golang.org/x/net/http2/frame.go b/v1/vendor/golang.org/x/net/http2/frame.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/frame.go
rename to v1/vendor/golang.org/x/net/http2/frame.go
diff --git a/vendor/golang.org/x/net/http2/gotrack.go b/v1/vendor/golang.org/x/net/http2/gotrack.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/gotrack.go
rename to v1/vendor/golang.org/x/net/http2/gotrack.go
diff --git a/vendor/golang.org/x/net/http2/h2c/h2c.go b/v1/vendor/golang.org/x/net/http2/h2c/h2c.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/h2c/h2c.go
rename to v1/vendor/golang.org/x/net/http2/h2c/h2c.go
diff --git a/vendor/golang.org/x/net/http2/headermap.go b/v1/vendor/golang.org/x/net/http2/headermap.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/headermap.go
rename to v1/vendor/golang.org/x/net/http2/headermap.go
diff --git a/vendor/golang.org/x/net/http2/hpack/encode.go b/v1/vendor/golang.org/x/net/http2/hpack/encode.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/hpack/encode.go
rename to v1/vendor/golang.org/x/net/http2/hpack/encode.go
diff --git a/vendor/golang.org/x/net/http2/hpack/hpack.go b/v1/vendor/golang.org/x/net/http2/hpack/hpack.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/hpack/hpack.go
rename to v1/vendor/golang.org/x/net/http2/hpack/hpack.go
diff --git a/vendor/golang.org/x/net/http2/hpack/huffman.go b/v1/vendor/golang.org/x/net/http2/hpack/huffman.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/hpack/huffman.go
rename to v1/vendor/golang.org/x/net/http2/hpack/huffman.go
diff --git a/vendor/golang.org/x/net/http2/hpack/static_table.go b/v1/vendor/golang.org/x/net/http2/hpack/static_table.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/hpack/static_table.go
rename to v1/vendor/golang.org/x/net/http2/hpack/static_table.go
diff --git a/vendor/golang.org/x/net/http2/hpack/tables.go b/v1/vendor/golang.org/x/net/http2/hpack/tables.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/hpack/tables.go
rename to v1/vendor/golang.org/x/net/http2/hpack/tables.go
diff --git a/vendor/golang.org/x/net/http2/http2.go b/v1/vendor/golang.org/x/net/http2/http2.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/http2.go
rename to v1/vendor/golang.org/x/net/http2/http2.go
diff --git a/vendor/golang.org/x/net/http2/pipe.go b/v1/vendor/golang.org/x/net/http2/pipe.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/pipe.go
rename to v1/vendor/golang.org/x/net/http2/pipe.go
diff --git a/vendor/golang.org/x/net/http2/server.go b/v1/vendor/golang.org/x/net/http2/server.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/server.go
rename to v1/vendor/golang.org/x/net/http2/server.go
diff --git a/vendor/golang.org/x/net/http2/transport.go b/v1/vendor/golang.org/x/net/http2/transport.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/transport.go
rename to v1/vendor/golang.org/x/net/http2/transport.go
diff --git a/vendor/golang.org/x/net/http2/write.go b/v1/vendor/golang.org/x/net/http2/write.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/write.go
rename to v1/vendor/golang.org/x/net/http2/write.go
diff --git a/vendor/golang.org/x/net/http2/writesched.go b/v1/vendor/golang.org/x/net/http2/writesched.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/writesched.go
rename to v1/vendor/golang.org/x/net/http2/writesched.go
diff --git a/vendor/golang.org/x/net/http2/writesched_priority.go b/v1/vendor/golang.org/x/net/http2/writesched_priority.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/writesched_priority.go
rename to v1/vendor/golang.org/x/net/http2/writesched_priority.go
diff --git a/vendor/golang.org/x/net/http2/writesched_random.go b/v1/vendor/golang.org/x/net/http2/writesched_random.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/writesched_random.go
rename to v1/vendor/golang.org/x/net/http2/writesched_random.go
diff --git a/vendor/golang.org/x/net/http2/writesched_roundrobin.go b/v1/vendor/golang.org/x/net/http2/writesched_roundrobin.go
similarity index 100%
rename from vendor/golang.org/x/net/http2/writesched_roundrobin.go
rename to v1/vendor/golang.org/x/net/http2/writesched_roundrobin.go
diff --git a/vendor/golang.org/x/net/idna/go118.go b/v1/vendor/golang.org/x/net/idna/go118.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/go118.go
rename to v1/vendor/golang.org/x/net/idna/go118.go
diff --git a/vendor/golang.org/x/net/idna/idna10.0.0.go b/v1/vendor/golang.org/x/net/idna/idna10.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/idna10.0.0.go
rename to v1/vendor/golang.org/x/net/idna/idna10.0.0.go
diff --git a/vendor/golang.org/x/net/idna/idna9.0.0.go b/v1/vendor/golang.org/x/net/idna/idna9.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/idna9.0.0.go
rename to v1/vendor/golang.org/x/net/idna/idna9.0.0.go
diff --git a/vendor/golang.org/x/net/idna/pre_go118.go b/v1/vendor/golang.org/x/net/idna/pre_go118.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/pre_go118.go
rename to v1/vendor/golang.org/x/net/idna/pre_go118.go
diff --git a/vendor/golang.org/x/net/idna/punycode.go b/v1/vendor/golang.org/x/net/idna/punycode.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/punycode.go
rename to v1/vendor/golang.org/x/net/idna/punycode.go
diff --git a/vendor/golang.org/x/net/idna/tables10.0.0.go b/v1/vendor/golang.org/x/net/idna/tables10.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/tables10.0.0.go
rename to v1/vendor/golang.org/x/net/idna/tables10.0.0.go
diff --git a/vendor/golang.org/x/net/idna/tables11.0.0.go b/v1/vendor/golang.org/x/net/idna/tables11.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/tables11.0.0.go
rename to v1/vendor/golang.org/x/net/idna/tables11.0.0.go
diff --git a/vendor/golang.org/x/net/idna/tables12.0.0.go b/v1/vendor/golang.org/x/net/idna/tables12.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/tables12.0.0.go
rename to v1/vendor/golang.org/x/net/idna/tables12.0.0.go
diff --git a/vendor/golang.org/x/net/idna/tables13.0.0.go b/v1/vendor/golang.org/x/net/idna/tables13.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/tables13.0.0.go
rename to v1/vendor/golang.org/x/net/idna/tables13.0.0.go
diff --git a/vendor/golang.org/x/net/idna/tables15.0.0.go b/v1/vendor/golang.org/x/net/idna/tables15.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/tables15.0.0.go
rename to v1/vendor/golang.org/x/net/idna/tables15.0.0.go
diff --git a/vendor/golang.org/x/net/idna/tables9.0.0.go b/v1/vendor/golang.org/x/net/idna/tables9.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/tables9.0.0.go
rename to v1/vendor/golang.org/x/net/idna/tables9.0.0.go
diff --git a/vendor/golang.org/x/net/idna/trie.go b/v1/vendor/golang.org/x/net/idna/trie.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/trie.go
rename to v1/vendor/golang.org/x/net/idna/trie.go
diff --git a/vendor/golang.org/x/net/idna/trie12.0.0.go b/v1/vendor/golang.org/x/net/idna/trie12.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/trie12.0.0.go
rename to v1/vendor/golang.org/x/net/idna/trie12.0.0.go
diff --git a/vendor/golang.org/x/net/idna/trie13.0.0.go b/v1/vendor/golang.org/x/net/idna/trie13.0.0.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/trie13.0.0.go
rename to v1/vendor/golang.org/x/net/idna/trie13.0.0.go
diff --git a/vendor/golang.org/x/net/idna/trieval.go b/v1/vendor/golang.org/x/net/idna/trieval.go
similarity index 100%
rename from vendor/golang.org/x/net/idna/trieval.go
rename to v1/vendor/golang.org/x/net/idna/trieval.go
diff --git a/vendor/golang.org/x/net/websocket/client.go b/v1/vendor/golang.org/x/net/websocket/client.go
similarity index 100%
rename from vendor/golang.org/x/net/websocket/client.go
rename to v1/vendor/golang.org/x/net/websocket/client.go
diff --git a/vendor/golang.org/x/net/websocket/dial.go b/v1/vendor/golang.org/x/net/websocket/dial.go
similarity index 100%
rename from vendor/golang.org/x/net/websocket/dial.go
rename to v1/vendor/golang.org/x/net/websocket/dial.go
diff --git a/vendor/golang.org/x/net/websocket/hybi.go b/v1/vendor/golang.org/x/net/websocket/hybi.go
similarity index 100%
rename from vendor/golang.org/x/net/websocket/hybi.go
rename to v1/vendor/golang.org/x/net/websocket/hybi.go
diff --git a/vendor/golang.org/x/net/websocket/server.go b/v1/vendor/golang.org/x/net/websocket/server.go
similarity index 100%
rename from vendor/golang.org/x/net/websocket/server.go
rename to v1/vendor/golang.org/x/net/websocket/server.go
diff --git a/vendor/golang.org/x/net/websocket/websocket.go b/v1/vendor/golang.org/x/net/websocket/websocket.go
similarity index 100%
rename from vendor/golang.org/x/net/websocket/websocket.go
rename to v1/vendor/golang.org/x/net/websocket/websocket.go
diff --git a/vendor/golang.org/x/sys/LICENSE b/v1/vendor/golang.org/x/sys/LICENSE
similarity index 100%
rename from vendor/golang.org/x/sys/LICENSE
rename to v1/vendor/golang.org/x/sys/LICENSE
diff --git a/vendor/golang.org/x/sys/PATENTS b/v1/vendor/golang.org/x/sys/PATENTS
similarity index 100%
rename from vendor/golang.org/x/sys/PATENTS
rename to v1/vendor/golang.org/x/sys/PATENTS
diff --git a/vendor/golang.org/x/sys/unix/.gitignore b/v1/vendor/golang.org/x/sys/unix/.gitignore
similarity index 100%
rename from vendor/golang.org/x/sys/unix/.gitignore
rename to v1/vendor/golang.org/x/sys/unix/.gitignore
diff --git a/vendor/golang.org/x/sys/unix/README.md b/v1/vendor/golang.org/x/sys/unix/README.md
similarity index 100%
rename from vendor/golang.org/x/sys/unix/README.md
rename to v1/vendor/golang.org/x/sys/unix/README.md
diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/v1/vendor/golang.org/x/sys/unix/affinity_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/affinity_linux.go
rename to v1/vendor/golang.org/x/sys/unix/affinity_linux.go
diff --git a/vendor/golang.org/x/sys/unix/aliases.go b/v1/vendor/golang.org/x/sys/unix/aliases.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/aliases.go
rename to v1/vendor/golang.org/x/sys/unix/aliases.go
diff --git a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/v1/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_386.s b/v1/vendor/golang.org/x/sys/unix/asm_bsd_386.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_bsd_386.s
rename to v1/vendor/golang.org/x/sys/unix/asm_bsd_386.s
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s b/v1/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_arm.s b/v1/vendor/golang.org/x/sys/unix/asm_bsd_arm.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_bsd_arm.s
rename to v1/vendor/golang.org/x/sys/unix/asm_bsd_arm.s
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s b/v1/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s b/v1/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s b/v1/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_386.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_386.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_386.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_386.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_amd64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_arm.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_arm.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_arm.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_arm64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_loong64.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_loong64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_loong64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_loong64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/v1/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_linux_s390x.s
rename to v1/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s b/v1/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s b/v1/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
rename to v1/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
diff --git a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/v1/vendor/golang.org/x/sys/unix/asm_zos_s390x.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/asm_zos_s390x.s
rename to v1/vendor/golang.org/x/sys/unix/asm_zos_s390x.s
diff --git a/vendor/golang.org/x/sys/unix/bluetooth_linux.go b/v1/vendor/golang.org/x/sys/unix/bluetooth_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/bluetooth_linux.go
rename to v1/vendor/golang.org/x/sys/unix/bluetooth_linux.go
diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/v1/vendor/golang.org/x/sys/unix/cap_freebsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/cap_freebsd.go
rename to v1/vendor/golang.org/x/sys/unix/cap_freebsd.go
diff --git a/vendor/golang.org/x/sys/unix/constants.go b/v1/vendor/golang.org/x/sys/unix/constants.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/constants.go
rename to v1/vendor/golang.org/x/sys/unix/constants.go
diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go b/v1/vendor/golang.org/x/sys/unix/dev_aix_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_aix_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/dev_aix_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go b/v1/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/dev_darwin.go b/v1/vendor/golang.org/x/sys/unix/dev_darwin.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_darwin.go
rename to v1/vendor/golang.org/x/sys/unix/dev_darwin.go
diff --git a/vendor/golang.org/x/sys/unix/dev_dragonfly.go b/v1/vendor/golang.org/x/sys/unix/dev_dragonfly.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_dragonfly.go
rename to v1/vendor/golang.org/x/sys/unix/dev_dragonfly.go
diff --git a/vendor/golang.org/x/sys/unix/dev_freebsd.go b/v1/vendor/golang.org/x/sys/unix/dev_freebsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_freebsd.go
rename to v1/vendor/golang.org/x/sys/unix/dev_freebsd.go
diff --git a/vendor/golang.org/x/sys/unix/dev_linux.go b/v1/vendor/golang.org/x/sys/unix/dev_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_linux.go
rename to v1/vendor/golang.org/x/sys/unix/dev_linux.go
diff --git a/vendor/golang.org/x/sys/unix/dev_netbsd.go b/v1/vendor/golang.org/x/sys/unix/dev_netbsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_netbsd.go
rename to v1/vendor/golang.org/x/sys/unix/dev_netbsd.go
diff --git a/vendor/golang.org/x/sys/unix/dev_openbsd.go b/v1/vendor/golang.org/x/sys/unix/dev_openbsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_openbsd.go
rename to v1/vendor/golang.org/x/sys/unix/dev_openbsd.go
diff --git a/vendor/golang.org/x/sys/unix/dev_zos.go b/v1/vendor/golang.org/x/sys/unix/dev_zos.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dev_zos.go
rename to v1/vendor/golang.org/x/sys/unix/dev_zos.go
diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/v1/vendor/golang.org/x/sys/unix/dirent.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/dirent.go
rename to v1/vendor/golang.org/x/sys/unix/dirent.go
diff --git a/vendor/golang.org/x/sys/unix/endian_big.go b/v1/vendor/golang.org/x/sys/unix/endian_big.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/endian_big.go
rename to v1/vendor/golang.org/x/sys/unix/endian_big.go
diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/v1/vendor/golang.org/x/sys/unix/endian_little.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/endian_little.go
rename to v1/vendor/golang.org/x/sys/unix/endian_little.go
diff --git a/vendor/golang.org/x/sys/unix/env_unix.go b/v1/vendor/golang.org/x/sys/unix/env_unix.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/env_unix.go
rename to v1/vendor/golang.org/x/sys/unix/env_unix.go
diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/v1/vendor/golang.org/x/sys/unix/epoll_zos.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/epoll_zos.go
rename to v1/vendor/golang.org/x/sys/unix/epoll_zos.go
diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/v1/vendor/golang.org/x/sys/unix/fcntl.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/fcntl.go
rename to v1/vendor/golang.org/x/sys/unix/fcntl.go
diff --git a/vendor/golang.org/x/sys/unix/fcntl_darwin.go b/v1/vendor/golang.org/x/sys/unix/fcntl_darwin.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/fcntl_darwin.go
rename to v1/vendor/golang.org/x/sys/unix/fcntl_darwin.go
diff --git a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go b/v1/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
rename to v1/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/v1/vendor/golang.org/x/sys/unix/fdset.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/fdset.go
rename to v1/vendor/golang.org/x/sys/unix/fdset.go
diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/v1/vendor/golang.org/x/sys/unix/fstatfs_zos.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/fstatfs_zos.go
rename to v1/vendor/golang.org/x/sys/unix/fstatfs_zos.go
diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/v1/vendor/golang.org/x/sys/unix/gccgo.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/gccgo.go
rename to v1/vendor/golang.org/x/sys/unix/gccgo.go
diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/v1/vendor/golang.org/x/sys/unix/gccgo_c.c
similarity index 100%
rename from vendor/golang.org/x/sys/unix/gccgo_c.c
rename to v1/vendor/golang.org/x/sys/unix/gccgo_c.c
diff --git a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go b/v1/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/v1/vendor/golang.org/x/sys/unix/ifreq_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ifreq_linux.go
rename to v1/vendor/golang.org/x/sys/unix/ifreq_linux.go
diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/v1/vendor/golang.org/x/sys/unix/ioctl_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ioctl_linux.go
rename to v1/vendor/golang.org/x/sys/unix/ioctl_linux.go
diff --git a/vendor/golang.org/x/sys/unix/ioctl_signed.go b/v1/vendor/golang.org/x/sys/unix/ioctl_signed.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ioctl_signed.go
rename to v1/vendor/golang.org/x/sys/unix/ioctl_signed.go
diff --git a/vendor/golang.org/x/sys/unix/ioctl_unsigned.go b/v1/vendor/golang.org/x/sys/unix/ioctl_unsigned.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ioctl_unsigned.go
rename to v1/vendor/golang.org/x/sys/unix/ioctl_unsigned.go
diff --git a/vendor/golang.org/x/sys/unix/ioctl_zos.go b/v1/vendor/golang.org/x/sys/unix/ioctl_zos.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ioctl_zos.go
rename to v1/vendor/golang.org/x/sys/unix/ioctl_zos.go
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/v1/vendor/golang.org/x/sys/unix/mkall.sh
similarity index 100%
rename from vendor/golang.org/x/sys/unix/mkall.sh
rename to v1/vendor/golang.org/x/sys/unix/mkall.sh
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/v1/vendor/golang.org/x/sys/unix/mkerrors.sh
similarity index 100%
rename from vendor/golang.org/x/sys/unix/mkerrors.sh
rename to v1/vendor/golang.org/x/sys/unix/mkerrors.sh
diff --git a/vendor/golang.org/x/sys/unix/mmap_nomremap.go b/v1/vendor/golang.org/x/sys/unix/mmap_nomremap.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/mmap_nomremap.go
rename to v1/vendor/golang.org/x/sys/unix/mmap_nomremap.go
diff --git a/vendor/golang.org/x/sys/unix/mremap.go b/v1/vendor/golang.org/x/sys/unix/mremap.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/mremap.go
rename to v1/vendor/golang.org/x/sys/unix/mremap.go
diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/v1/vendor/golang.org/x/sys/unix/pagesize_unix.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/pagesize_unix.go
rename to v1/vendor/golang.org/x/sys/unix/pagesize_unix.go
diff --git a/vendor/golang.org/x/sys/unix/pledge_openbsd.go b/v1/vendor/golang.org/x/sys/unix/pledge_openbsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/pledge_openbsd.go
rename to v1/vendor/golang.org/x/sys/unix/pledge_openbsd.go
diff --git a/vendor/golang.org/x/sys/unix/ptrace_darwin.go b/v1/vendor/golang.org/x/sys/unix/ptrace_darwin.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ptrace_darwin.go
rename to v1/vendor/golang.org/x/sys/unix/ptrace_darwin.go
diff --git a/vendor/golang.org/x/sys/unix/ptrace_ios.go b/v1/vendor/golang.org/x/sys/unix/ptrace_ios.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ptrace_ios.go
rename to v1/vendor/golang.org/x/sys/unix/ptrace_ios.go
diff --git a/vendor/golang.org/x/sys/unix/race.go b/v1/vendor/golang.org/x/sys/unix/race.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/race.go
rename to v1/vendor/golang.org/x/sys/unix/race.go
diff --git a/vendor/golang.org/x/sys/unix/race0.go b/v1/vendor/golang.org/x/sys/unix/race0.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/race0.go
rename to v1/vendor/golang.org/x/sys/unix/race0.go
diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdents.go b/v1/vendor/golang.org/x/sys/unix/readdirent_getdents.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/readdirent_getdents.go
rename to v1/vendor/golang.org/x/sys/unix/readdirent_getdents.go
diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/v1/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
rename to v1/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go b/v1/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go
rename to v1/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_linux.go b/v1/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sockcmsg_linux.go
rename to v1/vendor/golang.org/x/sys/unix/sockcmsg_linux.go
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/v1/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sockcmsg_unix.go
rename to v1/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go b/v1/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
rename to v1/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/v1/vendor/golang.org/x/sys/unix/syscall.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall.go
rename to v1/vendor/golang.org/x/sys/unix/syscall.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/v1/vendor/golang.org/x/sys/unix/syscall_aix.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_aix.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_aix.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/v1/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/v1/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/v1/vendor/golang.org/x/sys/unix/syscall_bsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_bsd.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_bsd.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/v1/vendor/golang.org/x/sys/unix/syscall_darwin.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_darwin.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_darwin.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/v1/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/v1/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/v1/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_dragonfly.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/v1/vendor/golang.org/x/sys/unix/syscall_freebsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_freebsd.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_freebsd.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/v1/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd.go b/v1/vendor/golang.org/x/sys/unix/syscall_hurd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_hurd.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_hurd.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_hurd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_hurd_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_hurd_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/v1/vendor/golang.org/x/sys/unix/syscall_illumos.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_illumos.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_illumos.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_arm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_gc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_gc.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_gc.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/v1/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/v1/vendor/golang.org/x/sys/unix/syscall_netbsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_netbsd.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_netbsd.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/v1/vendor/golang.org/x/sys/unix/syscall_solaris.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_solaris.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_solaris.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go b/v1/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/v1/vendor/golang.org/x/sys/unix/syscall_unix.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_unix.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_unix.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/v1/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_unix_gc.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go b/v1/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go
diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/v1/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/sysvshm_linux.go b/v1/vendor/golang.org/x/sys/unix/sysvshm_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sysvshm_linux.go
rename to v1/vendor/golang.org/x/sys/unix/sysvshm_linux.go
diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/v1/vendor/golang.org/x/sys/unix/sysvshm_unix.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sysvshm_unix.go
rename to v1/vendor/golang.org/x/sys/unix/sysvshm_unix.go
diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go b/v1/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/sysvshm_unix_other.go
rename to v1/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go
diff --git a/vendor/golang.org/x/sys/unix/timestruct.go b/v1/vendor/golang.org/x/sys/unix/timestruct.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/timestruct.go
rename to v1/vendor/golang.org/x/sys/unix/timestruct.go
diff --git a/vendor/golang.org/x/sys/unix/unveil_openbsd.go b/v1/vendor/golang.org/x/sys/unix/unveil_openbsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/unveil_openbsd.go
rename to v1/vendor/golang.org/x/sys/unix/unveil_openbsd.go
diff --git a/vendor/golang.org/x/sys/unix/xattr_bsd.go b/v1/vendor/golang.org/x/sys/unix/xattr_bsd.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/xattr_bsd.go
rename to v1/vendor/golang.org/x/sys/unix/xattr_bsd.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go b/v1/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go b/v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_386.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go b/v1/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/v1/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go b/v1/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go
rename to v1/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go
diff --git a/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go b/v1/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go b/v1/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go
rename to v1/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go
diff --git a/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go b/v1/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go
rename to v1/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go
diff --git a/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go b/v1/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zptrace_x86_linux.go
rename to v1/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/v1/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go b/v1/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go b/v1/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_386.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go b/v1/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/v1/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
similarity index 100%
rename from vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
rename to v1/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/v1/vendor/golang.org/x/sys/windows/aliases.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/aliases.go
rename to v1/vendor/golang.org/x/sys/windows/aliases.go
diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/v1/vendor/golang.org/x/sys/windows/dll_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/dll_windows.go
rename to v1/vendor/golang.org/x/sys/windows/dll_windows.go
diff --git a/vendor/golang.org/x/sys/windows/empty.s b/v1/vendor/golang.org/x/sys/windows/empty.s
similarity index 100%
rename from vendor/golang.org/x/sys/windows/empty.s
rename to v1/vendor/golang.org/x/sys/windows/empty.s
diff --git a/vendor/golang.org/x/sys/windows/env_windows.go b/v1/vendor/golang.org/x/sys/windows/env_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/env_windows.go
rename to v1/vendor/golang.org/x/sys/windows/env_windows.go
diff --git a/vendor/golang.org/x/sys/windows/eventlog.go b/v1/vendor/golang.org/x/sys/windows/eventlog.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/eventlog.go
rename to v1/vendor/golang.org/x/sys/windows/eventlog.go
diff --git a/vendor/golang.org/x/sys/windows/exec_windows.go b/v1/vendor/golang.org/x/sys/windows/exec_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/exec_windows.go
rename to v1/vendor/golang.org/x/sys/windows/exec_windows.go
diff --git a/vendor/golang.org/x/sys/windows/memory_windows.go b/v1/vendor/golang.org/x/sys/windows/memory_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/memory_windows.go
rename to v1/vendor/golang.org/x/sys/windows/memory_windows.go
diff --git a/vendor/golang.org/x/sys/windows/mkerrors.bash b/v1/vendor/golang.org/x/sys/windows/mkerrors.bash
similarity index 100%
rename from vendor/golang.org/x/sys/windows/mkerrors.bash
rename to v1/vendor/golang.org/x/sys/windows/mkerrors.bash
diff --git a/vendor/golang.org/x/sys/windows/mkknownfolderids.bash b/v1/vendor/golang.org/x/sys/windows/mkknownfolderids.bash
similarity index 100%
rename from vendor/golang.org/x/sys/windows/mkknownfolderids.bash
rename to v1/vendor/golang.org/x/sys/windows/mkknownfolderids.bash
diff --git a/vendor/golang.org/x/sys/windows/mksyscall.go b/v1/vendor/golang.org/x/sys/windows/mksyscall.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/mksyscall.go
rename to v1/vendor/golang.org/x/sys/windows/mksyscall.go
diff --git a/vendor/golang.org/x/sys/windows/race.go b/v1/vendor/golang.org/x/sys/windows/race.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/race.go
rename to v1/vendor/golang.org/x/sys/windows/race.go
diff --git a/vendor/golang.org/x/sys/windows/race0.go b/v1/vendor/golang.org/x/sys/windows/race0.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/race0.go
rename to v1/vendor/golang.org/x/sys/windows/race0.go
diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/v1/vendor/golang.org/x/sys/windows/registry/key.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/registry/key.go
rename to v1/vendor/golang.org/x/sys/windows/registry/key.go
diff --git a/vendor/golang.org/x/sys/windows/registry/mksyscall.go b/v1/vendor/golang.org/x/sys/windows/registry/mksyscall.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/registry/mksyscall.go
rename to v1/vendor/golang.org/x/sys/windows/registry/mksyscall.go
diff --git a/vendor/golang.org/x/sys/windows/registry/syscall.go b/v1/vendor/golang.org/x/sys/windows/registry/syscall.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/registry/syscall.go
rename to v1/vendor/golang.org/x/sys/windows/registry/syscall.go
diff --git a/vendor/golang.org/x/sys/windows/registry/value.go b/v1/vendor/golang.org/x/sys/windows/registry/value.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/registry/value.go
rename to v1/vendor/golang.org/x/sys/windows/registry/value.go
diff --git a/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go b/v1/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
rename to v1/vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/v1/vendor/golang.org/x/sys/windows/security_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/security_windows.go
rename to v1/vendor/golang.org/x/sys/windows/security_windows.go
diff --git a/vendor/golang.org/x/sys/windows/service.go b/v1/vendor/golang.org/x/sys/windows/service.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/service.go
rename to v1/vendor/golang.org/x/sys/windows/service.go
diff --git a/vendor/golang.org/x/sys/windows/setupapi_windows.go b/v1/vendor/golang.org/x/sys/windows/setupapi_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/setupapi_windows.go
rename to v1/vendor/golang.org/x/sys/windows/setupapi_windows.go
diff --git a/vendor/golang.org/x/sys/windows/str.go b/v1/vendor/golang.org/x/sys/windows/str.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/str.go
rename to v1/vendor/golang.org/x/sys/windows/str.go
diff --git a/vendor/golang.org/x/sys/windows/syscall.go b/v1/vendor/golang.org/x/sys/windows/syscall.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/syscall.go
rename to v1/vendor/golang.org/x/sys/windows/syscall.go
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/v1/vendor/golang.org/x/sys/windows/syscall_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/syscall_windows.go
rename to v1/vendor/golang.org/x/sys/windows/syscall_windows.go
diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/v1/vendor/golang.org/x/sys/windows/types_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/types_windows.go
rename to v1/vendor/golang.org/x/sys/windows/types_windows.go
diff --git a/vendor/golang.org/x/sys/windows/types_windows_386.go b/v1/vendor/golang.org/x/sys/windows/types_windows_386.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/types_windows_386.go
rename to v1/vendor/golang.org/x/sys/windows/types_windows_386.go
diff --git a/vendor/golang.org/x/sys/windows/types_windows_amd64.go b/v1/vendor/golang.org/x/sys/windows/types_windows_amd64.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/types_windows_amd64.go
rename to v1/vendor/golang.org/x/sys/windows/types_windows_amd64.go
diff --git a/vendor/golang.org/x/sys/windows/types_windows_arm.go b/v1/vendor/golang.org/x/sys/windows/types_windows_arm.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/types_windows_arm.go
rename to v1/vendor/golang.org/x/sys/windows/types_windows_arm.go
diff --git a/vendor/golang.org/x/sys/windows/types_windows_arm64.go b/v1/vendor/golang.org/x/sys/windows/types_windows_arm64.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/types_windows_arm64.go
rename to v1/vendor/golang.org/x/sys/windows/types_windows_arm64.go
diff --git a/vendor/golang.org/x/sys/windows/zerrors_windows.go b/v1/vendor/golang.org/x/sys/windows/zerrors_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/zerrors_windows.go
rename to v1/vendor/golang.org/x/sys/windows/zerrors_windows.go
diff --git a/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go b/v1/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/zknownfolderids_windows.go
rename to v1/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/v1/vendor/golang.org/x/sys/windows/zsyscall_windows.go
similarity index 100%
rename from vendor/golang.org/x/sys/windows/zsyscall_windows.go
rename to v1/vendor/golang.org/x/sys/windows/zsyscall_windows.go
diff --git a/vendor/golang.org/x/text/LICENSE b/v1/vendor/golang.org/x/text/LICENSE
similarity index 100%
rename from vendor/golang.org/x/text/LICENSE
rename to v1/vendor/golang.org/x/text/LICENSE
diff --git a/vendor/golang.org/x/text/PATENTS b/v1/vendor/golang.org/x/text/PATENTS
similarity index 100%
rename from vendor/golang.org/x/text/PATENTS
rename to v1/vendor/golang.org/x/text/PATENTS
diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule.go b/v1/vendor/golang.org/x/text/secure/bidirule/bidirule.go
similarity index 100%
rename from vendor/golang.org/x/text/secure/bidirule/bidirule.go
rename to v1/vendor/golang.org/x/text/secure/bidirule/bidirule.go
diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go b/v1/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go
rename to v1/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go
diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go b/v1/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go
rename to v1/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go
diff --git a/vendor/golang.org/x/text/transform/transform.go b/v1/vendor/golang.org/x/text/transform/transform.go
similarity index 100%
rename from vendor/golang.org/x/text/transform/transform.go
rename to v1/vendor/golang.org/x/text/transform/transform.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/bidi.go b/v1/vendor/golang.org/x/text/unicode/bidi/bidi.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/bidi.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/bidi.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/bracket.go b/v1/vendor/golang.org/x/text/unicode/bidi/bracket.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/bracket.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/bracket.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/core.go b/v1/vendor/golang.org/x/text/unicode/bidi/core.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/core.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/core.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/prop.go b/v1/vendor/golang.org/x/text/unicode/bidi/prop.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/prop.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/prop.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go b/v1/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go b/v1/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go b/v1/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go b/v1/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go b/v1/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go b/v1/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/bidi/trieval.go b/v1/vendor/golang.org/x/text/unicode/bidi/trieval.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/bidi/trieval.go
rename to v1/vendor/golang.org/x/text/unicode/bidi/trieval.go
diff --git a/vendor/golang.org/x/text/unicode/norm/composition.go b/v1/vendor/golang.org/x/text/unicode/norm/composition.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/composition.go
rename to v1/vendor/golang.org/x/text/unicode/norm/composition.go
diff --git a/vendor/golang.org/x/text/unicode/norm/forminfo.go b/v1/vendor/golang.org/x/text/unicode/norm/forminfo.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/forminfo.go
rename to v1/vendor/golang.org/x/text/unicode/norm/forminfo.go
diff --git a/vendor/golang.org/x/text/unicode/norm/input.go b/v1/vendor/golang.org/x/text/unicode/norm/input.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/input.go
rename to v1/vendor/golang.org/x/text/unicode/norm/input.go
diff --git a/vendor/golang.org/x/text/unicode/norm/iter.go b/v1/vendor/golang.org/x/text/unicode/norm/iter.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/iter.go
rename to v1/vendor/golang.org/x/text/unicode/norm/iter.go
diff --git a/vendor/golang.org/x/text/unicode/norm/normalize.go b/v1/vendor/golang.org/x/text/unicode/norm/normalize.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/normalize.go
rename to v1/vendor/golang.org/x/text/unicode/norm/normalize.go
diff --git a/vendor/golang.org/x/text/unicode/norm/readwriter.go b/v1/vendor/golang.org/x/text/unicode/norm/readwriter.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/readwriter.go
rename to v1/vendor/golang.org/x/text/unicode/norm/readwriter.go
diff --git a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go b/v1/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/tables10.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go b/v1/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/tables11.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go b/v1/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/tables12.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go b/v1/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/tables13.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go b/v1/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/tables15.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/v1/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/tables9.0.0.go
rename to v1/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go
diff --git a/vendor/golang.org/x/text/unicode/norm/transform.go b/v1/vendor/golang.org/x/text/unicode/norm/transform.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/transform.go
rename to v1/vendor/golang.org/x/text/unicode/norm/transform.go
diff --git a/vendor/golang.org/x/text/unicode/norm/trie.go b/v1/vendor/golang.org/x/text/unicode/norm/trie.go
similarity index 100%
rename from vendor/golang.org/x/text/unicode/norm/trie.go
rename to v1/vendor/golang.org/x/text/unicode/norm/trie.go
diff --git a/vendor/modules.txt b/v1/vendor/modules.txt
similarity index 80%
rename from vendor/modules.txt
rename to v1/vendor/modules.txt
index 131254c..c0533cb 100644
--- a/vendor/modules.txt
+++ b/v1/vendor/modules.txt
@@ -50,33 +50,15 @@ github.com/pkg/browser
# github.com/pkg/errors v0.9.1
## explicit
github.com/pkg/errors
-# github.com/r3labs/sse/v2 v2.10.0
-## explicit; go 1.13
-github.com/r3labs/sse/v2
# github.com/rivo/uniseg v0.4.4
## explicit; go 1.18
github.com/rivo/uniseg
-# github.com/robertkrimen/otto v0.3.0
-## explicit; go 1.18
-github.com/robertkrimen/otto
-github.com/robertkrimen/otto/ast
-github.com/robertkrimen/otto/dbg
-github.com/robertkrimen/otto/file
-github.com/robertkrimen/otto/parser
-github.com/robertkrimen/otto/registry
-github.com/robertkrimen/otto/token
# github.com/samber/lo v1.38.1
## explicit; go 1.18
github.com/samber/lo
# github.com/tkrajina/go-reflector v0.5.6
## explicit; go 1.17
github.com/tkrajina/go-reflector/reflector
-# github.com/tylertravisty/go-utils v0.0.0-20230524204414-6893ae548909
-## explicit; go 1.16
-github.com/tylertravisty/go-utils/random
-# github.com/tylertravisty/rumble-livestream-lib-go v0.3.4
-## explicit; go 1.19
-github.com/tylertravisty/rumble-livestream-lib-go
# github.com/valyala/bytebufferpool v1.0.0
## explicit
github.com/valyala/bytebufferpool
@@ -95,7 +77,7 @@ github.com/wailsapp/mimetype
github.com/wailsapp/mimetype/internal/charset
github.com/wailsapp/mimetype/internal/json
github.com/wailsapp/mimetype/internal/magic
-# github.com/wailsapp/wails/v2 v2.7.1
+# github.com/wailsapp/wails/v2 v2.8.0
## explicit; go 1.20
github.com/wailsapp/wails/v2
github.com/wailsapp/wails/v2/internal/app
@@ -146,7 +128,6 @@ golang.org/x/crypto/acme/autocert
golang.org/x/exp/constraints
# golang.org/x/net v0.20.0
## explicit; go 1.18
-golang.org/x/net/context
golang.org/x/net/html
golang.org/x/net/html/atom
golang.org/x/net/http/httpguts
@@ -162,27 +143,7 @@ golang.org/x/sys/windows
golang.org/x/sys/windows/registry
# golang.org/x/text v0.14.0
## explicit; go 1.18
-golang.org/x/text/feature/plural
-golang.org/x/text/internal
-golang.org/x/text/internal/catmsg
-golang.org/x/text/internal/format
-golang.org/x/text/internal/language
-golang.org/x/text/internal/language/compact
-golang.org/x/text/internal/number
-golang.org/x/text/internal/stringset
-golang.org/x/text/internal/tag
-golang.org/x/text/language
-golang.org/x/text/message
-golang.org/x/text/message/catalog
-golang.org/x/text/number
golang.org/x/text/secure/bidirule
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
-# gopkg.in/cenkalti/backoff.v1 v1.1.0
-## explicit
-gopkg.in/cenkalti/backoff.v1
-# gopkg.in/sourcemap.v1 v1.0.5
-## explicit
-gopkg.in/sourcemap.v1
-gopkg.in/sourcemap.v1/base64vlq
diff --git a/wails.json b/v1/wails.json
similarity index 100%
rename from wails.json
rename to v1/wails.json
diff --git a/vendor/github.com/r3labs/sse/v2/.gitignore b/vendor/github.com/r3labs/sse/v2/.gitignore
deleted file mode 100644
index d48c759..0000000
--- a/vendor/github.com/r3labs/sse/v2/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-.idea
-.vscode
\ No newline at end of file
diff --git a/vendor/github.com/r3labs/sse/v2/.golangci.yml b/vendor/github.com/r3labs/sse/v2/.golangci.yml
deleted file mode 100644
index 5a76e9a..0000000
--- a/vendor/github.com/r3labs/sse/v2/.golangci.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-linters:
- enable-all: true
- disable:
- - gofmt
- - gofumpt
- - goimports
- - golint # deprecated
- - interfacer # deprecated
- - maligned # deprecated
- - scopelint # deprecated
- - varnamelen
-
-linters-settings:
- govet:
- enable-all: true
diff --git a/vendor/github.com/r3labs/sse/v2/CONTRIBUTING.md b/vendor/github.com/r3labs/sse/v2/CONTRIBUTING.md
deleted file mode 100644
index b9c7859..0000000
--- a/vendor/github.com/r3labs/sse/v2/CONTRIBUTING.md
+++ /dev/null
@@ -1,80 +0,0 @@
-# Contributing guidelines
-
-Looking to contribute something to this project? Here's how you can help:
-
-Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
-
-Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
-
-We also have a [code of conduct](https://ernest.io/conduct).
-
-## Using the issue tracker
-
-The issue tracker is the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) and [submitting pull requests](#pull-requests), but please respect the following restrictions:
-
-* Please **do not** use the issue tracker for personal support requests.
-
-* Please **do not** derail issues. Keep the discussion on topic and
- respect the opinions of others.
-
-
-## Bug reports
-
-A bug is a _demonstrable problem_ that is caused by the code in the repository.
-Good bug reports are extremely helpful - thank you!
-
-Guidelines for bug reports:
-
-1. **Use the GitHub issue search** — check if the issue has already been
- reported.
-
-2. **Check if the issue has been fixed** — try to reproduce it using the
- latest `master` or `develop` branch in the repository.
-
-3. **Isolate the problem** — create a reduced test case and a live example.
-
-A good bug report shouldn't leave others needing to chase you up for more
-information. Please try to be as detailed as possible in your report. What is
-your environment? What steps will reproduce the issue? Which environment experience the problem? What would you expect to be the outcome? All these
-details will help people to fix any potential bugs.
-
-Example:
-
-> Short and descriptive example bug report title
->
-> A summary of the issue and the environment in which it occurs. If
-> suitable, include the steps required to reproduce the bug.
->
-> 1. This is the first step
-> 2. This is the second step
-> 3. Further steps, etc.
->
-> `` - a link to the reduced test case
->
-> Any other information you want to share that is relevant to the issue being
-> reported. This might include the lines of code that you have identified as
-> causing the bug, and potential solutions (and your opinions on their
-> merits).
-
-
-## Feature requests
-
-Feature requests are welcome. But take a moment to find out whether your idea
-fits with the scope and aims of the project. It's up to *you* to make a strong
-case to convince the project's developers of the merits of this feature. Please
-provide as much detail and context as possible.
-
-
-## Pull requests
-
-Good pull requests - patches, improvements, new features - are a fantastic
-help. They should remain focused in scope and avoid containing unrelated
-commits.
-
-[**Please ask first**](https://ernest.io/community) before embarking on any significant pull request (e.g.
-implementing features, refactoring code, porting to a different language),
-otherwise you risk spending a lot of time working on something that the
-project's developers might not want to merge into the project.
-
-Please adhere to the coding conventions used throughout a project (indentation,
-accurate comments, etc.) and any other requirements (such as test coverage).
diff --git a/vendor/github.com/r3labs/sse/v2/LICENSE b/vendor/github.com/r3labs/sse/v2/LICENSE
deleted file mode 100644
index a612ad9..0000000
--- a/vendor/github.com/r3labs/sse/v2/LICENSE
+++ /dev/null
@@ -1,373 +0,0 @@
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
- means each individual or legal entity that creates, contributes to
- the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
- means the combination of the Contributions of others (if any) used
- by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
- means Source Code Form to which the initial Contributor has attached
- the notice in Exhibit A, the Executable Form of such Source Code
- Form, and Modifications of such Source Code Form, in each case
- including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- (a) that the initial Contributor has attached the notice described
- in Exhibit B to the Covered Software; or
-
- (b) that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the
- terms of a Secondary License.
-
-1.6. "Executable Form"
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
- means a work that combines Covered Software with other material, in
- a separate file or files, that is not Covered Software.
-
-1.8. "License"
- means this document.
-
-1.9. "Licensable"
- means having the right to grant, to the maximum extent possible,
- whether at the time of the initial grant or subsequently, any and
- all of the rights conveyed by this License.
-
-1.10. "Modifications"
- means any of the following:
-
- (a) any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered
- Software; or
-
- (b) any new file in Source Code Form that contains any Covered
- Software.
-
-1.11. "Patent Claims" of a Contributor
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the
- License, by the making, using, selling, offering for sale, having
- made, import, or transfer of either its Contributions or its
- Contributor Version.
-
-1.12. "Secondary License"
- means either the GNU General Public License, Version 2.0, the GNU
- Lesser General Public License, Version 2.1, the GNU Affero General
- Public License, Version 3.0, or any later versions of those
- licenses.
-
-1.13. "Source Code Form"
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that
- controls, is controlled by, or is under common control with You. For
- purposes of this definition, "control" means (a) the power, direct
- or indirect, to cause the direction or management of such entity,
- whether by contract or otherwise, or (b) ownership of more than
- fifty percent (50%) of the outstanding shares or beneficial
- ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
- for sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
- or
-
-(b) for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
- Form, as described in Section 3.1, and You must inform recipients of
- the Executable Form how they can obtain a copy of such Source Code
- Form by reasonable means in a timely manner, at a charge no more
- than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter
- the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-* *
-* 6. Disclaimer of Warranty *
-* ------------------------- *
-* *
-* Covered Software is provided under this License on an "as is" *
-* basis, without warranty of any kind, either expressed, implied, or *
-* statutory, including, without limitation, warranties that the *
-* Covered Software is free of defects, merchantable, fit for a *
-* particular purpose or non-infringing. The entire risk as to the *
-* quality and performance of the Covered Software is with You. *
-* Should any Covered Software prove defective in any respect, You *
-* (not any Contributor) assume the cost of any necessary servicing, *
-* repair, or correction. This disclaimer of warranty constitutes an *
-* essential part of this License. No use of any Covered Software is *
-* authorized under this License except under this disclaimer. *
-* *
-************************************************************************
-
-************************************************************************
-* *
-* 7. Limitation of Liability *
-* -------------------------- *
-* *
-* Under no circumstances and under no legal theory, whether tort *
-* (including negligence), contract, or otherwise, shall any *
-* Contributor, or anyone who distributes Covered Software as *
-* permitted above, be liable to You for any direct, indirect, *
-* special, incidental, or consequential damages of any character *
-* including, without limitation, damages for lost profits, loss of *
-* goodwill, work stoppage, computer failure or malfunction, or any *
-* and all other commercial damages or losses, even if such party *
-* shall have been informed of the possibility of such damages. This *
-* limitation of liability shall not apply to liability for death or *
-* personal injury resulting from such party's negligence to the *
-* extent applicable law prohibits such limitation. Some *
-* jurisdictions do not allow the exclusion or limitation of *
-* incidental or consequential damages, so this exclusion and *
-* limitation may not apply to You. *
-* *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
- This Source Code Form is "Incompatible With Secondary Licenses", as
- defined by the Mozilla Public License, v. 2.0.
diff --git a/vendor/github.com/r3labs/sse/v2/Makefile b/vendor/github.com/r3labs/sse/v2/Makefile
deleted file mode 100644
index a63b700..0000000
--- a/vendor/github.com/r3labs/sse/v2/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-install:
- go install -v
-
-build:
- go build -v ./...
-
-lint:
- golint ./...
- go vet ./...
-
-test:
- go test -v ./... --cover
-
-deps:
- go get -u gopkg.in/cenkalti/backoff.v1
- go get -u github.com/golang/lint/golint
- go get -u github.com/stretchr/testify
-
-clean:
- go clean
diff --git a/vendor/github.com/r3labs/sse/v2/README.md b/vendor/github.com/r3labs/sse/v2/README.md
deleted file mode 100644
index c2201be..0000000
--- a/vendor/github.com/r3labs/sse/v2/README.md
+++ /dev/null
@@ -1,191 +0,0 @@
-# SSE - Server Sent Events Client/Server Library for Go
-
-## Synopsis
-
-SSE is a client/server implementation for Server Sent Events for Golang.
-
-## Build status
-
-* Master: [![CircleCI Master](https://circleci.com/gh/r3labs/sse.svg?style=svg)](https://circleci.com/gh/r3labs/sse)
-
-## Quick start
-
-To install:
-```
-go get github.com/r3labs/sse/v2
-```
-
-To Test:
-
-```sh
-$ make deps
-$ make test
-```
-
-#### Example Server
-
-There are two parts of the server. It is comprised of the message scheduler and a http handler function.
-The messaging system is started when running:
-
-```go
-func main() {
- server := sse.New()
-}
-```
-
-To add a stream to this handler:
-
-```go
-func main() {
- server := sse.New()
- server.CreateStream("messages")
-}
-```
-
-This creates a new stream inside of the scheduler. Seeing as there are no consumers, publishing a message to this channel will do nothing.
-Clients can connect to this stream once the http handler is started by specifying _stream_ as a url parameter, like so:
-
-```
-http://server/events?stream=messages
-```
-
-
-In order to start the http server:
-
-```go
-func main() {
- server := sse.New()
-
- // Create a new Mux and set the handler
- mux := http.NewServeMux()
- mux.HandleFunc("/events", server.ServeHTTP)
-
- http.ListenAndServe(":8080", mux)
-}
-```
-
-To publish messages to a stream:
-
-```go
-func main() {
- server := sse.New()
-
- // Publish a payload to the stream
- server.Publish("messages", &sse.Event{
- Data: []byte("ping"),
- })
-}
-```
-
-Please note there must be a stream with the name you specify and there must be subscribers to that stream
-
-A way to detect disconnected clients:
-
-```go
-func main() {
- server := sse.New()
-
- mux := http.NewServeMux()
- mux.HandleFunc("/events", func(w http.ResponseWriter, r *http.Request) {
- go func() {
- // Received Browser Disconnection
- <-r.Context().Done()
- println("The client is disconnected here")
- return
- }()
-
- server.ServeHTTP(w, r)
- })
-
- http.ListenAndServe(":8080", mux)
-}
-```
-
-#### Example Client
-
-The client exposes a way to connect to an SSE server. The client can also handle multiple events under the same url.
-
-To create a new client:
-
-```go
-func main() {
- client := sse.NewClient("http://server/events")
-}
-```
-
-To subscribe to an event stream, please use the Subscribe function. This accepts the name of the stream and a handler function:
-
-```go
-func main() {
- client := sse.NewClient("http://server/events")
-
- client.Subscribe("messages", func(msg *sse.Event) {
- // Got some data!
- fmt.Println(msg.Data)
- })
-}
-```
-
-Please note that this function will block the current thread. You can run this function in a go routine.
-
-If you wish to have events sent to a channel, you can use SubscribeChan:
-
-```go
-func main() {
- events := make(chan *sse.Event)
-
- client := sse.NewClient("http://server/events")
- client.SubscribeChan("messages", events)
-}
-```
-
-#### HTTP client parameters
-
-To add additional parameters to the http client, such as disabling ssl verification for self signed certs, you can override the http client or update its options:
-
-```go
-func main() {
- client := sse.NewClient("http://server/events")
- client.Connection.Transport = &http.Transport{
- TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
- }
-}
-```
-
-#### URL query parameters
-
-To set custom query parameters on the client or disable the stream parameter altogether:
-
-```go
-func main() {
- client := sse.NewClient("http://server/events?search=example")
-
- client.SubscribeRaw(func(msg *sse.Event) {
- // Got some data!
- fmt.Println(msg.Data)
- })
-}
-```
-
-
-## Contributing
-
-Please read through our
-[contributing guidelines](CONTRIBUTING.md).
-Included are directions for opening issues, coding standards, and notes on
-development.
-
-Moreover, if your pull request contains patches or features, you must include
-relevant unit tests.
-
-## Versioning
-
-For transparency into our release cycle and in striving to maintain backward
-compatibility, this project is maintained under [the Semantic Versioning guidelines](http://semver.org/).
-
-## Copyright and License
-
-Code and documentation copyright since 2015 r3labs.io authors.
-
-Code released under
-[the Mozilla Public License Version 2.0](LICENSE).
diff --git a/vendor/github.com/r3labs/sse/v2/client.go b/vendor/github.com/r3labs/sse/v2/client.go
deleted file mode 100644
index 61772b6..0000000
--- a/vendor/github.com/r3labs/sse/v2/client.go
+++ /dev/null
@@ -1,390 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import (
- "bytes"
- "context"
- "encoding/base64"
- "errors"
- "fmt"
- "io"
- "net/http"
- "sync"
- "sync/atomic"
- "time"
-
- "gopkg.in/cenkalti/backoff.v1"
-)
-
-var (
- headerID = []byte("id:")
- headerData = []byte("data:")
- headerEvent = []byte("event:")
- headerRetry = []byte("retry:")
-)
-
-func ClientMaxBufferSize(s int) func(c *Client) {
- return func(c *Client) {
- c.maxBufferSize = s
- }
-}
-
-// ConnCallback defines a function to be called on a particular connection event
-type ConnCallback func(c *Client)
-
-// ResponseValidator validates a response
-type ResponseValidator func(c *Client, resp *http.Response) error
-
-// Client handles an incoming server stream
-type Client struct {
- Retry time.Time
- ReconnectStrategy backoff.BackOff
- disconnectcb ConnCallback
- connectedcb ConnCallback
- subscribed map[chan *Event]chan struct{}
- Headers map[string]string
- ReconnectNotify backoff.Notify
- ResponseValidator ResponseValidator
- Connection *http.Client
- URL string
- LastEventID atomic.Value // []byte
- maxBufferSize int
- mu sync.Mutex
- EncodingBase64 bool
- Connected bool
-}
-
-// NewClient creates a new client
-func NewClient(url string, opts ...func(c *Client)) *Client {
- c := &Client{
- URL: url,
- Connection: &http.Client{},
- Headers: make(map[string]string),
- subscribed: make(map[chan *Event]chan struct{}),
- maxBufferSize: 1 << 16,
- }
-
- for _, opt := range opts {
- opt(c)
- }
-
- return c
-}
-
-// Subscribe to a data stream
-func (c *Client) Subscribe(stream string, handler func(msg *Event)) error {
- return c.SubscribeWithContext(context.Background(), stream, handler)
-}
-
-// SubscribeWithContext to a data stream with context
-func (c *Client) SubscribeWithContext(ctx context.Context, stream string, handler func(msg *Event)) error {
- operation := func() error {
- resp, err := c.request(ctx, stream)
- if err != nil {
- return err
- }
- if validator := c.ResponseValidator; validator != nil {
- err = validator(c, resp)
- if err != nil {
- return err
- }
- } else if resp.StatusCode != 200 {
- resp.Body.Close()
- return fmt.Errorf("could not connect to stream: %s", http.StatusText(resp.StatusCode))
- }
- defer resp.Body.Close()
-
- reader := NewEventStreamReader(resp.Body, c.maxBufferSize)
- eventChan, errorChan := c.startReadLoop(reader)
-
- for {
- select {
- case err = <-errorChan:
- return err
- case msg := <-eventChan:
- handler(msg)
- }
- }
- }
-
- // Apply user specified reconnection strategy or default to standard NewExponentialBackOff() reconnection method
- var err error
- if c.ReconnectStrategy != nil {
- err = backoff.RetryNotify(operation, c.ReconnectStrategy, c.ReconnectNotify)
- } else {
- err = backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), c.ReconnectNotify)
- }
- return err
-}
-
-// SubscribeChan sends all events to the provided channel
-func (c *Client) SubscribeChan(stream string, ch chan *Event) error {
- return c.SubscribeChanWithContext(context.Background(), stream, ch)
-}
-
-// SubscribeChanWithContext sends all events to the provided channel with context
-func (c *Client) SubscribeChanWithContext(ctx context.Context, stream string, ch chan *Event) error {
- var connected bool
- errch := make(chan error)
- c.mu.Lock()
- c.subscribed[ch] = make(chan struct{})
- c.mu.Unlock()
-
- operation := func() error {
- resp, err := c.request(ctx, stream)
- if err != nil {
- return err
- }
- if validator := c.ResponseValidator; validator != nil {
- err = validator(c, resp)
- if err != nil {
- return err
- }
- } else if resp.StatusCode != 200 {
- resp.Body.Close()
- return fmt.Errorf("could not connect to stream: %s", http.StatusText(resp.StatusCode))
- }
- defer resp.Body.Close()
-
- if !connected {
- // Notify connect
- errch <- nil
- connected = true
- }
-
- reader := NewEventStreamReader(resp.Body, c.maxBufferSize)
- eventChan, errorChan := c.startReadLoop(reader)
-
- for {
- var msg *Event
- // Wait for message to arrive or exit
- select {
- case <-c.subscribed[ch]:
- return nil
- case err = <-errorChan:
- return err
- case msg = <-eventChan:
- }
-
- // Wait for message to be sent or exit
- if msg != nil {
- select {
- case <-c.subscribed[ch]:
- return nil
- case ch <- msg:
- // message sent
- }
- }
- }
- }
-
- go func() {
- defer c.cleanup(ch)
- // Apply user specified reconnection strategy or default to standard NewExponentialBackOff() reconnection method
- var err error
- if c.ReconnectStrategy != nil {
- err = backoff.RetryNotify(operation, c.ReconnectStrategy, c.ReconnectNotify)
- } else {
- err = backoff.RetryNotify(operation, backoff.NewExponentialBackOff(), c.ReconnectNotify)
- }
-
- // channel closed once connected
- if err != nil && !connected {
- errch <- err
- }
- }()
- err := <-errch
- close(errch)
- return err
-}
-
-func (c *Client) startReadLoop(reader *EventStreamReader) (chan *Event, chan error) {
- outCh := make(chan *Event)
- erChan := make(chan error)
- go c.readLoop(reader, outCh, erChan)
- return outCh, erChan
-}
-
-func (c *Client) readLoop(reader *EventStreamReader, outCh chan *Event, erChan chan error) {
- for {
- // Read each new line and process the type of event
- event, err := reader.ReadEvent()
- if err != nil {
- if err == io.EOF {
- erChan <- nil
- return
- }
- // run user specified disconnect function
- if c.disconnectcb != nil {
- c.Connected = false
- c.disconnectcb(c)
- }
- erChan <- err
- return
- }
-
- if !c.Connected && c.connectedcb != nil {
- c.Connected = true
- c.connectedcb(c)
- }
-
- // If we get an error, ignore it.
- var msg *Event
- if msg, err = c.processEvent(event); err == nil {
- if len(msg.ID) > 0 {
- c.LastEventID.Store(msg.ID)
- } else {
- msg.ID, _ = c.LastEventID.Load().([]byte)
- }
-
- // Send downstream if the event has something useful
- if msg.hasContent() {
- outCh <- msg
- }
- }
- }
-}
-
-// SubscribeRaw to an sse endpoint
-func (c *Client) SubscribeRaw(handler func(msg *Event)) error {
- return c.Subscribe("", handler)
-}
-
-// SubscribeRawWithContext to an sse endpoint with context
-func (c *Client) SubscribeRawWithContext(ctx context.Context, handler func(msg *Event)) error {
- return c.SubscribeWithContext(ctx, "", handler)
-}
-
-// SubscribeChanRaw sends all events to the provided channel
-func (c *Client) SubscribeChanRaw(ch chan *Event) error {
- return c.SubscribeChan("", ch)
-}
-
-// SubscribeChanRawWithContext sends all events to the provided channel with context
-func (c *Client) SubscribeChanRawWithContext(ctx context.Context, ch chan *Event) error {
- return c.SubscribeChanWithContext(ctx, "", ch)
-}
-
-// Unsubscribe unsubscribes a channel
-func (c *Client) Unsubscribe(ch chan *Event) {
- c.mu.Lock()
- defer c.mu.Unlock()
-
- if c.subscribed[ch] != nil {
- c.subscribed[ch] <- struct{}{}
- }
-}
-
-// OnDisconnect specifies the function to run when the connection disconnects
-func (c *Client) OnDisconnect(fn ConnCallback) {
- c.disconnectcb = fn
-}
-
-// OnConnect specifies the function to run when the connection is successful
-func (c *Client) OnConnect(fn ConnCallback) {
- c.connectedcb = fn
-}
-
-func (c *Client) request(ctx context.Context, stream string) (*http.Response, error) {
- req, err := http.NewRequest("GET", c.URL, nil)
- if err != nil {
- return nil, err
- }
- req = req.WithContext(ctx)
-
- // Setup request, specify stream to connect to
- if stream != "" {
- query := req.URL.Query()
- query.Add("stream", stream)
- req.URL.RawQuery = query.Encode()
- }
-
- req.Header.Set("Cache-Control", "no-cache")
- req.Header.Set("Accept", "text/event-stream")
- req.Header.Set("Connection", "keep-alive")
-
- lastID, exists := c.LastEventID.Load().([]byte)
- if exists && lastID != nil {
- req.Header.Set("Last-Event-ID", string(lastID))
- }
-
- // Add user specified headers
- for k, v := range c.Headers {
- req.Header.Set(k, v)
- }
-
- return c.Connection.Do(req)
-}
-
-func (c *Client) processEvent(msg []byte) (event *Event, err error) {
- var e Event
-
- if len(msg) < 1 {
- return nil, errors.New("event message was empty")
- }
-
- // Normalize the crlf to lf to make it easier to split the lines.
- // Split the line by "\n" or "\r", per the spec.
- for _, line := range bytes.FieldsFunc(msg, func(r rune) bool { return r == '\n' || r == '\r' }) {
- switch {
- case bytes.HasPrefix(line, headerID):
- e.ID = append([]byte(nil), trimHeader(len(headerID), line)...)
- case bytes.HasPrefix(line, headerData):
- // The spec allows for multiple data fields per event, concatenated them with "\n".
- e.Data = append(e.Data[:], append(trimHeader(len(headerData), line), byte('\n'))...)
- // The spec says that a line that simply contains the string "data" should be treated as a data field with an empty body.
- case bytes.Equal(line, bytes.TrimSuffix(headerData, []byte(":"))):
- e.Data = append(e.Data, byte('\n'))
- case bytes.HasPrefix(line, headerEvent):
- e.Event = append([]byte(nil), trimHeader(len(headerEvent), line)...)
- case bytes.HasPrefix(line, headerRetry):
- e.Retry = append([]byte(nil), trimHeader(len(headerRetry), line)...)
- default:
- // Ignore any garbage that doesn't match what we're looking for.
- }
- }
-
- // Trim the last "\n" per the spec.
- e.Data = bytes.TrimSuffix(e.Data, []byte("\n"))
-
- if c.EncodingBase64 {
- buf := make([]byte, base64.StdEncoding.DecodedLen(len(e.Data)))
-
- n, err := base64.StdEncoding.Decode(buf, e.Data)
- if err != nil {
- err = fmt.Errorf("failed to decode event message: %s", err)
- }
- e.Data = buf[:n]
- }
- return &e, err
-}
-
-func (c *Client) cleanup(ch chan *Event) {
- c.mu.Lock()
- defer c.mu.Unlock()
-
- if c.subscribed[ch] != nil {
- close(c.subscribed[ch])
- delete(c.subscribed, ch)
- }
-}
-
-func trimHeader(size int, data []byte) []byte {
- if data == nil || len(data) < size {
- return data
- }
-
- data = data[size:]
- // Remove optional leading whitespace
- if len(data) > 0 && data[0] == 32 {
- data = data[1:]
- }
- // Remove trailing new line
- if len(data) > 0 && data[len(data)-1] == 10 {
- data = data[:len(data)-1]
- }
- return data
-}
diff --git a/vendor/github.com/r3labs/sse/v2/event.go b/vendor/github.com/r3labs/sse/v2/event.go
deleted file mode 100644
index 1258038..0000000
--- a/vendor/github.com/r3labs/sse/v2/event.go
+++ /dev/null
@@ -1,114 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import (
- "bufio"
- "bytes"
- "context"
- "io"
- "time"
-)
-
-// Event holds all of the event source fields
-type Event struct {
- timestamp time.Time
- ID []byte
- Data []byte
- Event []byte
- Retry []byte
- Comment []byte
-}
-
-func (e *Event) hasContent() bool {
- return len(e.ID) > 0 || len(e.Data) > 0 || len(e.Event) > 0 || len(e.Retry) > 0
-}
-
-// EventStreamReader scans an io.Reader looking for EventStream messages.
-type EventStreamReader struct {
- scanner *bufio.Scanner
-}
-
-// NewEventStreamReader creates an instance of EventStreamReader.
-func NewEventStreamReader(eventStream io.Reader, maxBufferSize int) *EventStreamReader {
- scanner := bufio.NewScanner(eventStream)
- initBufferSize := minPosInt(4096, maxBufferSize)
- scanner.Buffer(make([]byte, initBufferSize), maxBufferSize)
-
- split := func(data []byte, atEOF bool) (int, []byte, error) {
- if atEOF && len(data) == 0 {
- return 0, nil, nil
- }
-
- // We have a full event payload to parse.
- if i, nlen := containsDoubleNewline(data); i >= 0 {
- return i + nlen, data[0:i], nil
- }
- // If we're at EOF, we have all of the data.
- if atEOF {
- return len(data), data, nil
- }
- // Request more data.
- return 0, nil, nil
- }
- // Set the split function for the scanning operation.
- scanner.Split(split)
-
- return &EventStreamReader{
- scanner: scanner,
- }
-}
-
-// Returns a tuple containing the index of a double newline, and the number of bytes
-// represented by that sequence. If no double newline is present, the first value
-// will be negative.
-func containsDoubleNewline(data []byte) (int, int) {
- // Search for each potentially valid sequence of newline characters
- crcr := bytes.Index(data, []byte("\r\r"))
- lflf := bytes.Index(data, []byte("\n\n"))
- crlflf := bytes.Index(data, []byte("\r\n\n"))
- lfcrlf := bytes.Index(data, []byte("\n\r\n"))
- crlfcrlf := bytes.Index(data, []byte("\r\n\r\n"))
- // Find the earliest position of a double newline combination
- minPos := minPosInt(crcr, minPosInt(lflf, minPosInt(crlflf, minPosInt(lfcrlf, crlfcrlf))))
- // Detemine the length of the sequence
- nlen := 2
- if minPos == crlfcrlf {
- nlen = 4
- } else if minPos == crlflf || minPos == lfcrlf {
- nlen = 3
- }
- return minPos, nlen
-}
-
-// Returns the minimum non-negative value out of the two values. If both
-// are negative, a negative value is returned.
-func minPosInt(a, b int) int {
- if a < 0 {
- return b
- }
- if b < 0 {
- return a
- }
- if a > b {
- return b
- }
- return a
-}
-
-// ReadEvent scans the EventStream for events.
-func (e *EventStreamReader) ReadEvent() ([]byte, error) {
- if e.scanner.Scan() {
- event := e.scanner.Bytes()
- return event, nil
- }
- if err := e.scanner.Err(); err != nil {
- if err == context.Canceled {
- return nil, io.EOF
- }
- return nil, err
- }
- return nil, io.EOF
-}
diff --git a/vendor/github.com/r3labs/sse/v2/event_log.go b/vendor/github.com/r3labs/sse/v2/event_log.go
deleted file mode 100644
index aa17dad..0000000
--- a/vendor/github.com/r3labs/sse/v2/event_log.go
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import (
- "strconv"
- "time"
-)
-
-// EventLog holds all of previous events
-type EventLog []*Event
-
-// Add event to eventlog
-func (e *EventLog) Add(ev *Event) {
- if !ev.hasContent() {
- return
- }
-
- ev.ID = []byte(e.currentindex())
- ev.timestamp = time.Now()
- *e = append(*e, ev)
-}
-
-// Clear events from eventlog
-func (e *EventLog) Clear() {
- *e = nil
-}
-
-// Replay events to a subscriber
-func (e *EventLog) Replay(s *Subscriber) {
- for i := 0; i < len(*e); i++ {
- id, _ := strconv.Atoi(string((*e)[i].ID))
- if id >= s.eventid {
- s.connection <- (*e)[i]
- }
- }
-}
-
-func (e *EventLog) currentindex() string {
- return strconv.Itoa(len(*e))
-}
diff --git a/vendor/github.com/r3labs/sse/v2/http.go b/vendor/github.com/r3labs/sse/v2/http.go
deleted file mode 100644
index c7a2b43..0000000
--- a/vendor/github.com/r3labs/sse/v2/http.go
+++ /dev/null
@@ -1,120 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import (
- "bytes"
- "fmt"
- "net/http"
- "strconv"
- "time"
-)
-
-// ServeHTTP serves new connections with events for a given stream ...
-func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- flusher, err := w.(http.Flusher)
- if !err {
- http.Error(w, "Streaming unsupported!", http.StatusInternalServerError)
- return
- }
-
- w.Header().Set("Content-Type", "text/event-stream")
- w.Header().Set("Cache-Control", "no-cache")
- w.Header().Set("Connection", "keep-alive")
-
- for k, v := range s.Headers {
- w.Header().Set(k, v)
- }
-
- // Get the StreamID from the URL
- streamID := r.URL.Query().Get("stream")
- if streamID == "" {
- http.Error(w, "Please specify a stream!", http.StatusInternalServerError)
- return
- }
-
- stream := s.getStream(streamID)
-
- if stream == nil {
- if !s.AutoStream {
- http.Error(w, "Stream not found!", http.StatusInternalServerError)
- return
- }
-
- stream = s.CreateStream(streamID)
- }
-
- eventid := 0
- if id := r.Header.Get("Last-Event-ID"); id != "" {
- var err error
- eventid, err = strconv.Atoi(id)
- if err != nil {
- http.Error(w, "Last-Event-ID must be a number!", http.StatusBadRequest)
- return
- }
- }
-
- // Create the stream subscriber
- sub := stream.addSubscriber(eventid, r.URL)
-
- go func() {
- <-r.Context().Done()
-
- sub.close()
-
- if s.AutoStream && !s.AutoReplay && stream.getSubscriberCount() == 0 {
- s.RemoveStream(streamID)
- }
- }()
-
- w.WriteHeader(http.StatusOK)
- flusher.Flush()
-
- // Push events to client
- for ev := range sub.connection {
- // If the data buffer is an empty string abort.
- if len(ev.Data) == 0 && len(ev.Comment) == 0 {
- break
- }
-
- // if the event has expired, dont send it
- if s.EventTTL != 0 && time.Now().After(ev.timestamp.Add(s.EventTTL)) {
- continue
- }
-
- if len(ev.Data) > 0 {
- fmt.Fprintf(w, "id: %s\n", ev.ID)
-
- if s.SplitData {
- sd := bytes.Split(ev.Data, []byte("\n"))
- for i := range sd {
- fmt.Fprintf(w, "data: %s\n", sd[i])
- }
- } else {
- if bytes.HasPrefix(ev.Data, []byte(":")) {
- fmt.Fprintf(w, "%s\n", ev.Data)
- } else {
- fmt.Fprintf(w, "data: %s\n", ev.Data)
- }
- }
-
- if len(ev.Event) > 0 {
- fmt.Fprintf(w, "event: %s\n", ev.Event)
- }
-
- if len(ev.Retry) > 0 {
- fmt.Fprintf(w, "retry: %s\n", ev.Retry)
- }
- }
-
- if len(ev.Comment) > 0 {
- fmt.Fprintf(w, ": %s\n", ev.Comment)
- }
-
- fmt.Fprint(w, "\n")
-
- flusher.Flush()
- }
-}
diff --git a/vendor/github.com/r3labs/sse/v2/server.go b/vendor/github.com/r3labs/sse/v2/server.go
deleted file mode 100644
index d1b27af..0000000
--- a/vendor/github.com/r3labs/sse/v2/server.go
+++ /dev/null
@@ -1,156 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import (
- "encoding/base64"
- "sync"
- "time"
-)
-
-// DefaultBufferSize size of the queue that holds the streams messages.
-const DefaultBufferSize = 1024
-
-// Server Is our main struct
-type Server struct {
- // Extra headers adding to the HTTP response to each client
- Headers map[string]string
- // Sets a ttl that prevents old events from being transmitted
- EventTTL time.Duration
- // Specifies the size of the message buffer for each stream
- BufferSize int
- // Encodes all data as base64
- EncodeBase64 bool
- // Splits an events data into multiple data: entries
- SplitData bool
- // Enables creation of a stream when a client connects
- AutoStream bool
- // Enables automatic replay for each new subscriber that connects
- AutoReplay bool
-
- // Specifies the function to run when client subscribe or un-subscribe
- OnSubscribe func(streamID string, sub *Subscriber)
- OnUnsubscribe func(streamID string, sub *Subscriber)
-
- streams map[string]*Stream
- muStreams sync.RWMutex
-}
-
-// New will create a server and setup defaults
-func New() *Server {
- return &Server{
- BufferSize: DefaultBufferSize,
- AutoStream: false,
- AutoReplay: true,
- streams: make(map[string]*Stream),
- Headers: map[string]string{},
- }
-}
-
-// NewWithCallback will create a server and setup defaults with callback function
-func NewWithCallback(onSubscribe, onUnsubscribe func(streamID string, sub *Subscriber)) *Server {
- return &Server{
- BufferSize: DefaultBufferSize,
- AutoStream: false,
- AutoReplay: true,
- streams: make(map[string]*Stream),
- Headers: map[string]string{},
- OnSubscribe: onSubscribe,
- OnUnsubscribe: onUnsubscribe,
- }
-}
-
-// Close shuts down the server, closes all of the streams and connections
-func (s *Server) Close() {
- s.muStreams.Lock()
- defer s.muStreams.Unlock()
-
- for id := range s.streams {
- s.streams[id].close()
- delete(s.streams, id)
- }
-}
-
-// CreateStream will create a new stream and register it
-func (s *Server) CreateStream(id string) *Stream {
- s.muStreams.Lock()
- defer s.muStreams.Unlock()
-
- if s.streams[id] != nil {
- return s.streams[id]
- }
-
- str := newStream(id, s.BufferSize, s.AutoReplay, s.AutoStream, s.OnSubscribe, s.OnUnsubscribe)
- str.run()
-
- s.streams[id] = str
-
- return str
-}
-
-// RemoveStream will remove a stream
-func (s *Server) RemoveStream(id string) {
- s.muStreams.Lock()
- defer s.muStreams.Unlock()
-
- if s.streams[id] != nil {
- s.streams[id].close()
- delete(s.streams, id)
- }
-}
-
-// StreamExists checks whether a stream by a given id exists
-func (s *Server) StreamExists(id string) bool {
- return s.getStream(id) != nil
-}
-
-// Publish sends a mesage to every client in a streamID.
-// If the stream's buffer is full, it blocks until the message is sent out to
-// all subscribers (but not necessarily arrived the clients), or when the
-// stream is closed.
-func (s *Server) Publish(id string, event *Event) {
- stream := s.getStream(id)
- if stream == nil {
- return
- }
-
- select {
- case <-stream.quit:
- case stream.event <- s.process(event):
- }
-}
-
-// TryPublish is the same as Publish except that when the operation would cause
-// the call to be blocked, it simply drops the message and returns false.
-// Together with a small BufferSize, it can be useful when publishing the
-// latest message ASAP is more important than reliable delivery.
-func (s *Server) TryPublish(id string, event *Event) bool {
- stream := s.getStream(id)
- if stream == nil {
- return false
- }
-
- select {
- case stream.event <- s.process(event):
- return true
- default:
- return false
- }
-}
-
-func (s *Server) getStream(id string) *Stream {
- s.muStreams.RLock()
- defer s.muStreams.RUnlock()
- return s.streams[id]
-}
-
-func (s *Server) process(event *Event) *Event {
- if s.EncodeBase64 {
- output := make([]byte, base64.StdEncoding.EncodedLen(len(event.Data)))
- base64.StdEncoding.Encode(output, event.Data)
- event.Data = output
- }
- return event
-}
diff --git a/vendor/github.com/r3labs/sse/v2/stream.go b/vendor/github.com/r3labs/sse/v2/stream.go
deleted file mode 100644
index bfbcb9b..0000000
--- a/vendor/github.com/r3labs/sse/v2/stream.go
+++ /dev/null
@@ -1,153 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import (
- "net/url"
- "sync"
- "sync/atomic"
-)
-
-// Stream ...
-type Stream struct {
- ID string
- event chan *Event
- quit chan struct{}
- quitOnce sync.Once
- register chan *Subscriber
- deregister chan *Subscriber
- subscribers []*Subscriber
- Eventlog EventLog
- subscriberCount int32
- // Enables replaying of eventlog to newly added subscribers
- AutoReplay bool
- isAutoStream bool
-
- // Specifies the function to run when client subscribe or un-subscribe
- OnSubscribe func(streamID string, sub *Subscriber)
- OnUnsubscribe func(streamID string, sub *Subscriber)
-}
-
-// newStream returns a new stream
-func newStream(id string, buffSize int, replay, isAutoStream bool, onSubscribe, onUnsubscribe func(string, *Subscriber)) *Stream {
- return &Stream{
- ID: id,
- AutoReplay: replay,
- subscribers: make([]*Subscriber, 0),
- isAutoStream: isAutoStream,
- register: make(chan *Subscriber),
- deregister: make(chan *Subscriber),
- event: make(chan *Event, buffSize),
- quit: make(chan struct{}),
- Eventlog: make(EventLog, 0),
- OnSubscribe: onSubscribe,
- OnUnsubscribe: onUnsubscribe,
- }
-}
-
-func (str *Stream) run() {
- go func(str *Stream) {
- for {
- select {
- // Add new subscriber
- case subscriber := <-str.register:
- str.subscribers = append(str.subscribers, subscriber)
- if str.AutoReplay {
- str.Eventlog.Replay(subscriber)
- }
-
- // Remove closed subscriber
- case subscriber := <-str.deregister:
- i := str.getSubIndex(subscriber)
- if i != -1 {
- str.removeSubscriber(i)
- }
-
- if str.OnUnsubscribe != nil {
- go str.OnUnsubscribe(str.ID, subscriber)
- }
-
- // Publish event to subscribers
- case event := <-str.event:
- if str.AutoReplay {
- str.Eventlog.Add(event)
- }
- for i := range str.subscribers {
- str.subscribers[i].connection <- event
- }
-
- // Shutdown if the server closes
- case <-str.quit:
- // remove connections
- str.removeAllSubscribers()
- return
- }
- }
- }(str)
-}
-
-func (str *Stream) close() {
- str.quitOnce.Do(func() {
- close(str.quit)
- })
-}
-
-func (str *Stream) getSubIndex(sub *Subscriber) int {
- for i := range str.subscribers {
- if str.subscribers[i] == sub {
- return i
- }
- }
- return -1
-}
-
-// addSubscriber will create a new subscriber on a stream
-func (str *Stream) addSubscriber(eventid int, url *url.URL) *Subscriber {
- atomic.AddInt32(&str.subscriberCount, 1)
- sub := &Subscriber{
- eventid: eventid,
- quit: str.deregister,
- connection: make(chan *Event, 64),
- URL: url,
- }
-
- if str.isAutoStream {
- sub.removed = make(chan struct{}, 1)
- }
-
- str.register <- sub
-
- if str.OnSubscribe != nil {
- go str.OnSubscribe(str.ID, sub)
- }
-
- return sub
-}
-
-func (str *Stream) removeSubscriber(i int) {
- atomic.AddInt32(&str.subscriberCount, -1)
- close(str.subscribers[i].connection)
- if str.subscribers[i].removed != nil {
- str.subscribers[i].removed <- struct{}{}
- close(str.subscribers[i].removed)
- }
- str.subscribers = append(str.subscribers[:i], str.subscribers[i+1:]...)
-}
-
-func (str *Stream) removeAllSubscribers() {
- for i := 0; i < len(str.subscribers); i++ {
- close(str.subscribers[i].connection)
- if str.subscribers[i].removed != nil {
- str.subscribers[i].removed <- struct{}{}
- close(str.subscribers[i].removed)
- }
- }
- atomic.StoreInt32(&str.subscriberCount, 0)
- str.subscribers = str.subscribers[:0]
-}
-
-func (str *Stream) getSubscriberCount() int {
- return int(atomic.LoadInt32(&str.subscriberCount))
-}
diff --git a/vendor/github.com/r3labs/sse/v2/subscriber.go b/vendor/github.com/r3labs/sse/v2/subscriber.go
deleted file mode 100644
index 4b54c20..0000000
--- a/vendor/github.com/r3labs/sse/v2/subscriber.go
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package sse
-
-import "net/url"
-
-// Subscriber ...
-type Subscriber struct {
- quit chan *Subscriber
- connection chan *Event
- removed chan struct{}
- eventid int
- URL *url.URL
-}
-
-// Close will let the stream know that the clients connection has terminated
-func (s *Subscriber) close() {
- s.quit <- s
- if s.removed != nil {
- <-s.removed
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/.clog.toml b/vendor/github.com/robertkrimen/otto/.clog.toml
deleted file mode 100644
index 74e3702..0000000
--- a/vendor/github.com/robertkrimen/otto/.clog.toml
+++ /dev/null
@@ -1,13 +0,0 @@
-[clog]
-repository = "https://github.com/robertkrimen/otto"
-subtitle = "Release Notes"
-
-[sections]
-"Refactors" = ["refactor"]
-"Chores" = ["chore"]
-"Continuous Integration" = ["ci"]
-"Improvements" = ["imp", "improvement"]
-"Features" = ["feat", "feature"]
-"Legacy" = ["legacy"]
-"QA" = ["qa", "test", "tests"]
-"Documentation" = ["doc", "docs"]
diff --git a/vendor/github.com/robertkrimen/otto/.gitignore b/vendor/github.com/robertkrimen/otto/.gitignore
deleted file mode 100644
index ea050b8..0000000
--- a/vendor/github.com/robertkrimen/otto/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-.test
-otto/otto
-otto/otto-*
-tools/tester/testdata/
-tools/tester/tester
-tools/gen-jscore/gen-jscore
-tools/gen-tokens/gen-tokens
-.idea
-dist/
-.vscode/
diff --git a/vendor/github.com/robertkrimen/otto/.golangci.yml b/vendor/github.com/robertkrimen/otto/.golangci.yml
deleted file mode 100644
index 8c59196..0000000
--- a/vendor/github.com/robertkrimen/otto/.golangci.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-run:
- deadline: 6m
- skip-dirs:
- - terst
- skip-files:
- - dbg/dbg.go
- - token/token_const.go
-
-linters-settings:
- govet:
- check-shadowing: false
- goconst:
- min-len: 2
- min-occurrences: 4
- revive:
- enable-all-rules: false
- rules:
- - name: var-naming
- disabled: true
-
-linters:
- enable-all: true
- disable:
- - dupl
- - lll
- - gochecknoglobals
- - gochecknoinits
- - scopelint
- - funlen
- - godox
- - exhaustivestruct
- - goerr113
- - wsl
- - nlreturn
- - gomnd
- - paralleltest
- - wrapcheck
- - testpackage
- - gocognit
- - nestif
- - exhaustive
- - forcetypeassert
- - gocyclo
- - cyclop
- - varnamelen
- - maintidx
- - ireturn
- - exhaustruct
- - nosnakecase
- - dupword
- - structcheck
- - deadcode
- - golint
- - varcheck
- - ifshort
- - interfacer
- - maligned
- # Just causes noise
- - depguard
-
-issues:
- exclude-use-default: false
- max-same-issues: 0
- exclude:
- - Deferring unsafe method "Close" on type "io\.ReadCloser"
diff --git a/vendor/github.com/robertkrimen/otto/.goreleaser.yaml b/vendor/github.com/robertkrimen/otto/.goreleaser.yaml
deleted file mode 100644
index 56f72d9..0000000
--- a/vendor/github.com/robertkrimen/otto/.goreleaser.yaml
+++ /dev/null
@@ -1,70 +0,0 @@
-# When adding options check the documentation at https://goreleaser.com
-before:
- hooks:
- - go mod tidy
-builds:
- - env:
- - CGO_ENABLED=0
- goos:
- - linux
- - darwin
- goarch:
- - amd64
- - arm64
- main: ./otto
- id: otto
- binary: otto
-universal_binaries:
- - replace: true
- id: otto
-checksum:
- name_template: 'checksums.txt'
-snapshot:
- name_template: "{{ incpatch .Version }}-next"
-archives:
- - id: otto
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
-release:
- header: |
-
- ### {{.Tag}} Release Notes ({{.Date}})
- footer: |
- [Full Changelog](https://{{ .ModulePath }}/compare/{{ .PreviousTag }}...{{ .Tag }})
-changelog:
- use: github
- sort: asc
- filters:
- exclude:
- - Merge pull request
- - Merge remote-tracking branch
- - Merge branch
-
- # Group commits messages by given regex and title.
- # Order value defines the order of the groups.
- # Proving no regex means all commits will be grouped under the default group.
- # Groups are disabled when using github-native, as it already groups things by itself.
- # Matches are performed against strings of the form: " ".
- # Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax.
- #
- # Default is no groups.
- groups:
- - title: Features
- regexp: '^.*?(feat|feature)(\([[:word:]]+\))??!?:.+$'
- order: 0
- - title: 'Bug fixes'
- regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
- order: 1
- - title: 'Chores'
- regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
- order: 2
- - title: 'Quality'
- regexp: '^.*?(qa|test|tests)(\([[:word:]]+\))??!?:.+$'
- order: 3
- - title: 'Documentation'
- regexp: '^.*?(doc|docs)(\([[:word:]]+\))??!?:.+$'
- order: 4
- - title: 'Continuous Integration'
- regexp: '^.*?ci(\([[:word:]]+\))??!?:.+$'
- order: 5
- - title: Other
- order: 999
diff --git a/vendor/github.com/robertkrimen/otto/DESIGN.markdown b/vendor/github.com/robertkrimen/otto/DESIGN.markdown
deleted file mode 100644
index 2887529..0000000
--- a/vendor/github.com/robertkrimen/otto/DESIGN.markdown
+++ /dev/null
@@ -1 +0,0 @@
-* Designate the filename of "anonymous" source code by the hash (md5/sha1, etc.)
diff --git a/vendor/github.com/robertkrimen/otto/LICENSE b/vendor/github.com/robertkrimen/otto/LICENSE
deleted file mode 100644
index b6179fe..0000000
--- a/vendor/github.com/robertkrimen/otto/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright (c) 2012 Robert Krimen
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/robertkrimen/otto/README.md b/vendor/github.com/robertkrimen/otto/README.md
deleted file mode 100644
index 5dfa643..0000000
--- a/vendor/github.com/robertkrimen/otto/README.md
+++ /dev/null
@@ -1,877 +0,0 @@
-# otto
---
-```go
-import "github.com/robertkrimen/otto"
-```
-
-Package otto is a JavaScript parser and interpreter written natively in Go.
-
-http://godoc.org/github.com/robertkrimen/otto
-
-```go
-import (
- "github.com/robertkrimen/otto"
-)
-```
-
-Run something in the VM
-
-```go
-vm := otto.New()
-vm.Run(`
- abc = 2 + 2;
- console.log("The value of abc is " + abc); // 4
-`)
-```
-
-Get a value out of the VM
-
-```go
-if value, err := vm.Get("abc"); err == nil {
- if value_int, err := value.ToInteger(); err == nil {
- fmt.Printf("", value_int, err)
- }
-}
-```
-
-Set a number
-
-```go
-vm.Set("def", 11)
-vm.Run(`
- console.log("The value of def is " + def);
- // The value of def is 11
-`)
-```
-
-Set a string
-
-```go
-vm.Set("xyzzy", "Nothing happens.")
-vm.Run(`
- console.log(xyzzy.length); // 16
-`)
-```
-
-Get the value of an expression
-
-```go
-value, _ = vm.Run("xyzzy.length")
-{
- // value is an int64 with a value of 16
- value, _ := value.ToInteger()
-}
-```
-
-An error happens
-
-```go
-value, err = vm.Run("abcdefghijlmnopqrstuvwxyz.length")
-if err != nil {
- // err = ReferenceError: abcdefghijlmnopqrstuvwxyz is not defined
- // If there is an error, then value.IsUndefined() is true
- ...
-}
-```
-
-Set a Go function
-
-```go
-vm.Set("sayHello", func(call otto.FunctionCall) otto.Value {
- fmt.Printf("Hello, %s.\n", call.Argument(0).String())
- return otto.Value{}
-})
-```
-
-Set a Go function that returns something useful
-
-```go
-vm.Set("twoPlus", func(call otto.FunctionCall) otto.Value {
- right, _ := call.Argument(0).ToInteger()
- result, _ := vm.ToValue(2 + right)
- return result
-})
-```
-
-Use the functions in JavaScript
-
-```go
-result, _ = vm.Run(`
- sayHello("Xyzzy"); // Hello, Xyzzy.
- sayHello(); // Hello, undefined
-
- result = twoPlus(2.0); // 4
-`)
-```
-
-### Parser
-
-A separate parser is available in the parser package if you're just interested
-in building an AST.
-
-http://godoc.org/github.com/robertkrimen/otto/parser
-
-Parse and return an AST
-
-```go
-filename := "" // A filename is optional
-src := `
- // Sample xyzzy example
- (function(){
- if (3.14159 > 0) {
- console.log("Hello, World.");
- return;
- }
-
- var xyzzy = NaN;
- console.log("Nothing happens.");
- return xyzzy;
- })();
-`
-
-// Parse some JavaScript, yielding a *ast.Program and/or an ErrorList
-program, err := parser.ParseFile(nil, filename, src, 0)
-```
-
-### otto
-
-You can run (Go) JavaScript from the commandline with:
-http://github.com/robertkrimen/otto/tree/master/otto
-
- $ go get -v github.com/robertkrimen/otto/otto
-
-Run JavaScript by entering some source on stdin or by giving otto a filename:
-
- $ otto example.js
-
-### underscore
-
-Optionally include the JavaScript utility-belt library, underscore, with this
-import:
-
-```go
-import (
- "github.com/robertkrimen/otto"
- _ "github.com/robertkrimen/otto/underscore"
-)
-
-// Now every otto runtime will come loaded with underscore
-```
-
-For more information: http://github.com/robertkrimen/otto/tree/master/underscore
-
-
-### Caveat Emptor
-
-The following are some limitations with otto:
-
- * "use strict" will parse, but does nothing.
- * The regular expression engine (re2/regexp) is not fully compatible with the ECMA5 specification.
- * Otto targets ES5. ES6 features (eg: Typed Arrays) are not supported.
-
-
-### Regular Expression Incompatibility
-
-Go translates JavaScript-style regular expressions into something that is
-"regexp" compatible via `parser.TransformRegExp`. Unfortunately, RegExp requires
-backtracking for some patterns, and backtracking is not supported by the
-standard Go engine: https://code.google.com/p/re2/wiki/Syntax
-
-Therefore, the following syntax is incompatible:
-
- (?=) // Lookahead (positive), currently a parsing error
- (?!) // Lookahead (backhead), currently a parsing error
- \1 // Backreference (\1, \2, \3, ...), currently a parsing error
-
-A brief discussion of these limitations: "Regexp (?!re)"
-https://groups.google.com/forum/?fromgroups=#%21topic/golang-nuts/7qgSDWPIh_E
-
-More information about re2: https://code.google.com/p/re2/
-
-In addition to the above, re2 (Go) has a different definition for \s: [\t\n\f\r
-]. The JavaScript definition, on the other hand, also includes \v, Unicode
-"Separator, Space", etc.
-
-
-### Halting Problem
-
-If you want to stop long running executions (like third-party code), you can use
-the interrupt channel to do this:
-
-```go
-package main
-
-import (
- "errors"
- "fmt"
- "os"
- "time"
-
- "github.com/robertkrimen/otto"
-)
-
-var halt = errors.New("Stahp")
-
-func main() {
- runUnsafe(`var abc = [];`)
- runUnsafe(`
- while (true) {
- // Loop forever
- }`)
-}
-
-func runUnsafe(unsafe string) {
- start := time.Now()
- defer func() {
- duration := time.Since(start)
- if caught := recover(); caught != nil {
- if caught == halt {
- fmt.Fprintf(os.Stderr, "Some code took to long! Stopping after: %v\n", duration)
- return
- }
- panic(caught) // Something else happened, repanic!
- }
- fmt.Fprintf(os.Stderr, "Ran code successfully: %v\n", duration)
- }()
-
- vm := otto.New()
- vm.Interrupt = make(chan func(), 1) // The buffer prevents blocking
- watchdogCleanup := make(chan struct{})
- defer close(watchdogCleanup)
-
- go func() {
- select {
- case <-time.After(2 * time.Second): // Stop after two seconds
- vm.Interrupt <- func() {
- panic(halt)
- }
- case <-watchdogCleanup:
- }
- close(vm.Interrupt)
- }()
-
- vm.Run(unsafe) // Here be dragons (risky code)
-}
-```
-
-Where is setTimeout/setInterval?
-
-These timing functions are not actually part of the ECMA-262 specification.
-Typically, they belong to the `window` object (in the browser). It would not be
-difficult to provide something like these via Go, but you probably want to wrap
-otto in an event loop in that case.
-
-For an example of how this could be done in Go with otto, see natto:
-
-http://github.com/robertkrimen/natto
-
-Here is some more discussion of the issue:
-
-* http://book.mixu.net/node/ch2.html
-
-* http://en.wikipedia.org/wiki/Reentrancy_%28computing%29
-
-* http://aaroncrane.co.uk/2009/02/perl_safe_signals/
-
-## Usage
-
-```go
-var ErrVersion = errors.New("version mismatch")
-```
-
-#### type Error
-
-```go
-type Error struct {
-}
-```
-
-An Error represents a runtime error, e.g. a TypeError, a ReferenceError, etc.
-
-#### func (Error) Error
-
-```go
-func (err Error) Error() string
-```
-Error returns a description of the error
-
- TypeError: 'def' is not a function
-
-#### func (Error) String
-
-```go
-func (err Error) String() string
-```
-String returns a description of the error and a trace of where the error
-occurred.
-
- TypeError: 'def' is not a function
- at xyz (:3:9)
- at :7:1/
-
-#### type FunctionCall
-
-```go
-type FunctionCall struct {
- This Value
- ArgumentList []Value
- Otto *Otto
-}
-```
-
-FunctionCall is an encapsulation of a JavaScript function call.
-
-#### func (FunctionCall) Argument
-
-```go
-func (self FunctionCall) Argument(index int) Value
-```
-Argument will return the value of the argument at the given index.
-
-If no such argument exists, undefined is returned.
-
-#### type Object
-
-```go
-type Object struct {
-}
-```
-
-Object is the representation of a JavaScript object.
-
-#### func (Object) Call
-
-```go
-func (self Object) Call(name string, argumentList ...interface{}) (Value, error)
-```
-Call a method on the object.
-
-It is essentially equivalent to:
-
- var method, _ := object.Get(name)
- method.Call(object, argumentList...)
-
-An undefined value and an error will result if:
-
- 1. There is an error during conversion of the argument list
- 2. The property is not actually a function
- 3. An (uncaught) exception is thrown
-
-#### func (Object) Class
-
-```go
-func (self Object) Class() string
-```
-Class will return the class string of the object.
-
-The return value will (generally) be one of:
-
- Object
- Function
- Array
- String
- Number
- Boolean
- Date
- RegExp
-
-#### func (Object) Get
-
-```go
-func (self Object) Get(name string) (Value, error)
-```
-Get the value of the property with the given name.
-
-#### func (Object) Keys
-
-```go
-func (self Object) Keys() []string
-```
-Get the keys for the object
-
-Equivalent to calling Object.keys on the object
-
-#### func (Object) Set
-
-```go
-func (self Object) Set(name string, value interface{}) error
-```
-Set the property of the given name to the given value.
-
-An error will result if the setting the property triggers an exception (i.e.
-read-only), or there is an error during conversion of the given value.
-
-#### func (Object) Value
-
-```go
-func (self Object) Value() Value
-```
-Value will return self as a value.
-
-#### type Otto
-
-```go
-type Otto struct {
- // Interrupt is a channel for interrupting the runtime. You can use this to halt a long running execution, for example.
- // See "Halting Problem" for more information.
- Interrupt chan func()
-}
-```
-
-Otto is the representation of the JavaScript runtime. Each instance of Otto has
-a self-contained namespace.
-
-#### func New
-
-```go
-func New() *Otto
-```
-New will allocate a new JavaScript runtime
-
-#### func Run
-
-```go
-func Run(src interface{}) (*Otto, Value, error)
-```
-Run will allocate a new JavaScript runtime, run the given source on the
-allocated runtime, and return the runtime, resulting value, and error (if any).
-
-src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST
-always be in UTF-8.
-
-src may also be a Script.
-
-src may also be a Program, but if the AST has been modified, then runtime
-behavior is undefined.
-
-#### func (Otto) Call
-
-```go
-func (self Otto) Call(source string, this interface{}, argumentList ...interface{}) (Value, error)
-```
-Call the given JavaScript with a given this and arguments.
-
-If this is nil, then some special handling takes place to determine the proper
-this value, falling back to a "standard" invocation if necessary (where this is
-undefined).
-
-If source begins with "new " (A lowercase new followed by a space), then Call
-will invoke the function constructor rather than performing a function call. In
-this case, the this argument has no effect.
-
-```go
-// value is a String object
-value, _ := vm.Call("Object", nil, "Hello, World.")
-
-// Likewise...
-value, _ := vm.Call("new Object", nil, "Hello, World.")
-
-// This will perform a concat on the given array and return the result
-// value is [ 1, 2, 3, undefined, 4, 5, 6, 7, "abc" ]
-value, _ := vm.Call(`[ 1, 2, 3, undefined, 4 ].concat`, nil, 5, 6, 7, "abc")
-```
-
-#### func (*Otto) Compile
-
-```go
-func (self *Otto) Compile(filename string, src interface{}) (*Script, error)
-```
-Compile will parse the given source and return a Script value or nil and an
-error if there was a problem during compilation.
-
-```go
-script, err := vm.Compile("", `var abc; if (!abc) abc = 0; abc += 2; abc;`)
-vm.Run(script)
-```
-
-#### func (*Otto) Copy
-
-```go
-func (in *Otto) Copy() *Otto
-```
-Copy will create a copy/clone of the runtime.
-
-Copy is useful for saving some time when creating many similar runtimes.
-
-This method works by walking the original runtime and cloning each object,
-scope, stash, etc. into a new runtime.
-
-Be on the lookout for memory leaks or inadvertent sharing of resources.
-
-#### func (Otto) Get
-
-```go
-func (self Otto) Get(name string) (Value, error)
-```
-Get the value of the top-level binding of the given name.
-
-If there is an error (like the binding does not exist), then the value will be
-undefined.
-
-#### func (Otto) Object
-
-```go
-func (self Otto) Object(source string) (*Object, error)
-```
-Object will run the given source and return the result as an object.
-
-For example, accessing an existing object:
-
-```go
-object, _ := vm.Object(`Number`)
-```
-
-Or, creating a new object:
-
-```go
-object, _ := vm.Object(`({ xyzzy: "Nothing happens." })`)
-```
-
-Or, creating and assigning an object:
-
-```go
-object, _ := vm.Object(`xyzzy = {}`)
-object.Set("volume", 11)
-```
-
-If there is an error (like the source does not result in an object), then nil
-and an error is returned.
-
-#### func (Otto) Run
-
-```go
-func (self Otto) Run(src interface{}) (Value, error)
-```
-Run will run the given source (parsing it first if necessary), returning the
-resulting value and error (if any)
-
-src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST
-always be in UTF-8.
-
-If the runtime is unable to parse source, then this function will return
-undefined and the parse error (nothing will be evaluated in this case).
-
-src may also be a Script.
-
-src may also be a Program, but if the AST has been modified, then runtime
-behavior is undefined.
-
-#### func (Otto) Set
-
-```go
-func (self Otto) Set(name string, value interface{}) error
-```
-Set the top-level binding of the given name to the given value.
-
-Set will automatically apply ToValue to the given value in order to convert it
-to a JavaScript value (type Value).
-
-If there is an error (like the binding is read-only, or the ToValue conversion
-fails), then an error is returned.
-
-If the top-level binding does not exist, it will be created.
-
-#### func (Otto) ToValue
-
-```go
-func (self Otto) ToValue(value interface{}) (Value, error)
-```
-ToValue will convert an interface{} value to a value digestible by
-otto/JavaScript.
-
-#### type Script
-
-```go
-type Script struct {
-}
-```
-
-Script is a handle for some (reusable) JavaScript. Passing a Script value to a
-run method will evaluate the JavaScript.
-
-#### func (*Script) String
-
-```go
-func (self *Script) String() string
-```
-
-#### type Value
-
-```go
-type Value struct {
-}
-```
-
-Value is the representation of a JavaScript value.
-
-#### func FalseValue
-
-```go
-func FalseValue() Value
-```
-FalseValue will return a value representing false.
-
-It is equivalent to:
-
-```go
-ToValue(false)
-```
-
-#### func NaNValue
-
-```go
-func NaNValue() Value
-```
-NaNValue will return a value representing NaN.
-
-It is equivalent to:
-
-```go
-ToValue(math.NaN())
-```
-
-#### func NullValue
-
-```go
-func NullValue() Value
-```
-NullValue will return a Value representing null.
-
-#### func ToValue
-
-```go
-func ToValue(value interface{}) (Value, error)
-```
-ToValue will convert an interface{} value to a value digestible by
-otto/JavaScript
-
-This function will not work for advanced types (struct, map, slice/array, etc.)
-and you should use Otto.ToValue instead.
-
-#### func TrueValue
-
-```go
-func TrueValue() Value
-```
-TrueValue will return a value representing true.
-
-It is equivalent to:
-
-```go
-ToValue(true)
-```
-
-#### func UndefinedValue
-
-```go
-func UndefinedValue() Value
-```
-UndefinedValue will return a Value representing undefined.
-
-#### func (Value) Call
-
-```go
-func (value Value) Call(this Value, argumentList ...interface{}) (Value, error)
-```
-Call the value as a function with the given this value and argument list and
-return the result of invocation. It is essentially equivalent to:
-
- value.apply(thisValue, argumentList)
-
-An undefined value and an error will result if:
-
- 1. There is an error during conversion of the argument list
- 2. The value is not actually a function
- 3. An (uncaught) exception is thrown
-
-#### func (Value) Class
-
-```go
-func (value Value) Class() string
-```
-Class will return the class string of the value or the empty string if value is
-not an object.
-
-The return value will (generally) be one of:
-
- Object
- Function
- Array
- String
- Number
- Boolean
- Date
- RegExp
-
-#### func (Value) Export
-
-```go
-func (self Value) Export() (interface{}, error)
-```
-Export will attempt to convert the value to a Go representation and return it
-via an interface{} kind.
-
-Export returns an error, but it will always be nil. It is present for backwards
-compatibility.
-
-If a reasonable conversion is not possible, then the original value is returned.
-
- undefined -> nil (FIXME?: Should be Value{})
- null -> nil
- boolean -> bool
- number -> A number type (int, float32, uint64, ...)
- string -> string
- Array -> []interface{}
- Object -> map[string]interface{}
-
-#### func (Value) IsBoolean
-
-```go
-func (value Value) IsBoolean() bool
-```
-IsBoolean will return true if value is a boolean (primitive).
-
-#### func (Value) IsDefined
-
-```go
-func (value Value) IsDefined() bool
-```
-IsDefined will return false if the value is undefined, and true otherwise.
-
-#### func (Value) IsFunction
-
-```go
-func (value Value) IsFunction() bool
-```
-IsFunction will return true if value is a function.
-
-#### func (Value) IsNaN
-
-```go
-func (value Value) IsNaN() bool
-```
-IsNaN will return true if value is NaN (or would convert to NaN).
-
-#### func (Value) IsNull
-
-```go
-func (value Value) IsNull() bool
-```
-IsNull will return true if the value is null, and false otherwise.
-
-#### func (Value) IsNumber
-
-```go
-func (value Value) IsNumber() bool
-```
-IsNumber will return true if value is a number (primitive).
-
-#### func (Value) IsObject
-
-```go
-func (value Value) IsObject() bool
-```
-IsObject will return true if value is an object.
-
-#### func (Value) IsPrimitive
-
-```go
-func (value Value) IsPrimitive() bool
-```
-IsPrimitive will return true if value is a primitive (any kind of primitive).
-
-#### func (Value) IsString
-
-```go
-func (value Value) IsString() bool
-```
-IsString will return true if value is a string (primitive).
-
-#### func (Value) IsUndefined
-
-```go
-func (value Value) IsUndefined() bool
-```
-IsUndefined will return true if the value is undefined, and false otherwise.
-
-#### func (Value) Object
-
-```go
-func (value Value) Object() *Object
-```
-Object will return the object of the value, or nil if value is not an object.
-
-This method will not do any implicit conversion. For example, calling this
-method on a string primitive value will not return a String object.
-
-#### func (Value) String
-
-```go
-func (value Value) String() string
-```
-String will return the value as a string.
-
-This method will make return the empty string if there is an error.
-
-#### func (Value) ToBoolean
-
-```go
-func (value Value) ToBoolean() (bool, error)
-```
-ToBoolean will convert the value to a boolean (bool).
-
- ToValue(0).ToBoolean() => false
- ToValue("").ToBoolean() => false
- ToValue(true).ToBoolean() => true
- ToValue(1).ToBoolean() => true
- ToValue("Nothing happens").ToBoolean() => true
-
-If there is an error during the conversion process (like an uncaught exception),
-then the result will be false and an error.
-
-#### func (Value) ToFloat
-
-```go
-func (value Value) ToFloat() (float64, error)
-```
-ToFloat will convert the value to a number (float64).
-
- ToValue(0).ToFloat() => 0.
- ToValue(1.1).ToFloat() => 1.1
- ToValue("11").ToFloat() => 11.
-
-If there is an error during the conversion process (like an uncaught exception),
-then the result will be 0 and an error.
-
-#### func (Value) ToInteger
-
-```go
-func (value Value) ToInteger() (int64, error)
-```
-ToInteger will convert the value to a number (int64).
-
- ToValue(0).ToInteger() => 0
- ToValue(1.1).ToInteger() => 1
- ToValue("11").ToInteger() => 11
-
-If there is an error during the conversion process (like an uncaught exception),
-then the result will be 0 and an error.
-
-#### func (Value) ToString
-
-```go
-func (value Value) ToString() (string, error)
-```
-ToString will convert the value to a string (string).
-
- ToValue(0).ToString() => "0"
- ToValue(false).ToString() => "false"
- ToValue(1.1).ToString() => "1.1"
- ToValue("11").ToString() => "11"
- ToValue('Nothing happens.').ToString() => "Nothing happens."
-
-If there is an error during the conversion process (like an uncaught exception),
-then the result will be the empty string ("") and an error.
-
---
-**godocdown** http://github.com/robertkrimen/godocdown
diff --git a/vendor/github.com/robertkrimen/otto/ast/comments.go b/vendor/github.com/robertkrimen/otto/ast/comments.go
deleted file mode 100644
index 425aa21..0000000
--- a/vendor/github.com/robertkrimen/otto/ast/comments.go
+++ /dev/null
@@ -1,292 +0,0 @@
-package ast
-
-import (
- "fmt"
-
- "github.com/robertkrimen/otto/file"
-)
-
-// CommentPosition determines where the comment is in a given context.
-type CommentPosition int
-
-// Available comment positions.
-const (
- _ CommentPosition = iota
- // LEADING is before the pertinent expression.
- LEADING
- // TRAILING is after the pertinent expression.
- TRAILING
- // KEY is before a key in an object.
- KEY
- // COLON is after a colon in a field declaration.
- COLON
- // FINAL is the final comments in a block, not belonging to a specific expression or the comment after a trailing , in an array or object literal.
- FINAL
- // IF is after an if keyword.
- IF
- // WHILE is after a while keyword.
- WHILE
- // DO is after do keyword.
- DO
- // FOR is after a for keyword.
- FOR
- // WITH is after a with keyword.
- WITH
- // TBD is unknown.
- TBD
-)
-
-// Comment contains the data of the comment.
-type Comment struct {
- Begin file.Idx
- Text string
- Position CommentPosition
-}
-
-// NewComment creates a new comment.
-func NewComment(text string, idx file.Idx) *Comment {
- comment := &Comment{
- Begin: idx,
- Text: text,
- Position: TBD,
- }
-
- return comment
-}
-
-// String returns a stringified version of the position.
-func (cp CommentPosition) String() string {
- switch cp {
- case LEADING:
- return "Leading"
- case TRAILING:
- return "Trailing"
- case KEY:
- return "Key"
- case COLON:
- return "Colon"
- case FINAL:
- return "Final"
- case IF:
- return "If"
- case WHILE:
- return "While"
- case DO:
- return "Do"
- case FOR:
- return "For"
- case WITH:
- return "With"
- default:
- return "???"
- }
-}
-
-// String returns a stringified version of the comment.
-func (c Comment) String() string {
- return fmt.Sprintf("Comment: %v", c.Text)
-}
-
-// Comments defines the current view of comments from the parser.
-type Comments struct {
- // CommentMap is a reference to the parser comment map
- CommentMap CommentMap
- // Comments lists the comments scanned, not linked to a node yet
- Comments []*Comment
- // Current is node for which comments are linked to
- Current Expression
-
- // future lists the comments after a line break during a sequence of comments
- future []*Comment
- // wasLineBreak determines if a line break occurred while scanning for comments
- wasLineBreak bool
- // primary determines whether or not processing a primary expression
- primary bool
- // afterBlock determines whether or not being after a block statement
- afterBlock bool
-}
-
-// NewComments returns a new Comments.
-func NewComments() *Comments {
- comments := &Comments{
- CommentMap: CommentMap{},
- }
-
- return comments
-}
-
-func (c *Comments) String() string {
- return fmt.Sprintf("NODE: %v, Comments: %v, Future: %v(LINEBREAK:%v)", c.Current, len(c.Comments), len(c.future), c.wasLineBreak)
-}
-
-// FetchAll returns all the currently scanned comments,
-// including those from the next line.
-func (c *Comments) FetchAll() []*Comment {
- defer func() {
- c.Comments = nil
- c.future = nil
- }()
-
- return append(c.Comments, c.future...)
-}
-
-// Fetch returns all the currently scanned comments.
-func (c *Comments) Fetch() []*Comment {
- defer func() {
- c.Comments = nil
- }()
-
- return c.Comments
-}
-
-// ResetLineBreak marks the beginning of a new statement.
-func (c *Comments) ResetLineBreak() {
- c.wasLineBreak = false
-}
-
-// MarkPrimary will mark the context as processing a primary expression.
-func (c *Comments) MarkPrimary() {
- c.primary = true
- c.wasLineBreak = false
-}
-
-// AfterBlock will mark the context as being after a block.
-func (c *Comments) AfterBlock() {
- c.afterBlock = true
-}
-
-// AddComment adds a comment to the view.
-// Depending on the context, comments are added normally or as post line break.
-func (c *Comments) AddComment(comment *Comment) {
- if c.primary {
- if !c.wasLineBreak {
- c.Comments = append(c.Comments, comment)
- } else {
- c.future = append(c.future, comment)
- }
- } else {
- if !c.wasLineBreak || (c.Current == nil && !c.afterBlock) {
- c.Comments = append(c.Comments, comment)
- } else {
- c.future = append(c.future, comment)
- }
- }
-}
-
-// MarkComments will mark the found comments as the given position.
-func (c *Comments) MarkComments(position CommentPosition) {
- for _, comment := range c.Comments {
- if comment.Position == TBD {
- comment.Position = position
- }
- }
- for _, c := range c.future {
- if c.Position == TBD {
- c.Position = position
- }
- }
-}
-
-// Unset the current node and apply the comments to the current expression.
-// Resets context variables.
-func (c *Comments) Unset() {
- if c.Current != nil {
- c.applyComments(c.Current, c.Current, TRAILING)
- c.Current = nil
- }
- c.wasLineBreak = false
- c.primary = false
- c.afterBlock = false
-}
-
-// SetExpression sets the current expression.
-// It is applied the found comments, unless the previous expression has not been unset.
-// It is skipped if the node is already set or if it is a part of the previous node.
-func (c *Comments) SetExpression(node Expression) {
- // Skipping same node
- if c.Current == node {
- return
- }
- if c.Current != nil && c.Current.Idx1() == node.Idx1() {
- c.Current = node
- return
- }
- previous := c.Current
- c.Current = node
-
- // Apply the found comments and futures to the node and the previous.
- c.applyComments(node, previous, TRAILING)
-}
-
-// PostProcessNode applies all found comments to the given node.
-func (c *Comments) PostProcessNode(node Node) {
- c.applyComments(node, nil, TRAILING)
-}
-
-// applyComments applies both the comments and the future comments to the given node and the previous one,
-// based on the context.
-func (c *Comments) applyComments(node, previous Node, position CommentPosition) {
- if previous != nil {
- c.CommentMap.AddComments(previous, c.Comments, position)
- c.Comments = nil
- } else {
- c.CommentMap.AddComments(node, c.Comments, position)
- c.Comments = nil
- }
- // Only apply the future comments to the node if the previous is set.
- // This is for detecting end of line comments and which node comments on the following lines belongs to
- if previous != nil {
- c.CommentMap.AddComments(node, c.future, position)
- c.future = nil
- }
-}
-
-// AtLineBreak will mark a line break.
-func (c *Comments) AtLineBreak() {
- c.wasLineBreak = true
-}
-
-// CommentMap is the data structure where all found comments are stored.
-type CommentMap map[Node][]*Comment
-
-// AddComment adds a single comment to the map.
-func (cm CommentMap) AddComment(node Node, comment *Comment) {
- list := cm[node]
- list = append(list, comment)
-
- cm[node] = list
-}
-
-// AddComments adds a slice of comments, given a node and an updated position.
-func (cm CommentMap) AddComments(node Node, comments []*Comment, position CommentPosition) {
- for _, comment := range comments {
- if comment.Position == TBD {
- comment.Position = position
- }
- cm.AddComment(node, comment)
- }
-}
-
-// Size returns the size of the map.
-func (cm CommentMap) Size() int {
- size := 0
- for _, comments := range cm {
- size += len(comments)
- }
-
- return size
-}
-
-// MoveComments moves comments with a given position from a node to another.
-func (cm CommentMap) MoveComments(from, to Node, position CommentPosition) {
- for i, c := range cm[from] {
- if c.Position == position {
- cm.AddComment(to, c)
-
- // Remove the comment from the "from" slice
- cm[from][i] = cm[from][len(cm[from])-1]
- cm[from][len(cm[from])-1] = nil
- cm[from] = cm[from][:len(cm[from])-1]
- }
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/ast/node.go b/vendor/github.com/robertkrimen/otto/ast/node.go
deleted file mode 100644
index ec49c73..0000000
--- a/vendor/github.com/robertkrimen/otto/ast/node.go
+++ /dev/null
@@ -1,968 +0,0 @@
-// Package ast declares types representing a JavaScript AST.
-//
-// # Warning
-// The parser and AST interfaces are still works-in-progress (particularly where
-// node types are concerned) and may change in the future.
-package ast
-
-import (
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/token"
-)
-
-// Node is implemented by types that represent a node.
-type Node interface {
- Idx0() file.Idx // The index of the first character belonging to the node
- Idx1() file.Idx // The index of the first character immediately after the node
-}
-
-// Expression is implemented by types that represent an Expression.
-type Expression interface {
- Node
- expression()
-}
-
-// ArrayLiteral represents an array literal.
-type ArrayLiteral struct {
- LeftBracket file.Idx
- RightBracket file.Idx
- Value []Expression
-}
-
-// Idx0 implements Node.
-func (al *ArrayLiteral) Idx0() file.Idx {
- return al.LeftBracket
-}
-
-// Idx1 implements Node.
-func (al *ArrayLiteral) Idx1() file.Idx {
- return al.RightBracket + 1
-}
-
-// expression implements Expression.
-func (*ArrayLiteral) expression() {}
-
-// AssignExpression represents an assignment expression.
-type AssignExpression struct {
- Operator token.Token
- Left Expression
- Right Expression
-}
-
-// Idx0 implements Node.
-func (ae *AssignExpression) Idx0() file.Idx {
- return ae.Left.Idx0()
-}
-
-// Idx1 implements Node.
-func (ae *AssignExpression) Idx1() file.Idx {
- return ae.Right.Idx1()
-}
-
-// expression implements Expression.
-func (*AssignExpression) expression() {}
-
-// BadExpression represents a bad expression.
-type BadExpression struct {
- From file.Idx
- To file.Idx
-}
-
-// Idx0 implements Node.
-func (be *BadExpression) Idx0() file.Idx {
- return be.From
-}
-
-// Idx1 implements Node.
-func (be *BadExpression) Idx1() file.Idx {
- return be.To
-}
-
-// expression implements Expression.
-func (*BadExpression) expression() {}
-
-// BinaryExpression represents a binary expression.
-type BinaryExpression struct {
- Operator token.Token
- Left Expression
- Right Expression
- Comparison bool
-}
-
-// Idx0 implements Node.
-func (be *BinaryExpression) Idx0() file.Idx {
- return be.Left.Idx0()
-}
-
-// Idx1 implements Node.
-func (be *BinaryExpression) Idx1() file.Idx {
- return be.Right.Idx1()
-}
-
-// expression implements Expression.
-func (*BinaryExpression) expression() {}
-
-// BooleanLiteral represents a boolean expression.
-type BooleanLiteral struct {
- Idx file.Idx
- Literal string
- Value bool
-}
-
-// Idx0 implements Node.
-func (bl *BooleanLiteral) Idx0() file.Idx {
- return bl.Idx
-}
-
-// Idx1 implements Node.
-func (bl *BooleanLiteral) Idx1() file.Idx {
- return file.Idx(int(bl.Idx) + len(bl.Literal))
-}
-
-// expression implements Expression.
-func (*BooleanLiteral) expression() {}
-
-// BracketExpression represents a bracketed expression.
-type BracketExpression struct {
- Left Expression
- Member Expression
- LeftBracket file.Idx
- RightBracket file.Idx
-}
-
-// Idx0 implements Node.
-func (be *BracketExpression) Idx0() file.Idx {
- return be.Left.Idx0()
-}
-
-// Idx1 implements Node.
-func (be *BracketExpression) Idx1() file.Idx {
- return be.RightBracket + 1
-}
-
-// expression implements Expression.
-func (*BracketExpression) expression() {}
-
-// CallExpression represents a call expression.
-type CallExpression struct {
- Callee Expression
- LeftParenthesis file.Idx
- ArgumentList []Expression
- RightParenthesis file.Idx
-}
-
-// Idx0 implements Node.
-func (ce *CallExpression) Idx0() file.Idx {
- return ce.Callee.Idx0()
-}
-
-// Idx1 implements Node.
-func (ce *CallExpression) Idx1() file.Idx {
- return ce.RightParenthesis + 1
-}
-
-// expression implements Expression.
-func (*CallExpression) expression() {}
-
-// ConditionalExpression represents a conditional expression.
-type ConditionalExpression struct {
- Test Expression
- Consequent Expression
- Alternate Expression
-}
-
-// Idx0 implements Node.
-func (ce *ConditionalExpression) Idx0() file.Idx {
- return ce.Test.Idx0()
-}
-
-// Idx1 implements Node.
-func (ce *ConditionalExpression) Idx1() file.Idx {
- return ce.Alternate.Idx1()
-}
-
-// expression implements Expression.
-func (*ConditionalExpression) expression() {}
-
-// DotExpression represents a dot expression.
-type DotExpression struct {
- Left Expression
- Identifier *Identifier
-}
-
-// Idx0 implements Node.
-func (de *DotExpression) Idx0() file.Idx {
- return de.Left.Idx0()
-}
-
-// Idx1 implements Node.
-func (de *DotExpression) Idx1() file.Idx {
- return de.Identifier.Idx1()
-}
-
-// expression implements Expression.
-func (*DotExpression) expression() {}
-
-// EmptyExpression represents an empty expression.
-type EmptyExpression struct {
- Begin file.Idx
- End file.Idx
-}
-
-// Idx0 implements Node.
-func (ee *EmptyExpression) Idx0() file.Idx {
- return ee.Begin
-}
-
-// Idx1 implements Node.
-func (ee *EmptyExpression) Idx1() file.Idx {
- return ee.End
-}
-
-// expression implements Expression.
-func (*EmptyExpression) expression() {}
-
-// FunctionLiteral represents a function literal.
-type FunctionLiteral struct {
- Function file.Idx
- Name *Identifier
- ParameterList *ParameterList
- Body Statement
- Source string
-
- DeclarationList []Declaration
-}
-
-// Idx0 implements Node.
-func (fl *FunctionLiteral) Idx0() file.Idx {
- return fl.Function
-}
-
-// Idx1 implements Node.
-func (fl *FunctionLiteral) Idx1() file.Idx {
- return fl.Body.Idx1()
-}
-
-// expression implements Expression.
-func (*FunctionLiteral) expression() {}
-
-// Identifier represents an identifier.
-type Identifier struct {
- Name string
- Idx file.Idx
-}
-
-// Idx0 implements Node.
-func (i *Identifier) Idx0() file.Idx {
- return i.Idx
-}
-
-// Idx1 implements Node.
-func (i *Identifier) Idx1() file.Idx {
- return file.Idx(int(i.Idx) + len(i.Name))
-}
-
-// expression implements Expression.
-func (*Identifier) expression() {}
-
-// NewExpression represents a new expression.
-type NewExpression struct {
- New file.Idx
- Callee Expression
- LeftParenthesis file.Idx
- ArgumentList []Expression
- RightParenthesis file.Idx
-}
-
-// Idx0 implements Node.
-func (ne *NewExpression) Idx0() file.Idx {
- return ne.New
-}
-
-// Idx1 implements Node.
-func (ne *NewExpression) Idx1() file.Idx {
- if ne.RightParenthesis > 0 {
- return ne.RightParenthesis + 1
- }
- return ne.Callee.Idx1()
-}
-
-// expression implements Expression.
-func (*NewExpression) expression() {}
-
-// NullLiteral represents a null literal.
-type NullLiteral struct {
- Idx file.Idx
- Literal string
-}
-
-// Idx0 implements Node.
-func (nl *NullLiteral) Idx0() file.Idx {
- return nl.Idx
-}
-
-// Idx1 implements Node.
-func (nl *NullLiteral) Idx1() file.Idx {
- return file.Idx(int(nl.Idx) + 4)
-}
-
-// expression implements Expression.
-func (*NullLiteral) expression() {}
-
-// NumberLiteral represents a number literal.
-type NumberLiteral struct {
- Idx file.Idx
- Literal string
- Value interface{}
-}
-
-// Idx0 implements Node.
-func (nl *NumberLiteral) Idx0() file.Idx {
- return nl.Idx
-}
-
-// Idx1 implements Node.
-func (nl *NumberLiteral) Idx1() file.Idx {
- return file.Idx(int(nl.Idx) + len(nl.Literal))
-}
-
-// expression implements Expression.
-func (*NumberLiteral) expression() {}
-
-// ObjectLiteral represents an object literal.
-type ObjectLiteral struct {
- LeftBrace file.Idx
- RightBrace file.Idx
- Value []Property
-}
-
-// Idx0 implements Node.
-func (ol *ObjectLiteral) Idx0() file.Idx {
- return ol.LeftBrace
-}
-
-// Idx1 implements Node.
-func (ol *ObjectLiteral) Idx1() file.Idx {
- return ol.RightBrace + 1
-}
-
-// expression implements Expression.
-func (*ObjectLiteral) expression() {}
-
-// ParameterList represents a parameter list.
-type ParameterList struct {
- Opening file.Idx
- List []*Identifier
- Closing file.Idx
-}
-
-// Property represents a property.
-type Property struct {
- Key string
- Kind string
- Value Expression
-}
-
-// RegExpLiteral represents a regular expression literal.
-type RegExpLiteral struct {
- Idx file.Idx
- Literal string
- Pattern string
- Flags string
- Value string
-}
-
-// Idx0 implements Node.
-func (rl *RegExpLiteral) Idx0() file.Idx {
- return rl.Idx
-}
-
-// Idx1 implements Node.
-func (rl *RegExpLiteral) Idx1() file.Idx {
- return file.Idx(int(rl.Idx) + len(rl.Literal))
-}
-
-// expression implements Expression.
-func (*RegExpLiteral) expression() {}
-
-// SequenceExpression represents a sequence literal.
-type SequenceExpression struct {
- Sequence []Expression
-}
-
-// Idx0 implements Node.
-func (se *SequenceExpression) Idx0() file.Idx {
- return se.Sequence[0].Idx0()
-}
-
-// Idx1 implements Node.
-func (se *SequenceExpression) Idx1() file.Idx {
- return se.Sequence[len(se.Sequence)-1].Idx1()
-}
-
-// expression implements Expression.
-func (*SequenceExpression) expression() {}
-
-// StringLiteral represents a string literal.
-type StringLiteral struct {
- Idx file.Idx
- Literal string
- Value string
-}
-
-// Idx0 implements Node.
-func (sl *StringLiteral) Idx0() file.Idx {
- return sl.Idx
-}
-
-// Idx1 implements Node.
-func (sl *StringLiteral) Idx1() file.Idx {
- return file.Idx(int(sl.Idx) + len(sl.Literal))
-}
-
-// expression implements Expression.
-func (*StringLiteral) expression() {}
-
-// ThisExpression represents a this expression.
-type ThisExpression struct {
- Idx file.Idx
-}
-
-// Idx0 implements Node.
-func (te *ThisExpression) Idx0() file.Idx {
- return te.Idx
-}
-
-// Idx1 implements Node.
-func (te *ThisExpression) Idx1() file.Idx {
- return te.Idx + 4
-}
-
-// expression implements Expression.
-func (*ThisExpression) expression() {}
-
-// UnaryExpression represents a unary expression.
-type UnaryExpression struct {
- Operator token.Token
- Idx file.Idx // If a prefix operation
- Operand Expression
- Postfix bool
-}
-
-// Idx0 implements Node.
-func (ue *UnaryExpression) Idx0() file.Idx {
- if ue.Postfix {
- return ue.Operand.Idx0()
- }
- return ue.Idx
-}
-
-// Idx1 implements Node.
-func (ue *UnaryExpression) Idx1() file.Idx {
- if ue.Postfix {
- return ue.Operand.Idx1() + 2 // ++ --
- }
- return ue.Operand.Idx1()
-}
-
-// expression implements Expression.
-func (*UnaryExpression) expression() {}
-
-// VariableExpression represents a variable expression.
-type VariableExpression struct {
- Name string
- Idx file.Idx
- Initializer Expression
-}
-
-// Idx0 implements Node.
-func (ve *VariableExpression) Idx0() file.Idx {
- return ve.Idx
-}
-
-// Idx1 implements Node.
-func (ve *VariableExpression) Idx1() file.Idx {
- if ve.Initializer == nil {
- return file.Idx(int(ve.Idx) + len(ve.Name))
- }
- return ve.Initializer.Idx1()
-}
-
-// expression implements Expression.
-func (*VariableExpression) expression() {}
-
-// Statement is implemented by types which represent a statement.
-type Statement interface {
- Node
- statement()
-}
-
-// BadStatement represents a bad statement.
-type BadStatement struct {
- From file.Idx
- To file.Idx
-}
-
-// Idx0 implements Node.
-func (bs *BadStatement) Idx0() file.Idx {
- return bs.From
-}
-
-// Idx1 implements Node.
-func (bs *BadStatement) Idx1() file.Idx {
- return bs.To
-}
-
-// expression implements Statement.
-func (*BadStatement) statement() {}
-
-// BlockStatement represents a block statement.
-type BlockStatement struct {
- LeftBrace file.Idx
- List []Statement
- RightBrace file.Idx
-}
-
-// Idx0 implements Node.
-func (bs *BlockStatement) Idx0() file.Idx {
- return bs.LeftBrace
-}
-
-// Idx1 implements Node.
-func (bs *BlockStatement) Idx1() file.Idx {
- return bs.RightBrace + 1
-}
-
-// expression implements Statement.
-func (*BlockStatement) statement() {}
-
-// BranchStatement represents a branch statement.
-type BranchStatement struct {
- Idx file.Idx
- Token token.Token
- Label *Identifier
-}
-
-// Idx0 implements Node.
-func (bs *BranchStatement) Idx0() file.Idx {
- return bs.Idx
-}
-
-// Idx1 implements Node.
-func (bs *BranchStatement) Idx1() file.Idx {
- if bs.Label == nil {
- return file.Idx(int(bs.Idx) + len(bs.Token.String()))
- }
- return bs.Label.Idx1()
-}
-
-// expression implements Statement.
-func (*BranchStatement) statement() {}
-
-// CaseStatement represents a case statement.
-type CaseStatement struct {
- Case file.Idx
- Test Expression
- Consequent []Statement
-}
-
-// Idx0 implements Node.
-func (cs *CaseStatement) Idx0() file.Idx {
- return cs.Case
-}
-
-// Idx1 implements Node.
-func (cs *CaseStatement) Idx1() file.Idx {
- return cs.Consequent[len(cs.Consequent)-1].Idx1()
-}
-
-// expression implements Statement.
-func (*CaseStatement) statement() {}
-
-// CatchStatement represents a catch statement.
-type CatchStatement struct {
- Catch file.Idx
- Parameter *Identifier
- Body Statement
-}
-
-// Idx0 implements Node.
-func (cs *CatchStatement) Idx0() file.Idx {
- return cs.Catch
-}
-
-// Idx1 implements Node.
-func (cs *CatchStatement) Idx1() file.Idx {
- return cs.Body.Idx1()
-}
-
-// expression implements Statement.
-func (*CatchStatement) statement() {}
-
-// DebuggerStatement represents a debugger statement.
-type DebuggerStatement struct {
- Debugger file.Idx
-}
-
-// Idx0 implements Node.
-func (ds *DebuggerStatement) Idx0() file.Idx {
- return ds.Debugger
-}
-
-// Idx1 implements Node.
-func (ds *DebuggerStatement) Idx1() file.Idx {
- return ds.Debugger + 8
-}
-
-// expression implements Statement.
-func (*DebuggerStatement) statement() {}
-
-// DoWhileStatement represents a do while statement.
-type DoWhileStatement struct {
- Do file.Idx
- Test Expression
- Body Statement
- RightParenthesis file.Idx
-}
-
-// Idx0 implements Node.
-func (dws *DoWhileStatement) Idx0() file.Idx {
- return dws.Do
-}
-
-// Idx1 implements Node.
-func (dws *DoWhileStatement) Idx1() file.Idx {
- return dws.RightParenthesis + 1
-}
-
-// expression implements Statement.
-func (*DoWhileStatement) statement() {}
-
-// EmptyStatement represents a empty statement.
-type EmptyStatement struct {
- Semicolon file.Idx
-}
-
-// Idx0 implements Node.
-func (es *EmptyStatement) Idx0() file.Idx {
- return es.Semicolon
-}
-
-// Idx1 implements Node.
-func (es *EmptyStatement) Idx1() file.Idx {
- return es.Semicolon + 1
-}
-
-// expression implements Statement.
-func (*EmptyStatement) statement() {}
-
-// ExpressionStatement represents a expression statement.
-type ExpressionStatement struct {
- Expression Expression
-}
-
-// Idx0 implements Node.
-func (es *ExpressionStatement) Idx0() file.Idx {
- return es.Expression.Idx0()
-}
-
-// Idx1 implements Node.
-func (es *ExpressionStatement) Idx1() file.Idx {
- return es.Expression.Idx1()
-}
-
-// expression implements Statement.
-func (*ExpressionStatement) statement() {}
-
-// ForInStatement represents a for in statement.
-type ForInStatement struct {
- For file.Idx
- Into Expression
- Source Expression
- Body Statement
-}
-
-// Idx0 implements Node.
-func (fis *ForInStatement) Idx0() file.Idx {
- return fis.For
-}
-
-// Idx1 implements Node.
-func (fis *ForInStatement) Idx1() file.Idx {
- return fis.Body.Idx1()
-}
-
-// expression implements Statement.
-func (*ForInStatement) statement() {}
-
-// ForStatement represents a for statement.
-type ForStatement struct {
- For file.Idx
- Initializer Expression
- Update Expression
- Test Expression
- Body Statement
-}
-
-// Idx0 implements Node.
-func (fs *ForStatement) Idx0() file.Idx {
- return fs.For
-}
-
-// Idx1 implements Node.
-func (fs *ForStatement) Idx1() file.Idx {
- return fs.Body.Idx1()
-}
-
-// expression implements Statement.
-func (*ForStatement) statement() {}
-
-// FunctionStatement represents a function statement.
-type FunctionStatement struct {
- Function *FunctionLiteral
-}
-
-// Idx0 implements Node.
-func (fs *FunctionStatement) Idx0() file.Idx {
- return fs.Function.Idx0()
-}
-
-// Idx1 implements Node.
-func (fs *FunctionStatement) Idx1() file.Idx {
- return fs.Function.Idx1()
-}
-
-// expression implements Statement.
-func (*FunctionStatement) statement() {}
-
-// IfStatement represents a if statement.
-type IfStatement struct {
- If file.Idx
- Test Expression
- Consequent Statement
- Alternate Statement
-}
-
-// Idx0 implements Node.
-func (is *IfStatement) Idx0() file.Idx {
- return is.If
-}
-
-// Idx1 implements Node.
-func (is *IfStatement) Idx1() file.Idx {
- if is.Alternate != nil {
- return is.Alternate.Idx1()
- }
- return is.Consequent.Idx1()
-}
-
-// expression implements Statement.
-func (*IfStatement) statement() {}
-
-// LabelledStatement represents a labelled statement.
-type LabelledStatement struct {
- Label *Identifier
- Colon file.Idx
- Statement Statement
-}
-
-// Idx0 implements Node.
-func (ls *LabelledStatement) Idx0() file.Idx {
- return ls.Label.Idx0()
-}
-
-// Idx1 implements Node.
-func (ls *LabelledStatement) Idx1() file.Idx {
- return ls.Statement.Idx1()
-}
-
-// expression implements Statement.
-func (*LabelledStatement) statement() {}
-
-// ReturnStatement represents a return statement.
-type ReturnStatement struct {
- Return file.Idx
- Argument Expression
-}
-
-// Idx0 implements Node.
-func (rs *ReturnStatement) Idx0() file.Idx {
- return rs.Return
-}
-
-// Idx1 implements Node.
-func (rs *ReturnStatement) Idx1() file.Idx {
- if rs.Argument != nil {
- return rs.Argument.Idx1()
- }
- return rs.Return + 6
-}
-
-// expression implements Statement.
-func (*ReturnStatement) statement() {}
-
-// SwitchStatement represents a switch statement.
-type SwitchStatement struct {
- Switch file.Idx
- Discriminant Expression
- Default int
- Body []*CaseStatement
- RightBrace file.Idx
-}
-
-// Idx0 implements Node.
-func (ss *SwitchStatement) Idx0() file.Idx {
- return ss.Switch
-}
-
-// Idx1 implements Node.
-func (ss *SwitchStatement) Idx1() file.Idx {
- return ss.RightBrace + 1
-}
-
-// expression implements Statement.
-func (*SwitchStatement) statement() {}
-
-// ThrowStatement represents a throw statement.
-type ThrowStatement struct {
- Throw file.Idx
- Argument Expression
-}
-
-// Idx0 implements Node.
-func (ts *ThrowStatement) Idx0() file.Idx {
- return ts.Throw
-}
-
-// Idx1 implements Node.
-func (ts *ThrowStatement) Idx1() file.Idx {
- return ts.Argument.Idx1()
-}
-
-// expression implements Statement.
-func (*ThrowStatement) statement() {}
-
-// TryStatement represents a try statement.
-type TryStatement struct {
- Try file.Idx
- Body Statement
- Catch *CatchStatement
- Finally Statement
-}
-
-// Idx0 implements Node.
-func (ts *TryStatement) Idx0() file.Idx {
- return ts.Try
-}
-
-// Idx1 implements Node.
-func (ts *TryStatement) Idx1() file.Idx {
- if ts.Finally != nil {
- return ts.Finally.Idx1()
- }
- return ts.Catch.Idx1()
-}
-
-// expression implements Statement.
-func (*TryStatement) statement() {}
-
-// VariableStatement represents a variable statement.
-type VariableStatement struct {
- Var file.Idx
- List []Expression
-}
-
-// Idx0 implements Node.
-func (vs *VariableStatement) Idx0() file.Idx {
- return vs.Var
-}
-
-// Idx1 implements Node.
-func (vs *VariableStatement) Idx1() file.Idx {
- return vs.List[len(vs.List)-1].Idx1()
-}
-
-// expression implements Statement.
-func (*VariableStatement) statement() {}
-
-// WhileStatement represents a while statement.
-type WhileStatement struct {
- While file.Idx
- Test Expression
- Body Statement
-}
-
-// Idx0 implements Node.
-func (ws *WhileStatement) Idx0() file.Idx {
- return ws.While
-}
-
-// Idx1 implements Node.
-func (ws *WhileStatement) Idx1() file.Idx {
- return ws.Body.Idx1()
-}
-
-// expression implements Statement.
-func (*WhileStatement) statement() {}
-
-// WithStatement represents a with statement.
-type WithStatement struct {
- With file.Idx
- Object Expression
- Body Statement
-}
-
-// Idx0 implements Node.
-func (ws *WithStatement) Idx0() file.Idx {
- return ws.With
-}
-
-// Idx1 implements Node.
-func (ws *WithStatement) Idx1() file.Idx {
- return ws.Body.Idx1()
-}
-
-// expression implements Statement.
-func (*WithStatement) statement() {}
-
-// Declaration is implemented by type which represent declarations.
-type Declaration interface {
- declaration()
-}
-
-// FunctionDeclaration represents a function declaration.
-type FunctionDeclaration struct {
- Function *FunctionLiteral
-}
-
-func (*FunctionDeclaration) declaration() {}
-
-// VariableDeclaration represents a variable declaration.
-type VariableDeclaration struct {
- Var file.Idx
- List []*VariableExpression
-}
-
-// declaration implements Declaration.
-func (*VariableDeclaration) declaration() {}
-
-// Program represents a full program.
-type Program struct {
- Body []Statement
-
- DeclarationList []Declaration
-
- File *file.File
-
- Comments CommentMap
-}
-
-// Idx0 implements Node.
-func (p *Program) Idx0() file.Idx {
- return p.Body[0].Idx0()
-}
-
-// Idx1 implements Node.
-func (p *Program) Idx1() file.Idx {
- return p.Body[len(p.Body)-1].Idx1()
-}
diff --git a/vendor/github.com/robertkrimen/otto/ast/walk.go b/vendor/github.com/robertkrimen/otto/ast/walk.go
deleted file mode 100644
index 4422930..0000000
--- a/vendor/github.com/robertkrimen/otto/ast/walk.go
+++ /dev/null
@@ -1,220 +0,0 @@
-package ast
-
-import "fmt"
-
-// Visitor Enter method is invoked for each node encountered by Walk.
-// If the result visitor w is not nil, Walk visits each of the children
-// of node with the visitor v, followed by a call of the Exit method.
-type Visitor interface {
- Enter(n Node) (v Visitor)
- Exit(n Node)
-}
-
-// Walk traverses an AST in depth-first order: It starts by calling
-// v.Enter(node); node must not be nil. If the visitor v returned by
-// v.Enter(node) is not nil, Walk is invoked recursively with visitor
-// v for each of the non-nil children of node, followed by a call
-// of v.Exit(node).
-func Walk(v Visitor, n Node) {
- if n == nil {
- return
- }
- if v = v.Enter(n); v == nil {
- return
- }
-
- defer v.Exit(n)
-
- switch n := n.(type) {
- case *ArrayLiteral:
- if n != nil {
- for _, ex := range n.Value {
- Walk(v, ex)
- }
- }
- case *AssignExpression:
- if n != nil {
- Walk(v, n.Left)
- Walk(v, n.Right)
- }
- case *BadExpression:
- case *BadStatement:
- case *BinaryExpression:
- if n != nil {
- Walk(v, n.Left)
- Walk(v, n.Right)
- }
- case *BlockStatement:
- if n != nil {
- for _, s := range n.List {
- Walk(v, s)
- }
- }
- case *BooleanLiteral:
- case *BracketExpression:
- if n != nil {
- Walk(v, n.Left)
- Walk(v, n.Member)
- }
- case *BranchStatement:
- if n != nil {
- Walk(v, n.Label)
- }
- case *CallExpression:
- if n != nil {
- Walk(v, n.Callee)
- for _, a := range n.ArgumentList {
- Walk(v, a)
- }
- }
- case *CaseStatement:
- if n != nil {
- Walk(v, n.Test)
- for _, c := range n.Consequent {
- Walk(v, c)
- }
- }
- case *CatchStatement:
- if n != nil {
- Walk(v, n.Parameter)
- Walk(v, n.Body)
- }
- case *ConditionalExpression:
- if n != nil {
- Walk(v, n.Test)
- Walk(v, n.Consequent)
- Walk(v, n.Alternate)
- }
- case *DebuggerStatement:
- case *DoWhileStatement:
- if n != nil {
- Walk(v, n.Test)
- Walk(v, n.Body)
- }
- case *DotExpression:
- if n != nil {
- Walk(v, n.Left)
- Walk(v, n.Identifier)
- }
- case *EmptyExpression:
- case *EmptyStatement:
- case *ExpressionStatement:
- if n != nil {
- Walk(v, n.Expression)
- }
- case *ForInStatement:
- if n != nil {
- Walk(v, n.Into)
- Walk(v, n.Source)
- Walk(v, n.Body)
- }
- case *ForStatement:
- if n != nil {
- Walk(v, n.Initializer)
- Walk(v, n.Update)
- Walk(v, n.Test)
- Walk(v, n.Body)
- }
- case *FunctionLiteral:
- if n != nil {
- Walk(v, n.Name)
- for _, p := range n.ParameterList.List {
- Walk(v, p)
- }
- Walk(v, n.Body)
- }
- case *FunctionStatement:
- if n != nil {
- Walk(v, n.Function)
- }
- case *Identifier:
- case *IfStatement:
- if n != nil {
- Walk(v, n.Test)
- Walk(v, n.Consequent)
- Walk(v, n.Alternate)
- }
- case *LabelledStatement:
- if n != nil {
- Walk(v, n.Label)
- Walk(v, n.Statement)
- }
- case *NewExpression:
- if n != nil {
- Walk(v, n.Callee)
- for _, a := range n.ArgumentList {
- Walk(v, a)
- }
- }
- case *NullLiteral:
- case *NumberLiteral:
- case *ObjectLiteral:
- if n != nil {
- for _, p := range n.Value {
- Walk(v, p.Value)
- }
- }
- case *Program:
- if n != nil {
- for _, b := range n.Body {
- Walk(v, b)
- }
- }
- case *RegExpLiteral:
- case *ReturnStatement:
- if n != nil {
- Walk(v, n.Argument)
- }
- case *SequenceExpression:
- if n != nil {
- for _, e := range n.Sequence {
- Walk(v, e)
- }
- }
- case *StringLiteral:
- case *SwitchStatement:
- if n != nil {
- Walk(v, n.Discriminant)
- for _, c := range n.Body {
- Walk(v, c)
- }
- }
- case *ThisExpression:
- case *ThrowStatement:
- if n != nil {
- Walk(v, n.Argument)
- }
- case *TryStatement:
- if n != nil {
- Walk(v, n.Body)
- Walk(v, n.Catch)
- Walk(v, n.Finally)
- }
- case *UnaryExpression:
- if n != nil {
- Walk(v, n.Operand)
- }
- case *VariableExpression:
- if n != nil {
- Walk(v, n.Initializer)
- }
- case *VariableStatement:
- if n != nil {
- for _, e := range n.List {
- Walk(v, e)
- }
- }
- case *WhileStatement:
- if n != nil {
- Walk(v, n.Test)
- Walk(v, n.Body)
- }
- case *WithStatement:
- if n != nil {
- Walk(v, n.Object)
- Walk(v, n.Body)
- }
- default:
- panic(fmt.Sprintf("Walk: unexpected node type %T", n))
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin.go b/vendor/github.com/robertkrimen/otto/builtin.go
deleted file mode 100644
index 3e63dca..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin.go
+++ /dev/null
@@ -1,338 +0,0 @@
-package otto
-
-import (
- "encoding/hex"
- "errors"
- "math"
- "net/url"
- "regexp"
- "strconv"
- "strings"
- "unicode/utf16"
- "unicode/utf8"
-)
-
-// Global.
-func builtinGlobalEval(call FunctionCall) Value {
- src := call.Argument(0)
- if !src.IsString() {
- return src
- }
- rt := call.runtime
- program := rt.cmplParseOrThrow(src.string(), nil)
- if !call.eval {
- // Not a direct call to eval, so we enter the global ExecutionContext
- rt.enterGlobalScope()
- defer rt.leaveScope()
- }
- returnValue := rt.cmplEvaluateNodeProgram(program, true)
- if returnValue.isEmpty() {
- return Value{}
- }
- return returnValue
-}
-
-func builtinGlobalIsNaN(call FunctionCall) Value {
- value := call.Argument(0).float64()
- return boolValue(math.IsNaN(value))
-}
-
-func builtinGlobalIsFinite(call FunctionCall) Value {
- value := call.Argument(0).float64()
- return boolValue(!math.IsNaN(value) && !math.IsInf(value, 0))
-}
-
-func digitValue(chr rune) int {
- switch {
- case '0' <= chr && chr <= '9':
- return int(chr - '0')
- case 'a' <= chr && chr <= 'z':
- return int(chr - 'a' + 10)
- case 'A' <= chr && chr <= 'Z':
- return int(chr - 'A' + 10)
- }
- return 36 // Larger than any legal digit value
-}
-
-func builtinGlobalParseInt(call FunctionCall) Value {
- input := strings.Trim(call.Argument(0).string(), builtinStringTrimWhitespace)
- if len(input) == 0 {
- return NaNValue()
- }
-
- radix := int(toInt32(call.Argument(1)))
-
- negative := false
- switch input[0] {
- case '+':
- input = input[1:]
- case '-':
- negative = true
- input = input[1:]
- }
-
- strip := true
- if radix == 0 {
- radix = 10
- } else {
- if radix < 2 || radix > 36 {
- return NaNValue()
- } else if radix != 16 {
- strip = false
- }
- }
-
- switch len(input) {
- case 0:
- return NaNValue()
- case 1:
- default:
- if strip {
- if input[0] == '0' && (input[1] == 'x' || input[1] == 'X') {
- input = input[2:]
- radix = 16
- }
- }
- }
-
- base := radix
- index := 0
- for ; index < len(input); index++ {
- digit := digitValue(rune(input[index])) // If not ASCII, then an error anyway
- if digit >= base {
- break
- }
- }
- input = input[0:index]
-
- value, err := strconv.ParseInt(input, radix, 64)
- if err != nil {
- if errors.Is(err, strconv.ErrRange) {
- base := float64(base)
- // Could just be a very large number (e.g. 0x8000000000000000)
- var value float64
- for _, chr := range input {
- digit := float64(digitValue(chr))
- if digit >= base {
- return NaNValue()
- }
- value = value*base + digit
- }
- if negative {
- value *= -1
- }
- return float64Value(value)
- }
- return NaNValue()
- }
- if negative {
- value *= -1
- }
-
- return int64Value(value)
-}
-
-var (
- parseFloatMatchBadSpecial = regexp.MustCompile(`[\+\-]?(?:[Ii]nf$|infinity)`)
- parseFloatMatchValid = regexp.MustCompile(`[0-9eE\+\-\.]|Infinity`)
-)
-
-func builtinGlobalParseFloat(call FunctionCall) Value {
- // Caveat emptor: This implementation does NOT match the specification
- input := strings.Trim(call.Argument(0).string(), builtinStringTrimWhitespace)
-
- if parseFloatMatchBadSpecial.MatchString(input) {
- return NaNValue()
- }
- value, err := strconv.ParseFloat(input, 64)
- if err != nil {
- for end := len(input); end > 0; end-- {
- input := input[0:end]
- if !parseFloatMatchValid.MatchString(input) {
- return NaNValue()
- }
- value, err = strconv.ParseFloat(input, 64)
- if err == nil {
- break
- }
- }
- if err != nil {
- return NaNValue()
- }
- }
- return float64Value(value)
-}
-
-// encodeURI/decodeURI
-
-func encodeDecodeURI(call FunctionCall, escape *regexp.Regexp) Value {
- value := call.Argument(0)
- var input []uint16
- switch vl := value.value.(type) {
- case []uint16:
- input = vl
- default:
- input = utf16.Encode([]rune(value.string()))
- }
- if len(input) == 0 {
- return stringValue("")
- }
- output := []byte{}
- length := len(input)
- encode := make([]byte, 4)
- for index := 0; index < length; {
- value := input[index]
- decode := utf16.Decode(input[index : index+1])
- if value >= 0xDC00 && value <= 0xDFFF {
- panic(call.runtime.panicURIError("URI malformed"))
- }
- if value >= 0xD800 && value <= 0xDBFF {
- index++
- if index >= length {
- panic(call.runtime.panicURIError("URI malformed"))
- }
- // input = ..., value, value1, ...
- value1 := input[index]
- if value1 < 0xDC00 || value1 > 0xDFFF {
- panic(call.runtime.panicURIError("URI malformed"))
- }
- decode = []rune{((rune(value) - 0xD800) * 0x400) + (rune(value1) - 0xDC00) + 0x10000}
- }
- index++
- size := utf8.EncodeRune(encode, decode[0])
- encode := encode[0:size]
- output = append(output, encode...)
- }
-
- bytes := escape.ReplaceAllFunc(output, func(target []byte) []byte {
- // Probably a better way of doing this
- if target[0] == ' ' {
- return []byte("%20")
- }
- return []byte(url.QueryEscape(string(target)))
- })
- return stringValue(string(bytes))
-}
-
-var encodeURIRegexp = regexp.MustCompile(`([^~!@#$&*()=:/,;?+'])`)
-
-func builtinGlobalEncodeURI(call FunctionCall) Value {
- return encodeDecodeURI(call, encodeURIRegexp)
-}
-
-var encodeURIComponentRegexp = regexp.MustCompile(`([^~!*()'])`)
-
-func builtinGlobalEncodeURIComponent(call FunctionCall) Value {
- return encodeDecodeURI(call, encodeURIComponentRegexp)
-}
-
-// 3B/2F/3F/3A/40/26/3D/2B/24/2C/23.
-var decodeURIGuard = regexp.MustCompile(`(?i)(?:%)(3B|2F|3F|3A|40|26|3D|2B|24|2C|23)`)
-
-func decodeURI(input string, reserve bool) (string, bool) {
- if reserve {
- input = decodeURIGuard.ReplaceAllString(input, "%25$1")
- }
- input = strings.ReplaceAll(input, "+", "%2B") // Ugly hack to make QueryUnescape work with our use case
- output, err := url.QueryUnescape(input)
- if err != nil || !utf8.ValidString(output) {
- return "", true
- }
- return output, false
-}
-
-func builtinGlobalDecodeURI(call FunctionCall) Value {
- output, err := decodeURI(call.Argument(0).string(), true)
- if err {
- panic(call.runtime.panicURIError("URI malformed"))
- }
- return stringValue(output)
-}
-
-func builtinGlobalDecodeURIComponent(call FunctionCall) Value {
- output, err := decodeURI(call.Argument(0).string(), false)
- if err {
- panic(call.runtime.panicURIError("URI malformed"))
- }
- return stringValue(output)
-}
-
-// escape/unescape
-
-func builtinShouldEscape(chr byte) bool {
- if 'A' <= chr && chr <= 'Z' || 'a' <= chr && chr <= 'z' || '0' <= chr && chr <= '9' {
- return false
- }
- return !strings.ContainsRune("*_+-./", rune(chr))
-}
-
-const escapeBase16 = "0123456789ABCDEF"
-
-func builtinEscape(input string) string {
- output := make([]byte, 0, len(input))
- length := len(input)
- for index := 0; index < length; {
- if builtinShouldEscape(input[index]) {
- chr, width := utf8.DecodeRuneInString(input[index:])
- chr16 := utf16.Encode([]rune{chr})[0]
- if 256 > chr16 {
- output = append(output, '%',
- escapeBase16[chr16>>4],
- escapeBase16[chr16&15],
- )
- } else {
- output = append(output, '%', 'u',
- escapeBase16[chr16>>12],
- escapeBase16[(chr16>>8)&15],
- escapeBase16[(chr16>>4)&15],
- escapeBase16[chr16&15],
- )
- }
- index += width
- } else {
- output = append(output, input[index])
- index++
- }
- }
- return string(output)
-}
-
-func builtinUnescape(input string) string {
- output := make([]rune, 0, len(input))
- length := len(input)
- for index := 0; index < length; {
- if input[index] == '%' {
- if index <= length-6 && input[index+1] == 'u' {
- byte16, err := hex.DecodeString(input[index+2 : index+6])
- if err == nil {
- value := uint16(byte16[0])<<8 + uint16(byte16[1])
- chr := utf16.Decode([]uint16{value})[0]
- output = append(output, chr)
- index += 6
- continue
- }
- }
- if index <= length-3 {
- byte8, err := hex.DecodeString(input[index+1 : index+3])
- if err == nil {
- value := uint16(byte8[0])
- chr := utf16.Decode([]uint16{value})[0]
- output = append(output, chr)
- index += 3
- continue
- }
- }
- }
- output = append(output, rune(input[index]))
- index++
- }
- return string(output)
-}
-
-func builtinGlobalEscape(call FunctionCall) Value {
- return stringValue(builtinEscape(call.Argument(0).string()))
-}
-
-func builtinGlobalUnescape(call FunctionCall) Value {
- return stringValue(builtinUnescape(call.Argument(0).string()))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_array.go b/vendor/github.com/robertkrimen/otto/builtin_array.go
deleted file mode 100644
index a82ed01..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_array.go
+++ /dev/null
@@ -1,683 +0,0 @@
-package otto
-
-import (
- "strconv"
- "strings"
-)
-
-// Array
-
-func builtinArray(call FunctionCall) Value {
- return objectValue(builtinNewArrayNative(call.runtime, call.ArgumentList))
-}
-
-func builtinNewArray(obj *object, argumentList []Value) Value {
- return objectValue(builtinNewArrayNative(obj.runtime, argumentList))
-}
-
-func builtinNewArrayNative(rt *runtime, argumentList []Value) *object {
- if len(argumentList) == 1 {
- firstArgument := argumentList[0]
- if firstArgument.IsNumber() {
- return rt.newArray(arrayUint32(rt, firstArgument))
- }
- }
- return rt.newArrayOf(argumentList)
-}
-
-func builtinArrayToString(call FunctionCall) Value {
- thisObject := call.thisObject()
- join := thisObject.get("join")
- if join.isCallable() {
- join := join.object()
- return join.call(call.This, call.ArgumentList, false, nativeFrame)
- }
- return builtinObjectToString(call)
-}
-
-func builtinArrayToLocaleString(call FunctionCall) Value {
- separator := ","
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
- if length == 0 {
- return stringValue("")
- }
- stringList := make([]string, 0, length)
- for index := int64(0); index < length; index++ {
- value := thisObject.get(arrayIndexToString(index))
- stringValue := ""
- switch value.kind {
- case valueEmpty, valueUndefined, valueNull:
- default:
- obj := call.runtime.toObject(value)
- toLocaleString := obj.get("toLocaleString")
- if !toLocaleString.isCallable() {
- panic(call.runtime.panicTypeError("Array.toLocaleString index[%d] %q is not callable", index, toLocaleString))
- }
- stringValue = toLocaleString.call(call.runtime, objectValue(obj)).string()
- }
- stringList = append(stringList, stringValue)
- }
- return stringValue(strings.Join(stringList, separator))
-}
-
-func builtinArrayConcat(call FunctionCall) Value {
- thisObject := call.thisObject()
- valueArray := []Value{}
- source := append([]Value{objectValue(thisObject)}, call.ArgumentList...)
- for _, item := range source {
- switch item.kind {
- case valueObject:
- obj := item.object()
- if isArray(obj) {
- length := obj.get(propertyLength).number().int64
- for index := int64(0); index < length; index++ {
- name := strconv.FormatInt(index, 10)
- if obj.hasProperty(name) {
- valueArray = append(valueArray, obj.get(name))
- } else {
- valueArray = append(valueArray, Value{})
- }
- }
- continue
- }
-
- fallthrough
- default:
- valueArray = append(valueArray, item)
- }
- }
- return objectValue(call.runtime.newArrayOf(valueArray))
-}
-
-func builtinArrayShift(call FunctionCall) Value {
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
- if length == 0 {
- thisObject.put(propertyLength, int64Value(0), true)
- return Value{}
- }
- first := thisObject.get("0")
- for index := int64(1); index < length; index++ {
- from := arrayIndexToString(index)
- to := arrayIndexToString(index - 1)
- if thisObject.hasProperty(from) {
- thisObject.put(to, thisObject.get(from), true)
- } else {
- thisObject.delete(to, true)
- }
- }
- thisObject.delete(arrayIndexToString(length-1), true)
- thisObject.put(propertyLength, int64Value(length-1), true)
- return first
-}
-
-func builtinArrayPush(call FunctionCall) Value {
- thisObject := call.thisObject()
- itemList := call.ArgumentList
- index := int64(toUint32(thisObject.get(propertyLength)))
- for len(itemList) > 0 {
- thisObject.put(arrayIndexToString(index), itemList[0], true)
- itemList = itemList[1:]
- index++
- }
- length := int64Value(index)
- thisObject.put(propertyLength, length, true)
- return length
-}
-
-func builtinArrayPop(call FunctionCall) Value {
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
- if length == 0 {
- thisObject.put(propertyLength, uint32Value(0), true)
- return Value{}
- }
- last := thisObject.get(arrayIndexToString(length - 1))
- thisObject.delete(arrayIndexToString(length-1), true)
- thisObject.put(propertyLength, int64Value(length-1), true)
- return last
-}
-
-func builtinArrayJoin(call FunctionCall) Value {
- separator := ","
- argument := call.Argument(0)
- if argument.IsDefined() {
- separator = argument.string()
- }
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
- if length == 0 {
- return stringValue("")
- }
- stringList := make([]string, 0, length)
- for index := int64(0); index < length; index++ {
- value := thisObject.get(arrayIndexToString(index))
- stringValue := ""
- switch value.kind {
- case valueEmpty, valueUndefined, valueNull:
- default:
- stringValue = value.string()
- }
- stringList = append(stringList, stringValue)
- }
- return stringValue(strings.Join(stringList, separator))
-}
-
-func builtinArraySplice(call FunctionCall) Value {
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
-
- start := valueToRangeIndex(call.Argument(0), length, false)
- deleteCount := length - start
- if arg, ok := call.getArgument(1); ok {
- deleteCount = valueToRangeIndex(arg, length-start, true)
- }
- valueArray := make([]Value, deleteCount)
-
- for index := int64(0); index < deleteCount; index++ {
- indexString := arrayIndexToString(start + index)
- if thisObject.hasProperty(indexString) {
- valueArray[index] = thisObject.get(indexString)
- }
- }
-
- // 0, <1, 2, 3, 4>, 5, 6, 7
- // a, b
- // length 8 - delete 4 @ start 1
-
- itemList := []Value{}
- itemCount := int64(len(call.ArgumentList))
- if itemCount > 2 {
- itemCount -= 2 // Less the first two arguments
- itemList = call.ArgumentList[2:]
- } else {
- itemCount = 0
- }
- if itemCount < deleteCount {
- // The Object/Array is shrinking
- stop := length - deleteCount
- // The new length of the Object/Array before
- // appending the itemList remainder
- // Stopping at the lower bound of the insertion:
- // Move an item from the after the deleted portion
- // to a position after the inserted portion
- for index := start; index < stop; index++ {
- from := arrayIndexToString(index + deleteCount) // Position just after deletion
- to := arrayIndexToString(index + itemCount) // Position just after splice (insertion)
- if thisObject.hasProperty(from) {
- thisObject.put(to, thisObject.get(from), true)
- } else {
- thisObject.delete(to, true)
- }
- }
- // Delete off the end
- // We don't bother to delete below (if any) since those
- // will be overwritten anyway
- for index := length; index > (stop + itemCount); index-- {
- thisObject.delete(arrayIndexToString(index-1), true)
- }
- } else if itemCount > deleteCount {
- // The Object/Array is growing
- // The itemCount is greater than the deleteCount, so we do
- // not have to worry about overwriting what we should be moving
- // ---
- // Starting from the upper bound of the deletion:
- // Move an item from the after the deleted portion
- // to a position after the inserted portion
- for index := length - deleteCount; index > start; index-- {
- from := arrayIndexToString(index + deleteCount - 1)
- to := arrayIndexToString(index + itemCount - 1)
- if thisObject.hasProperty(from) {
- thisObject.put(to, thisObject.get(from), true)
- } else {
- thisObject.delete(to, true)
- }
- }
- }
-
- for index := int64(0); index < itemCount; index++ {
- thisObject.put(arrayIndexToString(index+start), itemList[index], true)
- }
- thisObject.put(propertyLength, int64Value(length+itemCount-deleteCount), true)
-
- return objectValue(call.runtime.newArrayOf(valueArray))
-}
-
-func builtinArraySlice(call FunctionCall) Value {
- thisObject := call.thisObject()
-
- length := int64(toUint32(thisObject.get(propertyLength)))
- start, end := rangeStartEnd(call.ArgumentList, length, false)
-
- if start >= end {
- // Always an empty array
- return objectValue(call.runtime.newArray(0))
- }
- sliceLength := end - start
- sliceValueArray := make([]Value, sliceLength)
-
- for index := int64(0); index < sliceLength; index++ {
- from := arrayIndexToString(index + start)
- if thisObject.hasProperty(from) {
- sliceValueArray[index] = thisObject.get(from)
- }
- }
-
- return objectValue(call.runtime.newArrayOf(sliceValueArray))
-}
-
-func builtinArrayUnshift(call FunctionCall) Value {
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
- itemList := call.ArgumentList
- itemCount := int64(len(itemList))
-
- for index := length; index > 0; index-- {
- from := arrayIndexToString(index - 1)
- to := arrayIndexToString(index + itemCount - 1)
- if thisObject.hasProperty(from) {
- thisObject.put(to, thisObject.get(from), true)
- } else {
- thisObject.delete(to, true)
- }
- }
-
- for index := int64(0); index < itemCount; index++ {
- thisObject.put(arrayIndexToString(index), itemList[index], true)
- }
-
- newLength := int64Value(length + itemCount)
- thisObject.put(propertyLength, newLength, true)
- return newLength
-}
-
-func builtinArrayReverse(call FunctionCall) Value {
- thisObject := call.thisObject()
- length := int64(toUint32(thisObject.get(propertyLength)))
-
- lower := struct {
- name string
- index int64
- exists bool
- }{}
- upper := lower
-
- lower.index = 0
- middle := length / 2 // Division will floor
-
- for lower.index != middle {
- lower.name = arrayIndexToString(lower.index)
- upper.index = length - lower.index - 1
- upper.name = arrayIndexToString(upper.index)
-
- lower.exists = thisObject.hasProperty(lower.name)
- upper.exists = thisObject.hasProperty(upper.name)
-
- switch {
- case lower.exists && upper.exists:
- lowerValue := thisObject.get(lower.name)
- upperValue := thisObject.get(upper.name)
- thisObject.put(lower.name, upperValue, true)
- thisObject.put(upper.name, lowerValue, true)
- case !lower.exists && upper.exists:
- value := thisObject.get(upper.name)
- thisObject.delete(upper.name, true)
- thisObject.put(lower.name, value, true)
- case lower.exists && !upper.exists:
- value := thisObject.get(lower.name)
- thisObject.delete(lower.name, true)
- thisObject.put(upper.name, value, true)
- }
-
- lower.index++
- }
-
- return call.This
-}
-
-func sortCompare(thisObject *object, index0, index1 uint, compare *object) int {
- j := struct {
- name string
- exists bool
- defined bool
- value string
- }{}
- k := j
- j.name = arrayIndexToString(int64(index0))
- j.exists = thisObject.hasProperty(j.name)
- k.name = arrayIndexToString(int64(index1))
- k.exists = thisObject.hasProperty(k.name)
-
- switch {
- case !j.exists && !k.exists:
- return 0
- case !j.exists:
- return 1
- case !k.exists:
- return -1
- }
-
- x := thisObject.get(j.name)
- y := thisObject.get(k.name)
- j.defined = x.IsDefined()
- k.defined = y.IsDefined()
-
- switch {
- case !j.defined && !k.defined:
- return 0
- case !j.defined:
- return 1
- case !k.defined:
- return -1
- }
-
- if compare == nil {
- j.value = x.string()
- k.value = y.string()
-
- if j.value == k.value {
- return 0
- } else if j.value < k.value {
- return -1
- }
-
- return 1
- }
-
- return toIntSign(compare.call(Value{}, []Value{x, y}, false, nativeFrame))
-}
-
-func arraySortSwap(thisObject *object, index0, index1 uint) {
- j := struct {
- name string
- exists bool
- }{}
- k := j
-
- j.name = arrayIndexToString(int64(index0))
- j.exists = thisObject.hasProperty(j.name)
- k.name = arrayIndexToString(int64(index1))
- k.exists = thisObject.hasProperty(k.name)
-
- switch {
- case j.exists && k.exists:
- jv := thisObject.get(j.name)
- kv := thisObject.get(k.name)
- thisObject.put(j.name, kv, true)
- thisObject.put(k.name, jv, true)
- case !j.exists && k.exists:
- value := thisObject.get(k.name)
- thisObject.delete(k.name, true)
- thisObject.put(j.name, value, true)
- case j.exists && !k.exists:
- value := thisObject.get(j.name)
- thisObject.delete(j.name, true)
- thisObject.put(k.name, value, true)
- }
-}
-
-func arraySortQuickPartition(thisObject *object, left, right, pivot uint, compare *object) (uint, uint) {
- arraySortSwap(thisObject, pivot, right) // Right is now the pivot value
- cursor := left
- cursor2 := left
- for index := left; index < right; index++ {
- comparison := sortCompare(thisObject, index, right, compare) // Compare to the pivot value
- if comparison < 0 {
- arraySortSwap(thisObject, index, cursor)
- if cursor < cursor2 {
- arraySortSwap(thisObject, index, cursor2)
- }
- cursor++
- cursor2++
- } else if comparison == 0 {
- arraySortSwap(thisObject, index, cursor2)
- cursor2++
- }
- }
- arraySortSwap(thisObject, cursor2, right)
- return cursor, cursor2
-}
-
-func arraySortQuickSort(thisObject *object, left, right uint, compare *object) {
- if left < right {
- middle := left + (right-left)/2
- pivot, pivot2 := arraySortQuickPartition(thisObject, left, right, middle, compare)
- if pivot > 0 {
- arraySortQuickSort(thisObject, left, pivot-1, compare)
- }
- arraySortQuickSort(thisObject, pivot2+1, right, compare)
- }
-}
-
-func builtinArraySort(call FunctionCall) Value {
- thisObject := call.thisObject()
- length := uint(toUint32(thisObject.get(propertyLength)))
- compareValue := call.Argument(0)
- compare := compareValue.object()
- if compareValue.IsUndefined() {
- } else if !compareValue.isCallable() {
- panic(call.runtime.panicTypeError("Array.sort value %q is not callable", compareValue))
- }
- if length > 1 {
- arraySortQuickSort(thisObject, 0, length-1, compare)
- }
- return call.This
-}
-
-func builtinArrayIsArray(call FunctionCall) Value {
- return boolValue(isArray(call.Argument(0).object()))
-}
-
-func builtinArrayIndexOf(call FunctionCall) Value {
- thisObject, matchValue := call.thisObject(), call.Argument(0)
- if length := int64(toUint32(thisObject.get(propertyLength))); length > 0 {
- index := int64(0)
- if len(call.ArgumentList) > 1 {
- index = call.Argument(1).number().int64
- }
- if index < 0 {
- if index += length; index < 0 {
- index = 0
- }
- } else if index >= length {
- index = -1
- }
- for ; index >= 0 && index < length; index++ {
- name := arrayIndexToString(index)
- if !thisObject.hasProperty(name) {
- continue
- }
- value := thisObject.get(name)
- if strictEqualityComparison(matchValue, value) {
- return uint32Value(uint32(index))
- }
- }
- }
- return intValue(-1)
-}
-
-func builtinArrayLastIndexOf(call FunctionCall) Value {
- thisObject, matchValue := call.thisObject(), call.Argument(0)
- length := int64(toUint32(thisObject.get(propertyLength)))
- index := length - 1
- if len(call.ArgumentList) > 1 {
- index = call.Argument(1).number().int64
- }
- if 0 > index {
- index += length
- }
- if index > length {
- index = length - 1
- } else if 0 > index {
- return intValue(-1)
- }
- for ; index >= 0; index-- {
- name := arrayIndexToString(index)
- if !thisObject.hasProperty(name) {
- continue
- }
- value := thisObject.get(name)
- if strictEqualityComparison(matchValue, value) {
- return uint32Value(uint32(index))
- }
- }
- return intValue(-1)
-}
-
-func builtinArrayEvery(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- length := int64(toUint32(thisObject.get(propertyLength)))
- callThis := call.Argument(1)
- for index := int64(0); index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
- continue
- }
- return falseValue
- }
- }
- return trueValue
- }
- panic(call.runtime.panicTypeError("Array.every argument %q is not callable", call.Argument(0)))
-}
-
-func builtinArraySome(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- length := int64(toUint32(thisObject.get(propertyLength)))
- callThis := call.Argument(1)
- for index := int64(0); index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- if value := thisObject.get(key); iterator.call(call.runtime, callThis, value, int64Value(index), this).bool() {
- return trueValue
- }
- }
- }
- return falseValue
- }
- panic(call.runtime.panicTypeError("Array.some %q if not callable", call.Argument(0)))
-}
-
-func builtinArrayForEach(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- length := int64(toUint32(thisObject.get(propertyLength)))
- callThis := call.Argument(1)
- for index := int64(0); index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- iterator.call(call.runtime, callThis, thisObject.get(key), int64Value(index), this)
- }
- }
- return Value{}
- }
- panic(call.runtime.panicTypeError("Array.foreach %q if not callable", call.Argument(0)))
-}
-
-func builtinArrayMap(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- length := int64(toUint32(thisObject.get(propertyLength)))
- callThis := call.Argument(1)
- values := make([]Value, length)
- for index := int64(0); index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- values[index] = iterator.call(call.runtime, callThis, thisObject.get(key), index, this)
- } else {
- values[index] = Value{}
- }
- }
- return objectValue(call.runtime.newArrayOf(values))
- }
- panic(call.runtime.panicTypeError("Array.foreach %q if not callable", call.Argument(0)))
-}
-
-func builtinArrayFilter(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- length := int64(toUint32(thisObject.get(propertyLength)))
- callThis := call.Argument(1)
- values := make([]Value, 0)
- for index := int64(0); index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- value := thisObject.get(key)
- if iterator.call(call.runtime, callThis, value, index, this).bool() {
- values = append(values, value)
- }
- }
- }
- return objectValue(call.runtime.newArrayOf(values))
- }
- panic(call.runtime.panicTypeError("Array.filter %q if not callable", call.Argument(0)))
-}
-
-func builtinArrayReduce(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- initial := len(call.ArgumentList) > 1
- start := call.Argument(1)
- length := int64(toUint32(thisObject.get(propertyLength)))
- index := int64(0)
- if length > 0 || initial {
- var accumulator Value
- if !initial {
- for ; index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- accumulator = thisObject.get(key)
- index++
-
- break
- }
- }
- } else {
- accumulator = start
- }
- for ; index < length; index++ {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- accumulator = iterator.call(call.runtime, Value{}, accumulator, thisObject.get(key), index, this)
- }
- }
- return accumulator
- }
- }
- panic(call.runtime.panicTypeError("Array.reduce %q if not callable", call.Argument(0)))
-}
-
-func builtinArrayReduceRight(call FunctionCall) Value {
- thisObject := call.thisObject()
- this := objectValue(thisObject)
- if iterator := call.Argument(0); iterator.isCallable() {
- initial := len(call.ArgumentList) > 1
- start := call.Argument(1)
- length := int64(toUint32(thisObject.get(propertyLength)))
- if length > 0 || initial {
- index := length - 1
- var accumulator Value
- if !initial {
- for ; index >= 0; index-- {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- accumulator = thisObject.get(key)
- index--
- break
- }
- }
- } else {
- accumulator = start
- }
- for ; index >= 0; index-- {
- if key := arrayIndexToString(index); thisObject.hasProperty(key) {
- accumulator = iterator.call(call.runtime, Value{}, accumulator, thisObject.get(key), key, this)
- }
- }
- return accumulator
- }
- }
- panic(call.runtime.panicTypeError("Array.reduceRight %q if not callable", call.Argument(0)))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_boolean.go b/vendor/github.com/robertkrimen/otto/builtin_boolean.go
deleted file mode 100644
index 54f0202..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_boolean.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package otto
-
-// Boolean
-
-func builtinBoolean(call FunctionCall) Value {
- return boolValue(call.Argument(0).bool())
-}
-
-func builtinNewBoolean(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newBoolean(valueOfArrayIndex(argumentList, 0)))
-}
-
-func builtinBooleanToString(call FunctionCall) Value {
- value := call.This
- if !value.IsBoolean() {
- // Will throw a TypeError if ThisObject is not a Boolean
- value = call.thisClassObject(classBooleanName).primitiveValue()
- }
- return stringValue(value.string())
-}
-
-func builtinBooleanValueOf(call FunctionCall) Value {
- value := call.This
- if !value.IsBoolean() {
- value = call.thisClassObject(classBooleanName).primitiveValue()
- }
- return value
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_date.go b/vendor/github.com/robertkrimen/otto/builtin_date.go
deleted file mode 100644
index e2e3c0b..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_date.go
+++ /dev/null
@@ -1,619 +0,0 @@
-package otto
-
-import (
- "math"
- "time"
-)
-
-// Date
-
-const (
- // TODO Be like V8?
- // builtinDateDateTimeLayout = "Mon Jan 2 2006 15:04:05 GMT-0700 (MST)".
- builtinDateDateTimeLayout = time.RFC1123 // "Mon, 02 Jan 2006 15:04:05 MST"
- builtinDateDateLayout = "Mon, 02 Jan 2006"
- builtinDateTimeLayout = "15:04:05 MST"
-)
-
-// utcTimeZone is the time zone used for UTC calculations.
-// It is GMT not UTC as that's what Javascript does because toUTCString is
-// actually an alias to toGMTString.
-var utcTimeZone = time.FixedZone("GMT", 0)
-
-func builtinDate(call FunctionCall) Value {
- date := &dateObject{}
- date.Set(newDateTime([]Value{}, time.Local)) //nolint: gosmopolitan
- return stringValue(date.Time().Format(builtinDateDateTimeLayout))
-}
-
-func builtinNewDate(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newDate(newDateTime(argumentList, time.Local))) //nolint: gosmopolitan
-}
-
-func builtinDateToString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Local().Format(builtinDateDateTimeLayout)) //nolint: gosmopolitan
-}
-
-func builtinDateToDateString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Local().Format(builtinDateDateLayout)) //nolint: gosmopolitan
-}
-
-func builtinDateToTimeString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Local().Format(builtinDateTimeLayout)) //nolint: gosmopolitan
-}
-
-func builtinDateToUTCString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().In(utcTimeZone).Format(builtinDateDateTimeLayout))
-}
-
-func builtinDateToISOString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Format("2006-01-02T15:04:05.000Z"))
-}
-
-func builtinDateToJSON(call FunctionCall) Value {
- obj := call.thisObject()
- value := obj.DefaultValue(defaultValueHintNumber) // FIXME object.primitiveNumberValue
- // FIXME fv.isFinite
- if fv := value.float64(); math.IsNaN(fv) || math.IsInf(fv, 0) {
- return nullValue
- }
-
- toISOString := obj.get("toISOString")
- if !toISOString.isCallable() {
- // FIXME
- panic(call.runtime.panicTypeError("Date.toJSON toISOString %q is not callable", toISOString))
- }
- return toISOString.call(call.runtime, objectValue(obj), []Value{})
-}
-
-func builtinDateToGMTString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Format("Mon, 02 Jan 2006 15:04:05 GMT"))
-}
-
-func builtinDateGetTime(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- // We do this (convert away from a float) so the user
- // does not get something back in exponential notation
- return int64Value(date.Epoch())
-}
-
-func builtinDateSetTime(call FunctionCall) Value {
- obj := call.thisObject()
- date := dateObjectOf(call.runtime, call.thisObject())
- date.Set(call.Argument(0).float64())
- obj.value = date
- return date.Value()
-}
-
-func builtinDateBeforeSet(call FunctionCall, argumentLimit int, timeLocal bool) (*object, *dateObject, *ecmaTime, []int) {
- obj := call.thisObject()
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return nil, nil, nil, nil
- }
-
- if argumentLimit > len(call.ArgumentList) {
- argumentLimit = len(call.ArgumentList)
- }
-
- if argumentLimit == 0 {
- obj.value = invalidDateObject
- return nil, nil, nil, nil
- }
-
- valueList := make([]int, argumentLimit)
- for index := 0; index < argumentLimit; index++ {
- value := call.ArgumentList[index]
- nm := value.number()
- switch nm.kind {
- case numberInteger, numberFloat:
- default:
- obj.value = invalidDateObject
- return nil, nil, nil, nil
- }
- valueList[index] = int(nm.int64)
- }
- baseTime := date.Time()
- if timeLocal {
- baseTime = baseTime.Local() //nolint: gosmopolitan
- }
- ecmaTime := newEcmaTime(baseTime)
- return obj, &date, &ecmaTime, valueList
-}
-
-func builtinDateParse(call FunctionCall) Value {
- date := call.Argument(0).string()
- return float64Value(dateParse(date))
-}
-
-func builtinDateUTC(call FunctionCall) Value {
- return float64Value(newDateTime(call.ArgumentList, time.UTC))
-}
-
-func builtinDateNow(call FunctionCall) Value {
- call.ArgumentList = []Value(nil)
- return builtinDateUTC(call)
-}
-
-// This is a placeholder.
-func builtinDateToLocaleString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Local().Format("2006-01-02 15:04:05")) //nolint: gosmopolitan
-}
-
-// This is a placeholder.
-func builtinDateToLocaleDateString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Local().Format("2006-01-02")) //nolint: gosmopolitan
-}
-
-// This is a placeholder.
-func builtinDateToLocaleTimeString(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return stringValue("Invalid Date")
- }
- return stringValue(date.Time().Local().Format("15:04:05")) //nolint: gosmopolitan
-}
-
-func builtinDateValueOf(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return date.Value()
-}
-
-func builtinDateGetYear(call FunctionCall) Value {
- // Will throw a TypeError is ThisObject is nil or
- // does not have Class of "Date"
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Year() - 1900) //nolint: gosmopolitan
-}
-
-func builtinDateGetFullYear(call FunctionCall) Value {
- // Will throw a TypeError is ThisObject is nil or
- // does not have Class of "Date"
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Year()) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCFullYear(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Year())
-}
-
-func builtinDateGetMonth(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(dateFromGoMonth(date.Time().Local().Month())) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCMonth(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(dateFromGoMonth(date.Time().Month()))
-}
-
-func builtinDateGetDate(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Day()) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCDate(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Day())
-}
-
-func builtinDateGetDay(call FunctionCall) Value {
- // Actually day of the week
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(dateFromGoDay(date.Time().Local().Weekday())) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCDay(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(dateFromGoDay(date.Time().Weekday()))
-}
-
-func builtinDateGetHours(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Hour()) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCHours(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Hour())
-}
-
-func builtinDateGetMinutes(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Minute()) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCMinutes(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Minute())
-}
-
-func builtinDateGetSeconds(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Second()) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCSeconds(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Second())
-}
-
-func builtinDateGetMilliseconds(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Local().Nanosecond() / (100 * 100 * 100)) //nolint: gosmopolitan
-}
-
-func builtinDateGetUTCMilliseconds(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- return intValue(date.Time().Nanosecond() / (100 * 100 * 100))
-}
-
-func builtinDateGetTimezoneOffset(call FunctionCall) Value {
- date := dateObjectOf(call.runtime, call.thisObject())
- if date.isNaN {
- return NaNValue()
- }
- timeLocal := date.Time().Local() //nolint: gosmopolitan
- // Is this kosher?
- timeLocalAsUTC := time.Date(
- timeLocal.Year(),
- timeLocal.Month(),
- timeLocal.Day(),
- timeLocal.Hour(),
- timeLocal.Minute(),
- timeLocal.Second(),
- timeLocal.Nanosecond(),
- time.UTC,
- )
- return float64Value(date.Time().Sub(timeLocalAsUTC).Seconds() / 60)
-}
-
-func builtinDateSetMilliseconds(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- ecmaTime.millisecond = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCMilliseconds(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- ecmaTime.millisecond = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetSeconds(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 1 {
- ecmaTime.millisecond = value[1]
- }
- ecmaTime.second = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCSeconds(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 1 {
- ecmaTime.millisecond = value[1]
- }
- ecmaTime.second = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetMinutes(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 2 {
- ecmaTime.millisecond = value[2]
- ecmaTime.second = value[1]
- } else if len(value) > 1 {
- ecmaTime.second = value[1]
- }
- ecmaTime.minute = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCMinutes(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 2 {
- ecmaTime.millisecond = value[2]
- ecmaTime.second = value[1]
- } else if len(value) > 1 {
- ecmaTime.second = value[1]
- }
- ecmaTime.minute = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetHours(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 4, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- switch {
- case len(value) > 3:
- ecmaTime.millisecond = value[3]
- fallthrough
- case len(value) > 2:
- ecmaTime.second = value[2]
- fallthrough
- case len(value) > 1:
- ecmaTime.minute = value[1]
- }
- ecmaTime.hour = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCHours(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 4, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- switch {
- case len(value) > 3:
- ecmaTime.millisecond = value[3]
- fallthrough
- case len(value) > 2:
- ecmaTime.second = value[2]
- fallthrough
- case len(value) > 1:
- ecmaTime.minute = value[1]
- }
- ecmaTime.hour = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetDate(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- ecmaTime.day = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCDate(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- ecmaTime.day = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetMonth(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 1 {
- ecmaTime.day = value[1]
- }
- ecmaTime.month = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCMonth(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 2, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 1 {
- ecmaTime.day = value[1]
- }
- ecmaTime.month = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetYear(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 1, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- year := value[0]
- if 0 <= year && year <= 99 {
- year += 1900
- }
- ecmaTime.year = year
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetFullYear(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, true)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 2 {
- ecmaTime.day = value[2]
- ecmaTime.month = value[1]
- } else if len(value) > 1 {
- ecmaTime.month = value[1]
- }
- ecmaTime.year = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-func builtinDateSetUTCFullYear(call FunctionCall) Value {
- obj, date, ecmaTime, value := builtinDateBeforeSet(call, 3, false)
- if ecmaTime == nil {
- return NaNValue()
- }
-
- if len(value) > 2 {
- ecmaTime.day = value[2]
- ecmaTime.month = value[1]
- } else if len(value) > 1 {
- ecmaTime.month = value[1]
- }
- ecmaTime.year = value[0]
-
- date.SetTime(ecmaTime.goTime())
- obj.value = *date
- return date.Value()
-}
-
-// toUTCString
-// toISOString
-// toJSONString
-// toJSON
diff --git a/vendor/github.com/robertkrimen/otto/builtin_error.go b/vendor/github.com/robertkrimen/otto/builtin_error.go
deleted file mode 100644
index 9d524f5..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_error.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package otto
-
-import (
- "fmt"
-)
-
-func builtinError(call FunctionCall) Value {
- return objectValue(call.runtime.newError(classErrorName, call.Argument(0), 1))
-}
-
-func builtinNewError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newError(classErrorName, valueOfArrayIndex(argumentList, 0), 0))
-}
-
-func builtinErrorToString(call FunctionCall) Value {
- thisObject := call.thisObject()
- if thisObject == nil {
- panic(call.runtime.panicTypeError("Error.toString is nil"))
- }
-
- name := classErrorName
- nameValue := thisObject.get("name")
- if nameValue.IsDefined() {
- name = nameValue.string()
- }
-
- message := ""
- messageValue := thisObject.get("message")
- if messageValue.IsDefined() {
- message = messageValue.string()
- }
-
- if len(name) == 0 {
- return stringValue(message)
- }
-
- if len(message) == 0 {
- return stringValue(name)
- }
-
- return stringValue(fmt.Sprintf("%s: %s", name, message))
-}
-
-func (rt *runtime) newEvalError(message Value) *object {
- o := rt.newErrorObject("EvalError", message, 0)
- o.prototype = rt.global.EvalErrorPrototype
- return o
-}
-
-func builtinEvalError(call FunctionCall) Value {
- return objectValue(call.runtime.newEvalError(call.Argument(0)))
-}
-
-func builtinNewEvalError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newEvalError(valueOfArrayIndex(argumentList, 0)))
-}
-
-func (rt *runtime) newTypeError(message Value) *object {
- o := rt.newErrorObject("TypeError", message, 0)
- o.prototype = rt.global.TypeErrorPrototype
- return o
-}
-
-func builtinTypeError(call FunctionCall) Value {
- return objectValue(call.runtime.newTypeError(call.Argument(0)))
-}
-
-func builtinNewTypeError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newTypeError(valueOfArrayIndex(argumentList, 0)))
-}
-
-func (rt *runtime) newRangeError(message Value) *object {
- o := rt.newErrorObject("RangeError", message, 0)
- o.prototype = rt.global.RangeErrorPrototype
- return o
-}
-
-func builtinRangeError(call FunctionCall) Value {
- return objectValue(call.runtime.newRangeError(call.Argument(0)))
-}
-
-func builtinNewRangeError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newRangeError(valueOfArrayIndex(argumentList, 0)))
-}
-
-func (rt *runtime) newURIError(message Value) *object {
- o := rt.newErrorObject("URIError", message, 0)
- o.prototype = rt.global.URIErrorPrototype
- return o
-}
-
-func (rt *runtime) newReferenceError(message Value) *object {
- o := rt.newErrorObject("ReferenceError", message, 0)
- o.prototype = rt.global.ReferenceErrorPrototype
- return o
-}
-
-func builtinReferenceError(call FunctionCall) Value {
- return objectValue(call.runtime.newReferenceError(call.Argument(0)))
-}
-
-func builtinNewReferenceError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newReferenceError(valueOfArrayIndex(argumentList, 0)))
-}
-
-func (rt *runtime) newSyntaxError(message Value) *object {
- o := rt.newErrorObject("SyntaxError", message, 0)
- o.prototype = rt.global.SyntaxErrorPrototype
- return o
-}
-
-func builtinSyntaxError(call FunctionCall) Value {
- return objectValue(call.runtime.newSyntaxError(call.Argument(0)))
-}
-
-func builtinNewSyntaxError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newSyntaxError(valueOfArrayIndex(argumentList, 0)))
-}
-
-func builtinURIError(call FunctionCall) Value {
- return objectValue(call.runtime.newURIError(call.Argument(0)))
-}
-
-func builtinNewURIError(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newURIError(valueOfArrayIndex(argumentList, 0)))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_function.go b/vendor/github.com/robertkrimen/otto/builtin_function.go
deleted file mode 100644
index 51d2cac..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_function.go
+++ /dev/null
@@ -1,125 +0,0 @@
-package otto
-
-import (
- "fmt"
- "strings"
- "unicode"
-
- "github.com/robertkrimen/otto/parser"
-)
-
-// Function
-
-func builtinFunction(call FunctionCall) Value {
- return objectValue(builtinNewFunctionNative(call.runtime, call.ArgumentList))
-}
-
-func builtinNewFunction(obj *object, argumentList []Value) Value {
- return objectValue(builtinNewFunctionNative(obj.runtime, argumentList))
-}
-
-func argumentList2parameterList(argumentList []Value) []string {
- parameterList := make([]string, 0, len(argumentList))
- for _, value := range argumentList {
- tmp := strings.FieldsFunc(value.string(), func(chr rune) bool {
- return chr == ',' || unicode.IsSpace(chr)
- })
- parameterList = append(parameterList, tmp...)
- }
- return parameterList
-}
-
-func builtinNewFunctionNative(rt *runtime, argumentList []Value) *object {
- var parameterList, body string
- if count := len(argumentList); count > 0 {
- tmp := make([]string, 0, count-1)
- for _, value := range argumentList[0 : count-1] {
- tmp = append(tmp, value.string())
- }
- parameterList = strings.Join(tmp, ",")
- body = argumentList[count-1].string()
- }
-
- // FIXME
- function, err := parser.ParseFunction(parameterList, body)
- rt.parseThrow(err) // Will panic/throw appropriately
- cmpl := compiler{}
- cmplFunction := cmpl.parseExpression(function)
-
- return rt.newNodeFunction(cmplFunction.(*nodeFunctionLiteral), rt.globalStash)
-}
-
-func builtinFunctionToString(call FunctionCall) Value {
- obj := call.thisClassObject(classFunctionName) // Should throw a TypeError unless Function
- switch fn := obj.value.(type) {
- case nativeFunctionObject:
- return stringValue(fmt.Sprintf("function %s() { [native code] }", fn.name))
- case nodeFunctionObject:
- return stringValue(fn.node.source)
- case bindFunctionObject:
- return stringValue("function () { [native code] }")
- default:
- panic(call.runtime.panicTypeError("Function.toString unknown type %T", obj.value))
- }
-}
-
-func builtinFunctionApply(call FunctionCall) Value {
- if !call.This.isCallable() {
- panic(call.runtime.panicTypeError("Function.apply %q is not callable", call.This))
- }
- this := call.Argument(0)
- if this.IsUndefined() {
- // FIXME Not ECMA5
- this = objectValue(call.runtime.globalObject)
- }
- argumentList := call.Argument(1)
- switch argumentList.kind {
- case valueUndefined, valueNull:
- return call.thisObject().call(this, nil, false, nativeFrame)
- case valueObject:
- default:
- panic(call.runtime.panicTypeError("Function.apply unknown type %T for second argument"))
- }
-
- arrayObject := argumentList.object()
- thisObject := call.thisObject()
- length := int64(toUint32(arrayObject.get(propertyLength)))
- valueArray := make([]Value, length)
- for index := int64(0); index < length; index++ {
- valueArray[index] = arrayObject.get(arrayIndexToString(index))
- }
- return thisObject.call(this, valueArray, false, nativeFrame)
-}
-
-func builtinFunctionCall(call FunctionCall) Value {
- if !call.This.isCallable() {
- panic(call.runtime.panicTypeError("Function.call %q is not callable", call.This))
- }
- thisObject := call.thisObject()
- this := call.Argument(0)
- if this.IsUndefined() {
- // FIXME Not ECMA5
- this = objectValue(call.runtime.globalObject)
- }
- if len(call.ArgumentList) >= 1 {
- return thisObject.call(this, call.ArgumentList[1:], false, nativeFrame)
- }
- return thisObject.call(this, nil, false, nativeFrame)
-}
-
-func builtinFunctionBind(call FunctionCall) Value {
- target := call.This
- if !target.isCallable() {
- panic(call.runtime.panicTypeError("Function.bind %q is not callable", call.This))
- }
- targetObject := target.object()
-
- this := call.Argument(0)
- argumentList := call.slice(1)
- if this.IsUndefined() {
- // FIXME Do this elsewhere?
- this = objectValue(call.runtime.globalObject)
- }
-
- return objectValue(call.runtime.newBoundFunction(targetObject, this, argumentList))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_json.go b/vendor/github.com/robertkrimen/otto/builtin_json.go
deleted file mode 100644
index 960c393..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_json.go
+++ /dev/null
@@ -1,297 +0,0 @@
-package otto
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "strings"
-)
-
-type builtinJSONParseContext struct {
- call FunctionCall
- reviver Value
-}
-
-func builtinJSONParse(call FunctionCall) Value {
- ctx := builtinJSONParseContext{
- call: call,
- }
- revive := false
- if reviver := call.Argument(1); reviver.isCallable() {
- revive = true
- ctx.reviver = reviver
- }
-
- var root interface{}
- err := json.Unmarshal([]byte(call.Argument(0).string()), &root)
- if err != nil {
- panic(call.runtime.panicSyntaxError(err.Error()))
- }
- value, exists := builtinJSONParseWalk(ctx, root)
- if !exists {
- value = Value{}
- }
- if revive {
- root := ctx.call.runtime.newObject()
- root.put("", value, false)
- return builtinJSONReviveWalk(ctx, root, "")
- }
- return value
-}
-
-func builtinJSONReviveWalk(ctx builtinJSONParseContext, holder *object, name string) Value {
- value := holder.get(name)
- if obj := value.object(); obj != nil {
- if isArray(obj) {
- length := int64(objectLength(obj))
- for index := int64(0); index < length; index++ {
- name := arrayIndexToString(index)
- value := builtinJSONReviveWalk(ctx, obj, name)
- if value.IsUndefined() {
- obj.delete(name, false)
- } else {
- obj.defineProperty(name, value, 0o111, false)
- }
- }
- } else {
- obj.enumerate(false, func(name string) bool {
- value := builtinJSONReviveWalk(ctx, obj, name)
- if value.IsUndefined() {
- obj.delete(name, false)
- } else {
- obj.defineProperty(name, value, 0o111, false)
- }
- return true
- })
- }
- }
- return ctx.reviver.call(ctx.call.runtime, objectValue(holder), name, value)
-}
-
-func builtinJSONParseWalk(ctx builtinJSONParseContext, rawValue interface{}) (Value, bool) {
- switch value := rawValue.(type) {
- case nil:
- return nullValue, true
- case bool:
- return boolValue(value), true
- case string:
- return stringValue(value), true
- case float64:
- return float64Value(value), true
- case []interface{}:
- arrayValue := make([]Value, len(value))
- for index, rawValue := range value {
- if value, exists := builtinJSONParseWalk(ctx, rawValue); exists {
- arrayValue[index] = value
- }
- }
- return objectValue(ctx.call.runtime.newArrayOf(arrayValue)), true
- case map[string]interface{}:
- obj := ctx.call.runtime.newObject()
- for name, rawValue := range value {
- if value, exists := builtinJSONParseWalk(ctx, rawValue); exists {
- obj.put(name, value, false)
- }
- }
- return objectValue(obj), true
- }
- return Value{}, false
-}
-
-type builtinJSONStringifyContext struct {
- call FunctionCall
- stack []*object
- propertyList []string
- replacerFunction *Value
- gap string
-}
-
-func builtinJSONStringify(call FunctionCall) Value {
- ctx := builtinJSONStringifyContext{
- call: call,
- stack: []*object{nil},
- }
- replacer := call.Argument(1).object()
- if replacer != nil {
- if isArray(replacer) {
- length := objectLength(replacer)
- seen := map[string]bool{}
- propertyList := make([]string, length)
- length = 0
- for index := range propertyList {
- value := replacer.get(arrayIndexToString(int64(index)))
- switch value.kind {
- case valueObject:
- switch value.value.(*object).class {
- case classStringName, classNumberName:
- default:
- continue
- }
- case valueString, valueNumber:
- default:
- continue
- }
- name := value.string()
- if seen[name] {
- continue
- }
- seen[name] = true
- length++
- propertyList[index] = name
- }
- ctx.propertyList = propertyList[0:length]
- } else if replacer.class == classFunctionName {
- value := objectValue(replacer)
- ctx.replacerFunction = &value
- }
- }
- if spaceValue, exists := call.getArgument(2); exists {
- if spaceValue.kind == valueObject {
- switch spaceValue.value.(*object).class {
- case classStringName:
- spaceValue = stringValue(spaceValue.string())
- case classNumberName:
- spaceValue = spaceValue.numberValue()
- }
- }
- switch spaceValue.kind {
- case valueString:
- value := spaceValue.string()
- if len(value) > 10 {
- ctx.gap = value[0:10]
- } else {
- ctx.gap = value
- }
- case valueNumber:
- value := spaceValue.number().int64
- if value > 10 {
- value = 10
- } else if value < 0 {
- value = 0
- }
- ctx.gap = strings.Repeat(" ", int(value))
- }
- }
- holder := call.runtime.newObject()
- holder.put("", call.Argument(0), false)
- value, exists := builtinJSONStringifyWalk(ctx, "", holder)
- if !exists {
- return Value{}
- }
- valueJSON, err := json.Marshal(value)
- if err != nil {
- panic(call.runtime.panicTypeError("JSON.stringify marshal: %s", err))
- }
- if ctx.gap != "" {
- valueJSON1 := bytes.Buffer{}
- if err = json.Indent(&valueJSON1, valueJSON, "", ctx.gap); err != nil {
- panic(call.runtime.panicTypeError("JSON.stringify indent: %s", err))
- }
- valueJSON = valueJSON1.Bytes()
- }
- return stringValue(string(valueJSON))
-}
-
-func builtinJSONStringifyWalk(ctx builtinJSONStringifyContext, key string, holder *object) (interface{}, bool) {
- value := holder.get(key)
-
- if value.IsObject() {
- obj := value.object()
- if toJSON := obj.get("toJSON"); toJSON.IsFunction() {
- value = toJSON.call(ctx.call.runtime, value, key)
- } else if obj.objectClass.marshalJSON != nil {
- // If the object is a GoStruct or something that implements json.Marshaler
- marshaler := obj.objectClass.marshalJSON(obj)
- if marshaler != nil {
- return marshaler, true
- }
- }
- }
-
- if ctx.replacerFunction != nil {
- value = ctx.replacerFunction.call(ctx.call.runtime, objectValue(holder), key, value)
- }
-
- if value.kind == valueObject {
- switch value.value.(*object).class {
- case classBooleanName:
- value = value.object().value.(Value)
- case classStringName:
- value = stringValue(value.string())
- case classNumberName:
- value = value.numberValue()
- }
- }
-
- switch value.kind {
- case valueBoolean:
- return value.bool(), true
- case valueString:
- return value.string(), true
- case valueNumber:
- integer := value.number()
- switch integer.kind {
- case numberInteger:
- return integer.int64, true
- case numberFloat:
- return integer.float64, true
- default:
- return nil, true
- }
- case valueNull:
- return nil, true
- case valueObject:
- holder := value.object()
- if value := value.object(); nil != value {
- for _, obj := range ctx.stack {
- if holder == obj {
- panic(ctx.call.runtime.panicTypeError("Converting circular structure to JSON"))
- }
- }
- ctx.stack = append(ctx.stack, value)
- defer func() { ctx.stack = ctx.stack[:len(ctx.stack)-1] }()
- }
- if isArray(holder) {
- var length uint32
- switch value := holder.get(propertyLength).value.(type) {
- case uint32:
- length = value
- case int:
- if value >= 0 {
- length = uint32(value)
- }
- default:
- panic(ctx.call.runtime.panicTypeError(fmt.Sprintf("JSON.stringify: invalid length: %v (%[1]T)", value)))
- }
- array := make([]interface{}, length)
- for index := range array {
- name := arrayIndexToString(int64(index))
- value, _ := builtinJSONStringifyWalk(ctx, name, holder)
- array[index] = value
- }
- return array, true
- } else if holder.class != classFunctionName {
- obj := map[string]interface{}{}
- if ctx.propertyList != nil {
- for _, name := range ctx.propertyList {
- value, exists := builtinJSONStringifyWalk(ctx, name, holder)
- if exists {
- obj[name] = value
- }
- }
- } else {
- // Go maps are without order, so this doesn't conform to the ECMA ordering
- // standard, but oh well...
- holder.enumerate(false, func(name string) bool {
- value, exists := builtinJSONStringifyWalk(ctx, name, holder)
- if exists {
- obj[name] = value
- }
- return true
- })
- }
- return obj, true
- }
- }
- return nil, false
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_math.go b/vendor/github.com/robertkrimen/otto/builtin_math.go
deleted file mode 100644
index ac62d8c..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_math.go
+++ /dev/null
@@ -1,211 +0,0 @@
-package otto
-
-import (
- "math"
- "math/rand"
-)
-
-// Math
-
-func builtinMathAbs(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Abs(number))
-}
-
-func builtinMathAcos(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Acos(number))
-}
-
-func builtinMathAcosh(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Acosh(number))
-}
-
-func builtinMathAsin(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Asin(number))
-}
-
-func builtinMathAsinh(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Asinh(number))
-}
-
-func builtinMathAtan(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Atan(number))
-}
-
-func builtinMathAtan2(call FunctionCall) Value {
- y := call.Argument(0).float64()
- if math.IsNaN(y) {
- return NaNValue()
- }
- x := call.Argument(1).float64()
- if math.IsNaN(x) {
- return NaNValue()
- }
- return float64Value(math.Atan2(y, x))
-}
-
-func builtinMathAtanh(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Atanh(number))
-}
-
-func builtinMathCbrt(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Cbrt(number))
-}
-
-func builtinMathCos(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Cos(number))
-}
-
-func builtinMathCeil(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Ceil(number))
-}
-
-func builtinMathCosh(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Cosh(number))
-}
-
-func builtinMathExp(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Exp(number))
-}
-
-func builtinMathExpm1(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Expm1(number))
-}
-
-func builtinMathFloor(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Floor(number))
-}
-
-func builtinMathLog(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Log(number))
-}
-
-func builtinMathLog10(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Log10(number))
-}
-
-func builtinMathLog1p(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Log1p(number))
-}
-
-func builtinMathLog2(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Log2(number))
-}
-
-func builtinMathMax(call FunctionCall) Value {
- switch len(call.ArgumentList) {
- case 0:
- return negativeInfinityValue()
- case 1:
- return float64Value(call.ArgumentList[0].float64())
- }
- result := call.ArgumentList[0].float64()
- if math.IsNaN(result) {
- return NaNValue()
- }
- for _, value := range call.ArgumentList[1:] {
- value := value.float64()
- if math.IsNaN(value) {
- return NaNValue()
- }
- result = math.Max(result, value)
- }
- return float64Value(result)
-}
-
-func builtinMathMin(call FunctionCall) Value {
- switch len(call.ArgumentList) {
- case 0:
- return positiveInfinityValue()
- case 1:
- return float64Value(call.ArgumentList[0].float64())
- }
- result := call.ArgumentList[0].float64()
- if math.IsNaN(result) {
- return NaNValue()
- }
- for _, value := range call.ArgumentList[1:] {
- value := value.float64()
- if math.IsNaN(value) {
- return NaNValue()
- }
- result = math.Min(result, value)
- }
- return float64Value(result)
-}
-
-func builtinMathPow(call FunctionCall) Value {
- // TODO Make sure this works according to the specification (15.8.2.13)
- x := call.Argument(0).float64()
- y := call.Argument(1).float64()
- if math.Abs(x) == 1 && math.IsInf(y, 0) {
- return NaNValue()
- }
- return float64Value(math.Pow(x, y))
-}
-
-func builtinMathRandom(call FunctionCall) Value {
- var v float64
- if call.runtime.random != nil {
- v = call.runtime.random()
- } else {
- v = rand.Float64() //nolint: gosec
- }
- return float64Value(v)
-}
-
-func builtinMathRound(call FunctionCall) Value {
- number := call.Argument(0).float64()
- value := math.Floor(number + 0.5)
- if value == 0 {
- value = math.Copysign(0, number)
- }
- return float64Value(value)
-}
-
-func builtinMathSin(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Sin(number))
-}
-
-func builtinMathSinh(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Sinh(number))
-}
-
-func builtinMathSqrt(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Sqrt(number))
-}
-
-func builtinMathTan(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Tan(number))
-}
-
-func builtinMathTanh(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Tanh(number))
-}
-
-func builtinMathTrunc(call FunctionCall) Value {
- number := call.Argument(0).float64()
- return float64Value(math.Trunc(number))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_number.go b/vendor/github.com/robertkrimen/otto/builtin_number.go
deleted file mode 100644
index acdeb50..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_number.go
+++ /dev/null
@@ -1,111 +0,0 @@
-package otto
-
-import (
- "math"
- "strconv"
-
- "golang.org/x/text/language"
- "golang.org/x/text/message"
- "golang.org/x/text/number"
-)
-
-// Number
-
-func numberValueFromNumberArgumentList(argumentList []Value) Value {
- if len(argumentList) > 0 {
- return argumentList[0].numberValue()
- }
- return intValue(0)
-}
-
-func builtinNumber(call FunctionCall) Value {
- return numberValueFromNumberArgumentList(call.ArgumentList)
-}
-
-func builtinNewNumber(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newNumber(numberValueFromNumberArgumentList(argumentList)))
-}
-
-func builtinNumberToString(call FunctionCall) Value {
- // Will throw a TypeError if ThisObject is not a Number
- value := call.thisClassObject(classNumberName).primitiveValue()
- radix := 10
- radixArgument := call.Argument(0)
- if radixArgument.IsDefined() {
- integer := toIntegerFloat(radixArgument)
- if integer < 2 || integer > 36 {
- panic(call.runtime.panicRangeError("toString() radix must be between 2 and 36"))
- }
- radix = int(integer)
- }
- if radix == 10 {
- return stringValue(value.string())
- }
- return stringValue(numberToStringRadix(value, radix))
-}
-
-func builtinNumberValueOf(call FunctionCall) Value {
- return call.thisClassObject(classNumberName).primitiveValue()
-}
-
-func builtinNumberToFixed(call FunctionCall) Value {
- precision := toIntegerFloat(call.Argument(0))
- if 20 < precision || 0 > precision {
- panic(call.runtime.panicRangeError("toFixed() precision must be between 0 and 20"))
- }
- if call.This.IsNaN() {
- return stringValue("NaN")
- }
- if value := call.This.float64(); math.Abs(value) >= 1e21 {
- return stringValue(floatToString(value, 64))
- }
- return stringValue(strconv.FormatFloat(call.This.float64(), 'f', int(precision), 64))
-}
-
-func builtinNumberToExponential(call FunctionCall) Value {
- if call.This.IsNaN() {
- return stringValue("NaN")
- }
- precision := float64(-1)
- if value := call.Argument(0); value.IsDefined() {
- precision = toIntegerFloat(value)
- if 0 > precision {
- panic(call.runtime.panicRangeError("toString() radix must be between 2 and 36"))
- }
- }
- return stringValue(strconv.FormatFloat(call.This.float64(), 'e', int(precision), 64))
-}
-
-func builtinNumberToPrecision(call FunctionCall) Value {
- if call.This.IsNaN() {
- return stringValue("NaN")
- }
- value := call.Argument(0)
- if value.IsUndefined() {
- return stringValue(call.This.string())
- }
- precision := toIntegerFloat(value)
- if 1 > precision {
- panic(call.runtime.panicRangeError("toPrecision() precision must be greater than 1"))
- }
- return stringValue(strconv.FormatFloat(call.This.float64(), 'g', int(precision), 64))
-}
-
-func builtinNumberIsNaN(call FunctionCall) Value {
- if len(call.ArgumentList) < 1 {
- return boolValue(false)
- }
- return boolValue(call.Argument(0).IsNaN())
-}
-
-func builtinNumberToLocaleString(call FunctionCall) Value {
- value := call.thisClassObject(classNumberName).primitiveValue()
- locale := call.Argument(0)
- lang := defaultLanguage
- if locale.IsDefined() {
- lang = language.MustParse(locale.string())
- }
-
- p := message.NewPrinter(lang)
- return stringValue(p.Sprintf("%v", number.Decimal(value.value)))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_object.go b/vendor/github.com/robertkrimen/otto/builtin_object.go
deleted file mode 100644
index 029a75f..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_object.go
+++ /dev/null
@@ -1,289 +0,0 @@
-package otto
-
-import (
- "fmt"
-)
-
-// Object
-
-func builtinObject(call FunctionCall) Value {
- value := call.Argument(0)
- switch value.kind {
- case valueUndefined, valueNull:
- return objectValue(call.runtime.newObject())
- }
-
- return objectValue(call.runtime.toObject(value))
-}
-
-func builtinNewObject(obj *object, argumentList []Value) Value {
- value := valueOfArrayIndex(argumentList, 0)
- switch value.kind {
- case valueNull, valueUndefined:
- case valueNumber, valueString, valueBoolean:
- return objectValue(obj.runtime.toObject(value))
- case valueObject:
- return value
- default:
- }
- return objectValue(obj.runtime.newObject())
-}
-
-func builtinObjectValueOf(call FunctionCall) Value {
- return objectValue(call.thisObject())
-}
-
-func builtinObjectHasOwnProperty(call FunctionCall) Value {
- propertyName := call.Argument(0).string()
- thisObject := call.thisObject()
- return boolValue(thisObject.hasOwnProperty(propertyName))
-}
-
-func builtinObjectIsPrototypeOf(call FunctionCall) Value {
- value := call.Argument(0)
- if !value.IsObject() {
- return falseValue
- }
- prototype := call.toObject(value).prototype
- thisObject := call.thisObject()
- for prototype != nil {
- if thisObject == prototype {
- return trueValue
- }
- prototype = prototype.prototype
- }
- return falseValue
-}
-
-func builtinObjectPropertyIsEnumerable(call FunctionCall) Value {
- propertyName := call.Argument(0).string()
- thisObject := call.thisObject()
- prop := thisObject.getOwnProperty(propertyName)
- if prop != nil && prop.enumerable() {
- return trueValue
- }
- return falseValue
-}
-
-func builtinObjectToString(call FunctionCall) Value {
- var result string
- switch {
- case call.This.IsUndefined():
- result = "[object Undefined]"
- case call.This.IsNull():
- result = "[object Null]"
- default:
- result = fmt.Sprintf("[object %s]", call.thisObject().class)
- }
- return stringValue(result)
-}
-
-func builtinObjectToLocaleString(call FunctionCall) Value {
- toString := call.thisObject().get("toString")
- if !toString.isCallable() {
- panic(call.runtime.panicTypeError("Object.toLocaleString %q is not callable", toString))
- }
- return toString.call(call.runtime, call.This)
-}
-
-func builtinObjectGetPrototypeOf(call FunctionCall) Value {
- val := call.Argument(0)
- obj := val.object()
- if obj == nil {
- panic(call.runtime.panicTypeError("Object.GetPrototypeOf is nil"))
- }
-
- if obj.prototype == nil {
- return nullValue
- }
-
- return objectValue(obj.prototype)
-}
-
-func builtinObjectGetOwnPropertyDescriptor(call FunctionCall) Value {
- val := call.Argument(0)
- obj := val.object()
- if obj == nil {
- panic(call.runtime.panicTypeError("Object.GetOwnPropertyDescriptor is nil"))
- }
-
- name := call.Argument(1).string()
- descriptor := obj.getOwnProperty(name)
- if descriptor == nil {
- return Value{}
- }
- return objectValue(call.runtime.fromPropertyDescriptor(*descriptor))
-}
-
-func builtinObjectDefineProperty(call FunctionCall) Value {
- val := call.Argument(0)
- obj := val.object()
- if obj == nil {
- panic(call.runtime.panicTypeError("Object.DefineProperty is nil"))
- }
- name := call.Argument(1).string()
- descriptor := toPropertyDescriptor(call.runtime, call.Argument(2))
- obj.defineOwnProperty(name, descriptor, true)
- return val
-}
-
-func builtinObjectDefineProperties(call FunctionCall) Value {
- val := call.Argument(0)
- obj := val.object()
- if obj == nil {
- panic(call.runtime.panicTypeError("Object.DefineProperties is nil"))
- }
-
- properties := call.runtime.toObject(call.Argument(1))
- properties.enumerate(false, func(name string) bool {
- descriptor := toPropertyDescriptor(call.runtime, properties.get(name))
- obj.defineOwnProperty(name, descriptor, true)
- return true
- })
-
- return val
-}
-
-func builtinObjectCreate(call FunctionCall) Value {
- prototypeValue := call.Argument(0)
- if !prototypeValue.IsNull() && !prototypeValue.IsObject() {
- panic(call.runtime.panicTypeError("Object.Create is nil"))
- }
-
- obj := call.runtime.newObject()
- obj.prototype = prototypeValue.object()
-
- propertiesValue := call.Argument(1)
- if propertiesValue.IsDefined() {
- properties := call.runtime.toObject(propertiesValue)
- properties.enumerate(false, func(name string) bool {
- descriptor := toPropertyDescriptor(call.runtime, properties.get(name))
- obj.defineOwnProperty(name, descriptor, true)
- return true
- })
- }
-
- return objectValue(obj)
-}
-
-func builtinObjectIsExtensible(call FunctionCall) Value {
- val := call.Argument(0)
- if obj := val.object(); obj != nil {
- return boolValue(obj.extensible)
- }
- panic(call.runtime.panicTypeError("Object.IsExtensible is nil"))
-}
-
-func builtinObjectPreventExtensions(call FunctionCall) Value {
- val := call.Argument(0)
- if obj := val.object(); obj != nil {
- obj.extensible = false
- return val
- }
- panic(call.runtime.panicTypeError("Object.PreventExtensions is nil"))
-}
-
-func builtinObjectIsSealed(call FunctionCall) Value {
- val := call.Argument(0)
- if obj := val.object(); obj != nil {
- if obj.extensible {
- return boolValue(false)
- }
- result := true
- obj.enumerate(true, func(name string) bool {
- prop := obj.getProperty(name)
- if prop.configurable() {
- result = false
- }
- return true
- })
- return boolValue(result)
- }
- panic(call.runtime.panicTypeError("Object.IsSealed is nil"))
-}
-
-func builtinObjectSeal(call FunctionCall) Value {
- val := call.Argument(0)
- if obj := val.object(); obj != nil {
- obj.enumerate(true, func(name string) bool {
- if prop := obj.getOwnProperty(name); nil != prop && prop.configurable() {
- prop.configureOff()
- obj.defineOwnProperty(name, *prop, true)
- }
- return true
- })
- obj.extensible = false
- return val
- }
- panic(call.runtime.panicTypeError("Object.Seal is nil"))
-}
-
-func builtinObjectIsFrozen(call FunctionCall) Value {
- val := call.Argument(0)
- if obj := val.object(); obj != nil {
- if obj.extensible {
- return boolValue(false)
- }
- result := true
- obj.enumerate(true, func(name string) bool {
- prop := obj.getProperty(name)
- if prop.configurable() || prop.writable() {
- result = false
- }
- return true
- })
- return boolValue(result)
- }
- panic(call.runtime.panicTypeError("Object.IsFrozen is nil"))
-}
-
-func builtinObjectFreeze(call FunctionCall) Value {
- val := call.Argument(0)
- if obj := val.object(); obj != nil {
- obj.enumerate(true, func(name string) bool {
- if prop, update := obj.getOwnProperty(name), false; nil != prop {
- if prop.isDataDescriptor() && prop.writable() {
- prop.writeOff()
- update = true
- }
- if prop.configurable() {
- prop.configureOff()
- update = true
- }
- if update {
- obj.defineOwnProperty(name, *prop, true)
- }
- }
- return true
- })
- obj.extensible = false
- return val
- }
- panic(call.runtime.panicTypeError("Object.Freeze is nil"))
-}
-
-func builtinObjectKeys(call FunctionCall) Value {
- if obj, keys := call.Argument(0).object(), []Value(nil); nil != obj {
- obj.enumerate(false, func(name string) bool {
- keys = append(keys, stringValue(name))
- return true
- })
- return objectValue(call.runtime.newArrayOf(keys))
- }
- panic(call.runtime.panicTypeError("Object.Keys is nil"))
-}
-
-func builtinObjectGetOwnPropertyNames(call FunctionCall) Value {
- if obj, propertyNames := call.Argument(0).object(), []Value(nil); nil != obj {
- obj.enumerate(true, func(name string) bool {
- if obj.hasOwnProperty(name) {
- propertyNames = append(propertyNames, stringValue(name))
- }
- return true
- })
- return objectValue(call.runtime.newArrayOf(propertyNames))
- }
-
- // Default to empty array for non object types.
- return objectValue(call.runtime.newArray(0))
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_regexp.go b/vendor/github.com/robertkrimen/otto/builtin_regexp.go
deleted file mode 100644
index 0430344..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_regexp.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package otto
-
-import (
- "fmt"
-)
-
-// RegExp
-
-func builtinRegExp(call FunctionCall) Value {
- pattern := call.Argument(0)
- flags := call.Argument(1)
- if obj := pattern.object(); obj != nil {
- if obj.class == classRegExpName && flags.IsUndefined() {
- return pattern
- }
- }
- return objectValue(call.runtime.newRegExp(pattern, flags))
-}
-
-func builtinNewRegExp(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newRegExp(
- valueOfArrayIndex(argumentList, 0),
- valueOfArrayIndex(argumentList, 1),
- ))
-}
-
-func builtinRegExpToString(call FunctionCall) Value {
- thisObject := call.thisObject()
- source := thisObject.get("source").string()
- flags := []byte{}
- if thisObject.get("global").bool() {
- flags = append(flags, 'g')
- }
- if thisObject.get("ignoreCase").bool() {
- flags = append(flags, 'i')
- }
- if thisObject.get("multiline").bool() {
- flags = append(flags, 'm')
- }
- return stringValue(fmt.Sprintf("/%s/%s", source, flags))
-}
-
-func builtinRegExpExec(call FunctionCall) Value {
- thisObject := call.thisObject()
- target := call.Argument(0).string()
- match, result := execRegExp(thisObject, target)
- if !match {
- return nullValue
- }
- return objectValue(execResultToArray(call.runtime, target, result))
-}
-
-func builtinRegExpTest(call FunctionCall) Value {
- thisObject := call.thisObject()
- target := call.Argument(0).string()
- match, result := execRegExp(thisObject, target)
-
- if !match {
- return boolValue(match)
- }
-
- // Match extract and assign input, $_ and $1 -> $9 on global RegExp.
- input := stringValue(target)
- call.runtime.global.RegExp.defineProperty("$_", input, 0o100, false)
- call.runtime.global.RegExp.defineProperty("input", input, 0o100, false)
-
- var start int
- n := 1
- re := call.runtime.global.RegExp
- empty := stringValue("")
- for i, v := range result[2:] {
- if i%2 == 0 {
- start = v
- } else {
- if v == -1 {
- // No match for this part.
- re.defineProperty(fmt.Sprintf("$%d", n), empty, 0o100, false)
- } else {
- re.defineProperty(fmt.Sprintf("$%d", n), stringValue(target[start:v]), 0o100, false)
- }
- n++
- if n == 10 {
- break
- }
- }
- }
-
- if n <= 9 {
- // Erase remaining.
- for i := n; i <= 9; i++ {
- re.defineProperty(fmt.Sprintf("$%d", i), empty, 0o100, false)
- }
- }
-
- return boolValue(match)
-}
-
-func builtinRegExpCompile(call FunctionCall) Value {
- // This (useless) function is deprecated, but is here to provide some
- // semblance of compatibility.
- // Caveat emptor: it may not be around for long.
- return Value{}
-}
diff --git a/vendor/github.com/robertkrimen/otto/builtin_string.go b/vendor/github.com/robertkrimen/otto/builtin_string.go
deleted file mode 100644
index 5b0f927..0000000
--- a/vendor/github.com/robertkrimen/otto/builtin_string.go
+++ /dev/null
@@ -1,508 +0,0 @@
-package otto
-
-import (
- "bytes"
- "regexp"
- "strconv"
- "strings"
- "unicode/utf16"
- "unicode/utf8"
-)
-
-// String
-
-func stringValueFromStringArgumentList(argumentList []Value) Value {
- if len(argumentList) > 0 {
- return stringValue(argumentList[0].string())
- }
- return stringValue("")
-}
-
-func builtinString(call FunctionCall) Value {
- return stringValueFromStringArgumentList(call.ArgumentList)
-}
-
-func builtinNewString(obj *object, argumentList []Value) Value {
- return objectValue(obj.runtime.newString(stringValueFromStringArgumentList(argumentList)))
-}
-
-func builtinStringToString(call FunctionCall) Value {
- return call.thisClassObject(classStringName).primitiveValue()
-}
-
-func builtinStringValueOf(call FunctionCall) Value {
- return call.thisClassObject(classStringName).primitiveValue()
-}
-
-func builtinStringFromCharCode(call FunctionCall) Value {
- chrList := make([]uint16, len(call.ArgumentList))
- for index, value := range call.ArgumentList {
- chrList[index] = toUint16(value)
- }
- return string16Value(chrList)
-}
-
-func builtinStringCharAt(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- idx := int(call.Argument(0).number().int64)
- chr := stringAt(call.This.object().stringValue(), idx)
- if chr == utf8.RuneError {
- return stringValue("")
- }
- return stringValue(string(chr))
-}
-
-func builtinStringCharCodeAt(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- idx := int(call.Argument(0).number().int64)
- chr := stringAt(call.This.object().stringValue(), idx)
- if chr == utf8.RuneError {
- return NaNValue()
- }
- return uint16Value(uint16(chr))
-}
-
-func builtinStringConcat(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- var value bytes.Buffer
- value.WriteString(call.This.string())
- for _, item := range call.ArgumentList {
- value.WriteString(item.string())
- }
- return stringValue(value.String())
-}
-
-func lastIndexRune(s, substr string) int {
- if i := strings.LastIndex(s, substr); i >= 0 {
- return utf16Length(s[:i])
- }
- return -1
-}
-
-func indexRune(s, substr string) int {
- if i := strings.Index(s, substr); i >= 0 {
- return utf16Length(s[:i])
- }
- return -1
-}
-
-func utf16Length(s string) int {
- return len(utf16.Encode([]rune(s)))
-}
-
-func builtinStringIndexOf(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- value := call.This.string()
- target := call.Argument(0).string()
- if 2 > len(call.ArgumentList) {
- return intValue(indexRune(value, target))
- }
- start := toIntegerFloat(call.Argument(1))
- if 0 > start {
- start = 0
- } else if start >= float64(len(value)) {
- if target == "" {
- return intValue(len(value))
- }
- return intValue(-1)
- }
- index := indexRune(value[int(start):], target)
- if index >= 0 {
- index += int(start)
- }
- return intValue(index)
-}
-
-func builtinStringLastIndexOf(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- value := call.This.string()
- target := call.Argument(0).string()
- if 2 > len(call.ArgumentList) || call.ArgumentList[1].IsUndefined() {
- return intValue(lastIndexRune(value, target))
- }
- length := len(value)
- if length == 0 {
- return intValue(lastIndexRune(value, target))
- }
- start := call.ArgumentList[1].number()
- if start.kind == numberInfinity { // FIXME
- // startNumber is infinity, so start is the end of string (start = length)
- return intValue(lastIndexRune(value, target))
- }
- if 0 > start.int64 {
- start.int64 = 0
- }
- end := int(start.int64) + len(target)
- if end > length {
- end = length
- }
- return intValue(lastIndexRune(value[:end], target))
-}
-
-func builtinStringMatch(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := call.This.string()
- matcherValue := call.Argument(0)
- matcher := matcherValue.object()
- if !matcherValue.IsObject() || matcher.class != classRegExpName {
- matcher = call.runtime.newRegExp(matcherValue, Value{})
- }
- global := matcher.get("global").bool()
- if !global {
- match, result := execRegExp(matcher, target)
- if !match {
- return nullValue
- }
- return objectValue(execResultToArray(call.runtime, target, result))
- }
-
- result := matcher.regExpValue().regularExpression.FindAllStringIndex(target, -1)
- if result == nil {
- matcher.put("lastIndex", intValue(0), true)
- return Value{} // !match
- }
- matchCount := len(result)
- valueArray := make([]Value, matchCount)
- for index := 0; index < matchCount; index++ {
- valueArray[index] = stringValue(target[result[index][0]:result[index][1]])
- }
- matcher.put("lastIndex", intValue(result[matchCount-1][1]), true)
- return objectValue(call.runtime.newArrayOf(valueArray))
-}
-
-var builtinStringReplaceRegexp = regexp.MustCompile("\\$(?:[\\$\\&\\'\\`1-9]|0[1-9]|[1-9][0-9])")
-
-func builtinStringFindAndReplaceString(input []byte, lastIndex int, match []int, target []byte, replaceValue []byte) []byte {
- matchCount := len(match) / 2
- output := input
- if match[0] != lastIndex {
- output = append(output, target[lastIndex:match[0]]...)
- }
- replacement := builtinStringReplaceRegexp.ReplaceAllFunc(replaceValue, func(part []byte) []byte {
- // TODO Check if match[0] or match[1] can be -1 in this scenario
- switch part[1] {
- case '$':
- return []byte{'$'}
- case '&':
- return target[match[0]:match[1]]
- case '`':
- return target[:match[0]]
- case '\'':
- return target[match[1]:]
- }
- matchNumberParse, err := strconv.ParseInt(string(part[1:]), 10, 64)
- if err != nil {
- return nil
- }
- matchNumber := int(matchNumberParse)
- if matchNumber >= matchCount {
- return nil
- }
- offset := 2 * matchNumber
- if match[offset] != -1 {
- return target[match[offset]:match[offset+1]]
- }
- return nil // The empty string
- })
-
- return append(output, replacement...)
-}
-
-func builtinStringReplace(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := []byte(call.This.string())
- searchValue := call.Argument(0)
- searchObject := searchValue.object()
-
- // TODO If a capture is -1?
- var search *regexp.Regexp
- global := false
- find := 1
- if searchValue.IsObject() && searchObject.class == classRegExpName {
- regExp := searchObject.regExpValue()
- search = regExp.regularExpression
- if regExp.global {
- find = -1
- global = true
- }
- } else {
- search = regexp.MustCompile(regexp.QuoteMeta(searchValue.string()))
- }
-
- found := search.FindAllSubmatchIndex(target, find)
- if found == nil {
- return stringValue(string(target)) // !match
- }
-
- lastIndex := 0
- result := []byte{}
- replaceValue := call.Argument(1)
- if replaceValue.isCallable() {
- target := string(target)
- replace := replaceValue.object()
- for _, match := range found {
- if match[0] != lastIndex {
- result = append(result, target[lastIndex:match[0]]...)
- }
- matchCount := len(match) / 2
- argumentList := make([]Value, matchCount+2)
- for index := 0; index < matchCount; index++ {
- offset := 2 * index
- if match[offset] != -1 {
- argumentList[index] = stringValue(target[match[offset]:match[offset+1]])
- } else {
- argumentList[index] = Value{}
- }
- }
- argumentList[matchCount+0] = intValue(match[0])
- argumentList[matchCount+1] = stringValue(target)
- replacement := replace.call(Value{}, argumentList, false, nativeFrame).string()
- result = append(result, []byte(replacement)...)
- lastIndex = match[1]
- }
- } else {
- replace := []byte(replaceValue.string())
- for _, match := range found {
- result = builtinStringFindAndReplaceString(result, lastIndex, match, target, replace)
- lastIndex = match[1]
- }
- }
-
- if lastIndex != len(target) {
- result = append(result, target[lastIndex:]...)
- }
-
- if global && searchObject != nil {
- searchObject.put("lastIndex", intValue(lastIndex), true)
- }
-
- return stringValue(string(result))
-}
-
-func builtinStringSearch(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := call.This.string()
- searchValue := call.Argument(0)
- search := searchValue.object()
- if !searchValue.IsObject() || search.class != classRegExpName {
- search = call.runtime.newRegExp(searchValue, Value{})
- }
- result := search.regExpValue().regularExpression.FindStringIndex(target)
- if result == nil {
- return intValue(-1)
- }
- return intValue(result[0])
-}
-
-func builtinStringSplit(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := call.This.string()
-
- separatorValue := call.Argument(0)
- limitValue := call.Argument(1)
- limit := -1
- if limitValue.IsDefined() {
- limit = int(toUint32(limitValue))
- }
-
- if limit == 0 {
- return objectValue(call.runtime.newArray(0))
- }
-
- if separatorValue.IsUndefined() {
- return objectValue(call.runtime.newArrayOf([]Value{stringValue(target)}))
- }
-
- if separatorValue.isRegExp() {
- targetLength := len(target)
- search := separatorValue.object().regExpValue().regularExpression
- valueArray := []Value{}
- result := search.FindAllStringSubmatchIndex(target, -1)
- lastIndex := 0
- found := 0
-
- for _, match := range result {
- if match[0] == match[1] {
- // FIXME Ugh, this is a hack
- if match[0] == 0 || match[0] == targetLength {
- continue
- }
- }
-
- if lastIndex != match[0] {
- valueArray = append(valueArray, stringValue(target[lastIndex:match[0]]))
- found++
- } else if lastIndex == match[0] {
- if lastIndex != -1 {
- valueArray = append(valueArray, stringValue(""))
- found++
- }
- }
-
- lastIndex = match[1]
- if found == limit {
- goto RETURN
- }
-
- captureCount := len(match) / 2
- for index := 1; index < captureCount; index++ {
- offset := index * 2
- value := Value{}
- if match[offset] != -1 {
- value = stringValue(target[match[offset]:match[offset+1]])
- }
- valueArray = append(valueArray, value)
- found++
- if found == limit {
- goto RETURN
- }
- }
- }
-
- if found != limit {
- if lastIndex != targetLength {
- valueArray = append(valueArray, stringValue(target[lastIndex:targetLength]))
- } else {
- valueArray = append(valueArray, stringValue(""))
- }
- }
-
- RETURN:
- return objectValue(call.runtime.newArrayOf(valueArray))
- } else {
- separator := separatorValue.string()
-
- splitLimit := limit
- excess := false
- if limit > 0 {
- splitLimit = limit + 1
- excess = true
- }
-
- split := strings.SplitN(target, separator, splitLimit)
-
- if excess && len(split) > limit {
- split = split[:limit]
- }
-
- valueArray := make([]Value, len(split))
- for index, value := range split {
- valueArray[index] = stringValue(value)
- }
-
- return objectValue(call.runtime.newArrayOf(valueArray))
- }
-}
-
-func builtinStringSlice(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := call.This.string()
-
- length := int64(len(target))
- start, end := rangeStartEnd(call.ArgumentList, length, false)
- if end-start <= 0 {
- return stringValue("")
- }
- return stringValue(target[start:end])
-}
-
-func builtinStringSubstring(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := []rune(call.This.string())
-
- length := int64(len(target))
- start, end := rangeStartEnd(call.ArgumentList, length, true)
- if start > end {
- start, end = end, start
- }
- return stringValue(string(target[start:end]))
-}
-
-func builtinStringSubstr(call FunctionCall) Value {
- target := []rune(call.This.string())
-
- size := int64(len(target))
- start, length := rangeStartLength(call.ArgumentList, size)
-
- if start >= size {
- return stringValue("")
- }
-
- if length <= 0 {
- return stringValue("")
- }
-
- if start+length >= size {
- // Cap length to be to the end of the string
- // start = 3, length = 5, size = 4 [0, 1, 2, 3]
- // 4 - 3 = 1
- // target[3:4]
- length = size - start
- }
-
- return stringValue(string(target[start : start+length]))
-}
-
-func builtinStringStartsWith(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- target := call.This.string()
- search := call.Argument(0).string()
- length := len(search)
- if length > len(target) {
- return boolValue(false)
- }
- return boolValue(target[:length] == search)
-}
-
-func builtinStringToLowerCase(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- return stringValue(strings.ToLower(call.This.string()))
-}
-
-func builtinStringToUpperCase(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- return stringValue(strings.ToUpper(call.This.string()))
-}
-
-// 7.2 Table 2 — Whitespace Characters & 7.3 Table 3 - Line Terminator Characters.
-const builtinStringTrimWhitespace = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"
-
-func builtinStringTrim(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- return toValue(strings.Trim(call.This.string(),
- builtinStringTrimWhitespace))
-}
-
-// Mozilla extension, not ECMAScript 5.
-func builtinStringTrimLeft(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- return toValue(strings.TrimLeft(call.This.string(),
- builtinStringTrimWhitespace))
-}
-
-// Mozilla extension, not ECMAScript 5.
-func builtinStringTrimRight(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- return toValue(strings.TrimRight(call.This.string(),
- builtinStringTrimWhitespace))
-}
-
-func builtinStringLocaleCompare(call FunctionCall) Value {
- checkObjectCoercible(call.runtime, call.This)
- this := call.This.string() //nolint: ifshort
- that := call.Argument(0).string()
- if this < that {
- return intValue(-1)
- } else if this == that {
- return intValue(0)
- }
- return intValue(1)
-}
-
-func builtinStringToLocaleLowerCase(call FunctionCall) Value {
- return builtinStringToLowerCase(call)
-}
-
-func builtinStringToLocaleUpperCase(call FunctionCall) Value {
- return builtinStringToUpperCase(call)
-}
diff --git a/vendor/github.com/robertkrimen/otto/clone.go b/vendor/github.com/robertkrimen/otto/clone.go
deleted file mode 100644
index edc2845..0000000
--- a/vendor/github.com/robertkrimen/otto/clone.go
+++ /dev/null
@@ -1,171 +0,0 @@
-package otto
-
-import (
- "fmt"
-)
-
-type cloner struct {
- runtime *runtime
- obj map[*object]*object
- objectstash map[*objectStash]*objectStash
- dclstash map[*dclStash]*dclStash
- fnstash map[*fnStash]*fnStash
-}
-
-func (rt *runtime) clone() *runtime {
- rt.lck.Lock()
- defer rt.lck.Unlock()
-
- out := &runtime{
- debugger: rt.debugger,
- random: rt.random,
- stackLimit: rt.stackLimit,
- traceLimit: rt.traceLimit,
- }
-
- c := cloner{
- runtime: out,
- obj: make(map[*object]*object),
- objectstash: make(map[*objectStash]*objectStash),
- dclstash: make(map[*dclStash]*dclStash),
- fnstash: make(map[*fnStash]*fnStash),
- }
-
- globalObject := c.object(rt.globalObject)
- out.globalStash = out.newObjectStash(globalObject, nil)
- out.globalObject = globalObject
- out.global = global{
- c.object(rt.global.Object),
- c.object(rt.global.Function),
- c.object(rt.global.Array),
- c.object(rt.global.String),
- c.object(rt.global.Boolean),
- c.object(rt.global.Number),
- c.object(rt.global.Math),
- c.object(rt.global.Date),
- c.object(rt.global.RegExp),
- c.object(rt.global.Error),
- c.object(rt.global.EvalError),
- c.object(rt.global.TypeError),
- c.object(rt.global.RangeError),
- c.object(rt.global.ReferenceError),
- c.object(rt.global.SyntaxError),
- c.object(rt.global.URIError),
- c.object(rt.global.JSON),
-
- c.object(rt.global.ObjectPrototype),
- c.object(rt.global.FunctionPrototype),
- c.object(rt.global.ArrayPrototype),
- c.object(rt.global.StringPrototype),
- c.object(rt.global.BooleanPrototype),
- c.object(rt.global.NumberPrototype),
- c.object(rt.global.DatePrototype),
- c.object(rt.global.RegExpPrototype),
- c.object(rt.global.ErrorPrototype),
- c.object(rt.global.EvalErrorPrototype),
- c.object(rt.global.TypeErrorPrototype),
- c.object(rt.global.RangeErrorPrototype),
- c.object(rt.global.ReferenceErrorPrototype),
- c.object(rt.global.SyntaxErrorPrototype),
- c.object(rt.global.URIErrorPrototype),
- }
-
- out.eval = out.globalObject.property["eval"].value.(Value).value.(*object)
- out.globalObject.prototype = out.global.ObjectPrototype
-
- // Not sure if this is necessary, but give some help to the GC
- c.runtime = nil
- c.obj = nil
- c.objectstash = nil
- c.dclstash = nil
- c.fnstash = nil
-
- return out
-}
-
-func (c *cloner) object(in *object) *object {
- if out, exists := c.obj[in]; exists {
- return out
- }
- out := &object{}
- c.obj[in] = out
- return in.objectClass.clone(in, out, c)
-}
-
-func (c *cloner) dclStash(in *dclStash) (*dclStash, bool) {
- if out, exists := c.dclstash[in]; exists {
- return out, true
- }
- out := &dclStash{}
- c.dclstash[in] = out
- return out, false
-}
-
-func (c *cloner) objectStash(in *objectStash) (*objectStash, bool) {
- if out, exists := c.objectstash[in]; exists {
- return out, true
- }
- out := &objectStash{}
- c.objectstash[in] = out
- return out, false
-}
-
-func (c *cloner) fnStash(in *fnStash) (*fnStash, bool) {
- if out, exists := c.fnstash[in]; exists {
- return out, true
- }
- out := &fnStash{}
- c.fnstash[in] = out
- return out, false
-}
-
-func (c *cloner) value(in Value) Value {
- out := in
- if value, ok := in.value.(*object); ok {
- out.value = c.object(value)
- }
- return out
-}
-
-func (c *cloner) valueArray(in []Value) []Value {
- out := make([]Value, len(in))
- for index, value := range in {
- out[index] = c.value(value)
- }
- return out
-}
-
-func (c *cloner) stash(in stasher) stasher {
- if in == nil {
- return nil
- }
- return in.clone(c)
-}
-
-func (c *cloner) property(in property) property {
- out := in
-
- switch value := in.value.(type) {
- case Value:
- out.value = c.value(value)
- case propertyGetSet:
- p := propertyGetSet{}
- if value[0] != nil {
- p[0] = c.object(value[0])
- }
- if value[1] != nil {
- p[1] = c.object(value[1])
- }
- out.value = p
- default:
- panic(fmt.Errorf("in.value.(Value) != true; in.value is %T", in.value))
- }
-
- return out
-}
-
-func (c *cloner) dclProperty(in dclProperty) dclProperty {
- out := in
- out.value = c.value(in.value)
- return out
-}
diff --git a/vendor/github.com/robertkrimen/otto/cmpl.go b/vendor/github.com/robertkrimen/otto/cmpl.go
deleted file mode 100644
index e81cd50..0000000
--- a/vendor/github.com/robertkrimen/otto/cmpl.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package otto
-
-import (
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/file"
-)
-
-type compiler struct {
- file *file.File
- program *ast.Program
-}
diff --git a/vendor/github.com/robertkrimen/otto/cmpl_evaluate.go b/vendor/github.com/robertkrimen/otto/cmpl_evaluate.go
deleted file mode 100644
index a29b7d8..0000000
--- a/vendor/github.com/robertkrimen/otto/cmpl_evaluate.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package otto
-
-import (
- "strconv"
-)
-
-func (rt *runtime) cmplEvaluateNodeProgram(node *nodeProgram, eval bool) Value {
- if !eval {
- rt.enterGlobalScope()
- defer rt.leaveScope()
- }
- rt.cmplFunctionDeclaration(node.functionList)
- rt.cmplVariableDeclaration(node.varList)
- rt.scope.frame.file = node.file
- return rt.cmplEvaluateNodeStatementList(node.body)
-}
-
-func (rt *runtime) cmplCallNodeFunction(function *object, stash *fnStash, node *nodeFunctionLiteral, argumentList []Value) Value {
- indexOfParameterName := make([]string, len(argumentList))
- // function(abc, def, ghi)
- // indexOfParameterName[0] = "abc"
- // indexOfParameterName[1] = "def"
- // indexOfParameterName[2] = "ghi"
- // ...
-
- argumentsFound := false
- for index, name := range node.parameterList {
- if name == "arguments" {
- argumentsFound = true
- }
- value := Value{}
- if index < len(argumentList) {
- value = argumentList[index]
- indexOfParameterName[index] = name
- }
- // strict = false
- rt.scope.lexical.setValue(name, value, false)
- }
-
- if !argumentsFound {
- arguments := rt.newArgumentsObject(indexOfParameterName, stash, len(argumentList))
- arguments.defineProperty("callee", objectValue(function), 0o101, false)
- stash.arguments = arguments
- // strict = false
- rt.scope.lexical.setValue("arguments", objectValue(arguments), false)
- for index := range argumentList {
- if index < len(node.parameterList) {
- continue
- }
- indexAsString := strconv.FormatInt(int64(index), 10)
- arguments.defineProperty(indexAsString, argumentList[index], 0o111, false)
- }
- }
-
- rt.cmplFunctionDeclaration(node.functionList)
- rt.cmplVariableDeclaration(node.varList)
-
- result := rt.cmplEvaluateNodeStatement(node.body)
- if result.kind == valueResult {
- return result
- }
-
- return Value{}
-}
-
-func (rt *runtime) cmplFunctionDeclaration(list []*nodeFunctionLiteral) {
- executionContext := rt.scope
- eval := executionContext.eval
- stash := executionContext.variable
-
- for _, function := range list {
- name := function.name
- value := rt.cmplEvaluateNodeExpression(function)
- if !stash.hasBinding(name) {
- stash.createBinding(name, eval, value)
- } else {
- // TODO 10.5.5.e
- stash.setBinding(name, value, false) // TODO strict
- }
- }
-}
-
-func (rt *runtime) cmplVariableDeclaration(list []string) {
- executionContext := rt.scope
- eval := executionContext.eval
- stash := executionContext.variable
-
- for _, name := range list {
- if !stash.hasBinding(name) {
- stash.createBinding(name, eval, Value{}) // TODO strict?
- }
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/cmpl_evaluate_expression.go b/vendor/github.com/robertkrimen/otto/cmpl_evaluate_expression.go
deleted file mode 100644
index 69c673a..0000000
--- a/vendor/github.com/robertkrimen/otto/cmpl_evaluate_expression.go
+++ /dev/null
@@ -1,444 +0,0 @@
-package otto
-
-import (
- "fmt"
- "math"
- goruntime "runtime"
-
- "github.com/robertkrimen/otto/token"
-)
-
-func (rt *runtime) cmplEvaluateNodeExpression(node nodeExpression) Value {
- // Allow interpreter interruption
- // If the Interrupt channel is nil, then
- // we avoid runtime.Gosched() overhead (if any)
- // FIXME: Test this
- if rt.otto.Interrupt != nil {
- goruntime.Gosched()
- select {
- case value := <-rt.otto.Interrupt:
- value()
- default:
- }
- }
-
- switch node := node.(type) {
- case *nodeArrayLiteral:
- return rt.cmplEvaluateNodeArrayLiteral(node)
-
- case *nodeAssignExpression:
- return rt.cmplEvaluateNodeAssignExpression(node)
-
- case *nodeBinaryExpression:
- if node.comparison {
- return rt.cmplEvaluateNodeBinaryExpressionComparison(node)
- }
- return rt.cmplEvaluateNodeBinaryExpression(node)
-
- case *nodeBracketExpression:
- return rt.cmplEvaluateNodeBracketExpression(node)
-
- case *nodeCallExpression:
- return rt.cmplEvaluateNodeCallExpression(node, nil)
-
- case *nodeConditionalExpression:
- return rt.cmplEvaluateNodeConditionalExpression(node)
-
- case *nodeDotExpression:
- return rt.cmplEvaluateNodeDotExpression(node)
-
- case *nodeFunctionLiteral:
- local := rt.scope.lexical
- if node.name != "" {
- local = rt.newDeclarationStash(local)
- }
-
- value := objectValue(rt.newNodeFunction(node, local))
- if node.name != "" {
- local.createBinding(node.name, false, value)
- }
- return value
-
- case *nodeIdentifier:
- name := node.name
- // TODO Should be true or false (strictness) depending on context
- // getIdentifierReference should not return nil, but we check anyway and panic
- // so as not to propagate the nil into something else
- reference := getIdentifierReference(rt, rt.scope.lexical, name, false, at(node.idx))
- if reference == nil {
- // Should never get here!
- panic(hereBeDragons("referenceError == nil: " + name))
- }
- return toValue(reference)
-
- case *nodeLiteral:
- return node.value
-
- case *nodeNewExpression:
- return rt.cmplEvaluateNodeNewExpression(node)
-
- case *nodeObjectLiteral:
- return rt.cmplEvaluateNodeObjectLiteral(node)
-
- case *nodeRegExpLiteral:
- return objectValue(rt.newRegExpDirect(node.pattern, node.flags))
-
- case *nodeSequenceExpression:
- return rt.cmplEvaluateNodeSequenceExpression(node)
-
- case *nodeThisExpression:
- return objectValue(rt.scope.this)
-
- case *nodeUnaryExpression:
- return rt.cmplEvaluateNodeUnaryExpression(node)
-
- case *nodeVariableExpression:
- return rt.cmplEvaluateNodeVariableExpression(node)
- default:
- panic(fmt.Sprintf("unknown node type: %T", node))
- }
-}
-
-func (rt *runtime) cmplEvaluateNodeArrayLiteral(node *nodeArrayLiteral) Value {
- valueArray := []Value{}
-
- for _, node := range node.value {
- if node == nil {
- valueArray = append(valueArray, emptyValue)
- } else {
- valueArray = append(valueArray, rt.cmplEvaluateNodeExpression(node).resolve())
- }
- }
-
- result := rt.newArrayOf(valueArray)
-
- return objectValue(result)
-}
-
-func (rt *runtime) cmplEvaluateNodeAssignExpression(node *nodeAssignExpression) Value {
- left := rt.cmplEvaluateNodeExpression(node.left)
- right := rt.cmplEvaluateNodeExpression(node.right)
- rightValue := right.resolve()
-
- result := rightValue
- if node.operator != token.ASSIGN {
- result = rt.calculateBinaryExpression(node.operator, left, rightValue)
- }
-
- rt.putValue(left.reference(), result)
-
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeBinaryExpression(node *nodeBinaryExpression) Value {
- left := rt.cmplEvaluateNodeExpression(node.left)
- leftValue := left.resolve()
-
- switch node.operator {
- // Logical
- case token.LOGICAL_AND:
- if !leftValue.bool() {
- return leftValue
- }
- right := rt.cmplEvaluateNodeExpression(node.right)
- return right.resolve()
- case token.LOGICAL_OR:
- if leftValue.bool() {
- return leftValue
- }
- right := rt.cmplEvaluateNodeExpression(node.right)
- return right.resolve()
- }
-
- return rt.calculateBinaryExpression(node.operator, leftValue, rt.cmplEvaluateNodeExpression(node.right))
-}
-
-func (rt *runtime) cmplEvaluateNodeBinaryExpressionComparison(node *nodeBinaryExpression) Value {
- left := rt.cmplEvaluateNodeExpression(node.left).resolve()
- right := rt.cmplEvaluateNodeExpression(node.right).resolve()
-
- return boolValue(rt.calculateComparison(node.operator, left, right))
-}
-
-func (rt *runtime) cmplEvaluateNodeBracketExpression(node *nodeBracketExpression) Value {
- target := rt.cmplEvaluateNodeExpression(node.left)
- targetValue := target.resolve()
- member := rt.cmplEvaluateNodeExpression(node.member)
- memberValue := member.resolve()
-
- // TODO Pass in base value as-is, and defer toObject till later?
- obj, err := rt.objectCoerce(targetValue)
- if err != nil {
- panic(rt.panicTypeError("Cannot access member %q of %s", memberValue.string(), err, at(node.idx)))
- }
- return toValue(newPropertyReference(rt, obj, memberValue.string(), false, at(node.idx)))
-}
-
-func (rt *runtime) cmplEvaluateNodeCallExpression(node *nodeCallExpression, withArgumentList []interface{}) Value {
- this := Value{}
- callee := rt.cmplEvaluateNodeExpression(node.callee)
-
- argumentList := []Value{}
- if withArgumentList != nil {
- argumentList = rt.toValueArray(withArgumentList...)
- } else {
- for _, argumentNode := range node.argumentList {
- argumentList = append(argumentList, rt.cmplEvaluateNodeExpression(argumentNode).resolve())
- }
- }
-
- eval := false // Whether this call is a (candidate for) direct call to eval
- name := ""
- if rf := callee.reference(); rf != nil {
- switch rf := rf.(type) {
- case *propertyReference:
- name = rf.name
- this = objectValue(rf.base)
- eval = rf.name == "eval" // Possible direct eval
- case *stashReference:
- // TODO ImplicitThisValue
- name = rf.name
- eval = rf.name == "eval" // Possible direct eval
- default:
- // FIXME?
- panic(rt.panicTypeError("unexpected callee type %T to node call expression", rf))
- }
- }
-
- atv := at(-1)
- switch callee := node.callee.(type) {
- case *nodeIdentifier:
- atv = at(callee.idx)
- case *nodeDotExpression:
- atv = at(callee.idx)
- case *nodeBracketExpression:
- atv = at(callee.idx)
- }
-
- frm := frame{
- callee: name,
- file: rt.scope.frame.file,
- }
-
- vl := callee.resolve()
- if !vl.IsFunction() {
- if name == "" {
- // FIXME Maybe typeof?
- panic(rt.panicTypeError("%v is not a function", vl, atv))
- }
- panic(rt.panicTypeError("%q is not a function", name, atv))
- }
-
- rt.scope.frame.offset = int(atv)
-
- return vl.object().call(this, argumentList, eval, frm)
-}
-
-func (rt *runtime) cmplEvaluateNodeConditionalExpression(node *nodeConditionalExpression) Value {
- test := rt.cmplEvaluateNodeExpression(node.test)
- testValue := test.resolve()
- if testValue.bool() {
- return rt.cmplEvaluateNodeExpression(node.consequent)
- }
- return rt.cmplEvaluateNodeExpression(node.alternate)
-}
-
-func (rt *runtime) cmplEvaluateNodeDotExpression(node *nodeDotExpression) Value {
- target := rt.cmplEvaluateNodeExpression(node.left)
- targetValue := target.resolve()
- // TODO Pass in base value as-is, and defer toObject till later?
- obj, err := rt.objectCoerce(targetValue)
- if err != nil {
- panic(rt.panicTypeError("Cannot access member %q of %s", node.identifier, err, at(node.idx)))
- }
- return toValue(newPropertyReference(rt, obj, node.identifier, false, at(node.idx)))
-}
-
-func (rt *runtime) cmplEvaluateNodeNewExpression(node *nodeNewExpression) Value {
- callee := rt.cmplEvaluateNodeExpression(node.callee)
-
- argumentList := []Value{}
- for _, argumentNode := range node.argumentList {
- argumentList = append(argumentList, rt.cmplEvaluateNodeExpression(argumentNode).resolve())
- }
-
- var name string
- if rf := callee.reference(); rf != nil {
- switch rf := rf.(type) {
- case *propertyReference:
- name = rf.name
- case *stashReference:
- name = rf.name
- default:
- panic(rt.panicTypeError("node new expression unexpected callee type %T", rf))
- }
- }
-
- atv := at(-1)
- switch callee := node.callee.(type) {
- case *nodeIdentifier:
- atv = at(callee.idx)
- case *nodeDotExpression:
- atv = at(callee.idx)
- case *nodeBracketExpression:
- atv = at(callee.idx)
- }
-
- vl := callee.resolve()
- if !vl.IsFunction() {
- if name == "" {
- // FIXME Maybe typeof?
- panic(rt.panicTypeError("%v is not a function", vl, atv))
- }
- panic(rt.panicTypeError("'%s' is not a function", name, atv))
- }
-
- rt.scope.frame.offset = int(atv)
-
- return vl.object().construct(argumentList)
-}
-
-func (rt *runtime) cmplEvaluateNodeObjectLiteral(node *nodeObjectLiteral) Value {
- result := rt.newObject()
- for _, prop := range node.value {
- switch prop.kind {
- case "value":
- result.defineProperty(prop.key, rt.cmplEvaluateNodeExpression(prop.value).resolve(), 0o111, false)
- case "get":
- getter := rt.newNodeFunction(prop.value.(*nodeFunctionLiteral), rt.scope.lexical)
- descriptor := property{}
- descriptor.mode = 0o211
- descriptor.value = propertyGetSet{getter, nil}
- result.defineOwnProperty(prop.key, descriptor, false)
- case "set":
- setter := rt.newNodeFunction(prop.value.(*nodeFunctionLiteral), rt.scope.lexical)
- descriptor := property{}
- descriptor.mode = 0o211
- descriptor.value = propertyGetSet{nil, setter}
- result.defineOwnProperty(prop.key, descriptor, false)
- default:
- panic(fmt.Sprintf("unknown node object literal property kind %T", prop.kind))
- }
- }
-
- return objectValue(result)
-}
-
-func (rt *runtime) cmplEvaluateNodeSequenceExpression(node *nodeSequenceExpression) Value {
- var result Value
- for _, node := range node.sequence {
- result = rt.cmplEvaluateNodeExpression(node)
- result = result.resolve()
- }
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeUnaryExpression(node *nodeUnaryExpression) Value {
- target := rt.cmplEvaluateNodeExpression(node.operand)
- switch node.operator {
- case token.TYPEOF, token.DELETE:
- if target.kind == valueReference && target.reference().invalid() {
- if node.operator == token.TYPEOF {
- return stringValue("undefined")
- }
- return trueValue
- }
- }
-
- switch node.operator {
- case token.NOT:
- targetValue := target.resolve()
- if targetValue.bool() {
- return falseValue
- }
- return trueValue
- case token.BITWISE_NOT:
- targetValue := target.resolve()
- integerValue := toInt32(targetValue)
- return int32Value(^integerValue)
- case token.PLUS:
- targetValue := target.resolve()
- return float64Value(targetValue.float64())
- case token.MINUS:
- targetValue := target.resolve()
- value := targetValue.float64()
- // TODO Test this
- sign := float64(-1)
- if math.Signbit(value) {
- sign = 1
- }
- return float64Value(math.Copysign(value, sign))
- case token.INCREMENT:
- targetValue := target.resolve()
- if node.postfix {
- // Postfix++
- oldValue := targetValue.float64()
- newValue := float64Value(+1 + oldValue)
- rt.putValue(target.reference(), newValue)
- return float64Value(oldValue)
- }
-
- // ++Prefix
- newValue := float64Value(+1 + targetValue.float64())
- rt.putValue(target.reference(), newValue)
- return newValue
- case token.DECREMENT:
- targetValue := target.resolve()
- if node.postfix {
- // Postfix--
- oldValue := targetValue.float64()
- newValue := float64Value(-1 + oldValue)
- rt.putValue(target.reference(), newValue)
- return float64Value(oldValue)
- }
-
- // --Prefix
- newValue := float64Value(-1 + targetValue.float64())
- rt.putValue(target.reference(), newValue)
- return newValue
- case token.VOID:
- target.resolve() // FIXME Side effect?
- return Value{}
- case token.DELETE:
- reference := target.reference()
- if reference == nil {
- return trueValue
- }
- return boolValue(target.reference().delete())
- case token.TYPEOF:
- targetValue := target.resolve()
- switch targetValue.kind {
- case valueUndefined:
- return stringValue("undefined")
- case valueNull:
- return stringValue("object")
- case valueBoolean:
- return stringValue("boolean")
- case valueNumber:
- return stringValue("number")
- case valueString:
- return stringValue("string")
- case valueObject:
- if targetValue.object().isCall() {
- return stringValue("function")
- }
- return stringValue("object")
- default:
- // FIXME ?
- }
- }
-
- panic(hereBeDragons())
-}
-
-func (rt *runtime) cmplEvaluateNodeVariableExpression(node *nodeVariableExpression) Value {
- if node.initializer != nil {
- // FIXME If reference is nil
- left := getIdentifierReference(rt, rt.scope.lexical, node.name, false, at(node.idx))
- right := rt.cmplEvaluateNodeExpression(node.initializer)
- rightValue := right.resolve()
-
- rt.putValue(left, rightValue)
- }
- return stringValue(node.name)
-}
diff --git a/vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go b/vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go
deleted file mode 100644
index e0a05ee..0000000
--- a/vendor/github.com/robertkrimen/otto/cmpl_evaluate_statement.go
+++ /dev/null
@@ -1,428 +0,0 @@
-package otto
-
-import (
- "fmt"
- goruntime "runtime"
-
- "github.com/robertkrimen/otto/token"
-)
-
-func (rt *runtime) cmplEvaluateNodeStatement(node nodeStatement) Value {
- // Allow interpreter interruption
- // If the Interrupt channel is nil, then
- // we avoid runtime.Gosched() overhead (if any)
- // FIXME: Test this
- if rt.otto.Interrupt != nil {
- goruntime.Gosched()
- select {
- case value := <-rt.otto.Interrupt:
- value()
- default:
- }
- }
-
- switch node := node.(type) {
- case *nodeBlockStatement:
- labels := rt.labels
- rt.labels = nil
-
- value := rt.cmplEvaluateNodeStatementList(node.list)
- if value.kind == valueResult {
- if value.evaluateBreak(labels) == resultBreak {
- return emptyValue
- }
- }
- return value
-
- case *nodeBranchStatement:
- target := node.label
- switch node.branch { // FIXME Maybe node.kind? node.operator?
- case token.BREAK:
- return toValue(newBreakResult(target))
- case token.CONTINUE:
- return toValue(newContinueResult(target))
- default:
- panic(fmt.Errorf("unknown node branch token %T", node))
- }
-
- case *nodeDebuggerStatement:
- if rt.debugger != nil {
- rt.debugger(rt.otto)
- }
- return emptyValue // Nothing happens.
-
- case *nodeDoWhileStatement:
- return rt.cmplEvaluateNodeDoWhileStatement(node)
-
- case *nodeEmptyStatement:
- return emptyValue
-
- case *nodeExpressionStatement:
- return rt.cmplEvaluateNodeExpression(node.expression)
-
- case *nodeForInStatement:
- return rt.cmplEvaluateNodeForInStatement(node)
-
- case *nodeForStatement:
- return rt.cmplEvaluateNodeForStatement(node)
-
- case *nodeIfStatement:
- return rt.cmplEvaluateNodeIfStatement(node)
-
- case *nodeLabelledStatement:
- rt.labels = append(rt.labels, node.label)
- defer func() {
- if len(rt.labels) > 0 {
- rt.labels = rt.labels[:len(rt.labels)-1] // Pop the label
- } else {
- rt.labels = nil
- }
- }()
- return rt.cmplEvaluateNodeStatement(node.statement)
-
- case *nodeReturnStatement:
- if node.argument != nil {
- return toValue(newReturnResult(rt.cmplEvaluateNodeExpression(node.argument).resolve()))
- }
- return toValue(newReturnResult(Value{}))
-
- case *nodeSwitchStatement:
- return rt.cmplEvaluateNodeSwitchStatement(node)
-
- case *nodeThrowStatement:
- value := rt.cmplEvaluateNodeExpression(node.argument).resolve()
- panic(newException(value))
-
- case *nodeTryStatement:
- return rt.cmplEvaluateNodeTryStatement(node)
-
- case *nodeVariableStatement:
- // Variables are already defined, this is initialization only
- for _, variable := range node.list {
- rt.cmplEvaluateNodeVariableExpression(variable.(*nodeVariableExpression))
- }
- return emptyValue
-
- case *nodeWhileStatement:
- return rt.cmplEvaluateModeWhileStatement(node)
-
- case *nodeWithStatement:
- return rt.cmplEvaluateNodeWithStatement(node)
- default:
- panic(fmt.Errorf("unknown node statement type %T", node))
- }
-}
-
-func (rt *runtime) cmplEvaluateNodeStatementList(list []nodeStatement) Value {
- var result Value
- for _, node := range list {
- value := rt.cmplEvaluateNodeStatement(node)
- switch value.kind {
- case valueResult:
- return value
- case valueEmpty:
- default:
- // We have getValue here to (for example) trigger a
- // ReferenceError (of the not defined variety)
- // Not sure if this is the best way to error out early
- // for such errors or if there is a better way
- // TODO Do we still need this?
- result = value.resolve()
- }
- }
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeDoWhileStatement(node *nodeDoWhileStatement) Value {
- labels := append(rt.labels, "") //nolint: gocritic
- rt.labels = nil
-
- test := node.test
-
- result := emptyValue
-resultBreak:
- for {
- for _, node := range node.body {
- value := rt.cmplEvaluateNodeStatement(node)
- switch value.kind {
- case valueResult:
- switch value.evaluateBreakContinue(labels) {
- case resultReturn:
- return value
- case resultBreak:
- break resultBreak
- case resultContinue:
- goto resultContinue
- }
- case valueEmpty:
- default:
- result = value
- }
- }
- resultContinue:
- if !rt.cmplEvaluateNodeExpression(test).resolve().bool() {
- // Stahp: do ... while (false)
- break
- }
- }
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeForInStatement(node *nodeForInStatement) Value {
- labels := append(rt.labels, "") //nolint: gocritic
- rt.labels = nil
-
- source := rt.cmplEvaluateNodeExpression(node.source)
- sourceValue := source.resolve()
-
- switch sourceValue.kind {
- case valueUndefined, valueNull:
- return emptyValue
- }
-
- sourceObject := rt.toObject(sourceValue)
-
- into := node.into
- body := node.body
-
- result := emptyValue
- obj := sourceObject
- for obj != nil {
- enumerateValue := emptyValue
- obj.enumerate(false, func(name string) bool {
- into := rt.cmplEvaluateNodeExpression(into)
- // In the case of: for (var abc in def) ...
- if into.reference() == nil {
- identifier := into.string()
- // TODO Should be true or false (strictness) depending on context
- into = toValue(getIdentifierReference(rt, rt.scope.lexical, identifier, false, -1))
- }
- rt.putValue(into.reference(), stringValue(name))
- for _, node := range body {
- value := rt.cmplEvaluateNodeStatement(node)
- switch value.kind {
- case valueResult:
- switch value.evaluateBreakContinue(labels) {
- case resultReturn:
- enumerateValue = value
- return false
- case resultBreak:
- obj = nil
- return false
- case resultContinue:
- return true
- }
- case valueEmpty:
- default:
- enumerateValue = value
- }
- }
- return true
- })
- if obj == nil {
- break
- }
- obj = obj.prototype
- if !enumerateValue.isEmpty() {
- result = enumerateValue
- }
- }
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeForStatement(node *nodeForStatement) Value {
- labels := append(rt.labels, "") //nolint: gocritic
- rt.labels = nil
-
- initializer := node.initializer
- test := node.test
- update := node.update
- body := node.body
-
- if initializer != nil {
- initialResult := rt.cmplEvaluateNodeExpression(initializer)
- initialResult.resolve() // Side-effect trigger
- }
-
- result := emptyValue
-resultBreak:
- for {
- if test != nil {
- testResult := rt.cmplEvaluateNodeExpression(test)
- testResultValue := testResult.resolve()
- if !testResultValue.bool() {
- break
- }
- }
-
- // this is to prevent for cycles with no body from running forever
- if len(body) == 0 && rt.otto.Interrupt != nil {
- goruntime.Gosched()
- select {
- case value := <-rt.otto.Interrupt:
- value()
- default:
- }
- }
-
- for _, node := range body {
- value := rt.cmplEvaluateNodeStatement(node)
- switch value.kind {
- case valueResult:
- switch value.evaluateBreakContinue(labels) {
- case resultReturn:
- return value
- case resultBreak:
- break resultBreak
- case resultContinue:
- goto resultContinue
- }
- case valueEmpty:
- default:
- result = value
- }
- }
- resultContinue:
- if update != nil {
- updateResult := rt.cmplEvaluateNodeExpression(update)
- updateResult.resolve() // Side-effect trigger
- }
- }
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeIfStatement(node *nodeIfStatement) Value {
- test := rt.cmplEvaluateNodeExpression(node.test)
- testValue := test.resolve()
- if testValue.bool() {
- return rt.cmplEvaluateNodeStatement(node.consequent)
- } else if node.alternate != nil {
- return rt.cmplEvaluateNodeStatement(node.alternate)
- }
-
- return emptyValue
-}
-
-func (rt *runtime) cmplEvaluateNodeSwitchStatement(node *nodeSwitchStatement) Value {
- labels := append(rt.labels, "") //nolint: gocritic
- rt.labels = nil
-
- discriminantResult := rt.cmplEvaluateNodeExpression(node.discriminant)
- target := node.defaultIdx
-
- for index, clause := range node.body {
- test := clause.test
- if test != nil {
- if rt.calculateComparison(token.STRICT_EQUAL, discriminantResult, rt.cmplEvaluateNodeExpression(test)) {
- target = index
- break
- }
- }
- }
-
- result := emptyValue
- if target != -1 {
- for _, clause := range node.body[target:] {
- for _, statement := range clause.consequent {
- value := rt.cmplEvaluateNodeStatement(statement)
- switch value.kind {
- case valueResult:
- switch value.evaluateBreak(labels) {
- case resultReturn:
- return value
- case resultBreak:
- return emptyValue
- }
- case valueEmpty:
- default:
- result = value
- }
- }
- }
- }
-
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeTryStatement(node *nodeTryStatement) Value {
- tryCatchValue, exep := rt.tryCatchEvaluate(func() Value {
- return rt.cmplEvaluateNodeStatement(node.body)
- })
-
- if exep && node.catch != nil {
- outer := rt.scope.lexical
- rt.scope.lexical = rt.newDeclarationStash(outer)
- defer func() {
- rt.scope.lexical = outer
- }()
- // TODO If necessary, convert TypeError => TypeError
- // That, is, such errors can be thrown despite not being JavaScript "native"
- // strict = false
- rt.scope.lexical.setValue(node.catch.parameter, tryCatchValue, false)
-
- // FIXME node.CatchParameter
- // FIXME node.Catch
- tryCatchValue, exep = rt.tryCatchEvaluate(func() Value {
- return rt.cmplEvaluateNodeStatement(node.catch.body)
- })
- }
-
- if node.finally != nil {
- finallyValue := rt.cmplEvaluateNodeStatement(node.finally)
- if finallyValue.kind == valueResult {
- return finallyValue
- }
- }
-
- if exep {
- panic(newException(tryCatchValue))
- }
-
- return tryCatchValue
-}
-
-func (rt *runtime) cmplEvaluateModeWhileStatement(node *nodeWhileStatement) Value {
- test := node.test
- body := node.body
- labels := append(rt.labels, "") //nolint: gocritic
- rt.labels = nil
-
- result := emptyValue
-resultBreakContinue:
- for {
- if !rt.cmplEvaluateNodeExpression(test).resolve().bool() {
- // Stahp: while (false) ...
- break
- }
- for _, node := range body {
- value := rt.cmplEvaluateNodeStatement(node)
- switch value.kind {
- case valueResult:
- switch value.evaluateBreakContinue(labels) {
- case resultReturn:
- return value
- case resultBreak:
- break resultBreakContinue
- case resultContinue:
- continue resultBreakContinue
- }
- case valueEmpty:
- default:
- result = value
- }
- }
- }
- return result
-}
-
-func (rt *runtime) cmplEvaluateNodeWithStatement(node *nodeWithStatement) Value {
- obj := rt.cmplEvaluateNodeExpression(node.object)
- outer := rt.scope.lexical
- lexical := rt.newObjectStash(rt.toObject(obj.resolve()), outer)
- rt.scope.lexical = lexical
- defer func() {
- rt.scope.lexical = outer
- }()
-
- return rt.cmplEvaluateNodeStatement(node.body)
-}
diff --git a/vendor/github.com/robertkrimen/otto/cmpl_parse.go b/vendor/github.com/robertkrimen/otto/cmpl_parse.go
deleted file mode 100644
index 3844cec..0000000
--- a/vendor/github.com/robertkrimen/otto/cmpl_parse.go
+++ /dev/null
@@ -1,644 +0,0 @@
-package otto
-
-import (
- "fmt"
-
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/token"
-)
-
-var (
- trueLiteral = &nodeLiteral{value: boolValue(true)}
- falseLiteral = &nodeLiteral{value: boolValue(false)}
- nullLiteral = &nodeLiteral{value: nullValue}
- emptyStatement = &nodeEmptyStatement{}
-)
-
-func (cmpl *compiler) parseExpression(expr ast.Expression) nodeExpression {
- if expr == nil {
- return nil
- }
-
- switch expr := expr.(type) {
- case *ast.ArrayLiteral:
- out := &nodeArrayLiteral{
- value: make([]nodeExpression, len(expr.Value)),
- }
- for i, value := range expr.Value {
- out.value[i] = cmpl.parseExpression(value)
- }
- return out
-
- case *ast.AssignExpression:
- return &nodeAssignExpression{
- operator: expr.Operator,
- left: cmpl.parseExpression(expr.Left),
- right: cmpl.parseExpression(expr.Right),
- }
-
- case *ast.BinaryExpression:
- return &nodeBinaryExpression{
- operator: expr.Operator,
- left: cmpl.parseExpression(expr.Left),
- right: cmpl.parseExpression(expr.Right),
- comparison: expr.Comparison,
- }
-
- case *ast.BooleanLiteral:
- if expr.Value {
- return trueLiteral
- }
- return falseLiteral
-
- case *ast.BracketExpression:
- return &nodeBracketExpression{
- idx: expr.Left.Idx0(),
- left: cmpl.parseExpression(expr.Left),
- member: cmpl.parseExpression(expr.Member),
- }
-
- case *ast.CallExpression:
- out := &nodeCallExpression{
- callee: cmpl.parseExpression(expr.Callee),
- argumentList: make([]nodeExpression, len(expr.ArgumentList)),
- }
- for i, value := range expr.ArgumentList {
- out.argumentList[i] = cmpl.parseExpression(value)
- }
- return out
-
- case *ast.ConditionalExpression:
- return &nodeConditionalExpression{
- test: cmpl.parseExpression(expr.Test),
- consequent: cmpl.parseExpression(expr.Consequent),
- alternate: cmpl.parseExpression(expr.Alternate),
- }
-
- case *ast.DotExpression:
- return &nodeDotExpression{
- idx: expr.Left.Idx0(),
- left: cmpl.parseExpression(expr.Left),
- identifier: expr.Identifier.Name,
- }
-
- case *ast.EmptyExpression:
- return nil
-
- case *ast.FunctionLiteral:
- name := ""
- if expr.Name != nil {
- name = expr.Name.Name
- }
- out := &nodeFunctionLiteral{
- name: name,
- body: cmpl.parseStatement(expr.Body),
- source: expr.Source,
- file: cmpl.file,
- }
- if expr.ParameterList != nil {
- list := expr.ParameterList.List
- out.parameterList = make([]string, len(list))
- for i, value := range list {
- out.parameterList[i] = value.Name
- }
- }
- for _, value := range expr.DeclarationList {
- switch value := value.(type) {
- case *ast.FunctionDeclaration:
- out.functionList = append(out.functionList, cmpl.parseExpression(value.Function).(*nodeFunctionLiteral))
- case *ast.VariableDeclaration:
- for _, value := range value.List {
- out.varList = append(out.varList, value.Name)
- }
- default:
- panic(fmt.Sprintf("parse expression unknown function declaration type %T", value))
- }
- }
- return out
-
- case *ast.Identifier:
- return &nodeIdentifier{
- idx: expr.Idx,
- name: expr.Name,
- }
-
- case *ast.NewExpression:
- out := &nodeNewExpression{
- callee: cmpl.parseExpression(expr.Callee),
- argumentList: make([]nodeExpression, len(expr.ArgumentList)),
- }
- for i, value := range expr.ArgumentList {
- out.argumentList[i] = cmpl.parseExpression(value)
- }
- return out
-
- case *ast.NullLiteral:
- return nullLiteral
-
- case *ast.NumberLiteral:
- return &nodeLiteral{
- value: toValue(expr.Value),
- }
-
- case *ast.ObjectLiteral:
- out := &nodeObjectLiteral{
- value: make([]nodeProperty, len(expr.Value)),
- }
- for i, value := range expr.Value {
- out.value[i] = nodeProperty{
- key: value.Key,
- kind: value.Kind,
- value: cmpl.parseExpression(value.Value),
- }
- }
- return out
-
- case *ast.RegExpLiteral:
- return &nodeRegExpLiteral{
- flags: expr.Flags,
- pattern: expr.Pattern,
- }
-
- case *ast.SequenceExpression:
- out := &nodeSequenceExpression{
- sequence: make([]nodeExpression, len(expr.Sequence)),
- }
- for i, value := range expr.Sequence {
- out.sequence[i] = cmpl.parseExpression(value)
- }
- return out
-
- case *ast.StringLiteral:
- return &nodeLiteral{
- value: stringValue(expr.Value),
- }
-
- case *ast.ThisExpression:
- return &nodeThisExpression{}
-
- case *ast.UnaryExpression:
- return &nodeUnaryExpression{
- operator: expr.Operator,
- operand: cmpl.parseExpression(expr.Operand),
- postfix: expr.Postfix,
- }
-
- case *ast.VariableExpression:
- return &nodeVariableExpression{
- idx: expr.Idx0(),
- name: expr.Name,
- initializer: cmpl.parseExpression(expr.Initializer),
- }
- default:
- panic(fmt.Errorf("parse expression unknown node type %T", expr))
- }
-}
-
-func (cmpl *compiler) parseStatement(stmt ast.Statement) nodeStatement {
- if stmt == nil {
- return nil
- }
-
- switch stmt := stmt.(type) {
- case *ast.BlockStatement:
- out := &nodeBlockStatement{
- list: make([]nodeStatement, len(stmt.List)),
- }
- for i, value := range stmt.List {
- out.list[i] = cmpl.parseStatement(value)
- }
- return out
-
- case *ast.BranchStatement:
- out := &nodeBranchStatement{
- branch: stmt.Token,
- }
- if stmt.Label != nil {
- out.label = stmt.Label.Name
- }
- return out
-
- case *ast.DebuggerStatement:
- return &nodeDebuggerStatement{}
-
- case *ast.DoWhileStatement:
- out := &nodeDoWhileStatement{
- test: cmpl.parseExpression(stmt.Test),
- }
- body := cmpl.parseStatement(stmt.Body)
- if block, ok := body.(*nodeBlockStatement); ok {
- out.body = block.list
- } else {
- out.body = append(out.body, body)
- }
- return out
-
- case *ast.EmptyStatement:
- return emptyStatement
-
- case *ast.ExpressionStatement:
- return &nodeExpressionStatement{
- expression: cmpl.parseExpression(stmt.Expression),
- }
-
- case *ast.ForInStatement:
- out := &nodeForInStatement{
- into: cmpl.parseExpression(stmt.Into),
- source: cmpl.parseExpression(stmt.Source),
- }
- body := cmpl.parseStatement(stmt.Body)
- if block, ok := body.(*nodeBlockStatement); ok {
- out.body = block.list
- } else {
- out.body = append(out.body, body)
- }
- return out
-
- case *ast.ForStatement:
- out := &nodeForStatement{
- initializer: cmpl.parseExpression(stmt.Initializer),
- update: cmpl.parseExpression(stmt.Update),
- test: cmpl.parseExpression(stmt.Test),
- }
- body := cmpl.parseStatement(stmt.Body)
- if block, ok := body.(*nodeBlockStatement); ok {
- out.body = block.list
- } else {
- out.body = append(out.body, body)
- }
- return out
-
- case *ast.FunctionStatement:
- return emptyStatement
-
- case *ast.IfStatement:
- return &nodeIfStatement{
- test: cmpl.parseExpression(stmt.Test),
- consequent: cmpl.parseStatement(stmt.Consequent),
- alternate: cmpl.parseStatement(stmt.Alternate),
- }
-
- case *ast.LabelledStatement:
- return &nodeLabelledStatement{
- label: stmt.Label.Name,
- statement: cmpl.parseStatement(stmt.Statement),
- }
-
- case *ast.ReturnStatement:
- return &nodeReturnStatement{
- argument: cmpl.parseExpression(stmt.Argument),
- }
-
- case *ast.SwitchStatement:
- out := &nodeSwitchStatement{
- discriminant: cmpl.parseExpression(stmt.Discriminant),
- defaultIdx: stmt.Default,
- body: make([]*nodeCaseStatement, len(stmt.Body)),
- }
- for i, clause := range stmt.Body {
- out.body[i] = &nodeCaseStatement{
- test: cmpl.parseExpression(clause.Test),
- consequent: make([]nodeStatement, len(clause.Consequent)),
- }
- for j, value := range clause.Consequent {
- out.body[i].consequent[j] = cmpl.parseStatement(value)
- }
- }
- return out
-
- case *ast.ThrowStatement:
- return &nodeThrowStatement{
- argument: cmpl.parseExpression(stmt.Argument),
- }
-
- case *ast.TryStatement:
- out := &nodeTryStatement{
- body: cmpl.parseStatement(stmt.Body),
- finally: cmpl.parseStatement(stmt.Finally),
- }
- if stmt.Catch != nil {
- out.catch = &nodeCatchStatement{
- parameter: stmt.Catch.Parameter.Name,
- body: cmpl.parseStatement(stmt.Catch.Body),
- }
- }
- return out
-
- case *ast.VariableStatement:
- out := &nodeVariableStatement{
- list: make([]nodeExpression, len(stmt.List)),
- }
- for i, value := range stmt.List {
- out.list[i] = cmpl.parseExpression(value)
- }
- return out
-
- case *ast.WhileStatement:
- out := &nodeWhileStatement{
- test: cmpl.parseExpression(stmt.Test),
- }
- body := cmpl.parseStatement(stmt.Body)
- if block, ok := body.(*nodeBlockStatement); ok {
- out.body = block.list
- } else {
- out.body = append(out.body, body)
- }
- return out
-
- case *ast.WithStatement:
- return &nodeWithStatement{
- object: cmpl.parseExpression(stmt.Object),
- body: cmpl.parseStatement(stmt.Body),
- }
- default:
- panic(fmt.Sprintf("parse statement: unknown type %T", stmt))
- }
-}
-
-func cmplParse(in *ast.Program) *nodeProgram {
- cmpl := compiler{
- program: in,
- }
- if cmpl.program != nil {
- cmpl.file = cmpl.program.File
- }
-
- return cmpl.parse()
-}
-
-func (cmpl *compiler) parse() *nodeProgram {
- out := &nodeProgram{
- body: make([]nodeStatement, len(cmpl.program.Body)),
- file: cmpl.program.File,
- }
- for i, value := range cmpl.program.Body {
- out.body[i] = cmpl.parseStatement(value)
- }
- for _, value := range cmpl.program.DeclarationList {
- switch value := value.(type) {
- case *ast.FunctionDeclaration:
- out.functionList = append(out.functionList, cmpl.parseExpression(value.Function).(*nodeFunctionLiteral))
- case *ast.VariableDeclaration:
- for _, value := range value.List {
- out.varList = append(out.varList, value.Name)
- }
- default:
- panic(fmt.Sprintf("Here be dragons: cmpl.parseProgram.DeclarationList(%T)", value))
- }
- }
- return out
-}
-
-type nodeProgram struct {
- body []nodeStatement
-
- varList []string
- functionList []*nodeFunctionLiteral
-
- file *file.File
-}
-
-type node interface{}
-
-type (
- nodeExpression interface {
- node
- expressionNode()
- }
-
- nodeArrayLiteral struct {
- value []nodeExpression
- }
-
- nodeAssignExpression struct {
- operator token.Token
- left nodeExpression
- right nodeExpression
- }
-
- nodeBinaryExpression struct {
- operator token.Token
- left nodeExpression
- right nodeExpression
- comparison bool
- }
-
- nodeBracketExpression struct {
- idx file.Idx
- left nodeExpression
- member nodeExpression
- }
-
- nodeCallExpression struct {
- callee nodeExpression
- argumentList []nodeExpression
- }
-
- nodeConditionalExpression struct {
- test nodeExpression
- consequent nodeExpression
- alternate nodeExpression
- }
-
- nodeDotExpression struct {
- idx file.Idx
- left nodeExpression
- identifier string
- }
-
- nodeFunctionLiteral struct {
- name string
- body nodeStatement
- source string
- parameterList []string
- varList []string
- functionList []*nodeFunctionLiteral
- file *file.File
- }
-
- nodeIdentifier struct {
- idx file.Idx
- name string
- }
-
- nodeLiteral struct {
- value Value
- }
-
- nodeNewExpression struct {
- callee nodeExpression
- argumentList []nodeExpression
- }
-
- nodeObjectLiteral struct {
- value []nodeProperty
- }
-
- nodeProperty struct {
- key string
- kind string
- value nodeExpression
- }
-
- nodeRegExpLiteral struct {
- flags string
- pattern string // Value?
- }
-
- nodeSequenceExpression struct {
- sequence []nodeExpression
- }
-
- nodeThisExpression struct{}
-
- nodeUnaryExpression struct {
- operator token.Token
- operand nodeExpression
- postfix bool
- }
-
- nodeVariableExpression struct {
- idx file.Idx
- name string
- initializer nodeExpression
- }
-)
-
-type (
- nodeStatement interface {
- node
- statementNode()
- }
-
- nodeBlockStatement struct {
- list []nodeStatement
- }
-
- nodeBranchStatement struct {
- branch token.Token
- label string
- }
-
- nodeCaseStatement struct {
- test nodeExpression
- consequent []nodeStatement
- }
-
- nodeCatchStatement struct {
- parameter string
- body nodeStatement
- }
-
- nodeDebuggerStatement struct{}
-
- nodeDoWhileStatement struct {
- test nodeExpression
- body []nodeStatement
- }
-
- nodeEmptyStatement struct{}
-
- nodeExpressionStatement struct {
- expression nodeExpression
- }
-
- nodeForInStatement struct {
- into nodeExpression
- source nodeExpression
- body []nodeStatement
- }
-
- nodeForStatement struct {
- initializer nodeExpression
- update nodeExpression
- test nodeExpression
- body []nodeStatement
- }
-
- nodeIfStatement struct {
- test nodeExpression
- consequent nodeStatement
- alternate nodeStatement
- }
-
- nodeLabelledStatement struct {
- label string
- statement nodeStatement
- }
-
- nodeReturnStatement struct {
- argument nodeExpression
- }
-
- nodeSwitchStatement struct {
- discriminant nodeExpression
- defaultIdx int
- body []*nodeCaseStatement
- }
-
- nodeThrowStatement struct {
- argument nodeExpression
- }
-
- nodeTryStatement struct {
- body nodeStatement
- catch *nodeCatchStatement
- finally nodeStatement
- }
-
- nodeVariableStatement struct {
- list []nodeExpression
- }
-
- nodeWhileStatement struct {
- test nodeExpression
- body []nodeStatement
- }
-
- nodeWithStatement struct {
- object nodeExpression
- body nodeStatement
- }
-)
-
-// expressionNode.
-func (*nodeArrayLiteral) expressionNode() {}
-func (*nodeAssignExpression) expressionNode() {}
-func (*nodeBinaryExpression) expressionNode() {}
-func (*nodeBracketExpression) expressionNode() {}
-func (*nodeCallExpression) expressionNode() {}
-func (*nodeConditionalExpression) expressionNode() {}
-func (*nodeDotExpression) expressionNode() {}
-func (*nodeFunctionLiteral) expressionNode() {}
-func (*nodeIdentifier) expressionNode() {}
-func (*nodeLiteral) expressionNode() {}
-func (*nodeNewExpression) expressionNode() {}
-func (*nodeObjectLiteral) expressionNode() {}
-func (*nodeRegExpLiteral) expressionNode() {}
-func (*nodeSequenceExpression) expressionNode() {}
-func (*nodeThisExpression) expressionNode() {}
-func (*nodeUnaryExpression) expressionNode() {}
-func (*nodeVariableExpression) expressionNode() {}
-
-// statementNode
-
-func (*nodeBlockStatement) statementNode() {}
-func (*nodeBranchStatement) statementNode() {}
-func (*nodeCaseStatement) statementNode() {}
-func (*nodeCatchStatement) statementNode() {}
-func (*nodeDebuggerStatement) statementNode() {}
-func (*nodeDoWhileStatement) statementNode() {}
-func (*nodeEmptyStatement) statementNode() {}
-func (*nodeExpressionStatement) statementNode() {}
-func (*nodeForInStatement) statementNode() {}
-func (*nodeForStatement) statementNode() {}
-func (*nodeIfStatement) statementNode() {}
-func (*nodeLabelledStatement) statementNode() {}
-func (*nodeReturnStatement) statementNode() {}
-func (*nodeSwitchStatement) statementNode() {}
-func (*nodeThrowStatement) statementNode() {}
-func (*nodeTryStatement) statementNode() {}
-func (*nodeVariableStatement) statementNode() {}
-func (*nodeWhileStatement) statementNode() {}
-func (*nodeWithStatement) statementNode() {}
diff --git a/vendor/github.com/robertkrimen/otto/console.go b/vendor/github.com/robertkrimen/otto/console.go
deleted file mode 100644
index 842fe2c..0000000
--- a/vendor/github.com/robertkrimen/otto/console.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package otto
-
-import (
- "fmt"
- "os"
- "strings"
-)
-
-func formatForConsole(argumentList []Value) string {
- output := []string{}
- for _, argument := range argumentList {
- output = append(output, fmt.Sprintf("%v", argument))
- }
- return strings.Join(output, " ")
-}
-
-func builtinConsoleLog(call FunctionCall) Value {
- fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
- return Value{}
-}
-
-func builtinConsoleError(call FunctionCall) Value {
- fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
- return Value{}
-}
-
-// Nothing happens.
-func builtinConsoleDir(call FunctionCall) Value {
- return Value{}
-}
-
-func builtinConsoleTime(call FunctionCall) Value {
- return Value{}
-}
-
-func builtinConsoleTimeEnd(call FunctionCall) Value {
- return Value{}
-}
-
-func builtinConsoleTrace(call FunctionCall) Value {
- return Value{}
-}
-
-func builtinConsoleAssert(call FunctionCall) Value {
- return Value{}
-}
diff --git a/vendor/github.com/robertkrimen/otto/consts.go b/vendor/github.com/robertkrimen/otto/consts.go
deleted file mode 100644
index f82aebc..0000000
--- a/vendor/github.com/robertkrimen/otto/consts.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package otto
-
-const (
- // Common classes.
- classStringName = "String"
- classGoArrayName = "GoArray"
- classGoSliceName = "GoSlice"
- classNumberName = "Number"
- classDateName = "Date"
- classArrayName = "Array"
- classFunctionName = "Function"
- classObjectName = "Object"
- classRegExpName = "RegExp"
- classBooleanName = "Boolean"
- classMathName = "Math"
- classJSONName = "JSON"
-
- // Error classes.
- classErrorName = "Error"
- classEvalErrorName = "EvalError"
- classTypeErrorName = "TypeError"
- classRangeErrorName = "RangeError"
- classReferenceErrorName = "ReferenceError"
- classSyntaxErrorName = "SyntaxError"
- classURIErrorName = "URIError"
-
- // Common properties.
- propertyName = "name"
- propertyLength = "length"
- propertyPrototype = "prototype"
- propertyConstructor = "constructor"
-
- // Common methods.
- methodToString = "toString"
-)
diff --git a/vendor/github.com/robertkrimen/otto/dbg.go b/vendor/github.com/robertkrimen/otto/dbg.go
deleted file mode 100644
index 51fbdc2..0000000
--- a/vendor/github.com/robertkrimen/otto/dbg.go
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file was AUTOMATICALLY GENERATED by dbg-import (smuggol) for github.com/robertkrimen/dbg
-
-package otto
-
-import (
- Dbg "github.com/robertkrimen/otto/dbg"
-)
-
-var dbg, dbgf = Dbg.New()
diff --git a/vendor/github.com/robertkrimen/otto/dbg/dbg.go b/vendor/github.com/robertkrimen/otto/dbg/dbg.go
deleted file mode 100644
index f091657..0000000
--- a/vendor/github.com/robertkrimen/otto/dbg/dbg.go
+++ /dev/null
@@ -1,380 +0,0 @@
-// This file was AUTOMATICALLY GENERATED by dbg-import (smuggol) from github.com/robertkrimen/dbg
-
-/*
-Package dbg is a println/printf/log-debugging utility library.
-
- import (
- Dbg "github.com/robertkrimen/dbg"
- )
-
- dbg, dbgf := Dbg.New()
-
- dbg("Emit some debug stuff", []byte{120, 121, 122, 122, 121}, math.Pi)
- # "2013/01/28 16:50:03 Emit some debug stuff [120 121 122 122 121] 3.141592653589793"
-
- dbgf("With a %s formatting %.2f", "little", math.Pi)
- # "2013/01/28 16:51:55 With a little formatting (3.14)"
-
- dbgf("%/fatal//A fatal debug statement: should not be here")
- # "A fatal debug statement: should not be here"
- # ...and then, os.Exit(1)
-
- dbgf("%/panic//Can also panic %s", "this")
- # "Can also panic this"
- # ...as a panic, equivalent to: panic("Can also panic this")
-
- dbgf("Any %s arguments without a corresponding %%", "extra", "are treated like arguments to dbg()")
- # "2013/01/28 17:14:40 Any extra arguments (without a corresponding %) are treated like arguments to dbg()"
-
- dbgf("%d %d", 1, 2, 3, 4, 5)
- # "2013/01/28 17:16:32 Another example: 1 2 3 4 5"
-
- dbgf("%@: Include the function name for a little context (via %s)", "%@")
- # "2013... github.com/robertkrimen/dbg.TestSynopsis: Include the function name for a little context (via %@)"
-
-By default, dbg uses log (log.Println, log.Printf, log.Panic, etc.) for output.
-However, you can also provide your own output destination by invoking dbg.New with
-a customization function:
-
- import (
- "bytes"
- Dbg "github.com/robertkrimen/dbg"
- "os"
- )
-
- # dbg to os.Stderr
- dbg, dbgf := Dbg.New(func(dbgr *Dbgr) {
- dbgr.SetOutput(os.Stderr)
- })
-
- # A slightly contrived example:
- var buffer bytes.Buffer
- dbg, dbgf := New(func(dbgr *Dbgr) {
- dbgr.SetOutput(&buffer)
- })
-*/
-package dbg
-
-import (
- "bytes"
- "fmt"
- "io"
- "log"
- "os"
- "regexp"
- goruntime "runtime"
- "strings"
- "unicode"
-)
-
-type _frmt struct {
- ctl string
- format string
- operandCount int
- panic bool
- fatal bool
- check bool
-}
-
-var (
- ctlTest = regexp.MustCompile(`^\s*%/`)
- ctlScan = regexp.MustCompile(`%?/(panic|fatal|check)(?:\s|$)`)
-)
-
-func operandCount(format string) int {
- count := 0
- end := len(format)
- for at := 0; at < end; {
- for at < end && format[at] != '%' {
- at++
- }
- at++
- if at < end {
- if format[at] != '%' && format[at] != '@' {
- count++
- }
- at++
- }
- }
- return count
-}
-
-func parseFormat(format string) (frmt _frmt) {
- if ctlTest.MatchString(format) {
- format = strings.TrimLeftFunc(format, unicode.IsSpace)
- index := strings.Index(format, "//")
- if index != -1 {
- frmt.ctl = format[0:index]
- format = format[index+2:] // Skip the second slash via +2 (instead of +1)
- } else {
- frmt.ctl = format
- format = ""
- }
- for _, tmp := range ctlScan.FindAllStringSubmatch(frmt.ctl, -1) {
- for _, value := range tmp[1:] {
- switch value {
- case "panic":
- frmt.panic = true
- case "fatal":
- frmt.fatal = true
- case "check":
- frmt.check = true
- }
- }
- }
- }
- frmt.format = format
- frmt.operandCount = operandCount(format)
- return
-}
-
-type Dbgr struct {
- emit emit
-}
-
-type DbgFunction func(values ...interface{})
-
-func NewDbgr() *Dbgr {
- return &Dbgr{}
-}
-
-/*
-New will create and return a pair of debugging functions. You can customize where
-they output to by passing in an (optional) customization function:
-
- import (
- Dbg "github.com/robertkrimen/dbg"
- "os"
- )
-
- # dbg to os.Stderr
- dbg, dbgf := Dbg.New(func(dbgr *Dbgr) {
- dbgr.SetOutput(os.Stderr)
- })
-*/
-func New(options ...interface{}) (dbg DbgFunction, dbgf DbgFunction) {
- dbgr := NewDbgr()
- if len(options) > 0 {
- if fn, ok := options[0].(func(*Dbgr)); ok {
- fn(dbgr)
- }
- }
- return dbgr.DbgDbgf()
-}
-
-func (d Dbgr) Dbg(values ...interface{}) {
- d.getEmit().emit(_frmt{}, "", values...)
-}
-
-func (d Dbgr) Dbgf(values ...interface{}) {
- d.dbgf(values...)
-}
-
-func (d Dbgr) DbgDbgf() (dbg DbgFunction, dbgf DbgFunction) {
- dbg = func(vl ...interface{}) {
- d.Dbg(vl...)
- }
- dbgf = func(vl ...interface{}) {
- d.dbgf(vl...)
- }
- return dbg, dbgf // Redundant, but...
-}
-
-func (d Dbgr) dbgf(values ...interface{}) {
- var frmt _frmt
- if len(values) > 0 {
- tmp := fmt.Sprint(values[0])
- frmt = parseFormat(tmp)
- values = values[1:]
- }
-
- buf := bytes.Buffer{}
- format := frmt.format
- end := len(format)
- for at := 0; at < end; {
- last := at
- for at < end && format[at] != '%' {
- at++
- }
- if at > last {
- buf.WriteString(format[last:at])
- }
- if at >= end {
- break
- }
- // format[at] == '%'
- at++
- // format[at] == ?
- if format[at] == '@' {
- depth := 2
- pc, _, _, _ := goruntime.Caller(depth)
- name := goruntime.FuncForPC(pc).Name()
- buf.WriteString(name)
- } else {
- buf.WriteString(format[at-1 : at+1])
- }
- at++
- }
-
- //valuesF := append([]interface{}{}, values[0:frmt.operandCount]...)
- valuesF := values[0:frmt.operandCount]
- valuesDbg := values[frmt.operandCount:]
- if len(valuesDbg) > 0 {
- // Adjust frmt.format:
- // (%v instead of %s because: frmt.check)
- tmp := format
- if len(tmp) > 0 {
- if unicode.IsSpace(rune(tmp[len(tmp)-1])) {
- buf.WriteString("%v")
- } else {
- buf.WriteString(" %v")
- }
- } else if frmt.check {
- // Performing a check, so no output
- } else {
- buf.WriteString("%v")
- }
-
- // Adjust valuesF:
- if !frmt.check {
- tmp := []string{}
- for _, value := range valuesDbg {
- tmp = append(tmp, fmt.Sprintf("%v", value))
- }
- // First, make a copy of valuesF, so we avoid overwriting valuesDbg when appending
- valuesF = append([]interface{}{}, valuesF...)
- valuesF = append(valuesF, strings.Join(tmp, " "))
- }
- }
-
- format = buf.String()
- if frmt.check {
- // We do not actually emit to the log, but panic if
- // a non-nil value is detected (e.g. a non-nil error)
- for _, value := range valuesDbg {
- if value != nil {
- if format == "" {
- panic(value)
- } else {
- panic(fmt.Sprintf(format, append(valuesF, value)...))
- }
- }
- }
- } else {
- d.getEmit().emit(frmt, format, valuesF...)
- }
-}
-
-// Idiot-proof &Dbgr{}, etc.
-func (d *Dbgr) getEmit() emit {
- if d.emit == nil {
- d.emit = standardEmit()
- }
- return d.emit
-}
-
-// SetOutput will accept the following as a destination for output:
-//
-// *log.Logger Print*/Panic*/Fatal* of the logger
-// io.Writer -
-// nil Reset to the default output (os.Stderr)
-// "log" Print*/Panic*/Fatal* via the "log" package
-func (d *Dbgr) SetOutput(output interface{}) {
- if output == nil {
- d.emit = standardEmit()
- return
- }
- switch output := output.(type) {
- case *log.Logger:
- d.emit = emitLogger{
- logger: output,
- }
- return
- case io.Writer:
- d.emit = emitWriter{
- writer: output,
- }
- return
- case string:
- if output == "log" {
- d.emit = emitLog{}
- return
- }
- }
- panic(output)
-}
-
-// ======== //
-// = emit = //
-// ======== //
-
-func standardEmit() emit {
- return emitWriter{
- writer: os.Stderr,
- }
-}
-
-func ln(tmp string) string {
- length := len(tmp)
- if length > 0 && tmp[length-1] != '\n' {
- return tmp + "\n"
- }
- return tmp
-}
-
-type emit interface {
- emit(_frmt, string, ...interface{})
-}
-
-type emitWriter struct {
- writer io.Writer
-}
-
-func (ew emitWriter) emit(frmt _frmt, format string, values ...interface{}) {
- if format == "" {
- fmt.Fprintln(ew.writer, values...)
- } else {
- if frmt.panic {
- panic(fmt.Sprintf(format, values...))
- }
- fmt.Fprintf(ew.writer, ln(format), values...)
- if frmt.fatal {
- os.Exit(1)
- }
- }
-}
-
-type emitLogger struct {
- logger *log.Logger
-}
-
-func (el emitLogger) emit(frmt _frmt, format string, values ...interface{}) {
- if format == "" {
- el.logger.Println(values...)
- } else {
- if frmt.panic {
- el.logger.Panicf(format, values...)
- } else if frmt.fatal {
- el.logger.Fatalf(format, values...)
- } else {
- el.logger.Printf(format, values...)
- }
- }
-}
-
-type emitLog struct {
-}
-
-func (el emitLog) emit(frmt _frmt, format string, values ...interface{}) {
- if format == "" {
- log.Println(values...)
- } else {
- if frmt.panic {
- log.Panicf(format, values...)
- } else if frmt.fatal {
- log.Fatalf(format, values...)
- } else {
- log.Printf(format, values...)
- }
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/error.go b/vendor/github.com/robertkrimen/otto/error.go
deleted file mode 100644
index 7f1bbaf..0000000
--- a/vendor/github.com/robertkrimen/otto/error.go
+++ /dev/null
@@ -1,252 +0,0 @@
-package otto
-
-import (
- "errors"
- "fmt"
-
- "github.com/robertkrimen/otto/file"
-)
-
-type exception struct {
- value interface{}
-}
-
-func newException(value interface{}) *exception {
- return &exception{
- value: value,
- }
-}
-
-func (e *exception) eject() interface{} {
- value := e.value
- e.value = nil // Prevent Go from holding on to the value, whatever it is
- return value
-}
-
-type ottoError struct {
- name string
- message string
- trace []frame
-
- offset int
-}
-
-func (e ottoError) format() string {
- if len(e.name) == 0 {
- return e.message
- }
- if len(e.message) == 0 {
- return e.name
- }
- return fmt.Sprintf("%s: %s", e.name, e.message)
-}
-
-func (e ottoError) formatWithStack() string {
- str := e.format() + "\n"
- for _, frm := range e.trace {
- str += " at " + frm.location() + "\n"
- }
- return str
-}
-
-type frame struct {
- native bool
- nativeFile string
- nativeLine int
- file *file.File
- offset int
- callee string
- fn interface{}
-}
-
-var nativeFrame = frame{}
-
-type at int
-
-func (fr frame) location() string {
- str := ""
-
- switch {
- case fr.native:
- str = ""
- if fr.nativeFile != "" && fr.nativeLine != 0 {
- str = fmt.Sprintf("%s:%d", fr.nativeFile, fr.nativeLine)
- }
- case fr.file != nil:
- if p := fr.file.Position(file.Idx(fr.offset)); p != nil {
- path, line, column := p.Filename, p.Line, p.Column
-
- if path == "" {
- path = ""
- }
-
- str = fmt.Sprintf("%s:%d:%d", path, line, column)
- }
- }
-
- if fr.callee != "" {
- str = fmt.Sprintf("%s (%s)", fr.callee, str)
- }
-
- return str
-}
-
-// An Error represents a runtime error, e.g. a TypeError, a ReferenceError, etc.
-type Error struct {
- ottoError
-}
-
-// Error returns a description of the error
-//
-// TypeError: 'def' is not a function
-func (e Error) Error() string {
- return e.format()
-}
-
-// String returns a description of the error and a trace of where the
-// error occurred.
-//
-// TypeError: 'def' is not a function
-// at xyz (:3:9)
-// at :7:1/
-func (e Error) String() string {
- return e.formatWithStack()
-}
-
-// GoString returns a description of the error and a trace of where the
-// error occurred. Printing with %#v will trigger this behaviour.
-func (e Error) GoString() string {
- return e.formatWithStack()
-}
-
-func (e ottoError) describe(format string, in ...interface{}) string {
- return fmt.Sprintf(format, in...)
-}
-
-func (e ottoError) messageValue() Value {
- if e.message == "" {
- return Value{}
- }
- return stringValue(e.message)
-}
-
-func (rt *runtime) typeErrorResult(throw bool) bool {
- if throw {
- panic(rt.panicTypeError())
- }
- return false
-}
-
-func newError(rt *runtime, name string, stackFramesToPop int, in ...interface{}) ottoError {
- err := ottoError{
- name: name,
- offset: -1,
- }
- description := ""
- length := len(in)
-
- if rt != nil && rt.scope != nil {
- curScope := rt.scope
-
- for i := 0; i < stackFramesToPop; i++ {
- if curScope.outer != nil {
- curScope = curScope.outer
- }
- }
-
- frm := curScope.frame
-
- if length > 0 {
- if atv, ok := in[length-1].(at); ok {
- in = in[0 : length-1]
- if curScope != nil {
- frm.offset = int(atv)
- }
- length--
- }
- if length > 0 {
- description, in = in[0].(string), in[1:]
- }
- }
-
- limit := rt.traceLimit
-
- err.trace = append(err.trace, frm)
- if curScope != nil {
- for curScope = curScope.outer; curScope != nil; curScope = curScope.outer {
- if limit--; limit == 0 {
- break
- }
-
- if curScope.frame.offset >= 0 {
- err.trace = append(err.trace, curScope.frame)
- }
- }
- }
- } else if length > 0 {
- description, in = in[0].(string), in[1:]
- }
- err.message = err.describe(description, in...)
-
- return err
-}
-
-func (rt *runtime) panicTypeError(argumentList ...interface{}) *exception {
- return &exception{
- value: newError(rt, "TypeError", 0, argumentList...),
- }
-}
-
-func (rt *runtime) panicReferenceError(argumentList ...interface{}) *exception {
- return &exception{
- value: newError(rt, "ReferenceError", 0, argumentList...),
- }
-}
-
-func (rt *runtime) panicURIError(argumentList ...interface{}) *exception {
- return &exception{
- value: newError(rt, "URIError", 0, argumentList...),
- }
-}
-
-func (rt *runtime) panicSyntaxError(argumentList ...interface{}) *exception {
- return &exception{
- value: newError(rt, "SyntaxError", 0, argumentList...),
- }
-}
-
-func (rt *runtime) panicRangeError(argumentList ...interface{}) *exception {
- return &exception{
- value: newError(rt, "RangeError", 0, argumentList...),
- }
-}
-
-func catchPanic(function func()) (err error) {
- defer func() {
- if caught := recover(); caught != nil {
- if excep, ok := caught.(*exception); ok {
- caught = excep.eject()
- }
- switch caught := caught.(type) {
- case *Error:
- err = caught
- return
- case ottoError:
- err = &Error{caught}
- return
- case Value:
- if vl := caught.object(); vl != nil {
- if vl, ok := vl.value.(ottoError); ok {
- err = &Error{vl}
- return
- }
- }
- err = errors.New(caught.string())
- return
- }
- panic(caught)
- }
- }()
- function()
- return nil
-}
diff --git a/vendor/github.com/robertkrimen/otto/evaluate.go b/vendor/github.com/robertkrimen/otto/evaluate.go
deleted file mode 100644
index 2108b7c..0000000
--- a/vendor/github.com/robertkrimen/otto/evaluate.go
+++ /dev/null
@@ -1,292 +0,0 @@
-package otto
-
-import (
- "fmt"
- "math"
- "strings"
-
- "github.com/robertkrimen/otto/token"
-)
-
-func (rt *runtime) evaluateMultiply(left float64, right float64) Value { //nolint: unused
- // TODO 11.5.1
- return Value{}
-}
-
-func (rt *runtime) evaluateDivide(left float64, right float64) Value {
- if math.IsNaN(left) || math.IsNaN(right) {
- return NaNValue()
- }
- if math.IsInf(left, 0) && math.IsInf(right, 0) {
- return NaNValue()
- }
- if left == 0 && right == 0 {
- return NaNValue()
- }
- if math.IsInf(left, 0) {
- if math.Signbit(left) == math.Signbit(right) {
- return positiveInfinityValue()
- }
- return negativeInfinityValue()
- }
- if math.IsInf(right, 0) {
- if math.Signbit(left) == math.Signbit(right) {
- return positiveZeroValue()
- }
- return negativeZeroValue()
- }
- if right == 0 {
- if math.Signbit(left) == math.Signbit(right) {
- return positiveInfinityValue()
- }
- return negativeInfinityValue()
- }
- return float64Value(left / right)
-}
-
-func (rt *runtime) evaluateModulo(left float64, right float64) Value { //nolint: unused
- // TODO 11.5.3
- return Value{}
-}
-
-func (rt *runtime) calculateBinaryExpression(operator token.Token, left Value, right Value) Value {
- leftValue := left.resolve()
-
- switch operator {
- // Additive
- case token.PLUS:
- leftValue = toPrimitiveValue(leftValue)
- rightValue := right.resolve()
- rightValue = toPrimitiveValue(rightValue)
-
- if leftValue.IsString() || rightValue.IsString() {
- return stringValue(strings.Join([]string{leftValue.string(), rightValue.string()}, ""))
- }
- return float64Value(leftValue.float64() + rightValue.float64())
- case token.MINUS:
- rightValue := right.resolve()
- return float64Value(leftValue.float64() - rightValue.float64())
-
- // Multiplicative
- case token.MULTIPLY:
- rightValue := right.resolve()
- return float64Value(leftValue.float64() * rightValue.float64())
- case token.SLASH:
- rightValue := right.resolve()
- return rt.evaluateDivide(leftValue.float64(), rightValue.float64())
- case token.REMAINDER:
- rightValue := right.resolve()
- return float64Value(math.Mod(leftValue.float64(), rightValue.float64()))
-
- // Logical
- case token.LOGICAL_AND:
- left := leftValue.bool()
- if !left {
- return falseValue
- }
- return boolValue(right.resolve().bool())
- case token.LOGICAL_OR:
- left := leftValue.bool()
- if left {
- return trueValue
- }
- return boolValue(right.resolve().bool())
-
- // Bitwise
- case token.AND:
- rightValue := right.resolve()
- return int32Value(toInt32(leftValue) & toInt32(rightValue))
- case token.OR:
- rightValue := right.resolve()
- return int32Value(toInt32(leftValue) | toInt32(rightValue))
- case token.EXCLUSIVE_OR:
- rightValue := right.resolve()
- return int32Value(toInt32(leftValue) ^ toInt32(rightValue))
-
- // Shift
- // (Masking of 0x1f is to restrict the shift to a maximum of 31 places)
- case token.SHIFT_LEFT:
- rightValue := right.resolve()
- return int32Value(toInt32(leftValue) << (toUint32(rightValue) & 0x1f))
- case token.SHIFT_RIGHT:
- rightValue := right.resolve()
- return int32Value(toInt32(leftValue) >> (toUint32(rightValue) & 0x1f))
- case token.UNSIGNED_SHIFT_RIGHT:
- rightValue := right.resolve()
- // Shifting an unsigned integer is a logical shift
- return uint32Value(toUint32(leftValue) >> (toUint32(rightValue) & 0x1f))
-
- case token.INSTANCEOF:
- rightValue := right.resolve()
- if !rightValue.IsObject() {
- panic(rt.panicTypeError("invalid kind %s for instanceof (expected object)", rightValue.kind))
- }
- return boolValue(rightValue.object().hasInstance(leftValue))
-
- case token.IN:
- rightValue := right.resolve()
- if !rightValue.IsObject() {
- panic(rt.panicTypeError("invalid kind %s for in (expected object)", rightValue.kind))
- }
- return boolValue(rightValue.object().hasProperty(leftValue.string()))
- }
-
- panic(hereBeDragons(operator))
-}
-
-type lessThanResult int
-
-const (
- lessThanFalse lessThanResult = iota
- lessThanTrue
- lessThanUndefined
-)
-
-func calculateLessThan(left Value, right Value, leftFirst bool) lessThanResult {
- var x, y Value
- if leftFirst {
- x = toNumberPrimitive(left)
- y = toNumberPrimitive(right)
- } else {
- y = toNumberPrimitive(right)
- x = toNumberPrimitive(left)
- }
-
- var result bool
- if x.kind != valueString || y.kind != valueString {
- x, y := x.float64(), y.float64()
- if math.IsNaN(x) || math.IsNaN(y) {
- return lessThanUndefined
- }
- result = x < y
- } else {
- x, y := x.string(), y.string()
- result = x < y
- }
-
- if result {
- return lessThanTrue
- }
-
- return lessThanFalse
-}
-
-// FIXME Probably a map is not the most efficient way to do this.
-var lessThanTable [4](map[lessThanResult]bool) = [4](map[lessThanResult]bool){
- // <
- map[lessThanResult]bool{
- lessThanFalse: false,
- lessThanTrue: true,
- lessThanUndefined: false,
- },
-
- // >
- map[lessThanResult]bool{
- lessThanFalse: false,
- lessThanTrue: true,
- lessThanUndefined: false,
- },
-
- // <=
- map[lessThanResult]bool{
- lessThanFalse: true,
- lessThanTrue: false,
- lessThanUndefined: false,
- },
-
- // >=
- map[lessThanResult]bool{
- lessThanFalse: true,
- lessThanTrue: false,
- lessThanUndefined: false,
- },
-}
-
-func (rt *runtime) calculateComparison(comparator token.Token, left Value, right Value) bool {
- // FIXME Use strictEqualityComparison?
- // TODO This might be redundant now (with regards to evaluateComparison)
- x := left.resolve()
- y := right.resolve()
-
- var kindEqualKind bool
- var negate bool
- result := true
-
- switch comparator {
- case token.LESS:
- result = lessThanTable[0][calculateLessThan(x, y, true)]
- case token.GREATER:
- result = lessThanTable[1][calculateLessThan(y, x, false)]
- case token.LESS_OR_EQUAL:
- result = lessThanTable[2][calculateLessThan(y, x, false)]
- case token.GREATER_OR_EQUAL:
- result = lessThanTable[3][calculateLessThan(x, y, true)]
- case token.STRICT_NOT_EQUAL:
- negate = true
- fallthrough
- case token.STRICT_EQUAL:
- if x.kind != y.kind {
- result = false
- } else {
- kindEqualKind = true
- }
- case token.NOT_EQUAL:
- negate = true
- fallthrough
- case token.EQUAL:
- switch {
- case x.kind == y.kind:
- kindEqualKind = true
- case x.kind <= valueNull && y.kind <= valueNull:
- result = true
- case x.kind <= valueNull || y.kind <= valueNull:
- result = false
- case x.kind <= valueString && y.kind <= valueString:
- result = x.float64() == y.float64()
- case x.kind == valueBoolean:
- result = rt.calculateComparison(token.EQUAL, float64Value(x.float64()), y)
- case y.kind == valueBoolean:
- result = rt.calculateComparison(token.EQUAL, x, float64Value(y.float64()))
- case x.kind == valueObject:
- result = rt.calculateComparison(token.EQUAL, toPrimitiveValue(x), y)
- case y.kind == valueObject:
- result = rt.calculateComparison(token.EQUAL, x, toPrimitiveValue(y))
- default:
- panic(fmt.Sprintf("unknown types for equal: %v ==? %v", x, y))
- }
- default:
- panic(fmt.Sprintf("unknown comparator %s", comparator.String()))
- }
-
- if kindEqualKind {
- switch x.kind {
- case valueUndefined, valueNull:
- result = true
- case valueNumber:
- x := x.float64()
- y := y.float64()
- if math.IsNaN(x) || math.IsNaN(y) {
- result = false
- } else {
- result = x == y
- }
- case valueString:
- result = x.string() == y.string()
- case valueBoolean:
- result = x.bool() == y.bool()
- case valueObject:
- result = x.object() == y.object()
- default:
- goto ERROR
- }
- }
-
- if negate {
- result = !result
- }
-
- return result
-
-ERROR:
- panic(hereBeDragons("%v (%v) %s %v (%v)", x, x.kind, comparator, y, y.kind))
-}
diff --git a/vendor/github.com/robertkrimen/otto/file/file.go b/vendor/github.com/robertkrimen/otto/file/file.go
deleted file mode 100644
index 3dda893..0000000
--- a/vendor/github.com/robertkrimen/otto/file/file.go
+++ /dev/null
@@ -1,167 +0,0 @@
-// Package file encapsulates the file abstractions used by the ast & parser.
-package file
-
-import (
- "fmt"
- "strings"
-
- "gopkg.in/sourcemap.v1"
-)
-
-// Idx is a compact encoding of a source position within a file set.
-// It can be converted into a Position for a more convenient, but much
-// larger, representation.
-type Idx int
-
-// Position describes an arbitrary source position
-// including the filename, line, and column location.
-type Position struct {
- Filename string // The filename where the error occurred, if any
- Offset int // The src offset
- Line int // The line number, starting at 1
- Column int // The column number, starting at 1 (The character count)
-}
-
-// A Position is valid if the line number is > 0.
-
-func (p *Position) isValid() bool {
- return p.Line > 0
-}
-
-// String returns a string in one of several forms:
-//
-// file:line:column A valid position with filename
-// line:column A valid position without filename
-// file An invalid position with filename
-// - An invalid position without filename
-func (p *Position) String() string {
- str := p.Filename
- if p.isValid() {
- if str != "" {
- str += ":"
- }
- str += fmt.Sprintf("%d:%d", p.Line, p.Column)
- }
- if str == "" {
- str = "-"
- }
- return str
-}
-
-// A FileSet represents a set of source files.
-type FileSet struct { //nolint: golint
- files []*File
- last *File
-}
-
-// AddFile adds a new file with the given filename and src.
-//
-// This an internal method, but exported for cross-package use.
-func (fs *FileSet) AddFile(filename, src string) int {
- base := fs.nextBase()
- file := &File{
- name: filename,
- src: src,
- base: base,
- }
- fs.files = append(fs.files, file)
- fs.last = file
- return base
-}
-
-func (fs *FileSet) nextBase() int {
- if fs.last == nil {
- return 1
- }
- return fs.last.base + len(fs.last.src) + 1
-}
-
-// File returns the File at idx or nil if not found.
-func (fs *FileSet) File(idx Idx) *File {
- for _, file := range fs.files {
- if idx <= Idx(file.base+len(file.src)) {
- return file
- }
- }
- return nil
-}
-
-// Position converts an Idx in the FileSet into a Position.
-func (fs *FileSet) Position(idx Idx) *Position {
- for _, file := range fs.files {
- if idx <= Idx(file.base+len(file.src)) {
- return file.Position(idx - Idx(file.base))
- }
- }
-
- return nil
-}
-
-// File represents a file to parse.
-type File struct {
- name string
- src string
- base int // This will always be 1 or greater
- sm *sourcemap.Consumer
-}
-
-// NewFile returns a new file with the given filename, src and base.
-func NewFile(filename, src string, base int) *File {
- return &File{
- name: filename,
- src: src,
- base: base,
- }
-}
-
-// WithSourceMap sets the source map of fl.
-func (fl *File) WithSourceMap(sm *sourcemap.Consumer) *File {
- fl.sm = sm
- return fl
-}
-
-// Name returns the name of fl.
-func (fl *File) Name() string {
- return fl.name
-}
-
-// Source returns the source of fl.
-func (fl *File) Source() string {
- return fl.src
-}
-
-// Base returns the base of fl.
-func (fl *File) Base() int {
- return fl.base
-}
-
-// Position returns the position at idx or nil if not valid.
-func (fl *File) Position(idx Idx) *Position {
- position := &Position{}
-
- offset := int(idx) - fl.base
-
- if offset >= len(fl.src) || offset < 0 {
- return nil
- }
-
- src := fl.src[:offset]
-
- position.Filename = fl.name
- position.Offset = offset
- position.Line = strings.Count(src, "\n") + 1
-
- if index := strings.LastIndex(src, "\n"); index >= 0 {
- position.Column = offset - index
- } else {
- position.Column = len(src) + 1
- }
-
- if fl.sm != nil {
- if f, _, l, c, ok := fl.sm.Source(position.Line, position.Column); ok {
- position.Filename, position.Line, position.Column = f, l, c
- }
- }
-
- return position
-}
diff --git a/vendor/github.com/robertkrimen/otto/generate.go b/vendor/github.com/robertkrimen/otto/generate.go
deleted file mode 100644
index 767091e..0000000
--- a/vendor/github.com/robertkrimen/otto/generate.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package otto
-
-//go:generate go run ./tools/gen-jscore -output inline.go
-//go:generate stringer -type=valueKind -trimprefix=value -output=value_kind.gen.go
diff --git a/vendor/github.com/robertkrimen/otto/global.go b/vendor/github.com/robertkrimen/otto/global.go
deleted file mode 100644
index e15dd83..0000000
--- a/vendor/github.com/robertkrimen/otto/global.go
+++ /dev/null
@@ -1,217 +0,0 @@
-package otto
-
-import (
- "strconv"
- "time"
-)
-
-var (
- prototypeValueObject = interface{}(nil)
- prototypeValueFunction = nativeFunctionObject{
- call: func(_ FunctionCall) Value {
- return Value{}
- },
- }
- prototypeValueString = stringASCII("")
- // TODO Make this just false?
- prototypeValueBoolean = Value{
- kind: valueBoolean,
- value: false,
- }
- prototypeValueNumber = Value{
- kind: valueNumber,
- value: 0,
- }
- prototypeValueDate = dateObject{
- epoch: 0,
- isNaN: false,
- time: time.Unix(0, 0).UTC(),
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- }
- prototypeValueRegExp = regExpObject{
- regularExpression: nil,
- global: false,
- ignoreCase: false,
- multiline: false,
- source: "",
- flags: "",
- }
-)
-
-func newContext() *runtime {
- rt := &runtime{}
-
- rt.globalStash = rt.newObjectStash(nil, nil)
- rt.globalObject = rt.globalStash.object
-
- rt.newContext()
-
- rt.eval = rt.globalObject.property["eval"].value.(Value).value.(*object)
- rt.globalObject.prototype = rt.global.ObjectPrototype
-
- return rt
-}
-
-func (rt *runtime) newBaseObject() *object {
- return newObject(rt, "")
-}
-
-func (rt *runtime) newClassObject(class string) *object {
- return newObject(rt, class)
-}
-
-func (rt *runtime) newPrimitiveObject(class string, value Value) *object {
- o := rt.newClassObject(class)
- o.value = value
- return o
-}
-
-func (o *object) primitiveValue() Value {
- switch value := o.value.(type) {
- case Value:
- return value
- case stringObjecter:
- return stringValue(value.String())
- }
- return Value{}
-}
-
-func (o *object) hasPrimitive() bool { //nolint: unused
- switch o.value.(type) {
- case Value, stringObjecter:
- return true
- }
- return false
-}
-
-func (rt *runtime) newObject() *object {
- o := rt.newClassObject(classObjectName)
- o.prototype = rt.global.ObjectPrototype
- return o
-}
-
-func (rt *runtime) newArray(length uint32) *object {
- o := rt.newArrayObject(length)
- o.prototype = rt.global.ArrayPrototype
- return o
-}
-
-func (rt *runtime) newArrayOf(valueArray []Value) *object {
- o := rt.newArray(uint32(len(valueArray)))
- for index, value := range valueArray {
- if value.isEmpty() {
- continue
- }
- o.defineProperty(strconv.FormatInt(int64(index), 10), value, 0o111, false)
- }
- return o
-}
-
-func (rt *runtime) newString(value Value) *object {
- o := rt.newStringObject(value)
- o.prototype = rt.global.StringPrototype
- return o
-}
-
-func (rt *runtime) newBoolean(value Value) *object {
- o := rt.newBooleanObject(value)
- o.prototype = rt.global.BooleanPrototype
- return o
-}
-
-func (rt *runtime) newNumber(value Value) *object {
- o := rt.newNumberObject(value)
- o.prototype = rt.global.NumberPrototype
- return o
-}
-
-func (rt *runtime) newRegExp(patternValue Value, flagsValue Value) *object {
- pattern := ""
- flags := ""
- if obj := patternValue.object(); obj != nil && obj.class == classRegExpName {
- if flagsValue.IsDefined() {
- panic(rt.panicTypeError("Cannot supply flags when constructing one RegExp from another"))
- }
- regExp := obj.regExpValue()
- pattern = regExp.source
- flags = regExp.flags
- } else {
- if patternValue.IsDefined() {
- pattern = patternValue.string()
- }
- if flagsValue.IsDefined() {
- flags = flagsValue.string()
- }
- }
-
- return rt.newRegExpDirect(pattern, flags)
-}
-
-func (rt *runtime) newRegExpDirect(pattern string, flags string) *object {
- o := rt.newRegExpObject(pattern, flags)
- o.prototype = rt.global.RegExpPrototype
- return o
-}
-
-// TODO Should (probably) be one argument, right? This is redundant.
-func (rt *runtime) newDate(epoch float64) *object {
- o := rt.newDateObject(epoch)
- o.prototype = rt.global.DatePrototype
- return o
-}
-
-func (rt *runtime) newError(name string, message Value, stackFramesToPop int) *object {
- switch name {
- case "EvalError":
- return rt.newEvalError(message)
- case "TypeError":
- return rt.newTypeError(message)
- case "RangeError":
- return rt.newRangeError(message)
- case "ReferenceError":
- return rt.newReferenceError(message)
- case "SyntaxError":
- return rt.newSyntaxError(message)
- case "URIError":
- return rt.newURIError(message)
- }
-
- obj := rt.newErrorObject(name, message, stackFramesToPop)
- obj.prototype = rt.global.ErrorPrototype
- if name != "" {
- obj.defineProperty("name", stringValue(name), 0o111, false)
- }
- return obj
-}
-
-func (rt *runtime) newNativeFunction(name, file string, line int, fn nativeFunction) *object {
- o := rt.newNativeFunctionObject(name, file, line, fn, 0)
- o.prototype = rt.global.FunctionPrototype
- prototype := rt.newObject()
- o.defineProperty("prototype", objectValue(prototype), 0o100, false)
- prototype.defineProperty("constructor", objectValue(o), 0o100, false)
- return o
-}
-
-func (rt *runtime) newNodeFunction(node *nodeFunctionLiteral, scopeEnvironment stasher) *object {
- // TODO Implement 13.2 fully
- o := rt.newNodeFunctionObject(node, scopeEnvironment)
- o.prototype = rt.global.FunctionPrototype
- prototype := rt.newObject()
- o.defineProperty("prototype", objectValue(prototype), 0o100, false)
- prototype.defineProperty("constructor", objectValue(o), 0o101, false)
- return o
-}
-
-// FIXME Only in one place...
-func (rt *runtime) newBoundFunction(target *object, this Value, argumentList []Value) *object {
- o := rt.newBoundFunctionObject(target, this, argumentList)
- o.prototype = rt.global.FunctionPrototype
- prototype := rt.newObject()
- o.defineProperty("prototype", objectValue(prototype), 0o100, false)
- prototype.defineProperty("constructor", objectValue(o), 0o100, false)
- return o
-}
diff --git a/vendor/github.com/robertkrimen/otto/inline.go b/vendor/github.com/robertkrimen/otto/inline.go
deleted file mode 100644
index 6edaff6..0000000
--- a/vendor/github.com/robertkrimen/otto/inline.go
+++ /dev/null
@@ -1,8660 +0,0 @@
-// Code generated by tools/gen-jscore. DO NOT EDIT.
-
-package otto
-
-import (
- "math"
-)
-
-func (rt *runtime) newContext() {
- // Order here is import as definitions depend on each other.
-
- // Object prototype.
- rt.global.ObjectPrototype = &object{
- runtime: rt,
- class: classObjectName,
- objectClass: classObject,
- prototype: nil,
- extensible: true,
- value: prototypeValueObject,
- }
-
- // Function prototype.
- rt.global.FunctionPrototype = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: prototypeValueFunction,
- }
-
- // Object prototype property definition.
- rt.global.ObjectPrototype.property = map[string]property{
- "hasOwnProperty": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "hasOwnProperty",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "hasOwnProperty",
- call: builtinObjectHasOwnProperty,
- },
- },
- },
- },
- "isPrototypeOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isPrototypeOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isPrototypeOf",
- call: builtinObjectIsPrototypeOf,
- },
- },
- },
- },
- "propertyIsEnumerable": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "propertyIsEnumerable",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "propertyIsEnumerable",
- call: builtinObjectPropertyIsEnumerable,
- },
- },
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinObjectToString,
- },
- },
- },
- },
- "valueOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "valueOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "valueOf",
- call: builtinObjectValueOf,
- },
- },
- },
- },
- "toLocaleString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleString",
- call: builtinObjectToLocaleString,
- },
- },
- },
- },
- }
- rt.global.ObjectPrototype.propertyOrder = []string{
- propertyConstructor,
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- methodToString,
- "valueOf",
- "toLocaleString",
- }
-
- // Function prototype property definition.
- rt.global.FunctionPrototype.property = map[string]property{
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinFunctionToString,
- },
- },
- },
- },
- "apply": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "apply",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "apply",
- call: builtinFunctionApply,
- },
- },
- },
- },
- "call": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "call",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "call",
- call: builtinFunctionCall,
- },
- },
- },
- },
- "bind": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "bind",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "bind",
- call: builtinFunctionBind,
- },
- },
- },
- },
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- }
- rt.global.FunctionPrototype.propertyOrder = []string{
- methodToString,
- "apply",
- "call",
- "bind",
- propertyConstructor,
- propertyLength,
- }
-
- // Object definition.
- rt.global.Object = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classObjectName,
- call: builtinObject,
- construct: builtinNewObject,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.ObjectPrototype,
- },
- },
- "getPrototypeOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getPrototypeOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getPrototypeOf",
- call: builtinObjectGetPrototypeOf,
- },
- },
- },
- },
- "getOwnPropertyDescriptor": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getOwnPropertyDescriptor",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getOwnPropertyDescriptor",
- call: builtinObjectGetOwnPropertyDescriptor,
- },
- },
- },
- },
- "defineProperty": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 3,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "defineProperty",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "defineProperty",
- call: builtinObjectDefineProperty,
- },
- },
- },
- },
- "defineProperties": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "defineProperties",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "defineProperties",
- call: builtinObjectDefineProperties,
- },
- },
- },
- },
- "create": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "create",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "create",
- call: builtinObjectCreate,
- },
- },
- },
- },
- "isExtensible": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isExtensible",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isExtensible",
- call: builtinObjectIsExtensible,
- },
- },
- },
- },
- "preventExtensions": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "preventExtensions",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "preventExtensions",
- call: builtinObjectPreventExtensions,
- },
- },
- },
- },
- "isSealed": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isSealed",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isSealed",
- call: builtinObjectIsSealed,
- },
- },
- },
- },
- "seal": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "seal",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "seal",
- call: builtinObjectSeal,
- },
- },
- },
- },
- "isFrozen": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isFrozen",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isFrozen",
- call: builtinObjectIsFrozen,
- },
- },
- },
- },
- "freeze": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "freeze",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "freeze",
- call: builtinObjectFreeze,
- },
- },
- },
- },
- "keys": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "keys",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "keys",
- call: builtinObjectKeys,
- },
- },
- },
- },
- "getOwnPropertyNames": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getOwnPropertyNames",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getOwnPropertyNames",
- call: builtinObjectGetOwnPropertyNames,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- "getPrototypeOf",
- "getOwnPropertyDescriptor",
- "defineProperty",
- "defineProperties",
- "create",
- "isExtensible",
- "preventExtensions",
- "isSealed",
- "seal",
- "isFrozen",
- "freeze",
- "keys",
- "getOwnPropertyNames",
- },
- }
-
- // Object constructor definition.
- rt.global.ObjectPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Object,
- },
- }
-
- // Function definition.
- rt.global.Function = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classFunctionName,
- call: builtinFunction,
- construct: builtinNewFunction,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.FunctionPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // Function constructor definition.
- rt.global.FunctionPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Function,
- },
- }
-
- // Array prototype.
- rt.global.ArrayPrototype = &object{
- runtime: rt,
- class: classArrayName,
- objectClass: classArray,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- propertyLength: {
- mode: 0o100,
- value: Value{
- kind: valueNumber,
- value: uint32(0),
- },
- },
- "concat": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "concat",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "concat",
- call: builtinArrayConcat,
- },
- },
- },
- },
- "lastIndexOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "lastIndexOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "lastIndexOf",
- call: builtinArrayLastIndexOf,
- },
- },
- },
- },
- "pop": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "pop",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "pop",
- call: builtinArrayPop,
- },
- },
- },
- },
- "push": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "push",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "push",
- call: builtinArrayPush,
- },
- },
- },
- },
- "reverse": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "reverse",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "reverse",
- call: builtinArrayReverse,
- },
- },
- },
- },
- "shift": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "shift",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "shift",
- call: builtinArrayShift,
- },
- },
- },
- },
- "unshift": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "unshift",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "unshift",
- call: builtinArrayUnshift,
- },
- },
- },
- },
- "slice": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "slice",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "slice",
- call: builtinArraySlice,
- },
- },
- },
- },
- "sort": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "sort",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "sort",
- call: builtinArraySort,
- },
- },
- },
- },
- "splice": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "splice",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "splice",
- call: builtinArraySplice,
- },
- },
- },
- },
- "indexOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "indexOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "indexOf",
- call: builtinArrayIndexOf,
- },
- },
- },
- },
- "join": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "join",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "join",
- call: builtinArrayJoin,
- },
- },
- },
- },
- "forEach": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "forEach",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "forEach",
- call: builtinArrayForEach,
- },
- },
- },
- },
- "filter": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "filter",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "filter",
- call: builtinArrayFilter,
- },
- },
- },
- },
- "map": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "map",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "map",
- call: builtinArrayMap,
- },
- },
- },
- },
- "every": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "every",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "every",
- call: builtinArrayEvery,
- },
- },
- },
- },
- "some": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "some",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "some",
- call: builtinArraySome,
- },
- },
- },
- },
- "reduce": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "reduce",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "reduce",
- call: builtinArrayReduce,
- },
- },
- },
- },
- "reduceRight": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "reduceRight",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "reduceRight",
- call: builtinArrayReduceRight,
- },
- },
- },
- },
- "toLocaleString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleString",
- call: builtinArrayToLocaleString,
- },
- },
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinArrayToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyConstructor,
- "concat",
- "lastIndexOf",
- "pop",
- "push",
- "reverse",
- "shift",
- "unshift",
- "slice",
- "sort",
- "splice",
- "indexOf",
- "join",
- "forEach",
- "filter",
- "map",
- "every",
- "some",
- "reduce",
- "reduceRight",
- "toLocaleString",
- methodToString,
- },
- }
-
- // Array definition.
- rt.global.Array = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classArrayName,
- call: builtinArray,
- construct: builtinNewArray,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.ArrayPrototype,
- },
- },
- "isArray": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isArray",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isArray",
- call: builtinArrayIsArray,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- "isArray",
- },
- }
-
- // Array constructor definition.
- rt.global.ArrayPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Array,
- },
- }
-
- // String prototype.
- rt.global.StringPrototype = &object{
- runtime: rt,
- class: classStringName,
- objectClass: classString,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: prototypeValueString,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: int(0),
- },
- },
- "charAt": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "charAt",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "charAt",
- call: builtinStringCharAt,
- },
- },
- },
- },
- "charCodeAt": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "charCodeAt",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "charCodeAt",
- call: builtinStringCharCodeAt,
- },
- },
- },
- },
- "concat": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "concat",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "concat",
- call: builtinStringConcat,
- },
- },
- },
- },
- "indexOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "indexOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "indexOf",
- call: builtinStringIndexOf,
- },
- },
- },
- },
- "lastIndexOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "lastIndexOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "lastIndexOf",
- call: builtinStringLastIndexOf,
- },
- },
- },
- },
- "localeCompare": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "localeCompare",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "localeCompare",
- call: builtinStringLocaleCompare,
- },
- },
- },
- },
- "match": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "match",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "match",
- call: builtinStringMatch,
- },
- },
- },
- },
- "replace": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "replace",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "replace",
- call: builtinStringReplace,
- },
- },
- },
- },
- "search": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "search",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "search",
- call: builtinStringSearch,
- },
- },
- },
- },
- "slice": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "slice",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "slice",
- call: builtinStringSlice,
- },
- },
- },
- },
- "split": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "split",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "split",
- call: builtinStringSplit,
- },
- },
- },
- },
- "substr": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "substr",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "substr",
- call: builtinStringSubstr,
- },
- },
- },
- },
- "substring": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "substring",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "substring",
- call: builtinStringSubstring,
- },
- },
- },
- },
- "startsWith": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "startsWith",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "startsWith",
- call: builtinStringStartsWith,
- },
- },
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinStringToString,
- },
- },
- },
- },
- "trim": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "trim",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "trim",
- call: builtinStringTrim,
- },
- },
- },
- },
- "trimLeft": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "trimLeft",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "trimLeft",
- call: builtinStringTrimLeft,
- },
- },
- },
- },
- "trimRight": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "trimRight",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "trimRight",
- call: builtinStringTrimRight,
- },
- },
- },
- },
- "toLocaleLowerCase": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleLowerCase",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleLowerCase",
- call: builtinStringToLocaleLowerCase,
- },
- },
- },
- },
- "toLocaleUpperCase": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleUpperCase",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleUpperCase",
- call: builtinStringToLocaleUpperCase,
- },
- },
- },
- },
- "toLowerCase": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLowerCase",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLowerCase",
- call: builtinStringToLowerCase,
- },
- },
- },
- },
- "toUpperCase": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toUpperCase",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toUpperCase",
- call: builtinStringToUpperCase,
- },
- },
- },
- },
- "valueOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "valueOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "valueOf",
- call: builtinStringValueOf,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyConstructor,
- "charAt",
- "charCodeAt",
- "concat",
- "indexOf",
- "lastIndexOf",
- "localeCompare",
- "match",
- "replace",
- "search",
- "slice",
- "split",
- "substr",
- "substring",
- "startsWith",
- methodToString,
- "trim",
- "trimLeft",
- "trimRight",
- "toLocaleLowerCase",
- "toLocaleUpperCase",
- "toLowerCase",
- "toUpperCase",
- "valueOf",
- },
- }
-
- // String definition.
- rt.global.String = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classStringName,
- call: builtinString,
- construct: builtinNewString,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.StringPrototype,
- },
- },
- "fromCharCode": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "fromCharCode",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "fromCharCode",
- call: builtinStringFromCharCode,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- "fromCharCode",
- },
- }
-
- // String constructor definition.
- rt.global.StringPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.String,
- },
- }
-
- // Boolean prototype.
- rt.global.BooleanPrototype = &object{
- runtime: rt,
- class: classBooleanName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: prototypeValueBoolean,
- property: map[string]property{
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinBooleanToString,
- },
- },
- },
- },
- "valueOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "valueOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "valueOf",
- call: builtinBooleanValueOf,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- methodToString,
- "valueOf",
- },
- }
-
- // Boolean definition.
- rt.global.Boolean = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classBooleanName,
- call: builtinBoolean,
- construct: builtinNewBoolean,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.BooleanPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // Boolean constructor definition.
- rt.global.BooleanPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Boolean,
- },
- }
-
- // Number prototype.
- rt.global.NumberPrototype = &object{
- runtime: rt,
- class: classNumberName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: prototypeValueNumber,
- property: map[string]property{
- "toExponential": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toExponential",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toExponential",
- call: builtinNumberToExponential,
- },
- },
- },
- },
- "toFixed": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toFixed",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toFixed",
- call: builtinNumberToFixed,
- },
- },
- },
- },
- "toPrecision": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toPrecision",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toPrecision",
- call: builtinNumberToPrecision,
- },
- },
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinNumberToString,
- },
- },
- },
- },
- "valueOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "valueOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "valueOf",
- call: builtinNumberValueOf,
- },
- },
- },
- },
- "toLocaleString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleString",
- call: builtinNumberToLocaleString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "toExponential",
- "toFixed",
- "toPrecision",
- methodToString,
- "valueOf",
- "toLocaleString",
- },
- }
-
- // Number definition.
- rt.global.Number = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classNumberName,
- call: builtinNumber,
- construct: builtinNewNumber,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.NumberPrototype,
- },
- },
- "isNaN": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isNaN",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isNaN",
- call: builtinNumberIsNaN,
- },
- },
- },
- },
- "MAX_VALUE": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.MaxFloat64,
- },
- },
- "MIN_VALUE": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.SmallestNonzeroFloat64,
- },
- },
- "NaN": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.NaN(),
- },
- },
- "NEGATIVE_INFINITY": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Inf(-1),
- },
- },
- "POSITIVE_INFINITY": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Inf(+1),
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- "isNaN",
- "MAX_VALUE",
- "MIN_VALUE",
- "NaN",
- "NEGATIVE_INFINITY",
- "POSITIVE_INFINITY",
- },
- }
-
- // Number constructor definition.
- rt.global.NumberPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Number,
- },
- }
-
- // Math definition.
- rt.global.Math = &object{
- runtime: rt,
- class: classMathName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- property: map[string]property{
- "abs": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "abs",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "abs",
- call: builtinMathAbs,
- },
- },
- },
- },
- "acos": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "acos",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "acos",
- call: builtinMathAcos,
- },
- },
- },
- },
- "acosh": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "acosh",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "acosh",
- call: builtinMathAcosh,
- },
- },
- },
- },
- "asin": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "asin",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "asin",
- call: builtinMathAsin,
- },
- },
- },
- },
- "asinh": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "asinh",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "asinh",
- call: builtinMathAsinh,
- },
- },
- },
- },
- "atan": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "atan",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "atan",
- call: builtinMathAtan,
- },
- },
- },
- },
- "atanh": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "atanh",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "atanh",
- call: builtinMathAtanh,
- },
- },
- },
- },
- "atan2": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "atan2",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "atan2",
- call: builtinMathAtan2,
- },
- },
- },
- },
- "cbrt": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "cbrt",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "cbrt",
- call: builtinMathCbrt,
- },
- },
- },
- },
- "ceil": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "ceil",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "ceil",
- call: builtinMathCeil,
- },
- },
- },
- },
- "cos": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "cos",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "cos",
- call: builtinMathCos,
- },
- },
- },
- },
- "cosh": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "cosh",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "cosh",
- call: builtinMathCosh,
- },
- },
- },
- },
- "exp": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "exp",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "exp",
- call: builtinMathExp,
- },
- },
- },
- },
- "expm1": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "expm1",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "expm1",
- call: builtinMathExpm1,
- },
- },
- },
- },
- "floor": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "floor",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "floor",
- call: builtinMathFloor,
- },
- },
- },
- },
- "log": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "log",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "log",
- call: builtinMathLog,
- },
- },
- },
- },
- "log10": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "log10",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "log10",
- call: builtinMathLog10,
- },
- },
- },
- },
- "log1p": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "log1p",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "log1p",
- call: builtinMathLog1p,
- },
- },
- },
- },
- "log2": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "log2",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "log2",
- call: builtinMathLog2,
- },
- },
- },
- },
- "max": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "max",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "max",
- call: builtinMathMax,
- },
- },
- },
- },
- "min": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "min",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "min",
- call: builtinMathMin,
- },
- },
- },
- },
- "pow": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "pow",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "pow",
- call: builtinMathPow,
- },
- },
- },
- },
- "random": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "random",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "random",
- call: builtinMathRandom,
- },
- },
- },
- },
- "round": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "round",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "round",
- call: builtinMathRound,
- },
- },
- },
- },
- "sin": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "sin",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "sin",
- call: builtinMathSin,
- },
- },
- },
- },
- "sinh": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "sinh",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "sinh",
- call: builtinMathSinh,
- },
- },
- },
- },
- "sqrt": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "sqrt",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "sqrt",
- call: builtinMathSqrt,
- },
- },
- },
- },
- "tan": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "tan",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "tan",
- call: builtinMathTan,
- },
- },
- },
- },
- "tanh": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "tanh",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "tanh",
- call: builtinMathTanh,
- },
- },
- },
- },
- "trunc": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "trunc",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "trunc",
- call: builtinMathTrunc,
- },
- },
- },
- },
- "E": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.E,
- },
- },
- "LN10": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Ln10,
- },
- },
- "LN2": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Ln2,
- },
- },
- "LOG10E": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Log10E,
- },
- },
- "LOG2E": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Log2E,
- },
- },
- "PI": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Pi,
- },
- },
- "SQRT1_2": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: sqrt1_2,
- },
- },
- "SQRT2": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Sqrt2,
- },
- },
- },
- propertyOrder: []string{
- "abs",
- "acos",
- "acosh",
- "asin",
- "asinh",
- "atan",
- "atanh",
- "atan2",
- "cbrt",
- "ceil",
- "cos",
- "cosh",
- "exp",
- "expm1",
- "floor",
- "log",
- "log10",
- "log1p",
- "log2",
- "max",
- "min",
- "pow",
- "random",
- "round",
- "sin",
- "sinh",
- "sqrt",
- "tan",
- "tanh",
- "trunc",
- "E",
- "LN10",
- "LN2",
- "LOG10E",
- "LOG2E",
- "PI",
- "SQRT1_2",
- "SQRT2",
- },
- }
-
- // Date prototype.
- rt.global.DatePrototype = &object{
- runtime: rt,
- class: classDateName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: prototypeValueDate,
- property: map[string]property{
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinDateToString,
- },
- },
- },
- },
- "toDateString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toDateString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toDateString",
- call: builtinDateToDateString,
- },
- },
- },
- },
- "toTimeString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toTimeString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toTimeString",
- call: builtinDateToTimeString,
- },
- },
- },
- },
- "toISOString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toISOString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toISOString",
- call: builtinDateToISOString,
- },
- },
- },
- },
- "toUTCString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toUTCString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toUTCString",
- call: builtinDateToUTCString,
- },
- },
- },
- },
- "toGMTString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toGMTString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toGMTString",
- call: builtinDateToGMTString,
- },
- },
- },
- },
- "getDate": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getDate",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getDate",
- call: builtinDateGetDate,
- },
- },
- },
- },
- "setDate": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setDate",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setDate",
- call: builtinDateSetDate,
- },
- },
- },
- },
- "getDay": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getDay",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getDay",
- call: builtinDateGetDay,
- },
- },
- },
- },
- "getFullYear": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getFullYear",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getFullYear",
- call: builtinDateGetFullYear,
- },
- },
- },
- },
- "setFullYear": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 3,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setFullYear",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setFullYear",
- call: builtinDateSetFullYear,
- },
- },
- },
- },
- "getHours": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getHours",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getHours",
- call: builtinDateGetHours,
- },
- },
- },
- },
- "setHours": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 4,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setHours",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setHours",
- call: builtinDateSetHours,
- },
- },
- },
- },
- "getMilliseconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getMilliseconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getMilliseconds",
- call: builtinDateGetMilliseconds,
- },
- },
- },
- },
- "setMilliseconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setMilliseconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setMilliseconds",
- call: builtinDateSetMilliseconds,
- },
- },
- },
- },
- "getMinutes": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getMinutes",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getMinutes",
- call: builtinDateGetMinutes,
- },
- },
- },
- },
- "setMinutes": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 3,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setMinutes",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setMinutes",
- call: builtinDateSetMinutes,
- },
- },
- },
- },
- "getMonth": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getMonth",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getMonth",
- call: builtinDateGetMonth,
- },
- },
- },
- },
- "setMonth": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setMonth",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setMonth",
- call: builtinDateSetMonth,
- },
- },
- },
- },
- "getSeconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getSeconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getSeconds",
- call: builtinDateGetSeconds,
- },
- },
- },
- },
- "setSeconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setSeconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setSeconds",
- call: builtinDateSetSeconds,
- },
- },
- },
- },
- "getTime": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getTime",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getTime",
- call: builtinDateGetTime,
- },
- },
- },
- },
- "setTime": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setTime",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setTime",
- call: builtinDateSetTime,
- },
- },
- },
- },
- "getTimezoneOffset": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getTimezoneOffset",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getTimezoneOffset",
- call: builtinDateGetTimezoneOffset,
- },
- },
- },
- },
- "getUTCDate": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCDate",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCDate",
- call: builtinDateGetUTCDate,
- },
- },
- },
- },
- "setUTCDate": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCDate",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCDate",
- call: builtinDateSetUTCDate,
- },
- },
- },
- },
- "getUTCDay": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCDay",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCDay",
- call: builtinDateGetUTCDay,
- },
- },
- },
- },
- "getUTCFullYear": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCFullYear",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCFullYear",
- call: builtinDateGetUTCFullYear,
- },
- },
- },
- },
- "setUTCFullYear": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 3,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCFullYear",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCFullYear",
- call: builtinDateSetUTCFullYear,
- },
- },
- },
- },
- "getUTCHours": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCHours",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCHours",
- call: builtinDateGetUTCHours,
- },
- },
- },
- },
- "setUTCHours": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 4,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCHours",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCHours",
- call: builtinDateSetUTCHours,
- },
- },
- },
- },
- "getUTCMilliseconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCMilliseconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCMilliseconds",
- call: builtinDateGetUTCMilliseconds,
- },
- },
- },
- },
- "setUTCMilliseconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCMilliseconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCMilliseconds",
- call: builtinDateSetUTCMilliseconds,
- },
- },
- },
- },
- "getUTCMinutes": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCMinutes",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCMinutes",
- call: builtinDateGetUTCMinutes,
- },
- },
- },
- },
- "setUTCMinutes": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 3,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCMinutes",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCMinutes",
- call: builtinDateSetUTCMinutes,
- },
- },
- },
- },
- "getUTCMonth": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCMonth",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCMonth",
- call: builtinDateGetUTCMonth,
- },
- },
- },
- },
- "setUTCMonth": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCMonth",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCMonth",
- call: builtinDateSetUTCMonth,
- },
- },
- },
- },
- "getUTCSeconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getUTCSeconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getUTCSeconds",
- call: builtinDateGetUTCSeconds,
- },
- },
- },
- },
- "setUTCSeconds": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setUTCSeconds",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setUTCSeconds",
- call: builtinDateSetUTCSeconds,
- },
- },
- },
- },
- "valueOf": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "valueOf",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "valueOf",
- call: builtinDateValueOf,
- },
- },
- },
- },
- "getYear": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "getYear",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "getYear",
- call: builtinDateGetYear,
- },
- },
- },
- },
- "setYear": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "setYear",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "setYear",
- call: builtinDateSetYear,
- },
- },
- },
- },
- "toJSON": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toJSON",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toJSON",
- call: builtinDateToJSON,
- },
- },
- },
- },
- "toLocaleString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleString",
- call: builtinDateToLocaleString,
- },
- },
- },
- },
- "toLocaleDateString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleDateString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleDateString",
- call: builtinDateToLocaleDateString,
- },
- },
- },
- },
- "toLocaleTimeString": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toLocaleTimeString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "toLocaleTimeString",
- call: builtinDateToLocaleTimeString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- methodToString,
- "toDateString",
- "toTimeString",
- "toISOString",
- "toUTCString",
- "toGMTString",
- "getDate",
- "setDate",
- "getDay",
- "getFullYear",
- "setFullYear",
- "getHours",
- "setHours",
- "getMilliseconds",
- "setMilliseconds",
- "getMinutes",
- "setMinutes",
- "getMonth",
- "setMonth",
- "getSeconds",
- "setSeconds",
- "getTime",
- "setTime",
- "getTimezoneOffset",
- "getUTCDate",
- "setUTCDate",
- "getUTCDay",
- "getUTCFullYear",
- "setUTCFullYear",
- "getUTCHours",
- "setUTCHours",
- "getUTCMilliseconds",
- "setUTCMilliseconds",
- "getUTCMinutes",
- "setUTCMinutes",
- "getUTCMonth",
- "setUTCMonth",
- "getUTCSeconds",
- "setUTCSeconds",
- "valueOf",
- "getYear",
- "setYear",
- "toJSON",
- "toLocaleString",
- "toLocaleDateString",
- "toLocaleTimeString",
- },
- }
-
- // Date definition.
- rt.global.Date = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classDateName,
- call: builtinDate,
- construct: builtinNewDate,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 7,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.DatePrototype,
- },
- },
- "parse": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "parse",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "parse",
- call: builtinDateParse,
- },
- },
- },
- },
- "UTC": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 7,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "UTC",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "UTC",
- call: builtinDateUTC,
- },
- },
- },
- },
- "now": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "now",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "now",
- call: builtinDateNow,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- "parse",
- "UTC",
- "now",
- },
- }
-
- // Date constructor definition.
- rt.global.DatePrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Date,
- },
- }
-
- // RegExp prototype.
- rt.global.RegExpPrototype = &object{
- runtime: rt,
- class: classRegExpName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: prototypeValueRegExp,
- property: map[string]property{
- "exec": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "exec",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "exec",
- call: builtinRegExpExec,
- },
- },
- },
- },
- "compile": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "compile",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "compile",
- call: builtinRegExpCompile,
- },
- },
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinRegExpToString,
- },
- },
- },
- },
- "test": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "test",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "test",
- call: builtinRegExpTest,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "exec",
- "compile",
- methodToString,
- "test",
- },
- }
-
- // RegExp definition.
- rt.global.RegExp = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classRegExpName,
- call: builtinRegExp,
- construct: builtinNewRegExp,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.RegExpPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // RegExp constructor definition.
- rt.global.RegExpPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.RegExp,
- },
- }
-
- // Error prototype.
- rt.global.ErrorPrototype = &object{
- runtime: rt,
- class: classErrorName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // Error definition.
- rt.global.Error = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classErrorName,
- call: builtinError,
- construct: builtinNewError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.ErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // Error constructor definition.
- rt.global.ErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Error,
- },
- }
-
- // EvalError prototype.
- rt.global.EvalErrorPrototype = &object{
- runtime: rt,
- class: classEvalErrorName,
- objectClass: classObject,
- prototype: rt.global.ErrorPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classEvalErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // EvalError definition.
- rt.global.EvalError = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classEvalErrorName,
- call: builtinEvalError,
- construct: builtinNewEvalError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.EvalErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // EvalError constructor definition.
- rt.global.EvalErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.EvalError,
- },
- }
-
- // TypeError prototype.
- rt.global.TypeErrorPrototype = &object{
- runtime: rt,
- class: classTypeErrorName,
- objectClass: classObject,
- prototype: rt.global.ErrorPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classTypeErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // TypeError definition.
- rt.global.TypeError = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classTypeErrorName,
- call: builtinTypeError,
- construct: builtinNewTypeError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.TypeErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // TypeError constructor definition.
- rt.global.TypeErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.TypeError,
- },
- }
-
- // RangeError prototype.
- rt.global.RangeErrorPrototype = &object{
- runtime: rt,
- class: classRangeErrorName,
- objectClass: classObject,
- prototype: rt.global.ErrorPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classRangeErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // RangeError definition.
- rt.global.RangeError = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classRangeErrorName,
- call: builtinRangeError,
- construct: builtinNewRangeError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.RangeErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // RangeError constructor definition.
- rt.global.RangeErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.RangeError,
- },
- }
-
- // ReferenceError prototype.
- rt.global.ReferenceErrorPrototype = &object{
- runtime: rt,
- class: classReferenceErrorName,
- objectClass: classObject,
- prototype: rt.global.ErrorPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classReferenceErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // ReferenceError definition.
- rt.global.ReferenceError = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classReferenceErrorName,
- call: builtinReferenceError,
- construct: builtinNewReferenceError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.ReferenceErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // ReferenceError constructor definition.
- rt.global.ReferenceErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.ReferenceError,
- },
- }
-
- // SyntaxError prototype.
- rt.global.SyntaxErrorPrototype = &object{
- runtime: rt,
- class: classSyntaxErrorName,
- objectClass: classObject,
- prototype: rt.global.ErrorPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classSyntaxErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // SyntaxError definition.
- rt.global.SyntaxError = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classSyntaxErrorName,
- call: builtinSyntaxError,
- construct: builtinNewSyntaxError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.SyntaxErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // SyntaxError constructor definition.
- rt.global.SyntaxErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.SyntaxError,
- },
- }
-
- // URIError prototype.
- rt.global.URIErrorPrototype = &object{
- runtime: rt,
- class: classURIErrorName,
- objectClass: classObject,
- prototype: rt.global.ErrorPrototype,
- extensible: true,
- value: nil,
- property: map[string]property{
- "name": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: classURIErrorName,
- },
- },
- "message": {
- mode: 0o101,
- value: Value{
- kind: valueString,
- value: "",
- },
- },
- methodToString: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "toString",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: methodToString,
- call: builtinErrorToString,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- propertyConstructor,
- "name",
- "message",
- methodToString,
- },
- }
-
- // URIError definition.
- rt.global.URIError = &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- value: nativeFunctionObject{
- name: classURIErrorName,
- call: builtinURIError,
- construct: builtinNewURIError,
- },
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyPrototype: {
- mode: 0,
- value: Value{
- kind: valueObject,
- value: rt.global.URIErrorPrototype,
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyPrototype,
- },
- }
-
- // URIError constructor definition.
- rt.global.URIErrorPrototype.property[propertyConstructor] = property{
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.URIError,
- },
- }
-
- // JSON definition.
- rt.global.JSON = &object{
- runtime: rt,
- class: classJSONName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- property: map[string]property{
- "parse": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "parse",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "parse",
- call: builtinJSONParse,
- },
- },
- },
- },
- "stringify": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 3,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "stringify",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "stringify",
- call: builtinJSONStringify,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- "parse",
- "stringify",
- },
- }
-
- // Global properties.
- rt.globalObject.property = map[string]property{
- "eval": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "eval",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "eval",
- call: builtinGlobalEval,
- },
- },
- },
- },
- "parseInt": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 2,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "parseInt",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "parseInt",
- call: builtinGlobalParseInt,
- },
- },
- },
- },
- "parseFloat": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "parseFloat",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "parseFloat",
- call: builtinGlobalParseFloat,
- },
- },
- },
- },
- "isNaN": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isNaN",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isNaN",
- call: builtinGlobalIsNaN,
- },
- },
- },
- },
- "isFinite": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "isFinite",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "isFinite",
- call: builtinGlobalIsFinite,
- },
- },
- },
- },
- "decodeURI": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "decodeURI",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "decodeURI",
- call: builtinGlobalDecodeURI,
- },
- },
- },
- },
- "decodeURIComponent": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "decodeURIComponent",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "decodeURIComponent",
- call: builtinGlobalDecodeURIComponent,
- },
- },
- },
- },
- "encodeURI": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "encodeURI",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "encodeURI",
- call: builtinGlobalEncodeURI,
- },
- },
- },
- },
- "encodeURIComponent": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "encodeURIComponent",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "encodeURIComponent",
- call: builtinGlobalEncodeURIComponent,
- },
- },
- },
- },
- "escape": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "escape",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "escape",
- call: builtinGlobalEscape,
- },
- },
- },
- },
- "unescape": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 1,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "unescape",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "unescape",
- call: builtinGlobalUnescape,
- },
- },
- },
- },
- classObjectName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Object,
- },
- },
- classFunctionName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Function,
- },
- },
- classArrayName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Array,
- },
- },
- classStringName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.String,
- },
- },
- classBooleanName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Boolean,
- },
- },
- classNumberName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Number,
- },
- },
- classMathName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Math,
- },
- },
- classDateName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Date,
- },
- },
- classRegExpName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.RegExp,
- },
- },
- classErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.Error,
- },
- },
- classEvalErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.EvalError,
- },
- },
- classTypeErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.TypeError,
- },
- },
- classRangeErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.RangeError,
- },
- },
- classReferenceErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.ReferenceError,
- },
- },
- classSyntaxErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.SyntaxError,
- },
- },
- classURIErrorName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.URIError,
- },
- },
- classJSONName: {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: rt.global.JSON,
- },
- },
- "undefined": {
- mode: 0,
- value: Value{
- kind: valueUndefined,
- },
- },
- "NaN": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.NaN(),
- },
- },
- "Infinity": {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: math.Inf(+1),
- },
- },
- }
-
- // Global property order.
- rt.globalObject.propertyOrder = []string{
- "eval",
- "parseInt",
- "parseFloat",
- "isNaN",
- "isFinite",
- "decodeURI",
- "decodeURIComponent",
- "encodeURI",
- "encodeURIComponent",
- "escape",
- "unescape",
- classObjectName,
- classFunctionName,
- classArrayName,
- classStringName,
- classBooleanName,
- classNumberName,
- classMathName,
- classDateName,
- classRegExpName,
- classErrorName,
- classEvalErrorName,
- classTypeErrorName,
- classRangeErrorName,
- classReferenceErrorName,
- classSyntaxErrorName,
- classURIErrorName,
- classJSONName,
- "undefined",
- "NaN",
- "Infinity",
- }
-}
-
-func (rt *runtime) newConsole() *object {
- return &object{
- runtime: rt,
- class: classObjectName,
- objectClass: classObject,
- prototype: rt.global.ObjectPrototype,
- extensible: true,
- property: map[string]property{
- "log": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "log",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "log",
- call: builtinConsoleLog,
- },
- },
- },
- },
- "debug": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "debug",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "debug",
- call: builtinConsoleLog,
- },
- },
- },
- },
- "info": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "info",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "info",
- call: builtinConsoleLog,
- },
- },
- },
- },
- "error": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "error",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "error",
- call: builtinConsoleError,
- },
- },
- },
- },
- "warn": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "warn",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "warn",
- call: builtinConsoleError,
- },
- },
- },
- },
- "dir": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "dir",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "dir",
- call: builtinConsoleDir,
- },
- },
- },
- },
- "time": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "time",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "time",
- call: builtinConsoleTime,
- },
- },
- },
- },
- "timeEnd": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "timeEnd",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "timeEnd",
- call: builtinConsoleTimeEnd,
- },
- },
- },
- },
- "trace": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "trace",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "trace",
- call: builtinConsoleTrace,
- },
- },
- },
- },
- "assert": {
- mode: 0o101,
- value: Value{
- kind: valueObject,
- value: &object{
- runtime: rt,
- class: classFunctionName,
- objectClass: classObject,
- prototype: rt.global.FunctionPrototype,
- extensible: true,
- property: map[string]property{
- propertyLength: {
- mode: 0,
- value: Value{
- kind: valueNumber,
- value: 0,
- },
- },
- propertyName: {
- mode: 0,
- value: Value{
- kind: valueString,
- value: "assert",
- },
- },
- },
- propertyOrder: []string{
- propertyLength,
- propertyName,
- },
- value: nativeFunctionObject{
- name: "assert",
- call: builtinConsoleAssert,
- },
- },
- },
- },
- },
- propertyOrder: []string{
- "log",
- "debug",
- "info",
- "error",
- "warn",
- "dir",
- "time",
- "timeEnd",
- "trace",
- "assert",
- },
- }
-}
-
-func intValue(value int) Value {
- return Value{
- kind: valueNumber,
- value: value,
- }
-}
-
-func int32Value(value int32) Value {
- return Value{
- kind: valueNumber,
- value: value,
- }
-}
-
-func int64Value(value int64) Value {
- return Value{
- kind: valueNumber,
- value: value,
- }
-}
-
-func uint16Value(value uint16) Value {
- return Value{
- kind: valueNumber,
- value: value,
- }
-}
-
-func uint32Value(value uint32) Value {
- return Value{
- kind: valueNumber,
- value: value,
- }
-}
-
-func float64Value(value float64) Value {
- return Value{
- kind: valueNumber,
- value: value,
- }
-}
-
-func stringValue(value string) Value {
- return Value{
- kind: valueString,
- value: value,
- }
-}
-
-func string16Value(value []uint16) Value {
- return Value{
- kind: valueString,
- value: value,
- }
-}
-
-func boolValue(value bool) Value {
- return Value{
- kind: valueBoolean,
- value: value,
- }
-}
-
-func objectValue(value *object) Value {
- return Value{
- kind: valueObject,
- value: value,
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/locale.go b/vendor/github.com/robertkrimen/otto/locale.go
deleted file mode 100644
index c92fe89..0000000
--- a/vendor/github.com/robertkrimen/otto/locale.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package otto
-
-import "golang.org/x/text/language"
-
-var defaultLanguage = language.MustParse("en-US")
diff --git a/vendor/github.com/robertkrimen/otto/object.go b/vendor/github.com/robertkrimen/otto/object.go
deleted file mode 100644
index f5b7c6c..0000000
--- a/vendor/github.com/robertkrimen/otto/object.go
+++ /dev/null
@@ -1,151 +0,0 @@
-package otto
-
-type object struct {
- runtime *runtime
-
- class string
- objectClass *objectClass
- value interface{}
-
- prototype *object
- extensible bool
-
- property map[string]property
- propertyOrder []string
-}
-
-func newObject(rt *runtime, class string) *object {
- o := &object{
- runtime: rt,
- class: class,
- objectClass: classObject,
- property: make(map[string]property),
- extensible: true,
- }
- return o
-}
-
-// 8.12
-
-// 8.12.1.
-func (o *object) getOwnProperty(name string) *property {
- return o.objectClass.getOwnProperty(o, name)
-}
-
-// 8.12.2.
-func (o *object) getProperty(name string) *property {
- return o.objectClass.getProperty(o, name)
-}
-
-// 8.12.3.
-func (o *object) get(name string) Value {
- return o.objectClass.get(o, name)
-}
-
-// 8.12.4.
-func (o *object) canPut(name string) bool {
- return o.objectClass.canPut(o, name)
-}
-
-// 8.12.5.
-func (o *object) put(name string, value Value, throw bool) {
- o.objectClass.put(o, name, value, throw)
-}
-
-// 8.12.6.
-func (o *object) hasProperty(name string) bool {
- return o.objectClass.hasProperty(o, name)
-}
-
-func (o *object) hasOwnProperty(name string) bool {
- return o.objectClass.hasOwnProperty(o, name)
-}
-
-type defaultValueHint int
-
-const (
- defaultValueNoHint defaultValueHint = iota
- defaultValueHintString
- defaultValueHintNumber
-)
-
-// 8.12.8.
-func (o *object) DefaultValue(hint defaultValueHint) Value {
- if hint == defaultValueNoHint {
- if o.class == classDateName {
- // Date exception
- hint = defaultValueHintString
- } else {
- hint = defaultValueHintNumber
- }
- }
- methodSequence := []string{"valueOf", "toString"}
- if hint == defaultValueHintString {
- methodSequence = []string{"toString", "valueOf"}
- }
- for _, methodName := range methodSequence {
- method := o.get(methodName)
- // FIXME This is redundant...
- if method.isCallable() {
- result := method.object().call(objectValue(o), nil, false, nativeFrame)
- if result.IsPrimitive() {
- return result
- }
- }
- }
-
- panic(o.runtime.panicTypeError("Object.DefaultValue unknown"))
-}
-
-func (o *object) String() string {
- return o.DefaultValue(defaultValueHintString).string()
-}
-
-func (o *object) defineProperty(name string, value Value, mode propertyMode, throw bool) bool { //nolint: unparam
- return o.defineOwnProperty(name, property{value, mode}, throw)
-}
-
-// 8.12.9.
-func (o *object) defineOwnProperty(name string, descriptor property, throw bool) bool {
- return o.objectClass.defineOwnProperty(o, name, descriptor, throw)
-}
-
-func (o *object) delete(name string, throw bool) bool {
- return o.objectClass.delete(o, name, throw)
-}
-
-func (o *object) enumerate(all bool, each func(string) bool) {
- o.objectClass.enumerate(o, all, each)
-}
-
-func (o *object) readProperty(name string) (property, bool) {
- prop, exists := o.property[name]
- return prop, exists
-}
-
-func (o *object) writeProperty(name string, value interface{}, mode propertyMode) {
- if value == nil {
- value = Value{}
- }
- if _, exists := o.property[name]; !exists {
- o.propertyOrder = append(o.propertyOrder, name)
- }
- o.property[name] = property{value, mode}
-}
-
-func (o *object) deleteProperty(name string) {
- if _, exists := o.property[name]; !exists {
- return
- }
-
- delete(o.property, name)
- for index, prop := range o.propertyOrder {
- if name == prop {
- if index == len(o.propertyOrder)-1 {
- o.propertyOrder = o.propertyOrder[:index]
- } else {
- o.propertyOrder = append(o.propertyOrder[:index], o.propertyOrder[index+1:]...)
- }
- }
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/object_class.go b/vendor/github.com/robertkrimen/otto/object_class.go
deleted file mode 100644
index 35407e5..0000000
--- a/vendor/github.com/robertkrimen/otto/object_class.go
+++ /dev/null
@@ -1,490 +0,0 @@
-package otto
-
-import (
- "encoding/json"
-)
-
-type objectClass struct {
- getOwnProperty func(*object, string) *property
- getProperty func(*object, string) *property
- get func(*object, string) Value
- canPut func(*object, string) bool
- put func(*object, string, Value, bool)
- hasProperty func(*object, string) bool
- hasOwnProperty func(*object, string) bool
- defineOwnProperty func(*object, string, property, bool) bool
- delete func(*object, string, bool) bool
- enumerate func(*object, bool, func(string) bool)
- clone func(*object, *object, *cloner) *object
- marshalJSON func(*object) json.Marshaler
-}
-
-func objectEnumerate(obj *object, all bool, each func(string) bool) {
- for _, name := range obj.propertyOrder {
- if all || obj.property[name].enumerable() {
- if !each(name) {
- return
- }
- }
- }
-}
-
-var classObject,
- classArray,
- classString,
- classArguments,
- classGoStruct,
- classGoMap,
- classGoArray,
- classGoSlice *objectClass
-
-func init() {
- classObject = &objectClass{
- objectGetOwnProperty,
- objectGetProperty,
- objectGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- objectDefineOwnProperty,
- objectDelete,
- objectEnumerate,
- objectClone,
- nil,
- }
-
- classArray = &objectClass{
- objectGetOwnProperty,
- objectGetProperty,
- objectGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- arrayDefineOwnProperty,
- objectDelete,
- objectEnumerate,
- objectClone,
- nil,
- }
-
- classString = &objectClass{
- stringGetOwnProperty,
- objectGetProperty,
- objectGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- objectDefineOwnProperty,
- objectDelete,
- stringEnumerate,
- objectClone,
- nil,
- }
-
- classArguments = &objectClass{
- argumentsGetOwnProperty,
- objectGetProperty,
- argumentsGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- argumentsDefineOwnProperty,
- argumentsDelete,
- objectEnumerate,
- objectClone,
- nil,
- }
-
- classGoStruct = &objectClass{
- goStructGetOwnProperty,
- objectGetProperty,
- objectGet,
- goStructCanPut,
- goStructPut,
- objectHasProperty,
- objectHasOwnProperty,
- objectDefineOwnProperty,
- objectDelete,
- goStructEnumerate,
- objectClone,
- goStructMarshalJSON,
- }
-
- classGoMap = &objectClass{
- goMapGetOwnProperty,
- objectGetProperty,
- objectGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- goMapDefineOwnProperty,
- goMapDelete,
- goMapEnumerate,
- objectClone,
- nil,
- }
-
- classGoArray = &objectClass{
- goArrayGetOwnProperty,
- objectGetProperty,
- objectGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- goArrayDefineOwnProperty,
- goArrayDelete,
- goArrayEnumerate,
- objectClone,
- nil,
- }
-
- classGoSlice = &objectClass{
- goSliceGetOwnProperty,
- objectGetProperty,
- objectGet,
- objectCanPut,
- objectPut,
- objectHasProperty,
- objectHasOwnProperty,
- goSliceDefineOwnProperty,
- goSliceDelete,
- goSliceEnumerate,
- objectClone,
- nil,
- }
-}
-
-// Allons-y
-
-// 8.12.1.
-func objectGetOwnProperty(obj *object, name string) *property {
- // Return a _copy_ of the prop
- prop, exists := obj.readProperty(name)
- if !exists {
- return nil
- }
- return &prop
-}
-
-// 8.12.2.
-func objectGetProperty(obj *object, name string) *property {
- prop := obj.getOwnProperty(name)
- if prop != nil {
- return prop
- }
- if obj.prototype != nil {
- return obj.prototype.getProperty(name)
- }
- return nil
-}
-
-// 8.12.3.
-func objectGet(obj *object, name string) Value {
- if prop := obj.getProperty(name); prop != nil {
- return prop.get(obj)
- }
- return Value{}
-}
-
-// 8.12.4.
-func objectCanPut(obj *object, name string) bool {
- canPut, _, _ := objectCanPutDetails(obj, name)
- return canPut
-}
-
-func objectCanPutDetails(obj *object, name string) (canPut bool, prop *property, setter *object) { //nolint: nonamedreturns
- prop = obj.getOwnProperty(name)
- if prop != nil {
- switch propertyValue := prop.value.(type) {
- case Value:
- return prop.writable(), prop, nil
- case propertyGetSet:
- setter = propertyValue[1]
- return setter != nil, prop, setter
- default:
- panic(obj.runtime.panicTypeError("unexpected type %T to Object.CanPutDetails", prop.value))
- }
- }
-
- if obj.prototype == nil {
- return obj.extensible, nil, nil
- }
-
- prop = obj.prototype.getProperty(name)
- if prop == nil {
- return obj.extensible, nil, nil
- }
-
- switch propertyValue := prop.value.(type) {
- case Value:
- if !obj.extensible {
- return false, nil, nil
- }
- return prop.writable(), nil, nil
- case propertyGetSet:
- setter = propertyValue[1]
- return setter != nil, prop, setter
- default:
- panic(obj.runtime.panicTypeError("unexpected type %T to Object.CanPutDetails", prop.value))
- }
-}
-
-// 8.12.5.
-func objectPut(obj *object, name string, value Value, throw bool) {
- if true {
- // Shortcut...
- //
- // So, right now, every class is using objectCanPut and every class
- // is using objectPut.
- //
- // If that were to no longer be the case, we would have to have
- // something to detect that here, so that we do not use an
- // incompatible canPut routine
- canPut, prop, setter := objectCanPutDetails(obj, name)
- switch {
- case !canPut:
- obj.runtime.typeErrorResult(throw)
- case setter != nil:
- setter.call(toValue(obj), []Value{value}, false, nativeFrame)
- case prop != nil:
- prop.value = value
- obj.defineOwnProperty(name, *prop, throw)
- default:
- obj.defineProperty(name, value, 0o111, throw)
- }
- return
- }
-
- // The long way...
- //
- // Right now, code should never get here, see above
- if !obj.canPut(name) {
- obj.runtime.typeErrorResult(throw)
- return
- }
-
- prop := obj.getOwnProperty(name)
- if prop == nil {
- prop = obj.getProperty(name)
- if prop != nil {
- if getSet, isAccessor := prop.value.(propertyGetSet); isAccessor {
- getSet[1].call(toValue(obj), []Value{value}, false, nativeFrame)
- return
- }
- }
- obj.defineProperty(name, value, 0o111, throw)
- return
- }
-
- switch propertyValue := prop.value.(type) {
- case Value:
- prop.value = value
- obj.defineOwnProperty(name, *prop, throw)
- case propertyGetSet:
- if propertyValue[1] != nil {
- propertyValue[1].call(toValue(obj), []Value{value}, false, nativeFrame)
- return
- }
- if throw {
- panic(obj.runtime.panicTypeError("Object.Put nil second parameter to propertyGetSet"))
- }
- default:
- panic(obj.runtime.panicTypeError("Object.Put unexpected type %T", prop.value))
- }
-}
-
-// 8.12.6.
-func objectHasProperty(obj *object, name string) bool {
- return obj.getProperty(name) != nil
-}
-
-func objectHasOwnProperty(obj *object, name string) bool {
- return obj.getOwnProperty(name) != nil
-}
-
-// 8.12.9.
-func objectDefineOwnProperty(obj *object, name string, descriptor property, throw bool) bool {
- reject := func(reason string) bool {
- if throw {
- panic(obj.runtime.panicTypeError("Object.DefineOwnProperty: %s", reason))
- }
- return false
- }
-
- prop, exists := obj.readProperty(name)
- if !exists {
- if !obj.extensible {
- return reject("not exists and not extensible")
- }
- if newGetSet, isAccessor := descriptor.value.(propertyGetSet); isAccessor {
- if newGetSet[0] == &nilGetSetObject {
- newGetSet[0] = nil
- }
- if newGetSet[1] == &nilGetSetObject {
- newGetSet[1] = nil
- }
- descriptor.value = newGetSet
- }
- obj.writeProperty(name, descriptor.value, descriptor.mode)
- return true
- }
-
- if descriptor.isEmpty() {
- return true
- }
-
- // TODO Per 8.12.9.6 - We should shortcut here (returning true) if
- // the current and new (define) properties are the same
-
- configurable := prop.configurable()
- if !configurable {
- if descriptor.configurable() {
- return reject("property and descriptor not configurable")
- }
- // Test that, if enumerable is set on the property descriptor, then it should
- // be the same as the existing property
- if descriptor.enumerateSet() && descriptor.enumerable() != prop.enumerable() {
- return reject("property not configurable and enumerable miss match")
- }
- }
-
- value, isDataDescriptor := prop.value.(Value)
- getSet, _ := prop.value.(propertyGetSet)
- switch {
- case descriptor.isGenericDescriptor():
- // GenericDescriptor
- case isDataDescriptor != descriptor.isDataDescriptor():
- // DataDescriptor <=> AccessorDescriptor
- if !configurable {
- return reject("property descriptor not configurable")
- }
- case isDataDescriptor && descriptor.isDataDescriptor():
- // DataDescriptor <=> DataDescriptor
- if !configurable {
- if !prop.writable() && descriptor.writable() {
- return reject("property not configurable or writeable and descriptor not writeable")
- }
- if !prop.writable() {
- if descriptor.value != nil && !sameValue(value, descriptor.value.(Value)) {
- return reject("property not configurable or writeable and descriptor not the same")
- }
- }
- }
- default:
- // AccessorDescriptor <=> AccessorDescriptor
- newGetSet, _ := descriptor.value.(propertyGetSet)
- presentGet, presentSet := true, true
- if newGetSet[0] == &nilGetSetObject {
- // Present, but nil
- newGetSet[0] = nil
- } else if newGetSet[0] == nil {
- // Missing, not even nil
- newGetSet[0] = getSet[0]
- presentGet = false
- }
- if newGetSet[1] == &nilGetSetObject {
- // Present, but nil
- newGetSet[1] = nil
- } else if newGetSet[1] == nil {
- // Missing, not even nil
- newGetSet[1] = getSet[1]
- presentSet = false
- }
- if !configurable {
- if (presentGet && (getSet[0] != newGetSet[0])) || (presentSet && (getSet[1] != newGetSet[1])) {
- return reject("access descriptor not configurable")
- }
- }
- descriptor.value = newGetSet
- }
-
- // This section will preserve attributes of
- // the original property, if necessary
- value1 := descriptor.value
- if value1 == nil {
- value1 = prop.value
- } else if newGetSet, isAccessor := descriptor.value.(propertyGetSet); isAccessor {
- if newGetSet[0] == &nilGetSetObject {
- newGetSet[0] = nil
- }
- if newGetSet[1] == &nilGetSetObject {
- newGetSet[1] = nil
- }
- value1 = newGetSet
- }
- mode1 := descriptor.mode
- if mode1&0o222 != 0 {
- // TODO Factor this out into somewhere testable
- // (Maybe put into switch ...)
- mode0 := prop.mode
- if mode1&0o200 != 0 {
- if descriptor.isDataDescriptor() {
- mode1 &= ^0o200 // Turn off "writable" missing
- mode1 |= (mode0 & 0o100)
- }
- }
- if mode1&0o20 != 0 {
- mode1 |= (mode0 & 0o10)
- }
- if mode1&0o2 != 0 {
- mode1 |= (mode0 & 0o1)
- }
- mode1 &= 0o311 // 0311 to preserve the non-setting on "writable"
- }
- obj.writeProperty(name, value1, mode1)
-
- return true
-}
-
-func objectDelete(obj *object, name string, throw bool) bool {
- prop := obj.getOwnProperty(name)
- if prop == nil {
- return true
- }
- if prop.configurable() {
- obj.deleteProperty(name)
- return true
- }
- return obj.runtime.typeErrorResult(throw)
-}
-
-func objectClone(in *object, out *object, clone *cloner) *object {
- *out = *in
-
- out.runtime = clone.runtime
- if out.prototype != nil {
- out.prototype = clone.object(in.prototype)
- }
- out.property = make(map[string]property, len(in.property))
- out.propertyOrder = make([]string, len(in.propertyOrder))
- copy(out.propertyOrder, in.propertyOrder)
- for index, prop := range in.property {
- out.property[index] = clone.property(prop)
- }
-
- switch value := in.value.(type) {
- case nativeFunctionObject:
- out.value = value
- case bindFunctionObject:
- out.value = bindFunctionObject{
- target: clone.object(value.target),
- this: clone.value(value.this),
- argumentList: clone.valueArray(value.argumentList),
- }
- case nodeFunctionObject:
- out.value = nodeFunctionObject{
- node: value.node,
- stash: clone.stash(value.stash),
- }
- case argumentsObject:
- out.value = value.clone(clone)
- }
-
- return out
-}
diff --git a/vendor/github.com/robertkrimen/otto/otto.go b/vendor/github.com/robertkrimen/otto/otto.go
deleted file mode 100644
index ca80bc5..0000000
--- a/vendor/github.com/robertkrimen/otto/otto.go
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
-Package otto is a JavaScript parser and interpreter written natively in Go.
-
-http://godoc.org/github.com/robertkrimen/otto
-
- import (
- "github.com/robertkrimen/otto"
- )
-
-Run something in the VM
-
- vm := otto.New()
- vm.Run(`
- abc = 2 + 2;
- console.log("The value of abc is " + abc); // 4
- `)
-
-Get a value out of the VM
-
- value, err := vm.Get("abc")
- value, _ := value.ToInteger()
- }
-
-Set a number
-
- vm.Set("def", 11)
- vm.Run(`
- console.log("The value of def is " + def);
- // The value of def is 11
- `)
-
-Set a string
-
- vm.Set("xyzzy", "Nothing happens.")
- vm.Run(`
- console.log(xyzzy.length); // 16
- `)
-
-Get the value of an expression
-
- value, _ = vm.Run("xyzzy.length")
- // iv is an int64 with a value of 16
- iv, _ := value.ToInteger()
-
-An error happens
-
- value, err = vm.Run("abcdefghijlmnopqrstuvwxyz.length")
- if err != nil {
- // err = ReferenceError: abcdefghijlmnopqrstuvwxyz is not defined
- // If there is an error, then value.IsUndefined() is true
- ...
- }
-
-Set a Go function
-
- vm.Set("sayHello", func(call otto.FunctionCall) otto.Value {
- fmt.Printf("Hello, %s.\n", call.Argument(0).String())
- return otto.Value{}
- })
-
-Set a Go function that returns something useful
-
- vm.Set("twoPlus", func(call otto.FunctionCall) otto.Value {
- right, _ := call.Argument(0).ToInteger()
- result, _ := vm.ToValue(2 + right)
- return result
- })
-
-Use the functions in JavaScript
-
- result, _ = vm.Run(`
- sayHello("Xyzzy"); // Hello, Xyzzy.
- sayHello(); // Hello, undefined
-
- result = twoPlus(2.0); // 4
- `)
-
-# Parser
-
-A separate parser is available in the parser package if you're just interested in building an AST.
-
-http://godoc.org/github.com/robertkrimen/otto/parser
-
-Parse and return an AST
-
- filename := "" // A filename is optional
- src := `
- // Sample xyzzy example
- (function(){
- if (3.14159 > 0) {
- console.log("Hello, World.");
- return;
- }
-
- var xyzzy = NaN;
- console.log("Nothing happens.");
- return xyzzy;
- })();
- `
-
- // Parse some JavaScript, yielding a *ast.Program and/or an ErrorList
- program, err := parser.ParseFile(nil, filename, src, 0)
-
-otto
-
-You can run (Go) JavaScript from the commandline with: http://github.com/robertkrimen/otto/tree/master/otto
-
- $ go get -v github.com/robertkrimen/otto/otto
-
-Run JavaScript by entering some source on stdin or by giving otto a filename:
-
- $ otto example.js
-
-underscore
-
-Optionally include the JavaScript utility-belt library, underscore, with this import:
-
- import (
- "github.com/robertkrimen/otto"
- _ "github.com/robertkrimen/otto/underscore"
- )
-
- // Now every otto runtime will come loaded with underscore
-
-For more information: http://github.com/robertkrimen/otto/tree/master/underscore
-
-# Caveat Emptor
-
-The following are some limitations with otto:
-
- - "use strict" will parse, but does nothing.
- - The regular expression engine (re2/regexp) is not fully compatible with the ECMA5 specification.
- - Otto targets ES5. ES6 features (eg: Typed Arrays) are not supported.
-
-# Regular Expression Incompatibility
-
-Go translates JavaScript-style regular expressions into something that is "regexp" compatible via `parser.TransformRegExp`.
-Unfortunately, RegExp requires backtracking for some patterns, and backtracking is not supported by the standard Go engine: https://code.google.com/p/re2/wiki/Syntax
-
-Therefore, the following syntax is incompatible:
-
- (?=) // Lookahead (positive), currently a parsing error
- (?!) // Lookahead (backhead), currently a parsing error
- \1 // Backreference (\1, \2, \3, ...), currently a parsing error
-
-A brief discussion of these limitations: "Regexp (?!re)" https://groups.google.com/forum/?fromgroups=#%21topic/golang-nuts/7qgSDWPIh_E
-
-More information about re2: https://code.google.com/p/re2/
-
-In addition to the above, re2 (Go) has a different definition for \s: [\t\n\f\r ].
-The JavaScript definition, on the other hand, also includes \v, Unicode "Separator, Space", etc.
-
-# Halting Problem
-
-If you want to stop long running executions (like third-party code), you can use the interrupt channel to do this:
-
- package main
-
- import (
- "errors"
- "fmt"
- "os"
- "time"
-
- "github.com/robertkrimen/otto"
- )
-
- var halt = errors.New("Stahp")
-
- func main() {
- runUnsafe(`var abc = [];`)
- runUnsafe(`
- while (true) {
- // Loop forever
- }`)
- }
-
- func runUnsafe(unsafe string) {
- start := time.Now()
- defer func() {
- duration := time.Since(start)
- if caught := recover(); caught != nil {
- if caught == halt {
- fmt.Fprintf(os.Stderr, "Some code took to long! Stopping after: %v\n", duration)
- return
- }
- panic(caught) // Something else happened, repanic!
- }
- fmt.Fprintf(os.Stderr, "Ran code successfully: %v\n", duration)
- }()
-
- vm := otto.New()
- vm.Interrupt = make(chan func(), 1) // The buffer prevents blocking
-
- go func() {
- time.Sleep(2 * time.Second) // Stop after two seconds
- vm.Interrupt <- func() {
- panic(halt)
- }
- }()
-
- vm.Run(unsafe) // Here be dragons (risky code)
- }
-
-Where is setTimeout/setInterval?
-
-These timing functions are not actually part of the ECMA-262 specification. Typically, they belong to the `windows` object (in the browser).
-It would not be difficult to provide something like these via Go, but you probably want to wrap otto in an event loop in that case.
-
-For an example of how this could be done in Go with otto, see natto:
-
-http://github.com/robertkrimen/natto
-
-Here is some more discussion of the issue:
-
-* http://book.mixu.net/node/ch2.html
-* http://en.wikipedia.org/wiki/Reentrancy_%28computing%29
-* http://aaroncrane.co.uk/2009/02/perl_safe_signals/
-*/
-package otto
-
-import (
- "encoding/json"
- "fmt"
- "strings"
-
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/registry"
-)
-
-// Otto is the representation of the JavaScript runtime.
-// Each instance of Otto has a self-contained namespace.
-type Otto struct {
- // Interrupt is a channel for interrupting the runtime. You can use this to halt a long running execution, for example.
- // See "Halting Problem" for more information.
- Interrupt chan func()
- runtime *runtime
-}
-
-// New will allocate a new JavaScript runtime.
-func New() *Otto {
- o := &Otto{
- runtime: newContext(),
- }
- o.runtime.otto = o
- o.runtime.traceLimit = 10
- if err := o.Set("console", o.runtime.newConsole()); err != nil {
- panic(err)
- }
-
- registry.Apply(func(entry registry.Entry) {
- if _, err := o.Run(entry.Source()); err != nil {
- panic(err)
- }
- })
-
- return o
-}
-
-func (o *Otto) clone() *Otto {
- n := &Otto{
- runtime: o.runtime.clone(),
- }
- n.runtime.otto = n
- return n
-}
-
-// Run will allocate a new JavaScript runtime, run the given source
-// on the allocated runtime, and return the runtime, resulting value, and
-// error (if any).
-//
-// src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST always be in UTF-8.
-//
-// src may also be a Script.
-//
-// src may also be a Program, but if the AST has been modified, then runtime behavior is undefined.
-func Run(src interface{}) (*Otto, Value, error) {
- otto := New()
- value, err := otto.Run(src) // This already does safety checking
- return otto, value, err
-}
-
-// Run will run the given source (parsing it first if necessary), returning the resulting value and error (if any)
-//
-// src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST always be in UTF-8.
-//
-// If the runtime is unable to parse source, then this function will return undefined and the parse error (nothing
-// will be evaluated in this case).
-//
-// src may also be a Script.
-//
-// src may also be a Program, but if the AST has been modified, then runtime behavior is undefined.
-func (o Otto) Run(src interface{}) (Value, error) {
- value, err := o.runtime.cmplRun(src, nil)
- if !value.safe() {
- value = Value{}
- }
- return value, err
-}
-
-// Eval will do the same thing as Run, except without leaving the current scope.
-//
-// By staying in the same scope, the code evaluated has access to everything
-// already defined in the current stack frame. This is most useful in, for
-// example, a debugger call.
-func (o Otto) Eval(src interface{}) (Value, error) {
- if o.runtime.scope == nil {
- o.runtime.enterGlobalScope()
- defer o.runtime.leaveScope()
- }
-
- value, err := o.runtime.cmplEval(src, nil)
- if !value.safe() {
- value = Value{}
- }
- return value, err
-}
-
-// Get the value of the top-level binding of the given name.
-//
-// If there is an error (like the binding does not exist), then the value
-// will be undefined.
-func (o Otto) Get(name string) (Value, error) {
- value := Value{}
- err := catchPanic(func() {
- value = o.getValue(name)
- })
- if !value.safe() {
- value = Value{}
- }
- return value, err
-}
-
-func (o Otto) getValue(name string) Value {
- return o.runtime.globalStash.getBinding(name, false)
-}
-
-// Set the top-level binding of the given name to the given value.
-//
-// Set will automatically apply ToValue to the given value in order
-// to convert it to a JavaScript value (type Value).
-//
-// If there is an error (like the binding is read-only, or the ToValue conversion
-// fails), then an error is returned.
-//
-// If the top-level binding does not exist, it will be created.
-func (o Otto) Set(name string, value interface{}) error {
- val, err := o.ToValue(value)
- if err != nil {
- return err
- }
-
- return catchPanic(func() {
- o.setValue(name, val)
- })
-}
-
-func (o Otto) setValue(name string, value Value) {
- o.runtime.globalStash.setValue(name, value, false)
-}
-
-// SetDebuggerHandler sets the debugger handler to fn.
-func (o Otto) SetDebuggerHandler(fn func(vm *Otto)) {
- o.runtime.debugger = fn
-}
-
-// SetRandomSource sets the random source to fn.
-func (o Otto) SetRandomSource(fn func() float64) {
- o.runtime.random = fn
-}
-
-// SetStackDepthLimit sets an upper limit to the depth of the JavaScript
-// stack. In simpler terms, this limits the number of "nested" function calls
-// you can make in a particular interpreter instance.
-//
-// Note that this doesn't take into account the Go stack depth. If your
-// JavaScript makes a call to a Go function, otto won't keep track of what
-// happens outside the interpreter. So if your Go function is infinitely
-// recursive, you're still in trouble.
-func (o Otto) SetStackDepthLimit(limit int) {
- o.runtime.stackLimit = limit
-}
-
-// SetStackTraceLimit sets an upper limit to the number of stack frames that
-// otto will use when formatting an error's stack trace. By default, the limit
-// is 10. This is consistent with V8 and SpiderMonkey.
-//
-// TODO: expose via `Error.stackTraceLimit`.
-func (o Otto) SetStackTraceLimit(limit int) {
- o.runtime.traceLimit = limit
-}
-
-// MakeCustomError creates a new Error object with the given name and message,
-// returning it as a Value.
-func (o Otto) MakeCustomError(name, message string) Value {
- return o.runtime.toValue(o.runtime.newError(name, o.runtime.toValue(message), 0))
-}
-
-// MakeRangeError creates a new RangeError object with the given message,
-// returning it as a Value.
-func (o Otto) MakeRangeError(message string) Value {
- return o.runtime.toValue(o.runtime.newRangeError(o.runtime.toValue(message)))
-}
-
-// MakeSyntaxError creates a new SyntaxError object with the given message,
-// returning it as a Value.
-func (o Otto) MakeSyntaxError(message string) Value {
- return o.runtime.toValue(o.runtime.newSyntaxError(o.runtime.toValue(message)))
-}
-
-// MakeTypeError creates a new TypeError object with the given message,
-// returning it as a Value.
-func (o Otto) MakeTypeError(message string) Value {
- return o.runtime.toValue(o.runtime.newTypeError(o.runtime.toValue(message)))
-}
-
-// Context is a structure that contains information about the current execution
-// context.
-type Context struct {
- Filename string
- Line int
- Column int
- Callee string
- Symbols map[string]Value
- This Value
- Stacktrace []string
-}
-
-// Context returns the current execution context of the vm, traversing up to
-// ten stack frames, and skipping any innermost native function stack frames.
-func (o Otto) Context() Context {
- return o.ContextSkip(10, true)
-}
-
-// ContextLimit returns the current execution context of the vm, with a
-// specific limit on the number of stack frames to traverse, skipping any
-// innermost native function stack frames.
-func (o Otto) ContextLimit(limit int) Context {
- return o.ContextSkip(limit, true)
-}
-
-// ContextSkip returns the current execution context of the vm, with a
-// specific limit on the number of stack frames to traverse, optionally
-// skipping any innermost native function stack frames.
-func (o Otto) ContextSkip(limit int, skipNative bool) Context {
- // Ensure we are operating in a scope
- if o.runtime.scope == nil {
- o.runtime.enterGlobalScope()
- defer o.runtime.leaveScope()
- }
-
- curScope := o.runtime.scope
- frm := curScope.frame
-
- for skipNative && frm.native && curScope.outer != nil {
- curScope = curScope.outer
- frm = curScope.frame
- }
-
- // Get location information
- var ctx Context
- ctx.Filename = ""
- ctx.Callee = frm.callee
-
- switch {
- case frm.native:
- ctx.Filename = frm.nativeFile
- ctx.Line = frm.nativeLine
- ctx.Column = 0
- case frm.file != nil:
- ctx.Filename = ""
-
- if p := frm.file.Position(file.Idx(frm.offset)); p != nil {
- ctx.Line = p.Line
- ctx.Column = p.Column
-
- if p.Filename != "" {
- ctx.Filename = p.Filename
- }
- }
- }
-
- // Get the current scope this Value
- ctx.This = objectValue(curScope.this)
-
- // Build stacktrace (up to 10 levels deep)
- ctx.Symbols = make(map[string]Value)
- ctx.Stacktrace = append(ctx.Stacktrace, frm.location())
- for limit != 0 {
- // Get variables
- stash := curScope.lexical
- for {
- for _, name := range getStashProperties(stash) {
- if _, ok := ctx.Symbols[name]; !ok {
- ctx.Symbols[name] = stash.getBinding(name, true)
- }
- }
- stash = stash.outer()
- if stash == nil || stash.outer() == nil {
- break
- }
- }
-
- curScope = curScope.outer
- if curScope == nil {
- break
- }
- if curScope.frame.offset >= 0 {
- ctx.Stacktrace = append(ctx.Stacktrace, curScope.frame.location())
- }
- limit--
- }
-
- return ctx
-}
-
-// Call the given JavaScript with a given this and arguments.
-//
-// If this is nil, then some special handling takes place to determine the proper
-// this value, falling back to a "standard" invocation if necessary (where this is
-// undefined).
-//
-// If source begins with "new " (A lowercase new followed by a space), then
-// Call will invoke the function constructor rather than performing a function call.
-// In this case, the this argument has no effect.
-//
-// // value is a String object
-// value, _ := vm.Call("Object", nil, "Hello, World.")
-//
-// // Likewise...
-// value, _ := vm.Call("new Object", nil, "Hello, World.")
-//
-// // This will perform a concat on the given array and return the result
-// // value is [ 1, 2, 3, undefined, 4, 5, 6, 7, "abc" ]
-// value, _ := vm.Call(`[ 1, 2, 3, undefined, 4 ].concat`, nil, 5, 6, 7, "abc")
-func (o Otto) Call(source string, this interface{}, argumentList ...interface{}) (Value, error) {
- thisValue := Value{}
-
- construct := false
- if strings.HasPrefix(source, "new ") {
- source = source[4:]
- construct = true
- }
-
- // FIXME enterGlobalScope
- o.runtime.enterGlobalScope()
- defer func() {
- o.runtime.leaveScope()
- }()
-
- if !construct && this == nil {
- program, err := o.runtime.cmplParse("", source+"()", nil)
- if err == nil {
- if node, ok := program.body[0].(*nodeExpressionStatement); ok {
- if node, ok := node.expression.(*nodeCallExpression); ok {
- var value Value
- err := catchPanic(func() {
- value = o.runtime.cmplEvaluateNodeCallExpression(node, argumentList)
- })
- if err != nil {
- return Value{}, err
- }
- return value, nil
- }
- }
- }
- } else {
- value, err := o.ToValue(this)
- if err != nil {
- return Value{}, err
- }
- thisValue = value
- }
-
- val := thisValue
- fn, err := o.Run(source)
- if err != nil {
- return Value{}, err
- }
-
- if construct {
- result, err := fn.constructSafe(o.runtime, val, argumentList...)
- if err != nil {
- return Value{}, err
- }
- return result, nil
- }
-
- result, err := fn.Call(val, argumentList...)
- if err != nil {
- return Value{}, err
- }
- return result, nil
-}
-
-// Object will run the given source and return the result as an object.
-//
-// For example, accessing an existing object:
-//
-// object, _ := vm.Object(`Number`)
-//
-// Or, creating a new object:
-//
-// object, _ := vm.Object(`({ xyzzy: "Nothing happens." })`)
-//
-// Or, creating and assigning an object:
-//
-// object, _ := vm.Object(`xyzzy = {}`)
-// object.Set("volume", 11)
-//
-// If there is an error (like the source does not result in an object), then
-// nil and an error is returned.
-func (o Otto) Object(source string) (*Object, error) {
- value, err := o.runtime.cmplRun(source, nil)
- if err != nil {
- return nil, err
- }
- if value.IsObject() {
- return value.Object(), nil
- }
- return nil, fmt.Errorf("value is not an object")
-}
-
-// ToValue will convert an interface{} value to a value digestible by otto/JavaScript.
-func (o Otto) ToValue(value interface{}) (Value, error) {
- return o.runtime.safeToValue(value)
-}
-
-// Copy will create a copy/clone of the runtime.
-//
-// Copy is useful for saving some time when creating many similar runtimes.
-//
-// This method works by walking the original runtime and cloning each object, scope, stash,
-// etc. into a new runtime.
-//
-// Be on the lookout for memory leaks or inadvertent sharing of resources.
-func (o *Otto) Copy() *Otto {
- out := &Otto{
- runtime: o.runtime.clone(),
- }
- out.runtime.otto = out
- return out
-}
-
-// Object is the representation of a JavaScript object.
-type Object struct {
- object *object
- value Value
-}
-
-// Call a method on the object.
-//
-// It is essentially equivalent to:
-//
-// var method, _ := object.Get(name)
-// method.Call(object, argumentList...)
-//
-// An undefined value and an error will result if:
-//
-// 1. There is an error during conversion of the argument list
-// 2. The property is not actually a function
-// 3. An (uncaught) exception is thrown
-func (o Object) Call(name string, argumentList ...interface{}) (Value, error) {
- // TODO: Insert an example using JavaScript below...
- // e.g., Object("JSON").Call("stringify", ...)
-
- function, err := o.Get(name)
- if err != nil {
- return Value{}, err
- }
- return function.Call(o.Value(), argumentList...)
-}
-
-// Value returns the value of o.
-func (o Object) Value() Value {
- return o.value
-}
-
-// Get the value of the property with the given name.
-func (o Object) Get(name string) (Value, error) {
- value := Value{}
- err := catchPanic(func() {
- value = o.object.get(name)
- })
- if !value.safe() {
- value = Value{}
- }
- return value, err
-}
-
-// Set the property of the given name to the given value.
-//
-// An error will result if the setting the property triggers an exception (i.e. read-only),
-// or there is an error during conversion of the given value.
-func (o Object) Set(name string, value interface{}) error {
- val, err := o.object.runtime.safeToValue(value)
- if err != nil {
- return err
- }
-
- return catchPanic(func() {
- o.object.put(name, val, true)
- })
-}
-
-// Keys gets the keys for the given object.
-//
-// Equivalent to calling Object.keys on the object.
-func (o Object) Keys() []string {
- var keys []string
- o.object.enumerate(false, func(name string) bool {
- keys = append(keys, name)
- return true
- })
- return keys
-}
-
-// KeysByParent gets the keys (and those of the parents) for the given object,
-// in order of "closest" to "furthest".
-func (o Object) KeysByParent() [][]string {
- var a [][]string
-
- for o := o.object; o != nil; o = o.prototype {
- var l []string
-
- o.enumerate(false, func(name string) bool {
- l = append(l, name)
- return true
- })
-
- a = append(a, l)
- }
-
- return a
-}
-
-// Class will return the class string of the object.
-//
-// The return value will (generally) be one of:
-//
-// Object
-// Function
-// Array
-// String
-// Number
-// Boolean
-// Date
-// RegExp
-func (o Object) Class() string {
- return o.object.class
-}
-
-// MarshalJSON implements json.Marshaller.
-func (o Object) MarshalJSON() ([]byte, error) {
- var goValue interface{}
- switch value := o.object.value.(type) {
- case *goStructObject:
- goValue = value.value.Interface()
- case *goMapObject:
- goValue = value.value.Interface()
- case *goArrayObject:
- goValue = value.value.Interface()
- case *goSliceObject:
- goValue = value.value.Interface()
- default:
- // It's a JS object; pass it to JSON.stringify:
- var result []byte
- err := catchPanic(func() {
- resultVal := builtinJSONStringify(FunctionCall{
- runtime: o.object.runtime,
- ArgumentList: []Value{o.value},
- })
- result = []byte(resultVal.String())
- })
- return result, err
- }
- return json.Marshal(goValue)
-}
diff --git a/vendor/github.com/robertkrimen/otto/otto_.go b/vendor/github.com/robertkrimen/otto/otto_.go
deleted file mode 100644
index bf44679..0000000
--- a/vendor/github.com/robertkrimen/otto/otto_.go
+++ /dev/null
@@ -1,150 +0,0 @@
-package otto
-
-import (
- "fmt"
- "regexp"
- goruntime "runtime"
- "strconv"
-)
-
-var isIdentifierRegexp *regexp.Regexp = regexp.MustCompile(`^[a-zA-Z\$][a-zA-Z0-9\$]*$`)
-
-func isIdentifier(value string) bool {
- return isIdentifierRegexp.MatchString(value)
-}
-
-func (rt *runtime) toValueArray(arguments ...interface{}) []Value {
- length := len(arguments)
- if length == 1 {
- if valueArray, ok := arguments[0].([]Value); ok {
- return valueArray
- }
- return []Value{rt.toValue(arguments[0])}
- }
-
- valueArray := make([]Value, length)
- for index, value := range arguments {
- valueArray[index] = rt.toValue(value)
- }
-
- return valueArray
-}
-
-func stringToArrayIndex(name string) int64 {
- index, err := strconv.ParseInt(name, 10, 64)
- if err != nil {
- return -1
- }
- if index < 0 {
- return -1
- }
- if index >= maxUint32 {
- // The value 2^32 (or above) is not a valid index because
- // you cannot store a uint32 length for an index of uint32
- return -1
- }
- return index
-}
-
-func isUint32(value int64) bool {
- return value >= 0 && value <= maxUint32
-}
-
-func arrayIndexToString(index int64) string {
- return strconv.FormatInt(index, 10)
-}
-
-func valueOfArrayIndex(array []Value, index int) Value {
- value, _ := getValueOfArrayIndex(array, index)
- return value
-}
-
-func getValueOfArrayIndex(array []Value, index int) (Value, bool) {
- if index >= 0 && index < len(array) {
- value := array[index]
- if !value.isEmpty() {
- return value, true
- }
- }
- return Value{}, false
-}
-
-// A range index can be anything from 0 up to length. It is NOT safe to use as an index
-// to an array, but is useful for slicing and in some ECMA algorithms.
-func valueToRangeIndex(indexValue Value, length int64, negativeIsZero bool) int64 {
- index := indexValue.number().int64
- if negativeIsZero {
- if index < 0 {
- index = 0
- }
- // minimum(index, length)
- if index >= length {
- index = length
- }
- return index
- }
-
- if index < 0 {
- index += length
- if index < 0 {
- index = 0
- }
- } else if index > length {
- index = length
- }
- return index
-}
-
-func rangeStartEnd(array []Value, size int64, negativeIsZero bool) (start, end int64) { //nolint: nonamedreturns
- start = valueToRangeIndex(valueOfArrayIndex(array, 0), size, negativeIsZero)
- if len(array) == 1 {
- // If there is only the start argument, then end = size
- end = size
- return
- }
-
- // Assuming the argument is undefined...
- end = size
- endValue := valueOfArrayIndex(array, 1)
- if !endValue.IsUndefined() {
- // Which it is not, so get the value as an array index
- end = valueToRangeIndex(endValue, size, negativeIsZero)
- }
- return
-}
-
-func rangeStartLength(source []Value, size int64) (start, length int64) { //nolint: nonamedreturns
- start = valueToRangeIndex(valueOfArrayIndex(source, 0), size, false)
-
- // Assume the second argument is missing or undefined
- length = size
- if len(source) == 1 {
- // If there is only the start argument, then length = size
- return start, length
- }
-
- lengthValue := valueOfArrayIndex(source, 1)
- if !lengthValue.IsUndefined() {
- // Which it is not, so get the value as an array index
- length = lengthValue.number().int64
- }
- return start, length
-}
-
-func hereBeDragons(arguments ...interface{}) string {
- pc, _, _, _ := goruntime.Caller(1) //nolint: dogsled
- name := goruntime.FuncForPC(pc).Name()
- message := fmt.Sprintf("Here be dragons -- %s", name)
- if len(arguments) > 0 {
- message += ": "
- argument0 := fmt.Sprintf("%s", arguments[0])
- if len(arguments) == 1 {
- message += argument0
- } else {
- message += fmt.Sprintf(argument0, arguments[1:]...)
- }
- } else {
- message += "."
- }
- return message
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/error.go b/vendor/github.com/robertkrimen/otto/parser/error.go
deleted file mode 100644
index ba66dec..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/error.go
+++ /dev/null
@@ -1,187 +0,0 @@
-package parser
-
-import (
- "fmt"
- "sort"
-
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/token"
-)
-
-const (
- errUnexpectedToken = "Unexpected token %v"
- errUnexpectedEndOfInput = "Unexpected end of input"
-)
-
-// UnexpectedNumber: 'Unexpected number',
-// UnexpectedString: 'Unexpected string',
-// UnexpectedIdentifier: 'Unexpected identifier',
-// UnexpectedReserved: 'Unexpected reserved word',
-// NewlineAfterThrow: 'Illegal newline after throw',
-// InvalidRegExp: 'Invalid regular expression',
-// UnterminatedRegExp: 'Invalid regular expression: missing /',
-// InvalidLHSInAssignment: 'invalid left-hand side in assignment',
-// InvalidLHSInForIn: 'Invalid left-hand side in for-in',
-// MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
-// NoCatchOrFinally: 'Missing catch or finally after try',
-// UnknownLabel: 'Undefined label \'%0\'',
-// Redeclaration: '%0 \'%1\' has already been declared',
-// IllegalContinue: 'Illegal continue statement',
-// IllegalBreak: 'Illegal break statement',
-// IllegalReturn: 'Illegal return statement',
-// StrictModeWith: 'Strict mode code may not include a with statement',
-// StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
-// StrictVarName: 'Variable name may not be eval or arguments in strict mode',
-// StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
-// StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
-// StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
-// StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
-// StrictDelete: 'Delete of an unqualified identifier in strict mode.',
-// StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',
-// AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',
-// AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',
-// StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
-// StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
-// StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
-// StrictReservedWord: 'Use of future reserved word in strict mode'
-
-// A SyntaxError is a description of an ECMAScript syntax error.
-
-// An Error represents a parsing error. It includes the position where the error occurred and a message/description.
-type Error struct {
- Position file.Position
- Message string
-}
-
-// FIXME Should this be "SyntaxError"?
-
-func (e Error) Error() string {
- filename := e.Position.Filename
- if filename == "" {
- filename = "(anonymous)"
- }
- return fmt.Sprintf("%s: Line %d:%d %s",
- filename,
- e.Position.Line,
- e.Position.Column,
- e.Message,
- )
-}
-
-func (p *parser) error(place interface{}, msg string, msgValues ...interface{}) {
- var idx file.Idx
- switch place := place.(type) {
- case int:
- idx = p.idxOf(place)
- case file.Idx:
- if place == 0 {
- idx = p.idxOf(p.chrOffset)
- } else {
- idx = place
- }
- default:
- panic(fmt.Errorf("error(%T, ...)", place))
- }
-
- position := p.position(idx)
- msg = fmt.Sprintf(msg, msgValues...)
- p.errors.Add(position, msg)
-}
-
-func (p *parser) errorUnexpected(idx file.Idx, chr rune) {
- if chr == -1 {
- p.error(idx, errUnexpectedEndOfInput)
- return
- }
- p.error(idx, errUnexpectedToken, token.ILLEGAL)
-}
-
-func (p *parser) errorUnexpectedToken(tkn token.Token) {
- if tkn == token.EOF {
- p.error(file.Idx(0), errUnexpectedEndOfInput)
- return
- }
- value := tkn.String()
- switch tkn {
- case token.BOOLEAN, token.NULL:
- p.error(p.idx, errUnexpectedToken, p.literal)
- case token.IDENTIFIER:
- p.error(p.idx, "Unexpected identifier")
- case token.KEYWORD:
- // TODO Might be a future reserved word
- p.error(p.idx, "Unexpected reserved word")
- case token.NUMBER:
- p.error(p.idx, "Unexpected number")
- case token.STRING:
- p.error(p.idx, "Unexpected string")
- default:
- p.error(p.idx, errUnexpectedToken, value)
- }
-}
-
-// ErrorList is a list of *Errors.
-type ErrorList []*Error //nolint: errname
-
-// Add adds an Error with given position and message to an ErrorList.
-func (el *ErrorList) Add(position file.Position, msg string) {
- *el = append(*el, &Error{position, msg})
-}
-
-// Reset resets an ErrorList to no errors.
-func (el *ErrorList) Reset() {
- *el = (*el)[0:0]
-}
-
-// Len implement sort.Interface.
-func (el *ErrorList) Len() int {
- return len(*el)
-}
-
-// Swap implement sort.Interface.
-func (el *ErrorList) Swap(i, j int) {
- (*el)[i], (*el)[j] = (*el)[j], (*el)[i]
-}
-
-// Less implement sort.Interface.
-func (el *ErrorList) Less(i, j int) bool {
- x := (*el)[i].Position
- y := (*el)[j].Position
- if x.Filename < y.Filename {
- return true
- }
- if x.Filename == y.Filename {
- if x.Line < y.Line {
- return true
- }
- if x.Line == y.Line {
- return x.Column < y.Column
- }
- }
- return false
-}
-
-// Sort sorts el.
-func (el *ErrorList) Sort() {
- sort.Sort(el)
-}
-
-// Error implements the Error interface.
-func (el *ErrorList) Error() string {
- switch len(*el) {
- case 0:
- return "no errors"
- case 1:
- return (*el)[0].Error()
- default:
- return fmt.Sprintf("%s (and %d more errors)", (*el)[0].Error(), len(*el)-1)
- }
-}
-
-// Err returns an error equivalent to this ErrorList.
-// If the list is empty, Err returns nil.
-func (el *ErrorList) Err() error {
- if len(*el) == 0 {
- return nil
- }
- return el
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/expression.go b/vendor/github.com/robertkrimen/otto/parser/expression.go
deleted file mode 100644
index bfff965..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/expression.go
+++ /dev/null
@@ -1,994 +0,0 @@
-package parser
-
-import (
- "regexp"
-
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/token"
-)
-
-func (p *parser) parseIdentifier() *ast.Identifier {
- literal := p.literal
- idx := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.LEADING)
- }
- p.next()
- exp := &ast.Identifier{
- Name: literal,
- Idx: idx,
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(exp)
- }
-
- return exp
-}
-
-func (p *parser) parsePrimaryExpression() ast.Expression {
- literal := p.literal
- idx := p.idx
- switch p.token {
- case token.IDENTIFIER:
- p.next()
- if len(literal) > 1 {
- tkn, strict := token.IsKeyword(literal)
- if tkn == token.KEYWORD {
- if !strict {
- p.error(idx, "Unexpected reserved word")
- }
- }
- }
- return &ast.Identifier{
- Name: literal,
- Idx: idx,
- }
- case token.NULL:
- p.next()
- return &ast.NullLiteral{
- Idx: idx,
- Literal: literal,
- }
- case token.BOOLEAN:
- p.next()
- value := false
- switch literal {
- case "true":
- value = true
- case "false":
- value = false
- default:
- p.error(idx, "Illegal boolean literal")
- }
- return &ast.BooleanLiteral{
- Idx: idx,
- Literal: literal,
- Value: value,
- }
- case token.STRING:
- p.next()
- value, err := parseStringLiteral(literal[1 : len(literal)-1])
- if err != nil {
- p.error(idx, err.Error())
- }
- return &ast.StringLiteral{
- Idx: idx,
- Literal: literal,
- Value: value,
- }
- case token.NUMBER:
- p.next()
- value, err := parseNumberLiteral(literal)
- if err != nil {
- p.error(idx, err.Error())
- value = 0
- }
- return &ast.NumberLiteral{
- Idx: idx,
- Literal: literal,
- Value: value,
- }
- case token.SLASH, token.QUOTIENT_ASSIGN:
- return p.parseRegExpLiteral()
- case token.LEFT_BRACE:
- return p.parseObjectLiteral()
- case token.LEFT_BRACKET:
- return p.parseArrayLiteral()
- case token.LEFT_PARENTHESIS:
- p.expect(token.LEFT_PARENTHESIS)
- expression := p.parseExpression()
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.RIGHT_PARENTHESIS)
- return expression
- case token.THIS:
- p.next()
- return &ast.ThisExpression{
- Idx: idx,
- }
- case token.FUNCTION:
- return p.parseFunction(false)
- }
-
- p.errorUnexpectedToken(p.token)
- p.nextStatement()
- return &ast.BadExpression{From: idx, To: p.idx}
-}
-
-func (p *parser) parseRegExpLiteral() *ast.RegExpLiteral {
- offset := p.chrOffset - 1 // Opening slash already gotten
- if p.token == token.QUOTIENT_ASSIGN {
- offset-- // =
- }
- idx := p.idxOf(offset)
-
- pattern, err := p.scanString(offset)
- endOffset := p.chrOffset
-
- p.next()
- if err == nil {
- pattern = pattern[1 : len(pattern)-1]
- }
-
- flags := ""
- if p.token == token.IDENTIFIER { // gim
- flags = p.literal
- p.next()
- endOffset = p.chrOffset - 1
- }
-
- var value string
- // TODO 15.10
- // Test during parsing that this is a valid regular expression
- // Sorry, (?=) and (?!) are invalid (for now)
- pat, err := TransformRegExp(pattern)
- if err != nil {
- if pat == "" || p.mode&IgnoreRegExpErrors == 0 {
- p.error(idx, "Invalid regular expression: %s", err.Error())
- }
- } else {
- _, err = regexp.Compile(pat)
- if err != nil {
- // We should not get here, ParseRegExp should catch any errors
- p.error(idx, "Invalid regular expression: %s", err.Error()[22:]) // Skip redundant "parse regexp error"
- } else {
- value = pat
- }
- }
-
- literal := p.str[offset:endOffset]
-
- return &ast.RegExpLiteral{
- Idx: idx,
- Literal: literal,
- Pattern: pattern,
- Flags: flags,
- Value: value,
- }
-}
-
-func (p *parser) parseVariableDeclaration(declarationList *[]*ast.VariableExpression) ast.Expression {
- if p.token != token.IDENTIFIER {
- idx := p.expect(token.IDENTIFIER)
- p.nextStatement()
- return &ast.BadExpression{From: idx, To: p.idx}
- }
-
- literal := p.literal
- idx := p.idx
- p.next()
- node := &ast.VariableExpression{
- Name: literal,
- Idx: idx,
- }
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(node)
- }
-
- if declarationList != nil {
- *declarationList = append(*declarationList, node)
- }
-
- if p.token == token.ASSIGN {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- node.Initializer = p.parseAssignmentExpression()
- }
-
- return node
-}
-
-func (p *parser) parseVariableDeclarationList(idx file.Idx) []ast.Expression {
- var declarationList []*ast.VariableExpression // Avoid bad expressions
- var list []ast.Expression
-
- for {
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.LEADING)
- }
- decl := p.parseVariableDeclaration(&declarationList)
- list = append(list, decl)
- if p.token != token.COMMA {
- break
- }
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- }
-
- p.scope.declare(&ast.VariableDeclaration{
- Var: idx,
- List: declarationList,
- })
-
- return list
-}
-
-func (p *parser) parseObjectPropertyKey() (string, string) {
- idx, tkn, literal := p.idx, p.token, p.literal
- value := ""
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.KEY)
- }
- p.next()
-
- switch tkn {
- case token.IDENTIFIER:
- value = literal
- case token.NUMBER:
- var err error
- _, err = parseNumberLiteral(literal)
- if err != nil {
- p.error(idx, err.Error())
- } else {
- value = literal
- }
- case token.STRING:
- var err error
- value, err = parseStringLiteral(literal[1 : len(literal)-1])
- if err != nil {
- p.error(idx, err.Error())
- }
- default:
- // null, false, class, etc.
- if matchIdentifier.MatchString(literal) {
- value = literal
- }
- }
- return literal, value
-}
-
-func (p *parser) parseObjectProperty() ast.Property {
- literal, value := p.parseObjectPropertyKey()
- if literal == "get" && p.token != token.COLON {
- idx := p.idx
- _, value := p.parseObjectPropertyKey()
- parameterList := p.parseFunctionParameterList()
-
- node := &ast.FunctionLiteral{
- Function: idx,
- ParameterList: parameterList,
- }
- p.parseFunctionBlock(node)
- return ast.Property{
- Key: value,
- Kind: "get",
- Value: node,
- }
- } else if literal == "set" && p.token != token.COLON {
- idx := p.idx
- _, value := p.parseObjectPropertyKey()
- parameterList := p.parseFunctionParameterList()
-
- node := &ast.FunctionLiteral{
- Function: idx,
- ParameterList: parameterList,
- }
- p.parseFunctionBlock(node)
- return ast.Property{
- Key: value,
- Kind: "set",
- Value: node,
- }
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.COLON)
- }
- p.expect(token.COLON)
-
- exp := ast.Property{
- Key: value,
- Kind: "value",
- Value: p.parseAssignmentExpression(),
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(exp.Value)
- }
- return exp
-}
-
-func (p *parser) parseObjectLiteral() ast.Expression {
- var value []ast.Property
- idx0 := p.expect(token.LEFT_BRACE)
- for p.token != token.RIGHT_BRACE && p.token != token.EOF {
- value = append(value, p.parseObjectProperty())
- if p.token == token.COMMA {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- continue
- }
- }
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.FINAL)
- }
- idx1 := p.expect(token.RIGHT_BRACE)
-
- return &ast.ObjectLiteral{
- LeftBrace: idx0,
- RightBrace: idx1,
- Value: value,
- }
-}
-
-func (p *parser) parseArrayLiteral() ast.Expression {
- idx0 := p.expect(token.LEFT_BRACKET)
- var value []ast.Expression
- for p.token != token.RIGHT_BRACKET && p.token != token.EOF {
- if p.token == token.COMMA {
- // This kind of comment requires a special empty expression node.
- empty := &ast.EmptyExpression{Begin: p.idx, End: p.idx}
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(empty)
- p.comments.Unset()
- }
- value = append(value, empty)
- p.next()
- continue
- }
-
- exp := p.parseAssignmentExpression()
-
- value = append(value, exp)
- if p.token != token.RIGHT_BRACKET {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.COMMA)
- }
- }
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.FINAL)
- }
- idx1 := p.expect(token.RIGHT_BRACKET)
-
- return &ast.ArrayLiteral{
- LeftBracket: idx0,
- RightBracket: idx1,
- Value: value,
- }
-}
-
-func (p *parser) parseArgumentList() (argumentList []ast.Expression, idx0, idx1 file.Idx) { //nolint: nonamedreturns
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- idx0 = p.expect(token.LEFT_PARENTHESIS)
- if p.token != token.RIGHT_PARENTHESIS {
- for {
- exp := p.parseAssignmentExpression()
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(exp)
- }
- argumentList = append(argumentList, exp)
- if p.token != token.COMMA {
- break
- }
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- }
- }
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- idx1 = p.expect(token.RIGHT_PARENTHESIS)
- return
-}
-
-func (p *parser) parseCallExpression(left ast.Expression) ast.Expression {
- argumentList, idx0, idx1 := p.parseArgumentList()
- exp := &ast.CallExpression{
- Callee: left,
- LeftParenthesis: idx0,
- ArgumentList: argumentList,
- RightParenthesis: idx1,
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(exp)
- }
- return exp
-}
-
-func (p *parser) parseDotMember(left ast.Expression) ast.Expression {
- period := p.expect(token.PERIOD)
-
- literal := p.literal
- idx := p.idx
-
- if !matchIdentifier.MatchString(literal) {
- p.expect(token.IDENTIFIER)
- p.nextStatement()
- return &ast.BadExpression{From: period, To: p.idx}
- }
-
- p.next()
-
- return &ast.DotExpression{
- Left: left,
- Identifier: &ast.Identifier{
- Idx: idx,
- Name: literal,
- },
- }
-}
-
-func (p *parser) parseBracketMember(left ast.Expression) ast.Expression {
- idx0 := p.expect(token.LEFT_BRACKET)
- member := p.parseExpression()
- idx1 := p.expect(token.RIGHT_BRACKET)
- return &ast.BracketExpression{
- LeftBracket: idx0,
- Left: left,
- Member: member,
- RightBracket: idx1,
- }
-}
-
-func (p *parser) parseNewExpression() ast.Expression {
- idx := p.expect(token.NEW)
- callee := p.parseLeftHandSideExpression()
- node := &ast.NewExpression{
- New: idx,
- Callee: callee,
- }
- if p.token == token.LEFT_PARENTHESIS {
- argumentList, idx0, idx1 := p.parseArgumentList()
- node.ArgumentList = argumentList
- node.LeftParenthesis = idx0
- node.RightParenthesis = idx1
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(node)
- }
-
- return node
-}
-
-func (p *parser) parseLeftHandSideExpression() ast.Expression {
- var left ast.Expression
- if p.token == token.NEW {
- left = p.parseNewExpression()
- } else {
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.LEADING)
- p.comments.MarkPrimary()
- }
- left = p.parsePrimaryExpression()
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(left)
- }
-
- for {
- switch p.token {
- case token.PERIOD:
- left = p.parseDotMember(left)
- case token.LEFT_BRACKET:
- left = p.parseBracketMember(left)
- default:
- return left
- }
- }
-}
-
-func (p *parser) parseLeftHandSideExpressionAllowCall() ast.Expression {
- allowIn := p.scope.allowIn
- p.scope.allowIn = true
- defer func() {
- p.scope.allowIn = allowIn
- }()
-
- var left ast.Expression
- if p.token == token.NEW {
- var newComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- newComments = p.comments.FetchAll()
- p.comments.MarkComments(ast.LEADING)
- p.comments.MarkPrimary()
- }
- left = p.parseNewExpression()
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(left, newComments, ast.LEADING)
- }
- } else {
- if p.mode&StoreComments != 0 {
- p.comments.MarkComments(ast.LEADING)
- p.comments.MarkPrimary()
- }
- left = p.parsePrimaryExpression()
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(left)
- }
-
- for {
- switch p.token {
- case token.PERIOD:
- left = p.parseDotMember(left)
- case token.LEFT_BRACKET:
- left = p.parseBracketMember(left)
- case token.LEFT_PARENTHESIS:
- left = p.parseCallExpression(left)
- default:
- return left
- }
- }
-}
-
-func (p *parser) parsePostfixExpression() ast.Expression {
- operand := p.parseLeftHandSideExpressionAllowCall()
-
- switch p.token {
- case token.INCREMENT, token.DECREMENT:
- // Make sure there is no line terminator here
- if p.implicitSemicolon {
- break
- }
- tkn := p.token
- idx := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- switch operand.(type) {
- case *ast.Identifier, *ast.DotExpression, *ast.BracketExpression:
- default:
- p.error(idx, "invalid left-hand side in assignment")
- p.nextStatement()
- return &ast.BadExpression{From: idx, To: p.idx}
- }
- exp := &ast.UnaryExpression{
- Operator: tkn,
- Idx: idx,
- Operand: operand,
- Postfix: true,
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(exp)
- }
-
- return exp
- }
-
- return operand
-}
-
-func (p *parser) parseUnaryExpression() ast.Expression {
- switch p.token {
- case token.PLUS, token.MINUS, token.NOT, token.BITWISE_NOT:
- fallthrough
- case token.DELETE, token.VOID, token.TYPEOF:
- tkn := p.token
- idx := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- return &ast.UnaryExpression{
- Operator: tkn,
- Idx: idx,
- Operand: p.parseUnaryExpression(),
- }
- case token.INCREMENT, token.DECREMENT:
- tkn := p.token
- idx := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- operand := p.parseUnaryExpression()
- switch operand.(type) {
- case *ast.Identifier, *ast.DotExpression, *ast.BracketExpression:
- default:
- p.error(idx, "invalid left-hand side in assignment")
- p.nextStatement()
- return &ast.BadExpression{From: idx, To: p.idx}
- }
- return &ast.UnaryExpression{
- Operator: tkn,
- Idx: idx,
- Operand: operand,
- }
- }
-
- return p.parsePostfixExpression()
-}
-
-func (p *parser) parseMultiplicativeExpression() ast.Expression {
- next := p.parseUnaryExpression
- left := next()
-
- for p.token == token.MULTIPLY || p.token == token.SLASH ||
- p.token == token.REMAINDER {
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseAdditiveExpression() ast.Expression {
- next := p.parseMultiplicativeExpression
- left := next()
-
- for p.token == token.PLUS || p.token == token.MINUS {
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseShiftExpression() ast.Expression {
- next := p.parseAdditiveExpression
- left := next()
-
- for p.token == token.SHIFT_LEFT || p.token == token.SHIFT_RIGHT ||
- p.token == token.UNSIGNED_SHIFT_RIGHT {
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseRelationalExpression() ast.Expression {
- next := p.parseShiftExpression
- left := next()
-
- allowIn := p.scope.allowIn
- p.scope.allowIn = true
- defer func() {
- p.scope.allowIn = allowIn
- }()
-
- switch p.token {
- case token.LESS, token.LESS_OR_EQUAL, token.GREATER, token.GREATER_OR_EQUAL:
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- exp := &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: p.parseRelationalExpression(),
- Comparison: true,
- }
- return exp
- case token.INSTANCEOF:
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- exp := &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: p.parseRelationalExpression(),
- }
- return exp
- case token.IN:
- if !allowIn {
- return left
- }
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- exp := &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: p.parseRelationalExpression(),
- }
- return exp
- }
-
- return left
-}
-
-func (p *parser) parseEqualityExpression() ast.Expression {
- next := p.parseRelationalExpression
- left := next()
-
- for p.token == token.EQUAL || p.token == token.NOT_EQUAL ||
- p.token == token.STRICT_EQUAL || p.token == token.STRICT_NOT_EQUAL {
- tkn := p.token
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- Comparison: true,
- }
- }
-
- return left
-}
-
-func (p *parser) parseBitwiseAndExpression() ast.Expression {
- next := p.parseEqualityExpression
- left := next()
-
- for p.token == token.AND {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- tkn := p.token
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseBitwiseExclusiveOrExpression() ast.Expression {
- next := p.parseBitwiseAndExpression
- left := next()
-
- for p.token == token.EXCLUSIVE_OR {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- tkn := p.token
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseBitwiseOrExpression() ast.Expression {
- next := p.parseBitwiseExclusiveOrExpression
- left := next()
-
- for p.token == token.OR {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- tkn := p.token
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseLogicalAndExpression() ast.Expression {
- next := p.parseBitwiseOrExpression
- left := next()
-
- for p.token == token.LOGICAL_AND {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- tkn := p.token
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseLogicalOrExpression() ast.Expression {
- next := p.parseLogicalAndExpression
- left := next()
-
- for p.token == token.LOGICAL_OR {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- tkn := p.token
- p.next()
-
- left = &ast.BinaryExpression{
- Operator: tkn,
- Left: left,
- Right: next(),
- }
- }
-
- return left
-}
-
-func (p *parser) parseConditionalExpression() ast.Expression {
- left := p.parseLogicalOrExpression()
-
- if p.token == token.QUESTION_MARK {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
-
- consequent := p.parseAssignmentExpression()
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.COLON)
- exp := &ast.ConditionalExpression{
- Test: left,
- Consequent: consequent,
- Alternate: p.parseAssignmentExpression(),
- }
-
- return exp
- }
-
- return left
-}
-
-func (p *parser) parseAssignmentExpression() ast.Expression {
- left := p.parseConditionalExpression()
- var operator token.Token
- switch p.token {
- case token.ASSIGN:
- operator = p.token
- case token.ADD_ASSIGN:
- operator = token.PLUS
- case token.SUBTRACT_ASSIGN:
- operator = token.MINUS
- case token.MULTIPLY_ASSIGN:
- operator = token.MULTIPLY
- case token.QUOTIENT_ASSIGN:
- operator = token.SLASH
- case token.REMAINDER_ASSIGN:
- operator = token.REMAINDER
- case token.AND_ASSIGN:
- operator = token.AND
- case token.AND_NOT_ASSIGN:
- operator = token.AND_NOT
- case token.OR_ASSIGN:
- operator = token.OR
- case token.EXCLUSIVE_OR_ASSIGN:
- operator = token.EXCLUSIVE_OR
- case token.SHIFT_LEFT_ASSIGN:
- operator = token.SHIFT_LEFT
- case token.SHIFT_RIGHT_ASSIGN:
- operator = token.SHIFT_RIGHT
- case token.UNSIGNED_SHIFT_RIGHT_ASSIGN:
- operator = token.UNSIGNED_SHIFT_RIGHT
- }
-
- if operator != 0 {
- idx := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- switch left.(type) {
- case *ast.Identifier, *ast.DotExpression, *ast.BracketExpression:
- default:
- p.error(left.Idx0(), "invalid left-hand side in assignment")
- p.nextStatement()
- return &ast.BadExpression{From: idx, To: p.idx}
- }
-
- exp := &ast.AssignExpression{
- Left: left,
- Operator: operator,
- Right: p.parseAssignmentExpression(),
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.SetExpression(exp)
- }
-
- return exp
- }
-
- return left
-}
-
-func (p *parser) parseExpression() ast.Expression {
- next := p.parseAssignmentExpression
- left := next()
-
- if p.token == token.COMMA {
- sequence := []ast.Expression{left}
- for {
- if p.token != token.COMMA {
- break
- }
- p.next()
- sequence = append(sequence, next())
- }
- return &ast.SequenceExpression{
- Sequence: sequence,
- }
- }
-
- return left
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/lexer.go b/vendor/github.com/robertkrimen/otto/parser/lexer.go
deleted file mode 100644
index f654490..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/lexer.go
+++ /dev/null
@@ -1,854 +0,0 @@
-package parser
-
-import (
- "bytes"
- "errors"
- "fmt"
- "regexp"
- "strconv"
- "strings"
- "unicode"
- "unicode/utf8"
-
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/token"
-)
-
-type chr struct { //nolint: unused
- value rune
- width int
-}
-
-var matchIdentifier = regexp.MustCompile(`^[$_\p{L}][$_\p{L}\d}]*$`)
-
-func isDecimalDigit(chr rune) bool {
- return '0' <= chr && chr <= '9'
-}
-
-func digitValue(chr rune) int {
- switch {
- case '0' <= chr && chr <= '9':
- return int(chr - '0')
- case 'a' <= chr && chr <= 'f':
- return int(chr - 'a' + 10)
- case 'A' <= chr && chr <= 'F':
- return int(chr - 'A' + 10)
- }
- return 16 // Larger than any legal digit value
-}
-
-func isDigit(chr rune, base int) bool {
- return digitValue(chr) < base
-}
-
-func isIdentifierStart(chr rune) bool {
- return chr == '$' || chr == '_' || chr == '\\' ||
- 'a' <= chr && chr <= 'z' || 'A' <= chr && chr <= 'Z' ||
- chr >= utf8.RuneSelf && unicode.IsLetter(chr)
-}
-
-func isIdentifierPart(chr rune) bool {
- return chr == '$' || chr == '_' || chr == '\\' ||
- 'a' <= chr && chr <= 'z' || 'A' <= chr && chr <= 'Z' ||
- '0' <= chr && chr <= '9' ||
- chr >= utf8.RuneSelf && (unicode.IsLetter(chr) || unicode.IsDigit(chr))
-}
-
-func (p *parser) scanIdentifier() (string, error) {
- offset := p.chrOffset
- parse := false
- for isIdentifierPart(p.chr) {
- if p.chr == '\\' {
- distance := p.chrOffset - offset
- p.read()
- if p.chr != 'u' {
- return "", fmt.Errorf("invalid identifier escape character: %c (%s)", p.chr, string(p.chr))
- }
- parse = true
- var value rune
- for j := 0; j < 4; j++ {
- p.read()
- decimal, ok := hex2decimal(byte(p.chr))
- if !ok {
- return "", fmt.Errorf("invalid identifier escape character: %c (%s)", p.chr, string(p.chr))
- }
- value = value<<4 | decimal
- }
- switch {
- case value == '\\':
- return "", fmt.Errorf("invalid identifier escape value: %c (%s)", value, string(value))
- case distance == 0:
- if !isIdentifierStart(value) {
- return "", fmt.Errorf("invalid identifier escape value: %c (%s)", value, string(value))
- }
- case distance > 0:
- if !isIdentifierPart(value) {
- return "", fmt.Errorf("invalid identifier escape value: %c (%s)", value, string(value))
- }
- }
- }
- p.read()
- }
- literal := p.str[offset:p.chrOffset]
- if parse {
- return parseStringLiteral(literal)
- }
- return literal, nil
-}
-
-// 7.2.
-func isLineWhiteSpace(chr rune) bool { //nolint: unused, deadcode
- switch chr {
- case '\u0009', '\u000b', '\u000c', '\u0020', '\u00a0', '\ufeff':
- return true
- case '\u000a', '\u000d', '\u2028', '\u2029':
- return false
- case '\u0085':
- return false
- }
- return unicode.IsSpace(chr)
-}
-
-// 7.3.
-func isLineTerminator(chr rune) bool {
- switch chr {
- case '\u000a', '\u000d', '\u2028', '\u2029':
- return true
- }
- return false
-}
-
-func (p *parser) scan() (tkn token.Token, literal string, idx file.Idx) { //nolint: nonamedreturns
- p.implicitSemicolon = false
-
- for {
- p.skipWhiteSpace()
-
- idx = p.idxOf(p.chrOffset)
- insertSemicolon := false
-
- switch chr := p.chr; {
- case isIdentifierStart(chr):
- var err error
- literal, err = p.scanIdentifier()
- if err != nil {
- tkn = token.ILLEGAL
- break
- }
- if len(literal) > 1 {
- // Keywords are longer than 1 character, avoid lookup otherwise
- var strict bool
- tkn, strict = token.IsKeyword(literal)
-
- switch tkn {
- case 0: // Not a keyword
- switch literal {
- case "true", "false":
- p.insertSemicolon = true
- return token.BOOLEAN, literal, idx
- case "null":
- p.insertSemicolon = true
- return token.NULL, literal, idx
- }
- case token.KEYWORD:
- if strict {
- // TODO If strict and in strict mode, then this is not a break
- break
- }
- return token.KEYWORD, literal, idx
-
- case
- token.THIS,
- token.BREAK,
- token.THROW, // A newline after a throw is not allowed, but we need to detect it
- token.RETURN,
- token.CONTINUE,
- token.DEBUGGER:
- p.insertSemicolon = true
- return tkn, literal, idx
-
- default:
- return tkn, literal, idx
- }
- }
- p.insertSemicolon = true
- return token.IDENTIFIER, literal, idx
- case '0' <= chr && chr <= '9':
- p.insertSemicolon = true
- tkn, literal = p.scanNumericLiteral(false)
- return tkn, literal, idx
- default:
- p.read()
- switch chr {
- case -1:
- if p.insertSemicolon {
- p.insertSemicolon = false
- p.implicitSemicolon = true
- }
- tkn = token.EOF
- case '\r', '\n', '\u2028', '\u2029':
- p.insertSemicolon = false
- p.implicitSemicolon = true
- p.comments.AtLineBreak()
- continue
- case ':':
- tkn = token.COLON
- case '.':
- if digitValue(p.chr) < 10 {
- insertSemicolon = true
- tkn, literal = p.scanNumericLiteral(true)
- } else {
- tkn = token.PERIOD
- }
- case ',':
- tkn = token.COMMA
- case ';':
- tkn = token.SEMICOLON
- case '(':
- tkn = token.LEFT_PARENTHESIS
- case ')':
- tkn = token.RIGHT_PARENTHESIS
- insertSemicolon = true
- case '[':
- tkn = token.LEFT_BRACKET
- case ']':
- tkn = token.RIGHT_BRACKET
- insertSemicolon = true
- case '{':
- tkn = token.LEFT_BRACE
- case '}':
- tkn = token.RIGHT_BRACE
- insertSemicolon = true
- case '+':
- tkn = p.switch3(token.PLUS, token.ADD_ASSIGN, '+', token.INCREMENT)
- if tkn == token.INCREMENT {
- insertSemicolon = true
- }
- case '-':
- tkn = p.switch3(token.MINUS, token.SUBTRACT_ASSIGN, '-', token.DECREMENT)
- if tkn == token.DECREMENT {
- insertSemicolon = true
- }
- case '*':
- tkn = p.switch2(token.MULTIPLY, token.MULTIPLY_ASSIGN)
- case '/':
- switch p.chr {
- case '/':
- if p.mode&StoreComments != 0 {
- literal := string(p.readSingleLineComment())
- p.comments.AddComment(ast.NewComment(literal, idx))
- continue
- }
- p.skipSingleLineComment()
- continue
- case '*':
- if p.mode&StoreComments != 0 {
- literal = string(p.readMultiLineComment())
- p.comments.AddComment(ast.NewComment(literal, idx))
- continue
- }
- p.skipMultiLineComment()
- continue
- default:
- // Could be division, could be RegExp literal
- tkn = p.switch2(token.SLASH, token.QUOTIENT_ASSIGN)
- insertSemicolon = true
- }
- case '%':
- tkn = p.switch2(token.REMAINDER, token.REMAINDER_ASSIGN)
- case '^':
- tkn = p.switch2(token.EXCLUSIVE_OR, token.EXCLUSIVE_OR_ASSIGN)
- case '<':
- tkn = p.switch4(token.LESS, token.LESS_OR_EQUAL, '<', token.SHIFT_LEFT, token.SHIFT_LEFT_ASSIGN)
- case '>':
- tkn = p.switch6(token.GREATER, token.GREATER_OR_EQUAL, '>', token.SHIFT_RIGHT, token.SHIFT_RIGHT_ASSIGN, '>', token.UNSIGNED_SHIFT_RIGHT, token.UNSIGNED_SHIFT_RIGHT_ASSIGN)
- case '=':
- tkn = p.switch2(token.ASSIGN, token.EQUAL)
- if tkn == token.EQUAL && p.chr == '=' {
- p.read()
- tkn = token.STRICT_EQUAL
- }
- case '!':
- tkn = p.switch2(token.NOT, token.NOT_EQUAL)
- if tkn == token.NOT_EQUAL && p.chr == '=' {
- p.read()
- tkn = token.STRICT_NOT_EQUAL
- }
- case '&':
- if p.chr == '^' {
- p.read()
- tkn = p.switch2(token.AND_NOT, token.AND_NOT_ASSIGN)
- } else {
- tkn = p.switch3(token.AND, token.AND_ASSIGN, '&', token.LOGICAL_AND)
- }
- case '|':
- tkn = p.switch3(token.OR, token.OR_ASSIGN, '|', token.LOGICAL_OR)
- case '~':
- tkn = token.BITWISE_NOT
- case '?':
- tkn = token.QUESTION_MARK
- case '"', '\'':
- insertSemicolon = true
- tkn = token.STRING
- var err error
- literal, err = p.scanString(p.chrOffset - 1)
- if err != nil {
- tkn = token.ILLEGAL
- }
- default:
- p.errorUnexpected(idx, chr)
- tkn = token.ILLEGAL
- }
- }
- p.insertSemicolon = insertSemicolon
- return tkn, literal, idx
- }
-}
-
-func (p *parser) switch2(tkn0, tkn1 token.Token) token.Token {
- if p.chr == '=' {
- p.read()
- return tkn1
- }
- return tkn0
-}
-
-func (p *parser) switch3(tkn0, tkn1 token.Token, chr2 rune, tkn2 token.Token) token.Token {
- if p.chr == '=' {
- p.read()
- return tkn1
- }
- if p.chr == chr2 {
- p.read()
- return tkn2
- }
- return tkn0
-}
-
-func (p *parser) switch4(tkn0, tkn1 token.Token, chr2 rune, tkn2, tkn3 token.Token) token.Token {
- if p.chr == '=' {
- p.read()
- return tkn1
- }
- if p.chr == chr2 {
- p.read()
- if p.chr == '=' {
- p.read()
- return tkn3
- }
- return tkn2
- }
- return tkn0
-}
-
-func (p *parser) switch6(tkn0, tkn1 token.Token, chr2 rune, tkn2, tkn3 token.Token, chr3 rune, tkn4, tkn5 token.Token) token.Token {
- if p.chr == '=' {
- p.read()
- return tkn1
- }
- if p.chr == chr2 {
- p.read()
- if p.chr == '=' {
- p.read()
- return tkn3
- }
- if p.chr == chr3 {
- p.read()
- if p.chr == '=' {
- p.read()
- return tkn5
- }
- return tkn4
- }
- return tkn2
- }
- return tkn0
-}
-
-func (p *parser) chrAt(index int) chr { //nolint: unused
- value, width := utf8.DecodeRuneInString(p.str[index:])
- return chr{
- value: value,
- width: width,
- }
-}
-
-func (p *parser) peek() rune {
- if p.offset+1 < p.length {
- return rune(p.str[p.offset+1])
- }
- return -1
-}
-
-func (p *parser) read() {
- if p.offset < p.length {
- p.chrOffset = p.offset
- chr, width := rune(p.str[p.offset]), 1
- if chr >= utf8.RuneSelf { // !ASCII
- chr, width = utf8.DecodeRuneInString(p.str[p.offset:])
- if chr == utf8.RuneError && width == 1 {
- p.error(p.chrOffset, "Invalid UTF-8 character")
- }
- }
- p.offset += width
- p.chr = chr
- } else {
- p.chrOffset = p.length
- p.chr = -1 // EOF
- }
-}
-
-// This is here since the functions are so similar.
-func (p *regExpParser) read() {
- if p.offset < p.length {
- p.chrOffset = p.offset
- chr, width := rune(p.str[p.offset]), 1
- if chr >= utf8.RuneSelf { // !ASCII
- chr, width = utf8.DecodeRuneInString(p.str[p.offset:])
- if chr == utf8.RuneError && width == 1 {
- p.error(p.chrOffset, "Invalid UTF-8 character")
- }
- }
- p.offset += width
- p.chr = chr
- } else {
- p.chrOffset = p.length
- p.chr = -1 // EOF
- }
-}
-
-func (p *parser) readSingleLineComment() []rune {
- var result []rune
- for p.chr != -1 {
- p.read()
- if isLineTerminator(p.chr) {
- return result
- }
- result = append(result, p.chr)
- }
-
- // Get rid of the trailing -1
- return result[:len(result)-1]
-}
-
-func (p *parser) readMultiLineComment() []rune {
- var result []rune
- p.read()
- for p.chr >= 0 {
- chr := p.chr
- p.read()
- if chr == '*' && p.chr == '/' {
- p.read()
- return result
- }
-
- result = append(result, chr)
- }
-
- p.errorUnexpected(0, p.chr)
-
- return result
-}
-
-func (p *parser) skipSingleLineComment() {
- for p.chr != -1 {
- p.read()
- if isLineTerminator(p.chr) {
- return
- }
- }
-}
-
-func (p *parser) skipMultiLineComment() {
- p.read()
- for p.chr >= 0 {
- chr := p.chr
- p.read()
- if chr == '*' && p.chr == '/' {
- p.read()
- return
- }
- }
-
- p.errorUnexpected(0, p.chr)
-}
-
-func (p *parser) skipWhiteSpace() {
- for {
- switch p.chr {
- case ' ', '\t', '\f', '\v', '\u00a0', '\ufeff':
- p.read()
- continue
- case '\r':
- if p.peek() == '\n' {
- p.comments.AtLineBreak()
- p.read()
- }
- fallthrough
- case '\u2028', '\u2029', '\n':
- if p.insertSemicolon {
- return
- }
- p.comments.AtLineBreak()
- p.read()
- continue
- }
- if p.chr >= utf8.RuneSelf {
- if unicode.IsSpace(p.chr) {
- p.read()
- continue
- }
- }
- break
- }
-}
-
-func (p *parser) scanMantissa(base int) {
- for digitValue(p.chr) < base {
- p.read()
- }
-}
-
-func (p *parser) scanEscape(quote rune) {
- var length, base uint32
- switch p.chr {
- // Octal:
- // length, base, limit = 3, 8, 255
- case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"', '\'', '0':
- p.read()
- return
- case '\r', '\n', '\u2028', '\u2029':
- p.scanNewline()
- return
- case 'x':
- p.read()
- length, base = 2, 16
- case 'u':
- p.read()
- length, base = 4, 16
- default:
- p.read() // Always make progress
- return
- }
-
- var value uint32
- for ; length > 0 && p.chr != quote && p.chr >= 0; length-- {
- digit := uint32(digitValue(p.chr))
- if digit >= base {
- break
- }
- value = value*base + digit
- p.read()
- }
-}
-
-func (p *parser) scanString(offset int) (string, error) {
- // " ' /
- quote := rune(p.str[offset])
-
- for p.chr != quote {
- chr := p.chr
- if chr == '\n' || chr == '\r' || chr == '\u2028' || chr == '\u2029' || chr < 0 {
- goto newline
- }
- p.read()
- switch {
- case chr == '\\':
- if quote == '/' {
- if p.chr == '\n' || p.chr == '\r' || p.chr == '\u2028' || p.chr == '\u2029' || p.chr < 0 {
- goto newline
- }
- p.read()
- } else {
- p.scanEscape(quote)
- }
- case chr == '[' && quote == '/':
- // Allow a slash (/) in a bracket character class ([...])
- // TODO Fix this, this is hacky...
- quote = -1
- case chr == ']' && quote == -1:
- quote = '/'
- }
- }
-
- // " ' /
- p.read()
-
- return p.str[offset:p.chrOffset], nil
-
-newline:
- p.scanNewline()
- err := "String not terminated"
- if quote == '/' {
- err = "Invalid regular expression: missing /"
- p.error(p.idxOf(offset), err)
- }
- return "", errors.New(err)
-}
-
-func (p *parser) scanNewline() {
- if p.chr == '\r' {
- p.read()
- if p.chr != '\n' {
- return
- }
- }
- p.read()
-}
-
-func hex2decimal(chr byte) (rune, bool) {
- r := rune(chr)
- switch {
- case '0' <= r && r <= '9':
- return r - '0', true
- case 'a' <= r && r <= 'f':
- return r - 'a' + 10, true
- case 'A' <= r && r <= 'F':
- return r - 'A' + 10, true
- default:
- return 0, false
- }
-}
-
-func parseNumberLiteral(literal string) (value interface{}, err error) { //nolint: nonamedreturns
- // TODO Is Uint okay? What about -MAX_UINT
- value, err = strconv.ParseInt(literal, 0, 64)
- if err == nil {
- return value, nil
- }
-
- parseIntErr := err // Save this first error, just in case
-
- value, err = strconv.ParseFloat(literal, 64)
- if err == nil {
- return value, nil
- } else if errors.Is(err, strconv.ErrRange) {
- // Infinity, etc.
- return value, nil
- }
-
- // TODO(steve): Fix as this is assigning to err so we know the type.
- // Need to understand what this was trying to do?
- err = parseIntErr
-
- if errors.Is(err, strconv.ErrRange) {
- if len(literal) > 2 && literal[0] == '0' && (literal[1] == 'X' || literal[1] == 'x') {
- // Could just be a very large number (e.g. 0x8000000000000000)
- var value float64
- literal = literal[2:]
- for _, chr := range literal {
- digit := digitValue(chr)
- if digit >= 16 {
- return nil, fmt.Errorf("illegal numeric literal: %v (>= 16)", digit)
- }
- value = value*16 + float64(digit)
- }
- return value, nil
- }
- }
-
- return nil, errors.New("illegal numeric literal")
-}
-
-func parseStringLiteral(literal string) (string, error) {
- // Best case scenario...
- if literal == "" {
- return "", nil
- }
-
- // Slightly less-best case scenario...
- if !strings.ContainsRune(literal, '\\') {
- return literal, nil
- }
-
- str := literal
- buffer := bytes.NewBuffer(make([]byte, 0, 3*len(literal)/2))
-
- for len(str) > 0 {
- switch chr := str[0]; {
- // We do not explicitly handle the case of the quote
- // value, which can be: " ' /
- // This assumes we're already passed a partially well-formed literal
- case chr >= utf8.RuneSelf:
- chr, size := utf8.DecodeRuneInString(str)
- buffer.WriteRune(chr)
- str = str[size:]
- continue
- case chr != '\\':
- buffer.WriteByte(chr)
- str = str[1:]
- continue
- }
-
- if len(str) <= 1 {
- panic("len(str) <= 1")
- }
- chr := str[1]
- var value rune
- if chr >= utf8.RuneSelf {
- str = str[1:]
- var size int
- value, size = utf8.DecodeRuneInString(str)
- str = str[size:] // \ +
- } else {
- str = str[2:] // \
- switch chr {
- case 'b':
- value = '\b'
- case 'f':
- value = '\f'
- case 'n':
- value = '\n'
- case 'r':
- value = '\r'
- case 't':
- value = '\t'
- case 'v':
- value = '\v'
- case 'x', 'u':
- size := 0
- switch chr {
- case 'x':
- size = 2
- case 'u':
- size = 4
- }
- if len(str) < size {
- return "", fmt.Errorf("invalid escape: \\%s: len(%q) != %d", string(chr), str, size)
- }
- for j := 0; j < size; j++ {
- decimal, ok := hex2decimal(str[j])
- if !ok {
- return "", fmt.Errorf("invalid escape: \\%s: %q", string(chr), str[:size])
- }
- value = value<<4 | decimal
- }
- str = str[size:]
- if chr == 'x' {
- break
- }
- if value > utf8.MaxRune {
- panic("value > utf8.MaxRune")
- }
- case '0':
- if len(str) == 0 || '0' > str[0] || str[0] > '7' {
- value = 0
- break
- }
- fallthrough
- case '1', '2', '3', '4', '5', '6', '7':
- // TODO strict
- value = rune(chr) - '0'
- j := 0
- for ; j < 2; j++ {
- if len(str) < j+1 {
- break
- }
- chr := str[j]
- if '0' > chr || chr > '7' {
- break
- }
- decimal := rune(str[j]) - '0'
- value = (value << 3) | decimal
- }
- str = str[j:]
- case '\\':
- value = '\\'
- case '\'', '"':
- value = rune(chr)
- case '\r':
- if len(str) > 0 {
- if str[0] == '\n' {
- str = str[1:]
- }
- }
- fallthrough
- case '\n':
- continue
- default:
- value = rune(chr)
- }
- }
- buffer.WriteRune(value)
- }
-
- return buffer.String(), nil
-}
-
-func (p *parser) scanNumericLiteral(decimalPoint bool) (token.Token, string) {
- offset := p.chrOffset
- tkn := token.NUMBER
-
- if decimalPoint {
- offset--
- p.scanMantissa(10)
- goto exponent
- }
-
- if p.chr == '0' {
- offset := p.chrOffset
- p.read()
- switch p.chr {
- case 'x', 'X':
- // Hexadecimal
- p.read()
- if isDigit(p.chr, 16) {
- p.read()
- } else {
- return token.ILLEGAL, p.str[offset:p.chrOffset]
- }
- p.scanMantissa(16)
-
- if p.chrOffset-offset <= 2 {
- // Only "0x" or "0X"
- p.error(0, "Illegal hexadecimal number")
- }
-
- goto hexadecimal
- case '.':
- // Float
- goto float
- default:
- // Octal, Float
- if p.chr == 'e' || p.chr == 'E' {
- goto exponent
- }
- p.scanMantissa(8)
- if p.chr == '8' || p.chr == '9' {
- return token.ILLEGAL, p.str[offset:p.chrOffset]
- }
- goto octal
- }
- }
-
- p.scanMantissa(10)
-
-float:
- if p.chr == '.' {
- p.read()
- p.scanMantissa(10)
- }
-
-exponent:
- if p.chr == 'e' || p.chr == 'E' {
- p.read()
- if p.chr == '-' || p.chr == '+' {
- p.read()
- }
- if isDecimalDigit(p.chr) {
- p.read()
- p.scanMantissa(10)
- } else {
- return token.ILLEGAL, p.str[offset:p.chrOffset]
- }
- }
-
-hexadecimal:
-octal:
- if isIdentifierStart(p.chr) || isDecimalDigit(p.chr) {
- return token.ILLEGAL, p.str[offset:p.chrOffset]
- }
-
- return tkn, p.str[offset:p.chrOffset]
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/parser.go b/vendor/github.com/robertkrimen/otto/parser/parser.go
deleted file mode 100644
index 940f295..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/parser.go
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
-Package parser implements a parser for JavaScript.
-
- import (
- "github.com/robertkrimen/otto/parser"
- )
-
-Parse and return an AST
-
- filename := "" // A filename is optional
- src := `
- // Sample xyzzy example
- (function(){
- if (3.14159 > 0) {
- console.log("Hello, World.");
- return;
- }
-
- var xyzzy = NaN;
- console.log("Nothing happens.");
- return xyzzy;
- })();
- `
-
- // Parse some JavaScript, yielding a *ast.Program and/or an ErrorList
- program, err := parser.ParseFile(nil, filename, src, 0)
-
-# Warning
-
-The parser and AST interfaces are still works-in-progress (particularly where
-node types are concerned) and may change in the future.
-*/
-package parser
-
-import (
- "bytes"
- "encoding/base64"
- "fmt"
- "io"
- "os"
-
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/file"
- "github.com/robertkrimen/otto/token"
- "gopkg.in/sourcemap.v1"
-)
-
-// A Mode value is a set of flags (or 0). They control optional parser functionality.
-type Mode uint
-
-const (
- // IgnoreRegExpErrors ignores RegExp compatibility errors (allow backtracking).
- IgnoreRegExpErrors Mode = 1 << iota
-
- // StoreComments stores the comments from source to the comments map.
- StoreComments
-)
-
-type parser struct { //nolint: maligned
- str string
- length int
- base int
-
- chr rune // The current character
- chrOffset int // The offset of current character
- offset int // The offset after current character (may be greater than 1)
-
- idx file.Idx // The index of token
- token token.Token // The token
- literal string // The literal of the token, if any
-
- scope *scope
- insertSemicolon bool // If we see a newline, then insert an implicit semicolon
- implicitSemicolon bool // An implicit semicolon exists
-
- errors ErrorList
-
- recover struct {
- // Scratch when trying to seek to the next statement, etc.
- idx file.Idx
- count int
- }
-
- mode Mode
-
- file *file.File
-
- comments *ast.Comments
-}
-
-// Parser is implemented by types which can parse JavaScript Code.
-type Parser interface {
- Scan() (tkn token.Token, literal string, idx file.Idx)
-}
-
-func newParser(filename, src string, base int, sm *sourcemap.Consumer) *parser {
- return &parser{
- chr: ' ', // This is set so we can start scanning by skipping whitespace
- str: src,
- length: len(src),
- base: base,
- file: file.NewFile(filename, src, base).WithSourceMap(sm),
- comments: ast.NewComments(),
- }
-}
-
-// NewParser returns a new Parser.
-func NewParser(filename, src string) Parser {
- return newParser(filename, src, 1, nil)
-}
-
-// ReadSource reads code from src if not nil, otherwise reads from filename.
-func ReadSource(filename string, src interface{}) ([]byte, error) {
- if src != nil {
- switch src := src.(type) {
- case string:
- return []byte(src), nil
- case []byte:
- return src, nil
- case *bytes.Buffer:
- if src != nil {
- return src.Bytes(), nil
- }
- case io.Reader:
- var bfr bytes.Buffer
- if _, err := io.Copy(&bfr, src); err != nil {
- return nil, err
- }
- return bfr.Bytes(), nil
- default:
- return nil, fmt.Errorf("invalid src type %T", src)
- }
- }
- return os.ReadFile(filename) //nolint: gosec
-}
-
-// ReadSourceMap reads the source map from src if not nil, otherwise is a noop.
-func ReadSourceMap(filename string, src interface{}) (*sourcemap.Consumer, error) {
- if src == nil {
- return nil, nil //nolint: nilnil
- }
-
- switch src := src.(type) {
- case string:
- return sourcemap.Parse(filename, []byte(src))
- case []byte:
- return sourcemap.Parse(filename, src)
- case *bytes.Buffer:
- return sourcemap.Parse(filename, src.Bytes())
- case io.Reader:
- var bfr bytes.Buffer
- if _, err := io.Copy(&bfr, src); err != nil {
- return nil, err
- }
- return sourcemap.Parse(filename, bfr.Bytes())
- case *sourcemap.Consumer:
- return src, nil
- default:
- return nil, fmt.Errorf("invalid sourcemap type %T", src)
- }
-}
-
-// ParseFileWithSourceMap parses the sourcemap returning the resulting Program.
-func ParseFileWithSourceMap(fileSet *file.FileSet, filename string, javascriptSource, sourcemapSource interface{}, mode Mode) (*ast.Program, error) {
- src, err := ReadSource(filename, javascriptSource)
- if err != nil {
- return nil, err
- }
-
- if sourcemapSource == nil {
- lines := bytes.Split(src, []byte("\n"))
- lastLine := lines[len(lines)-1]
- if bytes.HasPrefix(lastLine, []byte("//# sourceMappingURL=data:application/json")) {
- bits := bytes.SplitN(lastLine, []byte(","), 2)
- if len(bits) == 2 {
- if d, err := base64.StdEncoding.DecodeString(string(bits[1])); err == nil {
- sourcemapSource = d
- }
- }
- }
- }
-
- sm, err := ReadSourceMap(filename, sourcemapSource)
- if err != nil {
- return nil, err
- }
-
- base := 1
- if fileSet != nil {
- base = fileSet.AddFile(filename, string(src))
- }
-
- p := newParser(filename, string(src), base, sm)
- p.mode = mode
- program, err := p.parse()
- program.Comments = p.comments.CommentMap
-
- return program, err
-}
-
-// ParseFile parses the source code of a single JavaScript/ECMAScript source file and returns
-// the corresponding ast.Program node.
-//
-// If fileSet == nil, ParseFile parses source without a FileSet.
-// If fileSet != nil, ParseFile first adds filename and src to fileSet.
-//
-// The filename argument is optional and is used for labelling errors, etc.
-//
-// src may be a string, a byte slice, a bytes.Buffer, or an io.Reader, but it MUST always be in UTF-8.
-//
-// // Parse some JavaScript, yielding a *ast.Program and/or an ErrorList
-// program, err := parser.ParseFile(nil, "", `if (abc > 1) {}`, 0)
-func ParseFile(fileSet *file.FileSet, filename string, src interface{}, mode Mode) (*ast.Program, error) {
- return ParseFileWithSourceMap(fileSet, filename, src, nil, mode)
-}
-
-// ParseFunction parses a given parameter list and body as a function and returns the
-// corresponding ast.FunctionLiteral node.
-//
-// The parameter list, if any, should be a comma-separated list of identifiers.
-func ParseFunction(parameterList, body string) (*ast.FunctionLiteral, error) {
- src := "(function(" + parameterList + ") {\n" + body + "\n})"
-
- p := newParser("", src, 1, nil)
- program, err := p.parse()
- if err != nil {
- return nil, err
- }
-
- return program.Body[0].(*ast.ExpressionStatement).Expression.(*ast.FunctionLiteral), nil
-}
-
-// Scan reads a single token from the source at the current offset, increments the offset and
-// returns the token.Token token, a string literal representing the value of the token (if applicable)
-// and it's current file.Idx index.
-func (p *parser) Scan() (token.Token, string, file.Idx) {
- return p.scan()
-}
-
-func (p *parser) slice(idx0, idx1 file.Idx) string {
- from := int(idx0) - p.base
- to := int(idx1) - p.base
- if from >= 0 && to <= len(p.str) {
- return p.str[from:to]
- }
-
- return ""
-}
-
-func (p *parser) parse() (*ast.Program, error) {
- p.next()
- program := p.parseProgram()
- if false {
- p.errors.Sort()
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(program, p.comments.FetchAll(), ast.TRAILING)
- }
-
- return program, p.errors.Err()
-}
-
-func (p *parser) next() {
- p.token, p.literal, p.idx = p.scan()
-}
-
-func (p *parser) optionalSemicolon() {
- if p.token == token.SEMICOLON {
- p.next()
- return
- }
-
- if p.implicitSemicolon {
- p.implicitSemicolon = false
- return
- }
-
- if p.token != token.EOF && p.token != token.RIGHT_BRACE {
- p.expect(token.SEMICOLON)
- }
-}
-
-func (p *parser) semicolon() {
- if p.token != token.RIGHT_PARENTHESIS && p.token != token.RIGHT_BRACE {
- if p.implicitSemicolon {
- p.implicitSemicolon = false
- return
- }
-
- p.expect(token.SEMICOLON)
- }
-}
-
-func (p *parser) idxOf(offset int) file.Idx {
- return file.Idx(p.base + offset)
-}
-
-func (p *parser) expect(value token.Token) file.Idx {
- idx := p.idx
- if p.token != value {
- p.errorUnexpectedToken(p.token)
- }
- p.next()
- return idx
-}
-
-func lineCount(str string) (int, int) {
- line, last := 0, -1
- pair := false
- for index, chr := range str {
- switch chr {
- case '\r':
- line++
- last = index
- pair = true
- continue
- case '\n':
- if !pair {
- line++
- }
- last = index
- case '\u2028', '\u2029':
- line++
- last = index + 2
- }
- pair = false
- }
- return line, last
-}
-
-func (p *parser) position(idx file.Idx) file.Position {
- position := file.Position{}
- offset := int(idx) - p.base
- str := p.str[:offset]
- position.Filename = p.file.Name()
- line, last := lineCount(str)
- position.Line = 1 + line
- if last >= 0 {
- position.Column = offset - last
- } else {
- position.Column = 1 + len(str)
- }
-
- return position
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/regexp.go b/vendor/github.com/robertkrimen/otto/parser/regexp.go
deleted file mode 100644
index 45245c1..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/regexp.go
+++ /dev/null
@@ -1,352 +0,0 @@
-package parser
-
-import (
- "bytes"
- "fmt"
- "strconv"
-)
-
-type regExpParser struct { //nolint: maligned
- str string
- length int
-
- chr rune // The current character
- chrOffset int // The offset of current character
- offset int // The offset after current character (may be greater than 1)
-
- errors []error
- invalid bool // The input is an invalid JavaScript RegExp
-
- goRegexp *bytes.Buffer
-}
-
-// TransformRegExp transforms a JavaScript pattern into a Go "regexp" pattern.
-//
-// re2 (Go) cannot do backtracking, so the presence of a lookahead (?=) (?!) or
-// backreference (\1, \2, ...) will cause an error.
-//
-// re2 (Go) has a different definition for \s: [\t\n\f\r ].
-// The JavaScript definition, on the other hand, also includes \v, Unicode "Separator, Space", etc.
-//
-// If the pattern is invalid (not valid even in JavaScript), then this function
-// returns the empty string and an error.
-//
-// If the pattern is valid, but incompatible (contains a lookahead or backreference),
-// then this function returns the transformation (a non-empty string) AND an error.
-func TransformRegExp(pattern string) (string, error) {
- if pattern == "" {
- return "", nil
- }
-
- // TODO If without \, if without (?=, (?!, then another shortcut
-
- p := regExpParser{
- str: pattern,
- length: len(pattern),
- goRegexp: bytes.NewBuffer(make([]byte, 0, 3*len(pattern)/2)),
- }
- p.read() // Pull in the first character
- p.scan()
- var err error
- if len(p.errors) > 0 {
- err = p.errors[0]
- }
- if p.invalid {
- return "", err
- }
-
- // Might not be re2 compatible, but is still a valid JavaScript RegExp
- return p.goRegexp.String(), err
-}
-
-func (p *regExpParser) scan() {
- for p.chr != -1 {
- switch p.chr {
- case '\\':
- p.read()
- p.scanEscape(false)
- case '(':
- p.pass()
- p.scanGroup()
- case '[':
- p.pass()
- p.scanBracket()
- case ')':
- p.error(-1, "Unmatched ')'")
- p.invalid = true
- p.pass()
- default:
- p.pass()
- }
- }
-}
-
-// (...)
-func (p *regExpParser) scanGroup() {
- str := p.str[p.chrOffset:]
- if len(str) > 1 { // A possibility of (?= or (?!
- if str[0] == '?' {
- if str[1] == '=' || str[1] == '!' {
- p.error(-1, "re2: Invalid (%s) ", p.str[p.chrOffset:p.chrOffset+2])
- }
- }
- }
- for p.chr != -1 && p.chr != ')' {
- switch p.chr {
- case '\\':
- p.read()
- p.scanEscape(false)
- case '(':
- p.pass()
- p.scanGroup()
- case '[':
- p.pass()
- p.scanBracket()
- default:
- p.pass()
- continue
- }
- }
- if p.chr != ')' {
- p.error(-1, "Unterminated group")
- p.invalid = true
- return
- }
- p.pass()
-}
-
-// [...].
-func (p *regExpParser) scanBracket() {
- for p.chr != -1 {
- if p.chr == ']' {
- break
- } else if p.chr == '\\' {
- p.read()
- p.scanEscape(true)
- continue
- }
- p.pass()
- }
- if p.chr != ']' {
- p.error(-1, "Unterminated character class")
- p.invalid = true
- return
- }
- p.pass()
-}
-
-// \...
-func (p *regExpParser) scanEscape(inClass bool) {
- offset := p.chrOffset
-
- var length, base uint32
- switch p.chr {
- case '0', '1', '2', '3', '4', '5', '6', '7':
- var value int64
- size := 0
- for {
- digit := int64(digitValue(p.chr))
- if digit >= 8 {
- // Not a valid digit
- break
- }
- value = value*8 + digit
- p.read()
- size++
- }
- if size == 1 { // The number of characters read
- _, err := p.goRegexp.Write([]byte{'\\', byte(value) + '0'})
- if err != nil {
- p.errors = append(p.errors, err)
- }
- if value != 0 {
- // An invalid backreference
- p.error(-1, "re2: Invalid \\%d ", value)
- }
- return
- }
- tmp := []byte{'\\', 'x', '0', 0}
- if value >= 16 {
- tmp = tmp[0:2]
- } else {
- tmp = tmp[0:3]
- }
- tmp = strconv.AppendInt(tmp, value, 16)
- _, err := p.goRegexp.Write(tmp)
- if err != nil {
- p.errors = append(p.errors, err)
- }
- return
-
- case '8', '9':
- size := 0
- for {
- digit := digitValue(p.chr)
- if digit >= 10 {
- // Not a valid digit
- break
- }
- p.read()
- size++
- }
- err := p.goRegexp.WriteByte('\\')
- if err != nil {
- p.errors = append(p.errors, err)
- }
- _, err = p.goRegexp.WriteString(p.str[offset:p.chrOffset])
- if err != nil {
- p.errors = append(p.errors, err)
- }
- p.error(-1, "re2: Invalid \\%s ", p.str[offset:p.chrOffset])
- return
-
- case 'x':
- p.read()
- length, base = 2, 16
-
- case 'u':
- p.read()
- length, base = 4, 16
-
- case 'b':
- if inClass {
- _, err := p.goRegexp.Write([]byte{'\\', 'x', '0', '8'})
- if err != nil {
- p.errors = append(p.errors, err)
- }
- p.read()
- return
- }
- fallthrough
-
- case 'B':
- fallthrough
-
- case 'd', 'D', 's', 'S', 'w', 'W':
- // This is slightly broken, because ECMAScript
- // includes \v in \s, \S, while re2 does not
- fallthrough
-
- case '\\':
- fallthrough
-
- case 'f', 'n', 'r', 't', 'v':
- err := p.goRegexp.WriteByte('\\')
- if err != nil {
- p.errors = append(p.errors, err)
- }
- p.pass()
- return
-
- case 'c':
- p.read()
- var value int64
- switch {
- case 'a' <= p.chr && p.chr <= 'z':
- value = int64(p.chr) - 'a' + 1
- case 'A' <= p.chr && p.chr <= 'Z':
- value = int64(p.chr) - 'A' + 1
- default:
- err := p.goRegexp.WriteByte('c')
- if err != nil {
- p.errors = append(p.errors, err)
- }
- return
- }
- tmp := []byte{'\\', 'x', '0', 0}
- if value >= 16 {
- tmp = tmp[0:2]
- } else {
- tmp = tmp[0:3]
- }
- tmp = strconv.AppendInt(tmp, value, 16)
- _, err := p.goRegexp.Write(tmp)
- if err != nil {
- p.errors = append(p.errors, err)
- }
- p.read()
- return
-
- default:
- // $ is an identifier character, so we have to have
- // a special case for it here
- if p.chr == '$' || !isIdentifierPart(p.chr) {
- // A non-identifier character needs escaping
- err := p.goRegexp.WriteByte('\\')
- if err != nil {
- p.errors = append(p.errors, err)
- }
- } else { //nolint: staticcheck
- // Unescape the character for re2
- }
- p.pass()
- return
- }
-
- // Otherwise, we're a \u.... or \x...
- valueOffset := p.chrOffset
-
- var value uint32
- for length := length; length > 0; length-- {
- digit := uint32(digitValue(p.chr))
- if digit >= base {
- // Not a valid digit
- goto skip
- }
- value = value*base + digit
- p.read()
- }
-
- switch length {
- case 4:
- if _, err := p.goRegexp.Write([]byte{
- '\\',
- 'x',
- '{',
- p.str[valueOffset+0],
- p.str[valueOffset+1],
- p.str[valueOffset+2],
- p.str[valueOffset+3],
- '}',
- }); err != nil {
- p.errors = append(p.errors, err)
- }
- case 2:
- if _, err := p.goRegexp.Write([]byte{
- '\\',
- 'x',
- p.str[valueOffset+0],
- p.str[valueOffset+1],
- }); err != nil {
- p.errors = append(p.errors, err)
- }
- default:
- // Should never, ever get here...
- p.error(-1, "re2: Illegal branch in scanEscape")
- goto skip
- }
-
- return
-
-skip:
- _, err := p.goRegexp.WriteString(p.str[offset:p.chrOffset])
- if err != nil {
- p.errors = append(p.errors, err)
- }
-}
-
-func (p *regExpParser) pass() {
- if p.chr != -1 {
- _, err := p.goRegexp.WriteRune(p.chr)
- if err != nil {
- p.errors = append(p.errors, err)
- }
- }
- p.read()
-}
-
-// TODO Better error reporting, use the offset, etc.
-func (p *regExpParser) error(offset int, msg string, msgValues ...interface{}) { //nolint: unparam
- err := fmt.Errorf(msg, msgValues...)
- p.errors = append(p.errors, err)
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/scope.go b/vendor/github.com/robertkrimen/otto/parser/scope.go
deleted file mode 100644
index 4f1b435..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/scope.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package parser
-
-import (
- "github.com/robertkrimen/otto/ast"
-)
-
-type scope struct {
- outer *scope
- allowIn bool
- inIteration bool
- inSwitch bool
- inFunction bool
- declarationList []ast.Declaration
-
- labels []string
-}
-
-func (p *parser) openScope() {
- p.scope = &scope{
- outer: p.scope,
- allowIn: true,
- }
-}
-
-func (p *parser) closeScope() {
- p.scope = p.scope.outer
-}
-
-func (p *scope) declare(declaration ast.Declaration) {
- p.declarationList = append(p.declarationList, declaration)
-}
-
-func (p *scope) hasLabel(name string) bool {
- for _, label := range p.labels {
- if label == name {
- return true
- }
- }
- if p.outer != nil && !p.inFunction {
- // Crossing a function boundary to look for a label is verboten
- return p.outer.hasLabel(name)
- }
- return false
-}
diff --git a/vendor/github.com/robertkrimen/otto/parser/statement.go b/vendor/github.com/robertkrimen/otto/parser/statement.go
deleted file mode 100644
index 3abe175..0000000
--- a/vendor/github.com/robertkrimen/otto/parser/statement.go
+++ /dev/null
@@ -1,926 +0,0 @@
-package parser
-
-import (
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/token"
-)
-
-func (p *parser) parseBlockStatement() *ast.BlockStatement {
- node := &ast.BlockStatement{}
-
- // Find comments before the leading brace
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, p.comments.FetchAll(), ast.LEADING)
- p.comments.Unset()
- }
-
- node.LeftBrace = p.expect(token.LEFT_BRACE)
- node.List = p.parseStatementList()
-
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- p.comments.CommentMap.AddComments(node, p.comments.FetchAll(), ast.FINAL)
- p.comments.AfterBlock()
- }
-
- node.RightBrace = p.expect(token.RIGHT_BRACE)
-
- // Find comments after the trailing brace
- if p.mode&StoreComments != 0 {
- p.comments.ResetLineBreak()
- p.comments.CommentMap.AddComments(node, p.comments.Fetch(), ast.TRAILING)
- }
-
- return node
-}
-
-func (p *parser) parseEmptyStatement() ast.Statement {
- idx := p.expect(token.SEMICOLON)
- return &ast.EmptyStatement{Semicolon: idx}
-}
-
-func (p *parser) parseStatementList() (list []ast.Statement) { //nolint: nonamedreturns
- for p.token != token.RIGHT_BRACE && p.token != token.EOF {
- statement := p.parseStatement()
- list = append(list, statement)
- }
-
- return list
-}
-
-func (p *parser) parseStatement() ast.Statement {
- if p.token == token.EOF {
- p.errorUnexpectedToken(p.token)
- return &ast.BadStatement{From: p.idx, To: p.idx + 1}
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.ResetLineBreak()
- }
-
- switch p.token {
- case token.SEMICOLON:
- return p.parseEmptyStatement()
- case token.LEFT_BRACE:
- return p.parseBlockStatement()
- case token.IF:
- return p.parseIfStatement()
- case token.DO:
- statement := p.parseDoWhileStatement()
- p.comments.PostProcessNode(statement)
- return statement
- case token.WHILE:
- return p.parseWhileStatement()
- case token.FOR:
- return p.parseForOrForInStatement()
- case token.BREAK:
- return p.parseBreakStatement()
- case token.CONTINUE:
- return p.parseContinueStatement()
- case token.DEBUGGER:
- return p.parseDebuggerStatement()
- case token.WITH:
- return p.parseWithStatement()
- case token.VAR:
- return p.parseVariableStatement()
- case token.FUNCTION:
- return p.parseFunctionStatement()
- case token.SWITCH:
- return p.parseSwitchStatement()
- case token.RETURN:
- return p.parseReturnStatement()
- case token.THROW:
- return p.parseThrowStatement()
- case token.TRY:
- return p.parseTryStatement()
- }
-
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
-
- expression := p.parseExpression()
-
- if identifier, isIdentifier := expression.(*ast.Identifier); isIdentifier && p.token == token.COLON {
- // LabelledStatement
- colon := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next() // :
-
- label := identifier.Name
- for _, value := range p.scope.labels {
- if label == value {
- p.error(identifier.Idx0(), "Label '%s' already exists", label)
- }
- }
- var labelComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- labelComments = p.comments.FetchAll()
- }
- p.scope.labels = append(p.scope.labels, label) // Push the label
- statement := p.parseStatement()
- p.scope.labels = p.scope.labels[:len(p.scope.labels)-1] // Pop the label
- exp := &ast.LabelledStatement{
- Label: identifier,
- Colon: colon,
- Statement: statement,
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(exp, labelComments, ast.LEADING)
- }
-
- return exp
- }
-
- p.optionalSemicolon()
-
- statement := &ast.ExpressionStatement{
- Expression: expression,
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(statement, comments, ast.LEADING)
- }
- return statement
-}
-
-func (p *parser) parseTryStatement() ast.Statement {
- var tryComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- tryComments = p.comments.FetchAll()
- }
- node := &ast.TryStatement{
- Try: p.expect(token.TRY),
- Body: p.parseBlockStatement(),
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, tryComments, ast.LEADING)
- p.comments.CommentMap.AddComments(node.Body, p.comments.FetchAll(), ast.TRAILING)
- }
-
- if p.token == token.CATCH {
- catch := p.idx
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- p.expect(token.LEFT_PARENTHESIS)
- if p.token != token.IDENTIFIER {
- p.expect(token.IDENTIFIER)
- p.nextStatement()
- return &ast.BadStatement{From: catch, To: p.idx}
- }
-
- identifier := p.parseIdentifier()
- p.expect(token.RIGHT_PARENTHESIS)
- node.Catch = &ast.CatchStatement{
- Catch: catch,
- Parameter: identifier,
- Body: p.parseBlockStatement(),
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node.Catch.Body, p.comments.FetchAll(), ast.TRAILING)
- }
- }
-
- if p.token == token.FINALLY {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next()
- if p.mode&StoreComments != 0 {
- tryComments = p.comments.FetchAll()
- }
-
- node.Finally = p.parseBlockStatement()
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node.Finally, tryComments, ast.LEADING)
- }
- }
-
- if node.Catch == nil && node.Finally == nil {
- p.error(node.Try, "Missing catch or finally after try")
- return &ast.BadStatement{From: node.Try, To: node.Body.Idx1()}
- }
-
- return node
-}
-
-func (p *parser) parseFunctionParameterList() *ast.ParameterList {
- opening := p.expect(token.LEFT_PARENTHESIS)
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- var list []*ast.Identifier
- for p.token != token.RIGHT_PARENTHESIS && p.token != token.EOF {
- if p.token != token.IDENTIFIER {
- p.expect(token.IDENTIFIER)
- } else {
- identifier := p.parseIdentifier()
- list = append(list, identifier)
- }
- if p.token != token.RIGHT_PARENTHESIS {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.COMMA)
- }
- }
- closing := p.expect(token.RIGHT_PARENTHESIS)
-
- return &ast.ParameterList{
- Opening: opening,
- List: list,
- Closing: closing,
- }
-}
-
-func (p *parser) parseFunctionStatement() *ast.FunctionStatement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- function := &ast.FunctionStatement{
- Function: p.parseFunction(true),
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(function, comments, ast.LEADING)
- }
-
- return function
-}
-
-func (p *parser) parseFunction(declaration bool) *ast.FunctionLiteral {
- node := &ast.FunctionLiteral{
- Function: p.expect(token.FUNCTION),
- }
-
- var name *ast.Identifier
- if p.token == token.IDENTIFIER {
- name = p.parseIdentifier()
- if declaration {
- p.scope.declare(&ast.FunctionDeclaration{
- Function: node,
- })
- }
- } else if declaration {
- // Use expect error handling
- p.expect(token.IDENTIFIER)
- }
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- node.Name = name
- node.ParameterList = p.parseFunctionParameterList()
- p.parseFunctionBlock(node)
- node.Source = p.slice(node.Idx0(), node.Idx1())
-
- return node
-}
-
-func (p *parser) parseFunctionBlock(node *ast.FunctionLiteral) {
- p.openScope()
- inFunction := p.scope.inFunction
- p.scope.inFunction = true
- defer func() {
- p.scope.inFunction = inFunction
- p.closeScope()
- }()
- node.Body = p.parseBlockStatement()
- node.DeclarationList = p.scope.declarationList
-}
-
-func (p *parser) parseDebuggerStatement() ast.Statement {
- idx := p.expect(token.DEBUGGER)
-
- node := &ast.DebuggerStatement{
- Debugger: idx,
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, p.comments.FetchAll(), ast.TRAILING)
- }
-
- p.semicolon()
- return node
-}
-
-func (p *parser) parseReturnStatement() ast.Statement {
- idx := p.expect(token.RETURN)
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
-
- if !p.scope.inFunction {
- p.error(idx, "Illegal return statement")
- p.nextStatement()
- return &ast.BadStatement{From: idx, To: p.idx}
- }
-
- node := &ast.ReturnStatement{
- Return: idx,
- }
-
- if !p.implicitSemicolon && p.token != token.SEMICOLON && p.token != token.RIGHT_BRACE && p.token != token.EOF {
- node.Argument = p.parseExpression()
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- }
-
- p.semicolon()
-
- return node
-}
-
-func (p *parser) parseThrowStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.THROW)
-
- if p.implicitSemicolon {
- if p.chr == -1 { // Hackish
- p.error(idx, "Unexpected end of input")
- } else {
- p.error(idx, "Illegal newline after throw")
- }
- p.nextStatement()
- return &ast.BadStatement{From: idx, To: p.idx}
- }
-
- node := &ast.ThrowStatement{
- Throw: idx,
- Argument: p.parseExpression(),
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- }
-
- p.semicolon()
-
- return node
-}
-
-func (p *parser) parseSwitchStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.SWITCH)
- if p.mode&StoreComments != 0 {
- comments = append(comments, p.comments.FetchAll()...)
- }
- p.expect(token.LEFT_PARENTHESIS)
- node := &ast.SwitchStatement{
- Switch: idx,
- Discriminant: p.parseExpression(),
- Default: -1,
- }
- p.expect(token.RIGHT_PARENTHESIS)
- if p.mode&StoreComments != 0 {
- comments = append(comments, p.comments.FetchAll()...)
- }
-
- p.expect(token.LEFT_BRACE)
-
- inSwitch := p.scope.inSwitch
- p.scope.inSwitch = true
- defer func() {
- p.scope.inSwitch = inSwitch
- }()
-
- for index := 0; p.token != token.EOF; index++ {
- if p.token == token.RIGHT_BRACE {
- node.RightBrace = p.idx
- p.next()
- break
- }
-
- clause := p.parseCaseStatement()
- if clause.Test == nil {
- if node.Default != -1 {
- p.error(clause.Case, "Already saw a default in switch")
- }
- node.Default = index
- }
- node.Body = append(node.Body, clause)
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- }
-
- return node
-}
-
-func (p *parser) parseWithStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.WITH)
- var withComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- withComments = p.comments.FetchAll()
- }
-
- p.expect(token.LEFT_PARENTHESIS)
-
- node := &ast.WithStatement{
- With: idx,
- Object: p.parseExpression(),
- }
- p.expect(token.RIGHT_PARENTHESIS)
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(node, withComments, ast.WITH)
- }
-
- node.Body = p.parseStatement()
-
- return node
-}
-
-func (p *parser) parseCaseStatement() *ast.CaseStatement {
- node := &ast.CaseStatement{
- Case: p.idx,
- }
-
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- p.comments.Unset()
- }
-
- if p.token == token.DEFAULT {
- p.next()
- } else {
- p.expect(token.CASE)
- node.Test = p.parseExpression()
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.COLON)
-
- for {
- if p.token == token.EOF ||
- p.token == token.RIGHT_BRACE ||
- p.token == token.CASE ||
- p.token == token.DEFAULT {
- break
- }
- consequent := p.parseStatement()
- node.Consequent = append(node.Consequent, consequent)
- }
-
- // Link the comments to the case statement
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- }
-
- return node
-}
-
-func (p *parser) parseIterationStatement() ast.Statement {
- inIteration := p.scope.inIteration
- p.scope.inIteration = true
- defer func() {
- p.scope.inIteration = inIteration
- }()
- return p.parseStatement()
-}
-
-func (p *parser) parseForIn(into ast.Expression) *ast.ForInStatement {
- // Already have consumed " in"
-
- source := p.parseExpression()
- p.expect(token.RIGHT_PARENTHESIS)
- body := p.parseIterationStatement()
-
- forin := &ast.ForInStatement{
- Into: into,
- Source: source,
- Body: body,
- }
-
- return forin
-}
-
-func (p *parser) parseFor(initializer ast.Expression) *ast.ForStatement {
- // Already have consumed " ;"
-
- var test, update ast.Expression
-
- if p.token != token.SEMICOLON {
- test = p.parseExpression()
- }
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.SEMICOLON)
-
- if p.token != token.RIGHT_PARENTHESIS {
- update = p.parseExpression()
- }
- p.expect(token.RIGHT_PARENTHESIS)
- body := p.parseIterationStatement()
-
- forstatement := &ast.ForStatement{
- Initializer: initializer,
- Test: test,
- Update: update,
- Body: body,
- }
-
- return forstatement
-}
-
-func (p *parser) parseForOrForInStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.FOR)
- var forComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- forComments = p.comments.FetchAll()
- }
- p.expect(token.LEFT_PARENTHESIS)
-
- var left []ast.Expression
-
- forIn := false
- if p.token != token.SEMICOLON {
- allowIn := p.scope.allowIn
- p.scope.allowIn = false
- if p.token == token.VAR {
- idx := p.idx
- var varComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- varComments = p.comments.FetchAll()
- p.comments.Unset()
- }
- p.next()
- list := p.parseVariableDeclarationList(idx)
- if len(list) == 1 && p.token == token.IN {
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.next() // in
- forIn = true
- left = []ast.Expression{list[0]} // There is only one declaration
- } else {
- left = list
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(left[0], varComments, ast.LEADING)
- }
- } else {
- left = append(left, p.parseExpression())
- if p.token == token.IN {
- p.next()
- forIn = true
- }
- }
- p.scope.allowIn = allowIn
- }
-
- if forIn {
- switch left[0].(type) {
- case *ast.Identifier, *ast.DotExpression, *ast.BracketExpression, *ast.VariableExpression:
- // These are all acceptable
- default:
- p.error(idx, "Invalid left-hand side in for-in")
- p.nextStatement()
- return &ast.BadStatement{From: idx, To: p.idx}
- }
-
- forin := p.parseForIn(left[0])
- forin.For = idx
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(forin, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(forin, forComments, ast.FOR)
- }
- return forin
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.Unset()
- }
- p.expect(token.SEMICOLON)
- initializer := &ast.SequenceExpression{Sequence: left}
- forstatement := p.parseFor(initializer)
- forstatement.For = idx
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(forstatement, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(forstatement, forComments, ast.FOR)
- }
- return forstatement
-}
-
-func (p *parser) parseVariableStatement() *ast.VariableStatement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.VAR)
-
- list := p.parseVariableDeclarationList(idx)
-
- statement := &ast.VariableStatement{
- Var: idx,
- List: list,
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(statement, comments, ast.LEADING)
- p.comments.Unset()
- }
- p.semicolon()
-
- return statement
-}
-
-func (p *parser) parseDoWhileStatement() ast.Statement {
- inIteration := p.scope.inIteration
- p.scope.inIteration = true
- defer func() {
- p.scope.inIteration = inIteration
- }()
-
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.DO)
- var doComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- doComments = p.comments.FetchAll()
- }
-
- node := &ast.DoWhileStatement{Do: idx}
- if p.token == token.LEFT_BRACE {
- node.Body = p.parseBlockStatement()
- } else {
- node.Body = p.parseStatement()
- }
-
- p.expect(token.WHILE)
- var whileComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- whileComments = p.comments.FetchAll()
- }
- p.expect(token.LEFT_PARENTHESIS)
- node.Test = p.parseExpression()
- node.RightParenthesis = p.expect(token.RIGHT_PARENTHESIS)
-
- p.implicitSemicolon = true
- p.optionalSemicolon()
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(node, doComments, ast.DO)
- p.comments.CommentMap.AddComments(node, whileComments, ast.WHILE)
- }
-
- return node
-}
-
-func (p *parser) parseWhileStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.WHILE)
-
- var whileComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- whileComments = p.comments.FetchAll()
- }
-
- p.expect(token.LEFT_PARENTHESIS)
- node := &ast.WhileStatement{
- While: idx,
- Test: p.parseExpression(),
- }
- p.expect(token.RIGHT_PARENTHESIS)
- node.Body = p.parseIterationStatement()
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(node, whileComments, ast.WHILE)
- }
-
- return node
-}
-
-func (p *parser) parseIfStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- pos := p.expect(token.IF)
- var ifComments []*ast.Comment
- if p.mode&StoreComments != 0 {
- ifComments = p.comments.FetchAll()
- }
-
- p.expect(token.LEFT_PARENTHESIS)
- node := &ast.IfStatement{
- If: pos,
- Test: p.parseExpression(),
- }
- p.expect(token.RIGHT_PARENTHESIS)
- if p.token == token.LEFT_BRACE {
- node.Consequent = p.parseBlockStatement()
- } else {
- node.Consequent = p.parseStatement()
- }
-
- if p.token == token.ELSE {
- p.next()
- node.Alternate = p.parseStatement()
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(node, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(node, ifComments, ast.IF)
- }
-
- return node
-}
-
-func (p *parser) parseSourceElement() ast.Statement {
- statement := p.parseStatement()
- return statement
-}
-
-func (p *parser) parseSourceElements() []ast.Statement {
- body := []ast.Statement(nil)
-
- for {
- if p.token != token.STRING {
- break
- }
- body = append(body, p.parseSourceElement())
- }
-
- for p.token != token.EOF {
- body = append(body, p.parseSourceElement())
- }
-
- return body
-}
-
-func (p *parser) parseProgram() *ast.Program {
- p.openScope()
- defer p.closeScope()
- return &ast.Program{
- Body: p.parseSourceElements(),
- DeclarationList: p.scope.declarationList,
- File: p.file,
- }
-}
-
-func (p *parser) parseBreakStatement() ast.Statement {
- var comments []*ast.Comment
- if p.mode&StoreComments != 0 {
- comments = p.comments.FetchAll()
- }
- idx := p.expect(token.BREAK)
- semicolon := p.implicitSemicolon
- if p.token == token.SEMICOLON {
- semicolon = true
- p.next()
- }
-
- if semicolon || p.token == token.RIGHT_BRACE {
- p.implicitSemicolon = false
- if !p.scope.inIteration && !p.scope.inSwitch {
- goto illegal
- }
- breakStatement := &ast.BranchStatement{
- Idx: idx,
- Token: token.BREAK,
- }
-
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(breakStatement, comments, ast.LEADING)
- p.comments.CommentMap.AddComments(breakStatement, p.comments.FetchAll(), ast.TRAILING)
- }
-
- return breakStatement
- }
-
- if p.token == token.IDENTIFIER {
- identifier := p.parseIdentifier()
- if !p.scope.hasLabel(identifier.Name) {
- p.error(idx, "Undefined label '%s'", identifier.Name)
- return &ast.BadStatement{From: idx, To: identifier.Idx1()}
- }
- p.semicolon()
- breakStatement := &ast.BranchStatement{
- Idx: idx,
- Token: token.BREAK,
- Label: identifier,
- }
- if p.mode&StoreComments != 0 {
- p.comments.CommentMap.AddComments(breakStatement, comments, ast.LEADING)
- }
-
- return breakStatement
- }
-
- p.expect(token.IDENTIFIER)
-
-illegal:
- p.error(idx, "Illegal break statement")
- p.nextStatement()
- return &ast.BadStatement{From: idx, To: p.idx}
-}
-
-func (p *parser) parseContinueStatement() ast.Statement {
- idx := p.expect(token.CONTINUE)
- semicolon := p.implicitSemicolon
- if p.token == token.SEMICOLON {
- semicolon = true
- p.next()
- }
-
- if semicolon || p.token == token.RIGHT_BRACE {
- p.implicitSemicolon = false
- if !p.scope.inIteration {
- goto illegal
- }
- return &ast.BranchStatement{
- Idx: idx,
- Token: token.CONTINUE,
- }
- }
-
- if p.token == token.IDENTIFIER {
- identifier := p.parseIdentifier()
- if !p.scope.hasLabel(identifier.Name) {
- p.error(idx, "Undefined label '%s'", identifier.Name)
- return &ast.BadStatement{From: idx, To: identifier.Idx1()}
- }
- if !p.scope.inIteration {
- goto illegal
- }
- p.semicolon()
- return &ast.BranchStatement{
- Idx: idx,
- Token: token.CONTINUE,
- Label: identifier,
- }
- }
-
- p.expect(token.IDENTIFIER)
-
-illegal:
- p.error(idx, "Illegal continue statement")
- p.nextStatement()
- return &ast.BadStatement{From: idx, To: p.idx}
-}
-
-// Find the next statement after an error (recover).
-func (p *parser) nextStatement() {
- for {
- switch p.token {
- case token.BREAK, token.CONTINUE,
- token.FOR, token.IF, token.RETURN, token.SWITCH,
- token.VAR, token.DO, token.TRY, token.WITH,
- token.WHILE, token.THROW, token.CATCH, token.FINALLY:
- // Return only if parser made some progress since last
- // sync or if it has not reached 10 next calls without
- // progress. Otherwise consume at least one token to
- // avoid an endless parser loop
- if p.idx == p.recover.idx && p.recover.count < 10 {
- p.recover.count++
- return
- }
- if p.idx > p.recover.idx {
- p.recover.idx = p.idx
- p.recover.count = 0
- return
- }
- // Reaching here indicates a parser bug, likely an
- // incorrect token list in this function, but it only
- // leads to skipping of possibly correct code if a
- // previous error is present, and thus is preferred
- // over a non-terminating parse.
- case token.EOF:
- return
- }
- p.next()
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/property.go b/vendor/github.com/robertkrimen/otto/property.go
deleted file mode 100644
index 9c2758e..0000000
--- a/vendor/github.com/robertkrimen/otto/property.go
+++ /dev/null
@@ -1,218 +0,0 @@
-package otto
-
-// property
-
-type propertyMode int
-
-const (
- modeWriteMask propertyMode = 0o700
- modeEnumerateMask propertyMode = 0o070
- modeConfigureMask propertyMode = 0o007
- modeOnMask propertyMode = 0o111
- modeSetMask propertyMode = 0o222 // If value is 2, then mode is neither "On" nor "Off"
-)
-
-type propertyGetSet [2]*object
-
-var nilGetSetObject = object{}
-
-type property struct {
- value interface{}
- mode propertyMode
-}
-
-func (p property) writable() bool {
- return p.mode&modeWriteMask == modeWriteMask&modeOnMask
-}
-
-func (p *property) writeOn() {
- p.mode = (p.mode & ^modeWriteMask) | (modeWriteMask & modeOnMask)
-}
-
-func (p *property) writeOff() {
- p.mode &= ^modeWriteMask
-}
-
-func (p *property) writeClear() {
- p.mode = (p.mode & ^modeWriteMask) | (modeWriteMask & modeSetMask)
-}
-
-func (p property) writeSet() bool {
- return p.mode&modeWriteMask&modeSetMask == 0
-}
-
-func (p property) enumerable() bool {
- return p.mode&modeEnumerateMask == modeEnumerateMask&modeOnMask
-}
-
-func (p *property) enumerateOn() {
- p.mode = (p.mode & ^modeEnumerateMask) | (modeEnumerateMask & modeOnMask)
-}
-
-func (p *property) enumerateOff() {
- p.mode &= ^modeEnumerateMask
-}
-
-func (p property) enumerateSet() bool {
- return p.mode&modeEnumerateMask&modeSetMask == 0
-}
-
-func (p property) configurable() bool {
- return p.mode&modeConfigureMask == modeConfigureMask&modeOnMask
-}
-
-func (p *property) configureOn() {
- p.mode = (p.mode & ^modeConfigureMask) | (modeConfigureMask & modeOnMask)
-}
-
-func (p *property) configureOff() {
- p.mode &= ^modeConfigureMask
-}
-
-func (p property) configureSet() bool { //nolint: unused
- return p.mode&modeConfigureMask&modeSetMask == 0
-}
-
-func (p property) copy() *property { //nolint: unused
- cpy := p
- return &cpy
-}
-
-func (p property) get(this *object) Value {
- switch value := p.value.(type) {
- case Value:
- return value
- case propertyGetSet:
- if value[0] != nil {
- return value[0].call(toValue(this), nil, false, nativeFrame)
- }
- }
- return Value{}
-}
-
-func (p property) isAccessorDescriptor() bool {
- setGet, test := p.value.(propertyGetSet)
- return test && (setGet[0] != nil || setGet[1] != nil)
-}
-
-func (p property) isDataDescriptor() bool {
- if p.writeSet() { // Either "On" or "Off"
- return true
- }
- value, valid := p.value.(Value)
- return valid && !value.isEmpty()
-}
-
-func (p property) isGenericDescriptor() bool {
- return !(p.isDataDescriptor() || p.isAccessorDescriptor())
-}
-
-func (p property) isEmpty() bool {
- return p.mode == 0o222 && p.isGenericDescriptor()
-}
-
-// _enumerableValue, _enumerableTrue, _enumerableFalse?
-// .enumerableValue() .enumerableExists()
-
-func toPropertyDescriptor(rt *runtime, value Value) property {
- objectDescriptor := value.object()
- if objectDescriptor == nil {
- panic(rt.panicTypeError("toPropertyDescriptor on nil"))
- }
-
- var descriptor property
- descriptor.mode = modeSetMask // Initially nothing is set
- if objectDescriptor.hasProperty("enumerable") {
- if objectDescriptor.get("enumerable").bool() {
- descriptor.enumerateOn()
- } else {
- descriptor.enumerateOff()
- }
- }
-
- if objectDescriptor.hasProperty("configurable") {
- if objectDescriptor.get("configurable").bool() {
- descriptor.configureOn()
- } else {
- descriptor.configureOff()
- }
- }
-
- if objectDescriptor.hasProperty("writable") {
- if objectDescriptor.get("writable").bool() {
- descriptor.writeOn()
- } else {
- descriptor.writeOff()
- }
- }
-
- var getter, setter *object
- getterSetter := false
-
- if objectDescriptor.hasProperty("get") {
- value := objectDescriptor.get("get")
- if value.IsDefined() {
- if !value.isCallable() {
- panic(rt.panicTypeError("toPropertyDescriptor get not callable"))
- }
- getter = value.object()
- getterSetter = true
- } else {
- getter = &nilGetSetObject
- getterSetter = true
- }
- }
-
- if objectDescriptor.hasProperty("set") {
- value := objectDescriptor.get("set")
- if value.IsDefined() {
- if !value.isCallable() {
- panic(rt.panicTypeError("toPropertyDescriptor set not callable"))
- }
- setter = value.object()
- getterSetter = true
- } else {
- setter = &nilGetSetObject
- getterSetter = true
- }
- }
-
- if getterSetter {
- if descriptor.writeSet() {
- panic(rt.panicTypeError("toPropertyDescriptor descriptor writeSet"))
- }
- descriptor.value = propertyGetSet{getter, setter}
- }
-
- if objectDescriptor.hasProperty("value") {
- if getterSetter {
- panic(rt.panicTypeError("toPropertyDescriptor value getterSetter"))
- }
- descriptor.value = objectDescriptor.get("value")
- }
-
- return descriptor
-}
-
-func (rt *runtime) fromPropertyDescriptor(descriptor property) *object {
- obj := rt.newObject()
- if descriptor.isDataDescriptor() {
- obj.defineProperty("value", descriptor.value.(Value), 0o111, false)
- obj.defineProperty("writable", boolValue(descriptor.writable()), 0o111, false)
- } else if descriptor.isAccessorDescriptor() {
- getSet := descriptor.value.(propertyGetSet)
- get := Value{}
- if getSet[0] != nil {
- get = objectValue(getSet[0])
- }
- set := Value{}
- if getSet[1] != nil {
- set = objectValue(getSet[1])
- }
- obj.defineProperty("get", get, 0o111, false)
- obj.defineProperty("set", set, 0o111, false)
- }
- obj.defineProperty("enumerable", boolValue(descriptor.enumerable()), 0o111, false)
- obj.defineProperty("configurable", boolValue(descriptor.configurable()), 0o111, false)
- return obj
-}
diff --git a/vendor/github.com/robertkrimen/otto/registry/registry.go b/vendor/github.com/robertkrimen/otto/registry/registry.go
deleted file mode 100644
index e173133..0000000
--- a/vendor/github.com/robertkrimen/otto/registry/registry.go
+++ /dev/null
@@ -1,52 +0,0 @@
-// Package registry is an experimental package to facilitate altering the otto runtime via import.
-//
-// This interface can change at any time.
-package registry
-
-var registry []*Entry = make([]*Entry, 0)
-
-// Entry represents a registry entry.
-type Entry struct {
- active bool
- source func() string
-}
-
-// newEntry returns a new Entry for source.
-func newEntry(source func() string) *Entry {
- return &Entry{
- active: true,
- source: source,
- }
-}
-
-// Enable enables the entry.
-func (e *Entry) Enable() {
- e.active = true
-}
-
-// Disable disables the entry.
-func (e *Entry) Disable() {
- e.active = false
-}
-
-// Source returns the source of the entry.
-func (e Entry) Source() string {
- return e.source()
-}
-
-// Apply applies callback to all registry entries.
-func Apply(callback func(Entry)) {
- for _, entry := range registry {
- if !entry.active {
- continue
- }
- callback(*entry)
- }
-}
-
-// Register registers a new Entry for source.
-func Register(source func() string) *Entry {
- entry := newEntry(source)
- registry = append(registry, entry)
- return entry
-}
diff --git a/vendor/github.com/robertkrimen/otto/result.go b/vendor/github.com/robertkrimen/otto/result.go
deleted file mode 100644
index 1896c18..0000000
--- a/vendor/github.com/robertkrimen/otto/result.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package otto
-
-type resultKind int
-
-const (
- _ resultKind = iota
- resultReturn
- resultBreak
- resultContinue
-)
-
-type result struct {
- kind resultKind
- value Value
- target string
-}
-
-func newReturnResult(value Value) result {
- return result{resultReturn, value, ""}
-}
-
-func newContinueResult(target string) result {
- return result{resultContinue, emptyValue, target}
-}
-
-func newBreakResult(target string) result {
- return result{resultBreak, emptyValue, target}
-}
diff --git a/vendor/github.com/robertkrimen/otto/runtime.go b/vendor/github.com/robertkrimen/otto/runtime.go
deleted file mode 100644
index 883b512..0000000
--- a/vendor/github.com/robertkrimen/otto/runtime.go
+++ /dev/null
@@ -1,874 +0,0 @@
-package otto
-
-import (
- "encoding"
- "encoding/json"
- "errors"
- "fmt"
- "math"
- "path"
- "reflect"
- goruntime "runtime"
- "strconv"
- "strings"
- "sync"
-
- "github.com/robertkrimen/otto/ast"
- "github.com/robertkrimen/otto/parser"
-)
-
-type global struct {
- Object *object // Object( ... ), new Object( ... ) - 1 (length)
- Function *object // Function( ... ), new Function( ... ) - 1
- Array *object // Array( ... ), new Array( ... ) - 1
- String *object // String( ... ), new String( ... ) - 1
- Boolean *object // Boolean( ... ), new Boolean( ... ) - 1
- Number *object // Number( ... ), new Number( ... ) - 1
- Math *object
- Date *object // Date( ... ), new Date( ... ) - 7
- RegExp *object // RegExp( ... ), new RegExp( ... ) - 2
- Error *object // Error( ... ), new Error( ... ) - 1
- EvalError *object
- TypeError *object
- RangeError *object
- ReferenceError *object
- SyntaxError *object
- URIError *object
- JSON *object
-
- ObjectPrototype *object // Object.prototype
- FunctionPrototype *object // Function.prototype
- ArrayPrototype *object // Array.prototype
- StringPrototype *object // String.prototype
- BooleanPrototype *object // Boolean.prototype
- NumberPrototype *object // Number.prototype
- DatePrototype *object // Date.prototype
- RegExpPrototype *object // RegExp.prototype
- ErrorPrototype *object // Error.prototype
- EvalErrorPrototype *object
- TypeErrorPrototype *object
- RangeErrorPrototype *object
- ReferenceErrorPrototype *object
- SyntaxErrorPrototype *object
- URIErrorPrototype *object
-}
-
-type runtime struct {
- global global
- globalObject *object
- globalStash *objectStash
- scope *scope
- otto *Otto
- eval *object // The builtin eval, for determine indirect versus direct invocation
- debugger func(*Otto)
- random func() float64
- stackLimit int
- traceLimit int
-
- labels []string // FIXME
- lck sync.Mutex
-}
-
-func (rt *runtime) enterScope(scop *scope) {
- scop.outer = rt.scope
- if rt.scope != nil {
- if rt.stackLimit != 0 && rt.scope.depth+1 >= rt.stackLimit {
- panic(rt.panicRangeError("Maximum call stack size exceeded"))
- }
-
- scop.depth = rt.scope.depth + 1
- }
-
- rt.scope = scop
-}
-
-func (rt *runtime) leaveScope() {
- rt.scope = rt.scope.outer
-}
-
-// FIXME This is used in two places (cloning).
-func (rt *runtime) enterGlobalScope() {
- rt.enterScope(newScope(rt.globalStash, rt.globalStash, rt.globalObject))
-}
-
-func (rt *runtime) enterFunctionScope(outer stasher, this Value) *fnStash {
- if outer == nil {
- outer = rt.globalStash
- }
- stash := rt.newFunctionStash(outer)
- var thisObject *object
- switch this.kind {
- case valueUndefined, valueNull:
- thisObject = rt.globalObject
- default:
- thisObject = rt.toObject(this)
- }
- rt.enterScope(newScope(stash, stash, thisObject))
- return stash
-}
-
-func (rt *runtime) putValue(reference referencer, value Value) {
- name := reference.putValue(value)
- if name != "" {
- // Why? -- If reference.base == nil
- // strict = false
- rt.globalObject.defineProperty(name, value, 0o111, false)
- }
-}
-
-func (rt *runtime) tryCatchEvaluate(inner func() Value) (tryValue Value, isException bool) { //nolint: nonamedreturns
- // resultValue = The value of the block (e.g. the last statement)
- // throw = Something was thrown
- // throwValue = The value of what was thrown
- // other = Something that changes flow (return, break, continue) that is not a throw
- // Otherwise, some sort of unknown panic happened, we'll just propagate it.
- defer func() {
- if caught := recover(); caught != nil {
- if excep, ok := caught.(*exception); ok {
- caught = excep.eject()
- }
- switch caught := caught.(type) {
- case ottoError:
- isException = true
- tryValue = objectValue(rt.newErrorObjectError(caught))
- case Value:
- isException = true
- tryValue = caught
- default:
- isException = true
- tryValue = toValue(caught)
- }
- }
- }()
-
- return inner(), false
-}
-
-func (rt *runtime) toObject(value Value) *object {
- switch value.kind {
- case valueEmpty, valueUndefined, valueNull:
- panic(rt.panicTypeError("toObject unsupported kind %s", value.kind))
- case valueBoolean:
- return rt.newBoolean(value)
- case valueString:
- return rt.newString(value)
- case valueNumber:
- return rt.newNumber(value)
- case valueObject:
- return value.object()
- default:
- panic(rt.panicTypeError("toObject unknown kind %s", value.kind))
- }
-}
-
-func (rt *runtime) objectCoerce(value Value) (*object, error) {
- switch value.kind {
- case valueUndefined:
- return nil, errors.New("undefined")
- case valueNull:
- return nil, errors.New("null")
- case valueBoolean:
- return rt.newBoolean(value), nil
- case valueString:
- return rt.newString(value), nil
- case valueNumber:
- return rt.newNumber(value), nil
- case valueObject:
- return value.object(), nil
- default:
- panic(rt.panicTypeError("objectCoerce unknown kind %s", value.kind))
- }
-}
-
-func checkObjectCoercible(rt *runtime, value Value) {
- isObject, mustCoerce := testObjectCoercible(value)
- if !isObject && !mustCoerce {
- panic(rt.panicTypeError("checkObjectCoercible not object or mustCoerce"))
- }
-}
-
-// testObjectCoercible.
-func testObjectCoercible(value Value) (isObject, mustCoerce bool) { //nolint: nonamedreturns
- switch value.kind {
- case valueReference, valueEmpty, valueNull, valueUndefined:
- return false, false
- case valueNumber, valueString, valueBoolean:
- return false, true
- case valueObject:
- return true, false
- default:
- panic(fmt.Sprintf("testObjectCoercible unknown kind %s", value.kind))
- }
-}
-
-func (rt *runtime) safeToValue(value interface{}) (Value, error) {
- result := Value{}
- err := catchPanic(func() {
- result = rt.toValue(value)
- })
- return result, err
-}
-
-// convertNumeric converts numeric parameter val from js to that of type t if it is safe to do so, otherwise it panics.
-// This allows literals (int64), bitwise values (int32) and the general form (float64) of javascript numerics to be passed as parameters to go functions easily.
-func (rt *runtime) convertNumeric(v Value, t reflect.Type) reflect.Value {
- val := reflect.ValueOf(v.export())
-
- if val.Kind() == t.Kind() {
- return val
- }
-
- if val.Kind() == reflect.Interface {
- val = reflect.ValueOf(val.Interface())
- }
-
- switch val.Kind() {
- case reflect.Float32, reflect.Float64:
- f64 := val.Float()
- switch t.Kind() {
- case reflect.Float64:
- return reflect.ValueOf(f64)
- case reflect.Float32:
- if reflect.Zero(t).OverflowFloat(f64) {
- panic(rt.panicRangeError("converting float64 to float32 would overflow"))
- }
-
- return val.Convert(t)
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- i64 := int64(f64)
- if float64(i64) != f64 {
- panic(rt.panicRangeError(fmt.Sprintf("converting %v to %v would cause loss of precision", val.Type(), t)))
- }
-
- // The float represents an integer
- val = reflect.ValueOf(i64)
- default:
- panic(rt.panicTypeError(fmt.Sprintf("cannot convert %v to %v", val.Type(), t)))
- }
- }
-
- switch val.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- i64 := val.Int()
- switch t.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- if reflect.Zero(t).OverflowInt(i64) {
- panic(rt.panicRangeError(fmt.Sprintf("converting %v to %v would overflow", val.Type(), t)))
- }
- return val.Convert(t)
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- if i64 < 0 {
- panic(rt.panicRangeError(fmt.Sprintf("converting %v to %v would underflow", val.Type(), t)))
- }
- if reflect.Zero(t).OverflowUint(uint64(i64)) {
- panic(rt.panicRangeError(fmt.Sprintf("converting %v to %v would overflow", val.Type(), t)))
- }
- return val.Convert(t)
- case reflect.Float32, reflect.Float64:
- return val.Convert(t)
- }
-
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- u64 := val.Uint()
- switch t.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- if u64 > math.MaxInt64 || reflect.Zero(t).OverflowInt(int64(u64)) {
- panic(rt.panicRangeError(fmt.Sprintf("converting %v to %v would overflow", val.Type(), t)))
- }
- return val.Convert(t)
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- if reflect.Zero(t).OverflowUint(u64) {
- panic(rt.panicRangeError(fmt.Sprintf("converting %v to %v would overflow", val.Type(), t)))
- }
- return val.Convert(t)
- case reflect.Float32, reflect.Float64:
- return val.Convert(t)
- }
- }
-
- panic(rt.panicTypeError(fmt.Sprintf("unsupported type %v -> %v for numeric conversion", val.Type(), t)))
-}
-
-func fieldIndexByName(t reflect.Type, name string) []int {
- for t.Kind() == reflect.Ptr {
- t = t.Elem()
- }
-
- for i := 0; i < t.NumField(); i++ {
- f := t.Field(i)
-
- if !validGoStructName(f.Name) {
- continue
- }
-
- if f.Anonymous {
- for t.Kind() == reflect.Ptr {
- t = t.Elem()
- }
-
- if f.Type.Kind() == reflect.Struct {
- if a := fieldIndexByName(f.Type, name); a != nil {
- return append([]int{i}, a...)
- }
- }
- }
-
- if a := strings.SplitN(f.Tag.Get("json"), ",", 2); a[0] != "" {
- if a[0] == "-" {
- continue
- }
-
- if a[0] == name {
- return []int{i}
- }
- }
-
- if f.Name == name {
- return []int{i}
- }
- }
-
- return nil
-}
-
-var (
- typeOfValue = reflect.TypeOf(Value{})
- typeOfJSONRawMessage = reflect.TypeOf(json.RawMessage{})
-)
-
-// convertCallParameter converts request val to type t if possible.
-// If the conversion fails due to overflow or type miss-match then it panics.
-// If no conversion is known then the original value is returned.
-func (rt *runtime) convertCallParameter(v Value, t reflect.Type) (reflect.Value, error) {
- if t == typeOfValue {
- return reflect.ValueOf(v), nil
- }
-
- if t == typeOfJSONRawMessage {
- if d, err := json.Marshal(v.export()); err == nil {
- return reflect.ValueOf(d), nil
- }
- }
-
- if v.kind == valueObject {
- if gso, ok := v.object().value.(*goStructObject); ok {
- if gso.value.Type().AssignableTo(t) {
- // please see TestDynamicFunctionReturningInterface for why this exists
- if t.Kind() == reflect.Interface && gso.value.Type().ConvertibleTo(t) {
- return gso.value.Convert(t), nil
- }
- return gso.value, nil
- }
- }
-
- if gao, ok := v.object().value.(*goArrayObject); ok {
- if gao.value.Type().AssignableTo(t) {
- // please see TestDynamicFunctionReturningInterface for why this exists
- if t.Kind() == reflect.Interface && gao.value.Type().ConvertibleTo(t) {
- return gao.value.Convert(t), nil
- }
- return gao.value, nil
- }
- }
- }
-
- tk := t.Kind()
-
- if tk == reflect.Interface {
- e := v.export()
- if e == nil {
- return reflect.Zero(t), nil
- }
- iv := reflect.ValueOf(e)
- if iv.Type().AssignableTo(t) {
- return iv, nil
- }
- }
-
- if tk == reflect.Ptr {
- switch v.kind {
- case valueEmpty, valueNull, valueUndefined:
- return reflect.Zero(t), nil
- default:
- var vv reflect.Value
- vv, err := rt.convertCallParameter(v, t.Elem())
- if err != nil {
- return reflect.Zero(t), fmt.Errorf("can't convert to %s: %w", t, err)
- }
-
- if vv.CanAddr() {
- return vv.Addr(), nil
- }
-
- pv := reflect.New(vv.Type())
- pv.Elem().Set(vv)
- return pv, nil
- }
- }
-
- switch tk {
- case reflect.Bool:
- return reflect.ValueOf(v.bool()), nil
- case reflect.String:
- switch v.kind {
- case valueString:
- return reflect.ValueOf(v.value), nil
- case valueNumber:
- return reflect.ValueOf(fmt.Sprintf("%v", v.value)), nil
- }
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64:
- if v.kind == valueNumber {
- return rt.convertNumeric(v, t), nil
- }
- case reflect.Slice:
- if o := v.object(); o != nil {
- if lv := o.get(propertyLength); lv.IsNumber() {
- l := lv.number().int64
-
- s := reflect.MakeSlice(t, int(l), int(l))
-
- tt := t.Elem()
-
- switch o.class {
- case classArrayName:
- for i := int64(0); i < l; i++ {
- p, ok := o.property[strconv.FormatInt(i, 10)]
- if !ok {
- continue
- }
-
- e, ok := p.value.(Value)
- if !ok {
- continue
- }
-
- ev, err := rt.convertCallParameter(e, tt)
- if err != nil {
- return reflect.Zero(t), fmt.Errorf("couldn't convert element %d of %s: %w", i, t, err)
- }
-
- s.Index(int(i)).Set(ev)
- }
- case classGoArrayName, classGoSliceName:
- var gslice bool
- switch o.value.(type) {
- case *goSliceObject:
- gslice = true
- case *goArrayObject:
- gslice = false
- }
-
- for i := int64(0); i < l; i++ {
- var p *property
- if gslice {
- p = goSliceGetOwnProperty(o, strconv.FormatInt(i, 10))
- } else {
- p = goArrayGetOwnProperty(o, strconv.FormatInt(i, 10))
- }
- if p == nil {
- continue
- }
-
- e, ok := p.value.(Value)
- if !ok {
- continue
- }
-
- ev, err := rt.convertCallParameter(e, tt)
- if err != nil {
- return reflect.Zero(t), fmt.Errorf("couldn't convert element %d of %s: %w", i, t, err)
- }
-
- s.Index(int(i)).Set(ev)
- }
- }
-
- return s, nil
- }
- }
- case reflect.Map:
- if o := v.object(); o != nil && t.Key().Kind() == reflect.String {
- m := reflect.MakeMap(t)
-
- var err error
-
- o.enumerate(false, func(k string) bool {
- v, verr := rt.convertCallParameter(o.get(k), t.Elem())
- if verr != nil {
- err = fmt.Errorf("couldn't convert property %q of %s: %w", k, t, verr)
- return false
- }
- m.SetMapIndex(reflect.ValueOf(k), v)
- return true
- })
-
- if err != nil {
- return reflect.Zero(t), err
- }
-
- return m, nil
- }
- case reflect.Func:
- if t.NumOut() > 1 {
- return reflect.Zero(t), fmt.Errorf("converting JavaScript values to Go functions with more than one return value is currently not supported")
- }
-
- if o := v.object(); o != nil && o.class == classFunctionName {
- return reflect.MakeFunc(t, func(args []reflect.Value) []reflect.Value {
- l := make([]interface{}, len(args))
- for i, a := range args {
- if a.CanInterface() {
- l[i] = a.Interface()
- }
- }
-
- rv, err := v.Call(nullValue, l...)
- if err != nil {
- panic(err)
- }
-
- if t.NumOut() == 0 {
- return nil
- }
-
- r, err := rt.convertCallParameter(rv, t.Out(0))
- if err != nil {
- panic(rt.panicTypeError("convertCallParameter Func: %s", err))
- }
-
- return []reflect.Value{r}
- }), nil
- }
- case reflect.Struct:
- if o := v.object(); o != nil && o.class == classObjectName {
- s := reflect.New(t)
-
- for _, k := range o.propertyOrder {
- idx := fieldIndexByName(t, k)
-
- if idx == nil {
- return reflect.Zero(t), fmt.Errorf("can't convert property %q of %s: field does not exist", k, t)
- }
-
- ss := s
-
- for _, i := range idx {
- if ss.Kind() == reflect.Ptr {
- if ss.IsNil() {
- if !ss.CanSet() {
- return reflect.Zero(t), fmt.Errorf("can't convert property %q of %s: %s is unexported", k, t, ss.Type().Elem())
- }
-
- ss.Set(reflect.New(ss.Type().Elem()))
- }
-
- ss = ss.Elem()
- }
-
- ss = ss.Field(i)
- }
-
- v, err := rt.convertCallParameter(o.get(k), ss.Type())
- if err != nil {
- return reflect.Zero(t), fmt.Errorf("couldn't convert property %q of %s: %w", k, t, err)
- }
-
- ss.Set(v)
- }
-
- return s.Elem(), nil
- }
- }
-
- if tk == reflect.String {
- if o := v.object(); o != nil && o.hasProperty("toString") {
- if fn := o.get("toString"); fn.IsFunction() {
- sv, err := fn.Call(v)
- if err != nil {
- return reflect.Zero(t), fmt.Errorf("couldn't call toString: %w", err)
- }
-
- r, err := rt.convertCallParameter(sv, t)
- if err != nil {
- return reflect.Zero(t), fmt.Errorf("couldn't convert toString result: %w", err)
- }
- return r, nil
- }
- }
-
- return reflect.ValueOf(v.String()), nil
- }
-
- if v.kind == valueString {
- var s encoding.TextUnmarshaler
-
- if reflect.PtrTo(t).Implements(reflect.TypeOf(&s).Elem()) {
- r := reflect.New(t)
-
- if err := r.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(v.string())); err != nil {
- return reflect.Zero(t), fmt.Errorf("can't convert to %s as TextUnmarshaller: %w", t.String(), err)
- }
-
- return r.Elem(), nil
- }
- }
-
- s := "OTTO DOES NOT UNDERSTAND THIS TYPE"
- switch v.kind {
- case valueBoolean:
- s = "boolean"
- case valueNull:
- s = "null"
- case valueNumber:
- s = "number"
- case valueString:
- s = "string"
- case valueUndefined:
- s = "undefined"
- case valueObject:
- s = v.Class()
- }
-
- return reflect.Zero(t), fmt.Errorf("can't convert from %q to %q", s, t)
-}
-
-func (rt *runtime) toValue(value interface{}) Value {
- rv, ok := value.(reflect.Value)
- if ok {
- value = rv.Interface()
- }
-
- switch value := value.(type) {
- case Value:
- return value
- case func(FunctionCall) Value:
- var name, file string
- var line int
- pc := reflect.ValueOf(value).Pointer()
- fn := goruntime.FuncForPC(pc)
- if fn != nil {
- name = fn.Name()
- file, line = fn.FileLine(pc)
- file = path.Base(file)
- }
- return objectValue(rt.newNativeFunction(name, file, line, value))
- case nativeFunction:
- var name, file string
- var line int
- pc := reflect.ValueOf(value).Pointer()
- fn := goruntime.FuncForPC(pc)
- if fn != nil {
- name = fn.Name()
- file, line = fn.FileLine(pc)
- file = path.Base(file)
- }
- return objectValue(rt.newNativeFunction(name, file, line, value))
- case Object, *Object, object, *object:
- // Nothing happens.
- // FIXME We should really figure out what can come here.
- // This catch-all is ugly.
- default:
- val := reflect.ValueOf(value)
- if ok && val.Kind() == rv.Kind() {
- // Use passed in rv which may be writable.
- val = rv
- }
-
- switch val.Kind() {
- case reflect.Ptr:
- switch reflect.Indirect(val).Kind() {
- case reflect.Struct:
- return objectValue(rt.newGoStructObject(val))
- case reflect.Array:
- return objectValue(rt.newGoArray(val))
- }
- case reflect.Struct:
- return objectValue(rt.newGoStructObject(val))
- case reflect.Map:
- return objectValue(rt.newGoMapObject(val))
- case reflect.Slice:
- return objectValue(rt.newGoSlice(val))
- case reflect.Array:
- return objectValue(rt.newGoArray(val))
- case reflect.Func:
- var name, file string
- var line int
- if v := reflect.ValueOf(val); v.Kind() == reflect.Ptr {
- pc := v.Pointer()
- fn := goruntime.FuncForPC(pc)
- if fn != nil {
- name = fn.Name()
- file, line = fn.FileLine(pc)
- file = path.Base(file)
- }
- }
-
- typ := val.Type()
-
- return objectValue(rt.newNativeFunction(name, file, line, func(c FunctionCall) Value {
- nargs := typ.NumIn()
-
- if len(c.ArgumentList) != nargs {
- if typ.IsVariadic() {
- if len(c.ArgumentList) < nargs-1 {
- panic(rt.panicRangeError(fmt.Sprintf("expected at least %d arguments; got %d", nargs-1, len(c.ArgumentList))))
- }
- } else {
- panic(rt.panicRangeError(fmt.Sprintf("expected %d argument(s); got %d", nargs, len(c.ArgumentList))))
- }
- }
-
- in := make([]reflect.Value, len(c.ArgumentList))
-
- callSlice := false
-
- for i, a := range c.ArgumentList {
- var t reflect.Type
-
- n := i
- if n >= nargs-1 && typ.IsVariadic() {
- if n > nargs-1 {
- n = nargs - 1
- }
-
- t = typ.In(n).Elem()
- } else {
- t = typ.In(n)
- }
-
- // if this is a variadic Go function, and the caller has supplied
- // exactly the number of JavaScript arguments required, and this
- // is the last JavaScript argument, try treating the it as the
- // actual set of variadic Go arguments. if that succeeds, break
- // out of the loop.
- if typ.IsVariadic() && len(c.ArgumentList) == nargs && i == nargs-1 {
- if v, err := rt.convertCallParameter(a, typ.In(n)); err == nil {
- in[i] = v
- callSlice = true
- break
- }
- }
-
- v, err := rt.convertCallParameter(a, t)
- if err != nil {
- panic(rt.panicTypeError(err.Error()))
- }
-
- in[i] = v
- }
-
- var out []reflect.Value
- if callSlice {
- out = val.CallSlice(in)
- } else {
- out = val.Call(in)
- }
-
- switch len(out) {
- case 0:
- return Value{}
- case 1:
- return rt.toValue(out[0].Interface())
- default:
- s := make([]interface{}, len(out))
- for i, v := range out {
- s[i] = rt.toValue(v.Interface())
- }
-
- return rt.toValue(s)
- }
- }))
- }
- }
-
- return toValue(value)
-}
-
-func (rt *runtime) newGoSlice(value reflect.Value) *object {
- obj := rt.newGoSliceObject(value)
- obj.prototype = rt.global.ArrayPrototype
- return obj
-}
-
-func (rt *runtime) newGoArray(value reflect.Value) *object {
- obj := rt.newGoArrayObject(value)
- obj.prototype = rt.global.ArrayPrototype
- return obj
-}
-
-func (rt *runtime) parse(filename string, src, sm interface{}) (*ast.Program, error) {
- return parser.ParseFileWithSourceMap(nil, filename, src, sm, 0)
-}
-
-func (rt *runtime) cmplParse(filename string, src, sm interface{}) (*nodeProgram, error) {
- program, err := parser.ParseFileWithSourceMap(nil, filename, src, sm, 0)
- if err != nil {
- return nil, err
- }
-
- return cmplParse(program), nil
-}
-
-func (rt *runtime) parseSource(src, sm interface{}) (*nodeProgram, *ast.Program, error) {
- switch src := src.(type) {
- case *ast.Program:
- return nil, src, nil
- case *Script:
- return src.program, nil, nil
- }
-
- program, err := rt.parse("", src, sm)
-
- return nil, program, err
-}
-
-func (rt *runtime) cmplRunOrEval(src, sm interface{}, eval bool) (Value, error) {
- result := Value{}
- node, program, err := rt.parseSource(src, sm)
- if err != nil {
- return result, err
- }
- if node == nil {
- node = cmplParse(program)
- }
- err = catchPanic(func() {
- result = rt.cmplEvaluateNodeProgram(node, eval)
- })
- switch result.kind {
- case valueEmpty:
- result = Value{}
- case valueReference:
- result = result.resolve()
- }
- return result, err
-}
-
-func (rt *runtime) cmplRun(src, sm interface{}) (Value, error) {
- return rt.cmplRunOrEval(src, sm, false)
-}
-
-func (rt *runtime) cmplEval(src, sm interface{}) (Value, error) {
- return rt.cmplRunOrEval(src, sm, true)
-}
-
-func (rt *runtime) parseThrow(err error) {
- if err == nil {
- return
- }
-
- var errl parser.ErrorList
- if errors.Is(err, &errl) {
- err := errl[0]
- if err.Message == "invalid left-hand side in assignment" {
- panic(rt.panicReferenceError(err.Message))
- }
- panic(rt.panicSyntaxError(err.Message))
- }
- panic(rt.panicSyntaxError(err.Error()))
-}
-
-func (rt *runtime) cmplParseOrThrow(src, sm interface{}) *nodeProgram {
- program, err := rt.cmplParse("", src, sm)
- rt.parseThrow(err) // Will panic/throw appropriately
- return program
-}
diff --git a/vendor/github.com/robertkrimen/otto/scope.go b/vendor/github.com/robertkrimen/otto/scope.go
deleted file mode 100644
index 607f7c6..0000000
--- a/vendor/github.com/robertkrimen/otto/scope.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package otto
-
-// An ECMA-262 ExecutionContext.
-type scope struct {
- lexical stasher
- variable stasher
- this *object
- eval bool // Replace this with kind?
- outer *scope
- depth int
-
- frame frame
-}
-
-func newScope(lexical stasher, variable stasher, this *object) *scope {
- return &scope{
- lexical: lexical,
- variable: variable,
- this: this,
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/script.go b/vendor/github.com/robertkrimen/otto/script.go
deleted file mode 100644
index ab44429..0000000
--- a/vendor/github.com/robertkrimen/otto/script.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package otto
-
-import (
- "bytes"
- "encoding/gob"
- "errors"
-)
-
-// ErrVersion is an error which represents a version mismatch.
-var ErrVersion = errors.New("version mismatch")
-
-var scriptVersion = "2014-04-13/1"
-
-// Script is a handle for some (reusable) JavaScript.
-// Passing a Script value to a run method will evaluate the JavaScript.
-type Script struct {
- version string
- program *nodeProgram
- filename string
- src string
-}
-
-// Compile will parse the given source and return a Script value or nil and
-// an error if there was a problem during compilation.
-//
-// script, err := vm.Compile("", `var abc; if (!abc) abc = 0; abc += 2; abc;`)
-// vm.Run(script)
-func (o *Otto) Compile(filename string, src interface{}) (*Script, error) {
- return o.CompileWithSourceMap(filename, src, nil)
-}
-
-// CompileWithSourceMap does the same thing as Compile, but with the obvious
-// difference of applying a source map.
-func (o *Otto) CompileWithSourceMap(filename string, src, sm interface{}) (*Script, error) {
- program, err := o.runtime.parse(filename, src, sm)
- if err != nil {
- return nil, err
- }
-
- node := cmplParse(program)
- script := &Script{
- version: scriptVersion,
- program: node,
- filename: filename,
- src: program.File.Source(),
- }
-
- return script, nil
-}
-
-func (s *Script) String() string {
- return "// " + s.filename + "\n" + s.src
-}
-
-// MarshalBinary will marshal a script into a binary form. A marshalled script
-// that is later unmarshalled can be executed on the same version of the otto runtime.
-//
-// The binary format can change at any time and should be considered unspecified and opaque.
-func (s *Script) marshalBinary() ([]byte, error) {
- var bfr bytes.Buffer
- encoder := gob.NewEncoder(&bfr)
- err := encoder.Encode(s.version)
- if err != nil {
- return nil, err
- }
- err = encoder.Encode(s.program)
- if err != nil {
- return nil, err
- }
- err = encoder.Encode(s.filename)
- if err != nil {
- return nil, err
- }
- err = encoder.Encode(s.src)
- if err != nil {
- return nil, err
- }
- return bfr.Bytes(), nil
-}
-
-// UnmarshalBinary will vivify a marshalled script into something usable. If the script was
-// originally marshalled on a different version of the otto runtime, then this method
-// will return an error.
-//
-// The binary format can change at any time and should be considered unspecified and opaque.
-func (s *Script) unmarshalBinary(data []byte) (err error) { //nolint: nonamedreturns
- decoder := gob.NewDecoder(bytes.NewReader(data))
- defer func() {
- if err != nil {
- s.version = ""
- s.program = nil
- s.filename = ""
- s.src = ""
- }
- }()
- if err = decoder.Decode(&s.version); err != nil {
- return err
- }
- if s.version != scriptVersion {
- return ErrVersion
- }
- if err = decoder.Decode(&s.program); err != nil {
- return err
- }
- if err = decoder.Decode(&s.filename); err != nil {
- return err
- }
- return decoder.Decode(&s.src)
-}
diff --git a/vendor/github.com/robertkrimen/otto/stash.go b/vendor/github.com/robertkrimen/otto/stash.go
deleted file mode 100644
index 40aeb85..0000000
--- a/vendor/github.com/robertkrimen/otto/stash.go
+++ /dev/null
@@ -1,289 +0,0 @@
-package otto
-
-import (
- "fmt"
-)
-
-// stasher is implemented by types which can stash data.
-type stasher interface {
- hasBinding(string) bool //
- createBinding(string, bool, Value) // CreateMutableBinding
- setBinding(string, Value, bool) // SetMutableBinding
- getBinding(string, bool) Value // GetBindingValue
- deleteBinding(string) bool //
- setValue(string, Value, bool) // createBinding + setBinding
-
- outer() stasher
- runtime() *runtime
-
- newReference(string, bool, at) referencer
-
- clone(*cloner) stasher
-}
-
-type objectStash struct {
- rt *runtime
- outr stasher
- object *object
-}
-
-func (s *objectStash) runtime() *runtime {
- return s.rt
-}
-
-func (rt *runtime) newObjectStash(obj *object, outer stasher) *objectStash {
- if obj == nil {
- obj = rt.newBaseObject()
- obj.class = "environment"
- }
- return &objectStash{
- rt: rt,
- outr: outer,
- object: obj,
- }
-}
-
-func (s *objectStash) clone(c *cloner) stasher {
- out, exists := c.objectStash(s)
- if exists {
- return out
- }
- *out = objectStash{
- c.runtime,
- c.stash(s.outr),
- c.object(s.object),
- }
- return out
-}
-
-func (s *objectStash) hasBinding(name string) bool {
- return s.object.hasProperty(name)
-}
-
-func (s *objectStash) createBinding(name string, deletable bool, value Value) {
- if s.object.hasProperty(name) {
- panic(hereBeDragons())
- }
- mode := propertyMode(0o111)
- if !deletable {
- mode = propertyMode(0o110)
- }
- // TODO False?
- s.object.defineProperty(name, value, mode, false)
-}
-
-func (s *objectStash) setBinding(name string, value Value, strict bool) {
- s.object.put(name, value, strict)
-}
-
-func (s *objectStash) setValue(name string, value Value, throw bool) {
- if !s.hasBinding(name) {
- s.createBinding(name, true, value) // Configurable by default
- } else {
- s.setBinding(name, value, throw)
- }
-}
-
-func (s *objectStash) getBinding(name string, throw bool) Value {
- if s.object.hasProperty(name) {
- return s.object.get(name)
- }
- if throw { // strict?
- panic(s.rt.panicReferenceError("Not Defined", name))
- }
- return Value{}
-}
-
-func (s *objectStash) deleteBinding(name string) bool {
- return s.object.delete(name, false)
-}
-
-func (s *objectStash) outer() stasher {
- return s.outr
-}
-
-func (s *objectStash) newReference(name string, strict bool, atv at) referencer {
- return newPropertyReference(s.rt, s.object, name, strict, atv)
-}
-
-type dclStash struct {
- rt *runtime
- outr stasher
- property map[string]dclProperty
-}
-
-type dclProperty struct {
- value Value
- mutable bool
- deletable bool
- readable bool
-}
-
-func (rt *runtime) newDeclarationStash(outer stasher) *dclStash {
- return &dclStash{
- rt: rt,
- outr: outer,
- property: map[string]dclProperty{},
- }
-}
-
-func (s *dclStash) clone(c *cloner) stasher {
- out, exists := c.dclStash(s)
- if exists {
- return out
- }
- prop := make(map[string]dclProperty, len(s.property))
- for index, value := range s.property {
- prop[index] = c.dclProperty(value)
- }
- *out = dclStash{
- c.runtime,
- c.stash(s.outr),
- prop,
- }
- return out
-}
-
-func (s *dclStash) hasBinding(name string) bool {
- _, exists := s.property[name]
- return exists
-}
-
-func (s *dclStash) runtime() *runtime {
- return s.rt
-}
-
-func (s *dclStash) createBinding(name string, deletable bool, value Value) {
- if _, exists := s.property[name]; exists {
- panic(fmt.Errorf("createBinding: %s: already exists", name))
- }
- s.property[name] = dclProperty{
- value: value,
- mutable: true,
- deletable: deletable,
- readable: false,
- }
-}
-
-func (s *dclStash) setBinding(name string, value Value, strict bool) {
- prop, exists := s.property[name]
- if !exists {
- panic(fmt.Errorf("setBinding: %s: missing", name))
- }
- if prop.mutable {
- prop.value = value
- s.property[name] = prop
- } else {
- s.rt.typeErrorResult(strict)
- }
-}
-
-func (s *dclStash) setValue(name string, value Value, throw bool) {
- if !s.hasBinding(name) {
- s.createBinding(name, false, value) // NOT deletable by default
- } else {
- s.setBinding(name, value, throw)
- }
-}
-
-// FIXME This is called a __lot__.
-func (s *dclStash) getBinding(name string, throw bool) Value {
- prop, exists := s.property[name]
- if !exists {
- panic(fmt.Errorf("getBinding: %s: missing", name))
- }
- if !prop.mutable && !prop.readable {
- if throw { // strict?
- panic(s.rt.panicTypeError("getBinding property %s not mutable and not readable", name))
- }
- return Value{}
- }
- return prop.value
-}
-
-func (s *dclStash) deleteBinding(name string) bool {
- prop, exists := s.property[name]
- if !exists {
- return true
- }
- if !prop.deletable {
- return false
- }
- delete(s.property, name)
- return true
-}
-
-func (s *dclStash) outer() stasher {
- return s.outr
-}
-
-func (s *dclStash) newReference(name string, strict bool, _ at) referencer {
- return &stashReference{
- name: name,
- base: s,
- }
-}
-
-// ========
-// _fnStash
-// ========
-
-type fnStash struct {
- dclStash
- arguments *object
- indexOfArgumentName map[string]string
-}
-
-func (rt *runtime) newFunctionStash(outer stasher) *fnStash {
- return &fnStash{
- dclStash: dclStash{
- rt: rt,
- outr: outer,
- property: map[string]dclProperty{},
- },
- }
-}
-
-func (s *fnStash) clone(c *cloner) stasher {
- out, exists := c.fnStash(s)
- if exists {
- return out
- }
- dclStash := s.dclStash.clone(c).(*dclStash)
- index := make(map[string]string, len(s.indexOfArgumentName))
- for name, value := range s.indexOfArgumentName {
- index[name] = value
- }
- *out = fnStash{
- dclStash: *dclStash,
- arguments: c.object(s.arguments),
- indexOfArgumentName: index,
- }
- return out
-}
-
-// getStashProperties returns the properties from stash.
-func getStashProperties(stash stasher) []string {
- switch vars := stash.(type) {
- case *dclStash:
- keys := make([]string, 0, len(vars.property))
- for k := range vars.property {
- keys = append(keys, k)
- }
- return keys
- case *fnStash:
- keys := make([]string, 0, len(vars.property))
- for k := range vars.property {
- keys = append(keys, k)
- }
- return keys
- case *objectStash:
- keys := make([]string, 0, len(vars.object.property))
- for k := range vars.object.property {
- keys = append(keys, k)
- }
- return keys
- default:
- panic("unknown stash type")
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/token/generate.go b/vendor/github.com/robertkrimen/otto/token/generate.go
deleted file mode 100644
index 3c02aee..0000000
--- a/vendor/github.com/robertkrimen/otto/token/generate.go
+++ /dev/null
@@ -1,3 +0,0 @@
-package token
-
-//go:generate go run ../tools/gen-tokens -output token_const.go
diff --git a/vendor/github.com/robertkrimen/otto/token/token.go b/vendor/github.com/robertkrimen/otto/token/token.go
deleted file mode 100644
index 8cb9113..0000000
--- a/vendor/github.com/robertkrimen/otto/token/token.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Package token defines constants representing the lexical tokens of JavaScript (ECMA5).
-package token
-
-import (
- "strconv"
-)
-
-// Token is the set of lexical tokens in JavaScript (ECMA5).
-type Token int
-
-// String returns the string corresponding to the token.
-// For operators, delimiters, and keywords the string is the actual
-// token string (e.g., for the token PLUS, the String() is
-// "+"). For all other tokens the string corresponds to the token
-// name (e.g. for the token IDENTIFIER, the string is "IDENTIFIER").
-func (tkn Token) String() string {
- switch {
- case tkn == 0:
- return "UNKNOWN"
- case tkn < Token(len(token2string)):
- return token2string[tkn]
- default:
- return "token(" + strconv.Itoa(int(tkn)) + ")"
- }
-}
-
-type keyword struct {
- token Token
- futureKeyword bool
- strict bool
-}
-
-// IsKeyword returns the keyword token if literal is a keyword, a KEYWORD token
-// if the literal is a future keyword (const, let, class, super, ...), or 0 if the literal is not a keyword.
-//
-// If the literal is a keyword, IsKeyword returns a second value indicating if the literal
-// is considered a future keyword in strict-mode only.
-//
-// 7.6.1.2 Future Reserved Words:
-//
-// const
-// class
-// enum
-// export
-// extends
-// import
-// super
-//
-// 7.6.1.2 Future Reserved Words (strict):
-//
-// implements
-// interface
-// let
-// package
-// private
-// protected
-// public
-// static
-func IsKeyword(literal string) (Token, bool) {
- if keyword, exists := keywordTable[literal]; exists {
- if keyword.futureKeyword {
- return KEYWORD, keyword.strict
- }
- return keyword.token, false
- }
- return 0, false
-}
diff --git a/vendor/github.com/robertkrimen/otto/token/token_const.go b/vendor/github.com/robertkrimen/otto/token/token_const.go
deleted file mode 100644
index 09ba017..0000000
--- a/vendor/github.com/robertkrimen/otto/token/token_const.go
+++ /dev/null
@@ -1,351 +0,0 @@
-// Code generated by tools/gen-tokens. DO NOT EDIT.
-
-package token
-
-const (
- _ Token = iota
-
- // Control.
- ILLEGAL
- EOF
- COMMENT
- KEYWORD
- // Types.
- STRING
- BOOLEAN
- NULL
- NUMBER
- IDENTIFIER
- // Maths.
- PLUS // +
- MINUS // -
- MULTIPLY // *
- SLASH // /
- REMAINDER // %
- // Logical and bitwise operators.
- AND // &
- OR // |
- EXCLUSIVE_OR // ^
- SHIFT_LEFT // <<
- SHIFT_RIGHT // >>
- UNSIGNED_SHIFT_RIGHT // >>>
- AND_NOT // &^
- // Math assignments.
- ADD_ASSIGN // +=
- SUBTRACT_ASSIGN // -=
- MULTIPLY_ASSIGN // *=
- QUOTIENT_ASSIGN // /=
- REMAINDER_ASSIGN // %=
- // Math and bitwise assignments.
- AND_ASSIGN // &=
- OR_ASSIGN // |=
- EXCLUSIVE_OR_ASSIGN // ^=
- SHIFT_LEFT_ASSIGN // <<=
- SHIFT_RIGHT_ASSIGN // >>=
- UNSIGNED_SHIFT_RIGHT_ASSIGN // >>>=
- AND_NOT_ASSIGN // &^=
- // Logical operators and decrement / increment.
- LOGICAL_AND // &&
- LOGICAL_OR // ||
- INCREMENT // ++
- DECREMENT // --
- // Comparison operators.
- EQUAL // ==
- STRICT_EQUAL // ===
- LESS // <
- GREATER // >
- ASSIGN // =
- NOT // !
- // Bitwise not.
- BITWISE_NOT // ~
- // Comparison operators.
- NOT_EQUAL // !=
- STRICT_NOT_EQUAL // !==
- LESS_OR_EQUAL // <=
- GREATER_OR_EQUAL // >=
- // Left operators.
- LEFT_PARENTHESIS // (
- LEFT_BRACKET // [
- LEFT_BRACE // {
- COMMA // ,
- PERIOD // .
- // Right operators.
- RIGHT_PARENTHESIS // )
- RIGHT_BRACKET // ]
- RIGHT_BRACE // }
- SEMICOLON // ;
- COLON // :
- QUESTION_MARK // ?
- // Basic flow - keywords below here.
- _
- IF
- IN
- DO
- // Declarations.
- VAR
- FOR
- NEW
- TRY
- // Advanced flow.
- THIS
- ELSE
- CASE
- VOID
- WITH
- // Loops.
- WHILE
- BREAK
- CATCH
- THROW
- // Functions.
- RETURN
- TYPEOF
- DELETE
- SWITCH
- // Fallback identifiers.
- DEFAULT
- FINALLY
- // Miscellaneous.
- FUNCTION
- CONTINUE
- DEBUGGER
- // Instance of.
- INSTANCEOF
-)
-
-var token2string = [...]string{
- ILLEGAL: "ILLEGAL",
- EOF: "EOF",
- COMMENT: "COMMENT",
- KEYWORD: "KEYWORD",
- STRING: "STRING",
- BOOLEAN: "BOOLEAN",
- NULL: "NULL",
- NUMBER: "NUMBER",
- IDENTIFIER: "IDENTIFIER",
- PLUS: "+",
- MINUS: "-",
- MULTIPLY: "*",
- SLASH: "/",
- REMAINDER: "%",
- AND: "&",
- OR: "|",
- EXCLUSIVE_OR: "^",
- SHIFT_LEFT: "<<",
- SHIFT_RIGHT: ">>",
- UNSIGNED_SHIFT_RIGHT: ">>>",
- AND_NOT: "&^",
- ADD_ASSIGN: "+=",
- SUBTRACT_ASSIGN: "-=",
- MULTIPLY_ASSIGN: "*=",
- QUOTIENT_ASSIGN: "/=",
- REMAINDER_ASSIGN: "%=",
- AND_ASSIGN: "&=",
- OR_ASSIGN: "|=",
- EXCLUSIVE_OR_ASSIGN: "^=",
- SHIFT_LEFT_ASSIGN: "<<=",
- SHIFT_RIGHT_ASSIGN: ">>=",
- UNSIGNED_SHIFT_RIGHT_ASSIGN: ">>>=",
- AND_NOT_ASSIGN: "&^=",
- LOGICAL_AND: "&&",
- LOGICAL_OR: "||",
- INCREMENT: "++",
- DECREMENT: "--",
- EQUAL: "==",
- STRICT_EQUAL: "===",
- LESS: "<",
- GREATER: ">",
- ASSIGN: "=",
- NOT: "!",
- BITWISE_NOT: "~",
- NOT_EQUAL: "!=",
- STRICT_NOT_EQUAL: "!==",
- LESS_OR_EQUAL: "<=",
- GREATER_OR_EQUAL: ">=",
- LEFT_PARENTHESIS: "(",
- LEFT_BRACKET: "[",
- LEFT_BRACE: "{",
- COMMA: ",",
- PERIOD: ".",
- RIGHT_PARENTHESIS: ")",
- RIGHT_BRACKET: "]",
- RIGHT_BRACE: "}",
- SEMICOLON: ";",
- COLON: ":",
- QUESTION_MARK: "?",
- IF: "if",
- IN: "in",
- DO: "do",
- VAR: "var",
- FOR: "for",
- NEW: "new",
- TRY: "try",
- THIS: "this",
- ELSE: "else",
- CASE: "case",
- VOID: "void",
- WITH: "with",
- WHILE: "while",
- BREAK: "break",
- CATCH: "catch",
- THROW: "throw",
- RETURN: "return",
- TYPEOF: "typeof",
- DELETE: "delete",
- SWITCH: "switch",
- DEFAULT: "default",
- FINALLY: "finally",
- FUNCTION: "function",
- CONTINUE: "continue",
- DEBUGGER: "debugger",
- INSTANCEOF: "instanceof",
-}
-
-var keywordTable = map[string]keyword{
- "if": {
- token: IF,
- },
- "in": {
- token: IN,
- },
- "do": {
- token: DO,
- },
- "var": {
- token: VAR,
- },
- "for": {
- token: FOR,
- },
- "new": {
- token: NEW,
- },
- "try": {
- token: TRY,
- },
- "this": {
- token: THIS,
- },
- "else": {
- token: ELSE,
- },
- "case": {
- token: CASE,
- },
- "void": {
- token: VOID,
- },
- "with": {
- token: WITH,
- },
- "while": {
- token: WHILE,
- },
- "break": {
- token: BREAK,
- },
- "catch": {
- token: CATCH,
- },
- "throw": {
- token: THROW,
- },
- "return": {
- token: RETURN,
- },
- "typeof": {
- token: TYPEOF,
- },
- "delete": {
- token: DELETE,
- },
- "switch": {
- token: SWITCH,
- },
- "default": {
- token: DEFAULT,
- },
- "finally": {
- token: FINALLY,
- },
- "function": {
- token: FUNCTION,
- },
- "continue": {
- token: CONTINUE,
- },
- "debugger": {
- token: DEBUGGER,
- },
- "instanceof": {
- token: INSTANCEOF,
- },
- "const": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "class": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "enum": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "export": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "extends": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "import": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "super": {
- token: KEYWORD,
- futureKeyword: true,
- },
- "implements": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "interface": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "let": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "package": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "private": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "protected": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "public": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
- "static": {
- token: KEYWORD,
- futureKeyword: true,
- strict: true,
- },
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_arguments.go b/vendor/github.com/robertkrimen/otto/type_arguments.go
deleted file mode 100644
index 2e313fb..0000000
--- a/vendor/github.com/robertkrimen/otto/type_arguments.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package otto
-
-import (
- "strconv"
-)
-
-func (rt *runtime) newArgumentsObject(indexOfParameterName []string, stash stasher, length int) *object {
- obj := rt.newClassObject("Arguments")
-
- for index := range indexOfParameterName {
- name := strconv.FormatInt(int64(index), 10)
- objectDefineOwnProperty(obj, name, property{Value{}, 0o111}, false)
- }
-
- obj.objectClass = classArguments
- obj.value = argumentsObject{
- indexOfParameterName: indexOfParameterName,
- stash: stash,
- }
-
- obj.prototype = rt.global.ObjectPrototype
-
- obj.defineProperty(propertyLength, intValue(length), 0o101, false)
-
- return obj
-}
-
-type argumentsObject struct {
- indexOfParameterName []string
- // function(abc, def, ghi)
- // indexOfParameterName[0] = "abc"
- // indexOfParameterName[1] = "def"
- // indexOfParameterName[2] = "ghi"
- // ...
- stash stasher
-}
-
-func (o argumentsObject) clone(c *cloner) argumentsObject {
- indexOfParameterName := make([]string, len(o.indexOfParameterName))
- copy(indexOfParameterName, o.indexOfParameterName)
- return argumentsObject{
- indexOfParameterName,
- c.stash(o.stash),
- }
-}
-
-func (o argumentsObject) get(name string) (Value, bool) {
- index := stringToArrayIndex(name)
- if index >= 0 && index < int64(len(o.indexOfParameterName)) {
- name := o.indexOfParameterName[index]
- if name == "" {
- return Value{}, false
- }
- return o.stash.getBinding(name, false), true
- }
- return Value{}, false
-}
-
-func (o argumentsObject) put(name string, value Value) {
- index := stringToArrayIndex(name)
- name = o.indexOfParameterName[index]
- o.stash.setBinding(name, value, false)
-}
-
-func (o argumentsObject) delete(name string) {
- index := stringToArrayIndex(name)
- o.indexOfParameterName[index] = ""
-}
-
-func argumentsGet(obj *object, name string) Value {
- if value, exists := obj.value.(argumentsObject).get(name); exists {
- return value
- }
- return objectGet(obj, name)
-}
-
-func argumentsGetOwnProperty(obj *object, name string) *property {
- prop := objectGetOwnProperty(obj, name)
- if value, exists := obj.value.(argumentsObject).get(name); exists {
- prop.value = value
- }
- return prop
-}
-
-func argumentsDefineOwnProperty(obj *object, name string, descriptor property, throw bool) bool {
- if _, exists := obj.value.(argumentsObject).get(name); exists {
- if !objectDefineOwnProperty(obj, name, descriptor, false) {
- return obj.runtime.typeErrorResult(throw)
- }
- if value, valid := descriptor.value.(Value); valid {
- obj.value.(argumentsObject).put(name, value)
- }
- return true
- }
- return objectDefineOwnProperty(obj, name, descriptor, throw)
-}
-
-func argumentsDelete(obj *object, name string, throw bool) bool {
- if !objectDelete(obj, name, throw) {
- return false
- }
- if _, exists := obj.value.(argumentsObject).get(name); exists {
- obj.value.(argumentsObject).delete(name)
- }
- return true
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_array.go b/vendor/github.com/robertkrimen/otto/type_array.go
deleted file mode 100644
index cb67354..0000000
--- a/vendor/github.com/robertkrimen/otto/type_array.go
+++ /dev/null
@@ -1,120 +0,0 @@
-package otto
-
-import (
- "strconv"
-)
-
-func (rt *runtime) newArrayObject(length uint32) *object {
- obj := rt.newObject()
- obj.class = classArrayName
- obj.defineProperty(propertyLength, uint32Value(length), 0o100, false)
- obj.objectClass = classArray
- return obj
-}
-
-func isArray(obj *object) bool {
- if obj == nil {
- return false
- }
-
- switch obj.class {
- case classArrayName, classGoArrayName, classGoSliceName:
- return true
- default:
- return false
- }
-}
-
-func objectLength(obj *object) uint32 {
- if obj == nil {
- return 0
- }
- switch obj.class {
- case classArrayName:
- return obj.get(propertyLength).value.(uint32)
- case classStringName:
- return uint32(obj.get(propertyLength).value.(int))
- case classGoArrayName, classGoSliceName:
- return uint32(obj.get(propertyLength).value.(int))
- }
- return 0
-}
-
-func arrayUint32(rt *runtime, value Value) uint32 {
- nm := value.number()
- if nm.kind != numberInteger || !isUint32(nm.int64) {
- // FIXME
- panic(rt.panicRangeError())
- }
- return uint32(nm.int64)
-}
-
-func arrayDefineOwnProperty(obj *object, name string, descriptor property, throw bool) bool {
- lengthProperty := obj.getOwnProperty(propertyLength)
- lengthValue, valid := lengthProperty.value.(Value)
- if !valid {
- panic("Array.length != Value{}")
- }
-
- reject := func(reason string) bool {
- if throw {
- panic(obj.runtime.panicTypeError("Array.DefineOwnProperty %s", reason))
- }
- return false
- }
- length := lengthValue.value.(uint32)
- if name == propertyLength {
- if descriptor.value == nil {
- return objectDefineOwnProperty(obj, name, descriptor, throw)
- }
- newLengthValue, isValue := descriptor.value.(Value)
- if !isValue {
- panic(obj.runtime.panicTypeError("Array.DefineOwnProperty %q is not a value", descriptor.value))
- }
- newLength := arrayUint32(obj.runtime, newLengthValue)
- descriptor.value = uint32Value(newLength)
- if newLength > length {
- return objectDefineOwnProperty(obj, name, descriptor, throw)
- }
- if !lengthProperty.writable() {
- return reject("property length for not writable")
- }
- newWritable := true
- if descriptor.mode&0o700 == 0 {
- // If writable is off
- newWritable = false
- descriptor.mode |= 0o100
- }
- if !objectDefineOwnProperty(obj, name, descriptor, throw) {
- return false
- }
- for newLength < length {
- length--
- if !obj.delete(strconv.FormatInt(int64(length), 10), false) {
- descriptor.value = uint32Value(length + 1)
- if !newWritable {
- descriptor.mode &= 0o077
- }
- objectDefineOwnProperty(obj, name, descriptor, false)
- return reject("delete failed")
- }
- }
- if !newWritable {
- descriptor.mode &= 0o077
- objectDefineOwnProperty(obj, name, descriptor, false)
- }
- } else if index := stringToArrayIndex(name); index >= 0 {
- if index >= int64(length) && !lengthProperty.writable() {
- return reject("property length not writable")
- }
- if !objectDefineOwnProperty(obj, strconv.FormatInt(index, 10), descriptor, false) {
- return reject("Object.DefineOwnProperty failed")
- }
- if index >= int64(length) {
- lengthProperty.value = uint32Value(uint32(index + 1))
- objectDefineOwnProperty(obj, propertyLength, *lengthProperty, false)
- return true
- }
- }
- return objectDefineOwnProperty(obj, name, descriptor, throw)
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_boolean.go b/vendor/github.com/robertkrimen/otto/type_boolean.go
deleted file mode 100644
index 3620553..0000000
--- a/vendor/github.com/robertkrimen/otto/type_boolean.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package otto
-
-func (rt *runtime) newBooleanObject(value Value) *object {
- return rt.newPrimitiveObject(classBooleanName, boolValue(value.bool()))
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_date.go b/vendor/github.com/robertkrimen/otto/type_date.go
deleted file mode 100644
index a996908..0000000
--- a/vendor/github.com/robertkrimen/otto/type_date.go
+++ /dev/null
@@ -1,289 +0,0 @@
-package otto
-
-import (
- "fmt"
- "math"
- "regexp"
- Time "time"
-)
-
-type dateObject struct {
- time Time.Time // Time from the "time" package, a cached version of time
- epoch int64
- value Value
- isNaN bool
-}
-
-var invalidDateObject = dateObject{
- time: Time.Time{},
- epoch: -1,
- value: NaNValue(),
- isNaN: true,
-}
-
-type ecmaTime struct {
- year int
- month int
- day int
- hour int
- minute int
- second int
- millisecond int
- location *Time.Location // Basically, either local or UTC
-}
-
-func newEcmaTime(goTime Time.Time) ecmaTime {
- return ecmaTime{
- goTime.Year(),
- dateFromGoMonth(goTime.Month()),
- goTime.Day(),
- goTime.Hour(),
- goTime.Minute(),
- goTime.Second(),
- goTime.Nanosecond() / (100 * 100 * 100),
- goTime.Location(),
- }
-}
-
-func (t *ecmaTime) goTime() Time.Time {
- return Time.Date(
- t.year,
- dateToGoMonth(t.month),
- t.day,
- t.hour,
- t.minute,
- t.second,
- t.millisecond*(100*100*100),
- t.location,
- )
-}
-
-func (d *dateObject) Time() Time.Time {
- return d.time
-}
-
-func (d *dateObject) Epoch() int64 {
- return d.epoch
-}
-
-func (d *dateObject) Value() Value {
- return d.value
-}
-
-// FIXME A date should only be in the range of -100,000,000 to +100,000,000 (1970): 15.9.1.1.
-func (d *dateObject) SetNaN() {
- d.time = Time.Time{}
- d.epoch = -1
- d.value = NaNValue()
- d.isNaN = true
-}
-
-func (d *dateObject) SetTime(time Time.Time) {
- d.Set(timeToEpoch(time))
-}
-
-func (d *dateObject) Set(epoch float64) {
- // epoch
- d.epoch = epochToInteger(epoch)
-
- // time
- time, err := epochToTime(epoch)
- d.time = time // Is either a valid time, or the zero-value for time.Time
-
- // value & isNaN
- if err != nil {
- d.isNaN = true
- d.epoch = -1
- d.value = NaNValue()
- } else {
- d.value = int64Value(d.epoch)
- }
-}
-
-func epochToInteger(value float64) int64 {
- if value > 0 {
- return int64(math.Floor(value))
- }
- return int64(math.Ceil(value))
-}
-
-func epochToTime(value float64) (Time.Time, error) {
- epochWithMilli := value
- if math.IsNaN(epochWithMilli) || math.IsInf(epochWithMilli, 0) {
- return Time.Time{}, fmt.Errorf("invalid time %v", value)
- }
-
- epoch := int64(epochWithMilli / 1000)
- milli := int64(epochWithMilli) % 1000
-
- return Time.Unix(epoch, milli*1000000).In(utcTimeZone), nil
-}
-
-func timeToEpoch(time Time.Time) float64 {
- return float64(time.UnixMilli())
-}
-
-func (rt *runtime) newDateObject(epoch float64) *object {
- obj := rt.newObject()
- obj.class = classDateName
-
- // FIXME This is ugly...
- date := dateObject{}
- date.Set(epoch)
- obj.value = date
- return obj
-}
-
-func (o *object) dateValue() dateObject {
- value, _ := o.value.(dateObject)
- return value
-}
-
-func dateObjectOf(rt *runtime, date *object) dateObject {
- if date == nil {
- panic(rt.panicTypeError("Date.ObjectOf is nil"))
- }
- if date.class != classDateName {
- panic(rt.panicTypeError("Date.ObjectOf %q != %q", date.class, classDateName))
- }
- return date.dateValue()
-}
-
-// JavaScript is 0-based, Go is 1-based (15.9.1.4).
-func dateToGoMonth(month int) Time.Month {
- return Time.Month(month + 1)
-}
-
-func dateFromGoMonth(month Time.Month) int {
- return int(month) - 1
-}
-
-func dateFromGoDay(day Time.Weekday) int {
- return int(day)
-}
-
-// newDateTime returns the epoch of date contained in argumentList for location.
-func newDateTime(argumentList []Value, location *Time.Location) float64 {
- pick := func(index int, default_ float64) (float64, bool) {
- if index >= len(argumentList) {
- return default_, false
- }
- value := argumentList[index].float64()
- if math.IsNaN(value) || math.IsInf(value, 0) {
- return 0, true
- }
- return value, false
- }
-
- switch len(argumentList) {
- case 0: // 0-argument
- time := Time.Now().In(utcTimeZone)
- return timeToEpoch(time)
- case 1: // 1-argument
- value := valueOfArrayIndex(argumentList, 0)
- value = toPrimitiveValue(value)
- if value.IsString() {
- return dateParse(value.string())
- }
-
- return value.float64()
- default: // 2-argument, 3-argument, ...
- var year, month, day, hour, minute, second, millisecond float64
- var invalid bool
- if year, invalid = pick(0, 1900.0); invalid {
- return math.NaN()
- }
- if month, invalid = pick(1, 0.0); invalid {
- return math.NaN()
- }
- if day, invalid = pick(2, 1.0); invalid {
- return math.NaN()
- }
- if hour, invalid = pick(3, 0.0); invalid {
- return math.NaN()
- }
- if minute, invalid = pick(4, 0.0); invalid {
- return math.NaN()
- }
- if second, invalid = pick(5, 0.0); invalid {
- return math.NaN()
- }
- if millisecond, invalid = pick(6, 0.0); invalid {
- return math.NaN()
- }
-
- if year >= 0 && year <= 99 {
- year += 1900
- }
-
- time := Time.Date(int(year), dateToGoMonth(int(month)), int(day), int(hour), int(minute), int(second), int(millisecond)*1000*1000, location)
- return timeToEpoch(time)
- }
-}
-
-var (
- dateLayoutList = []string{
- "2006",
- "2006-01",
- "2006-01-02",
-
- "2006T15:04",
- "2006-01T15:04",
- "2006-01-02T15:04",
-
- "2006T15:04:05",
- "2006-01T15:04:05",
- "2006-01-02T15:04:05",
-
- "2006/01",
- "2006/01/02",
- "2006/01/02 15:04:05",
-
- "2006T15:04:05.000",
- "2006-01T15:04:05.000",
- "2006-01-02T15:04:05.000",
-
- "2006T15:04-0700",
- "2006-01T15:04-0700",
- "2006-01-02T15:04-0700",
-
- "2006T15:04:05-0700",
- "2006-01T15:04:05-0700",
- "2006-01-02T15:04:05-0700",
-
- "2006T15:04:05.000-0700",
- "2006-01T15:04:05.000-0700",
- "2006-01-02T15:04:05.000-0700",
-
- Time.RFC1123,
- }
- matchDateTimeZone = regexp.MustCompile(`^(.*)(?:(Z)|([\+\-]\d{2}):(\d{2}))$`)
-)
-
-// dateParse returns the epoch of the parsed date.
-func dateParse(date string) float64 {
- // YYYY-MM-DDTHH:mm:ss.sssZ
- var time Time.Time
- var err error
-
- if match := matchDateTimeZone.FindStringSubmatch(date); match != nil {
- if match[2] == "Z" {
- date = match[1] + "+0000"
- } else {
- date = match[1] + match[3] + match[4]
- }
- }
-
- for _, layout := range dateLayoutList {
- time, err = Time.Parse(layout, date)
- if err == nil {
- break
- }
- }
-
- if err != nil {
- return math.NaN()
- }
-
- return float64(time.UnixMilli())
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_error.go b/vendor/github.com/robertkrimen/otto/type_error.go
deleted file mode 100644
index 3ad9d6b..0000000
--- a/vendor/github.com/robertkrimen/otto/type_error.go
+++ /dev/null
@@ -1,58 +0,0 @@
-package otto
-
-func (rt *runtime) newErrorObject(name string, message Value, stackFramesToPop int) *object {
- obj := rt.newClassObject(classErrorName)
- if message.IsDefined() {
- err := newError(rt, name, stackFramesToPop, "%s", message.string())
- obj.defineProperty("message", err.messageValue(), 0o111, false)
- obj.value = err
- } else {
- obj.value = newError(rt, name, stackFramesToPop)
- }
-
- obj.defineOwnProperty("stack", property{
- value: propertyGetSet{
- rt.newNativeFunction("get", "internal", 0, func(FunctionCall) Value {
- return stringValue(obj.value.(ottoError).formatWithStack())
- }),
- &nilGetSetObject,
- },
- mode: modeConfigureMask & modeOnMask,
- }, false)
-
- return obj
-}
-
-func (rt *runtime) newErrorObjectError(err ottoError) *object {
- obj := rt.newClassObject(classErrorName)
- obj.defineProperty("message", err.messageValue(), 0o111, false)
- obj.value = err
- switch err.name {
- case "EvalError":
- obj.prototype = rt.global.EvalErrorPrototype
- case "TypeError":
- obj.prototype = rt.global.TypeErrorPrototype
- case "RangeError":
- obj.prototype = rt.global.RangeErrorPrototype
- case "ReferenceError":
- obj.prototype = rt.global.ReferenceErrorPrototype
- case "SyntaxError":
- obj.prototype = rt.global.SyntaxErrorPrototype
- case "URIError":
- obj.prototype = rt.global.URIErrorPrototype
- default:
- obj.prototype = rt.global.ErrorPrototype
- }
-
- obj.defineOwnProperty("stack", property{
- value: propertyGetSet{
- rt.newNativeFunction("get", "internal", 0, func(FunctionCall) Value {
- return stringValue(obj.value.(ottoError).formatWithStack())
- }),
- &nilGetSetObject,
- },
- mode: modeConfigureMask & modeOnMask,
- }, false)
-
- return obj
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_function.go b/vendor/github.com/robertkrimen/otto/type_function.go
deleted file mode 100644
index f602426..0000000
--- a/vendor/github.com/robertkrimen/otto/type_function.go
+++ /dev/null
@@ -1,323 +0,0 @@
-package otto
-
-// constructFunction.
-type constructFunction func(*object, []Value) Value
-
-// 13.2.2 [[Construct]].
-func defaultConstruct(fn *object, argumentList []Value) Value {
- obj := fn.runtime.newObject()
- obj.class = classObjectName
-
- prototype := fn.get("prototype")
- if prototype.kind != valueObject {
- prototype = objectValue(fn.runtime.global.ObjectPrototype)
- }
- obj.prototype = prototype.object()
-
- this := objectValue(obj)
- value := fn.call(this, argumentList, false, nativeFrame)
- if value.kind == valueObject {
- return value
- }
- return this
-}
-
-// nativeFunction.
-type nativeFunction func(FunctionCall) Value
-
-// nativeFunctionObject.
-type nativeFunctionObject struct {
- name string
- file string
- line int
- call nativeFunction // [[Call]]
- construct constructFunction // [[Construct]]
-}
-
-func (rt *runtime) newNativeFunctionProperty(name, file string, line int, native nativeFunction, length int) *object {
- o := rt.newClassObject(classFunctionName)
- o.value = nativeFunctionObject{
- name: name,
- file: file,
- line: line,
- call: native,
- construct: defaultConstruct,
- }
- o.defineProperty("name", stringValue(name), 0o000, false)
- o.defineProperty(propertyLength, intValue(length), 0o000, false)
- return o
-}
-
-func (rt *runtime) newNativeFunctionObject(name, file string, line int, native nativeFunction, length int) *object {
- o := rt.newNativeFunctionProperty(name, file, line, native, length)
- o.defineOwnProperty("caller", property{
- value: propertyGetSet{
- rt.newNativeFunctionProperty("get", "internal", 0, func(fc FunctionCall) Value {
- for sc := rt.scope; sc != nil; sc = sc.outer {
- if sc.frame.fn == o {
- if sc.outer == nil || sc.outer.frame.fn == nil {
- return nullValue
- }
-
- return rt.toValue(sc.outer.frame.fn)
- }
- }
-
- return nullValue
- }, 0),
- &nilGetSetObject,
- },
- mode: 0o000,
- }, false)
- return o
-}
-
-// bindFunctionObject.
-type bindFunctionObject struct {
- target *object
- this Value
- argumentList []Value
-}
-
-func (rt *runtime) newBoundFunctionObject(target *object, this Value, argumentList []Value) *object {
- o := rt.newClassObject(classFunctionName)
- o.value = bindFunctionObject{
- target: target,
- this: this,
- argumentList: argumentList,
- }
- length := int(toInt32(target.get(propertyLength)))
- length -= len(argumentList)
- if length < 0 {
- length = 0
- }
- o.defineProperty("name", stringValue("bound "+target.get("name").String()), 0o000, false)
- o.defineProperty(propertyLength, intValue(length), 0o000, false)
- o.defineProperty("caller", Value{}, 0o000, false) // TODO Should throw a TypeError
- o.defineProperty("arguments", Value{}, 0o000, false) // TODO Should throw a TypeError
- return o
-}
-
-// [[Construct]].
-func (fn bindFunctionObject) construct(argumentList []Value) Value {
- obj := fn.target
- switch value := obj.value.(type) {
- case nativeFunctionObject:
- return value.construct(obj, fn.argumentList)
- case nodeFunctionObject:
- argumentList = append(fn.argumentList, argumentList...)
- return obj.construct(argumentList)
- default:
- panic(fn.target.runtime.panicTypeError("construct unknown type %T", obj.value))
- }
-}
-
-// nodeFunctionObject.
-type nodeFunctionObject struct {
- node *nodeFunctionLiteral
- stash stasher
-}
-
-func (rt *runtime) newNodeFunctionObject(node *nodeFunctionLiteral, stash stasher) *object {
- o := rt.newClassObject(classFunctionName)
- o.value = nodeFunctionObject{
- node: node,
- stash: stash,
- }
- o.defineProperty("name", stringValue(node.name), 0o000, false)
- o.defineProperty(propertyLength, intValue(len(node.parameterList)), 0o000, false)
- o.defineOwnProperty("caller", property{
- value: propertyGetSet{
- rt.newNativeFunction("get", "internal", 0, func(fc FunctionCall) Value {
- for sc := rt.scope; sc != nil; sc = sc.outer {
- if sc.frame.fn == o {
- if sc.outer == nil || sc.outer.frame.fn == nil {
- return nullValue
- }
-
- return rt.toValue(sc.outer.frame.fn)
- }
- }
-
- return nullValue
- }),
- &nilGetSetObject,
- },
- mode: 0o000,
- }, false)
- return o
-}
-
-// _object.
-func (o *object) isCall() bool {
- switch fn := o.value.(type) {
- case nativeFunctionObject:
- return fn.call != nil
- case bindFunctionObject:
- return true
- case nodeFunctionObject:
- return true
- default:
- return false
- }
-}
-
-func (o *object) call(this Value, argumentList []Value, eval bool, frm frame) Value { //nolint: unparam // Isn't currently used except in recursive self.
- switch fn := o.value.(type) {
- case nativeFunctionObject:
- // Since eval is a native function, we only have to check for it here
- if eval {
- eval = o == o.runtime.eval // If eval is true, then it IS a direct eval
- }
-
- // Enter a scope, name from the native object...
- rt := o.runtime
- if rt.scope != nil && !eval {
- rt.enterFunctionScope(rt.scope.lexical, this)
- rt.scope.frame = frame{
- native: true,
- nativeFile: fn.file,
- nativeLine: fn.line,
- callee: fn.name,
- file: nil,
- fn: o,
- }
- defer func() {
- rt.leaveScope()
- }()
- }
-
- return fn.call(FunctionCall{
- runtime: o.runtime,
- eval: eval,
-
- This: this,
- ArgumentList: argumentList,
- Otto: o.runtime.otto,
- })
-
- case bindFunctionObject:
- // TODO Passthrough site, do not enter a scope
- argumentList = append(fn.argumentList, argumentList...)
- return fn.target.call(fn.this, argumentList, false, frm)
-
- case nodeFunctionObject:
- rt := o.runtime
- stash := rt.enterFunctionScope(fn.stash, this)
- rt.scope.frame = frame{
- callee: fn.node.name,
- file: fn.node.file,
- fn: o,
- }
- defer func() {
- rt.leaveScope()
- }()
- callValue := rt.cmplCallNodeFunction(o, stash, fn.node, argumentList)
- if value, valid := callValue.value.(result); valid {
- return value.value
- }
- return callValue
- }
-
- panic(o.runtime.panicTypeError("%v is not a function", objectValue(o)))
-}
-
-func (o *object) construct(argumentList []Value) Value {
- switch fn := o.value.(type) {
- case nativeFunctionObject:
- if fn.call == nil {
- panic(o.runtime.panicTypeError("%v is not a function", objectValue(o)))
- }
- if fn.construct == nil {
- panic(o.runtime.panicTypeError("%v is not a constructor", objectValue(o)))
- }
- return fn.construct(o, argumentList)
-
- case bindFunctionObject:
- return fn.construct(argumentList)
-
- case nodeFunctionObject:
- return defaultConstruct(o, argumentList)
- }
-
- panic(o.runtime.panicTypeError("%v is not a function", objectValue(o)))
-}
-
-// 15.3.5.3.
-func (o *object) hasInstance(of Value) bool {
- if !o.isCall() {
- // We should not have a hasInstance method
- panic(o.runtime.panicTypeError("Object.hasInstance not callable"))
- }
- if !of.IsObject() {
- return false
- }
- prototype := o.get("prototype")
- if !prototype.IsObject() {
- panic(o.runtime.panicTypeError("Object.hasInstance prototype %q is not an object", prototype))
- }
- prototypeObject := prototype.object()
-
- value := of.object().prototype
- for value != nil {
- if value == prototypeObject {
- return true
- }
- value = value.prototype
- }
- return false
-}
-
-// FunctionCall is an encapsulation of a JavaScript function call.
-type FunctionCall struct {
- runtime *runtime
- thisObj *object
- eval bool // This call is a direct call to eval
-
- This Value
- ArgumentList []Value
- Otto *Otto
-}
-
-// Argument will return the value of the argument at the given index.
-//
-// If no such argument exists, undefined is returned.
-func (f FunctionCall) Argument(index int) Value {
- return valueOfArrayIndex(f.ArgumentList, index)
-}
-
-func (f FunctionCall) getArgument(index int) (Value, bool) {
- return getValueOfArrayIndex(f.ArgumentList, index)
-}
-
-func (f FunctionCall) slice(index int) []Value {
- if index < len(f.ArgumentList) {
- return f.ArgumentList[index:]
- }
- return []Value{}
-}
-
-func (f *FunctionCall) thisObject() *object {
- if f.thisObj == nil {
- this := f.This.resolve() // FIXME Is this right?
- f.thisObj = f.runtime.toObject(this)
- }
- return f.thisObj
-}
-
-func (f *FunctionCall) thisClassObject(class string) *object {
- if o := f.thisObject(); o.class != class {
- panic(f.runtime.panicTypeError("Function.Class %s != %s", o.class, class))
- }
- return f.thisObj
-}
-
-func (f FunctionCall) toObject(value Value) *object {
- return f.runtime.toObject(value)
-}
-
-// CallerLocation will return file location information (file:line:pos) where this function is being called.
-func (f FunctionCall) CallerLocation() string {
- // see error.go for location()
- return f.runtime.scope.outer.frame.location()
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_go_array.go b/vendor/github.com/robertkrimen/otto/type_go_array.go
deleted file mode 100644
index ad7b320..0000000
--- a/vendor/github.com/robertkrimen/otto/type_go_array.go
+++ /dev/null
@@ -1,156 +0,0 @@
-package otto
-
-import (
- "reflect"
- "strconv"
-)
-
-func (rt *runtime) newGoArrayObject(value reflect.Value) *object {
- o := rt.newObject()
- o.class = classGoArrayName
- o.objectClass = classGoArray
- o.value = newGoArrayObject(value)
- return o
-}
-
-type goArrayObject struct {
- value reflect.Value
- writable bool
- propertyMode propertyMode
-}
-
-func newGoArrayObject(value reflect.Value) *goArrayObject {
- writable := value.Kind() == reflect.Ptr || value.CanSet() // The Array is addressable (like a Slice)
- mode := propertyMode(0o010)
- if writable {
- mode = 0o110
- }
-
- return &goArrayObject{
- value: value,
- writable: writable,
- propertyMode: mode,
- }
-}
-
-func (o goArrayObject) getValue(name string) (reflect.Value, bool) { //nolint: unused
- if index, err := strconv.ParseInt(name, 10, 64); err != nil {
- v, ok := o.getValueIndex(index)
- if ok {
- return v, ok
- }
- }
-
- if m := o.value.MethodByName(name); m != (reflect.Value{}) {
- return m, true
- }
-
- return reflect.Value{}, false
-}
-
-func (o goArrayObject) getValueIndex(index int64) (reflect.Value, bool) {
- value := reflect.Indirect(o.value)
- if index < int64(value.Len()) {
- return value.Index(int(index)), true
- }
-
- return reflect.Value{}, false
-}
-
-func (o goArrayObject) setValue(index int64, value Value) bool {
- indexValue, exists := o.getValueIndex(index)
- if !exists {
- return false
- }
- reflectValue, err := value.toReflectValue(reflect.Indirect(o.value).Type().Elem())
- if err != nil {
- panic(err)
- }
- indexValue.Set(reflectValue)
- return true
-}
-
-func goArrayGetOwnProperty(obj *object, name string) *property {
- // length
- if name == propertyLength {
- return &property{
- value: toValue(reflect.Indirect(obj.value.(*goArrayObject).value).Len()),
- mode: 0,
- }
- }
-
- // .0, .1, .2, ...
- if index := stringToArrayIndex(name); index >= 0 {
- goObj := obj.value.(*goArrayObject)
- value := Value{}
- reflectValue, exists := goObj.getValueIndex(index)
- if exists {
- value = obj.runtime.toValue(reflectValue.Interface())
- }
- return &property{
- value: value,
- mode: goObj.propertyMode,
- }
- }
-
- if method := obj.value.(*goArrayObject).value.MethodByName(name); method != (reflect.Value{}) {
- return &property{
- obj.runtime.toValue(method.Interface()),
- 0o110,
- }
- }
-
- return objectGetOwnProperty(obj, name)
-}
-
-func goArrayEnumerate(obj *object, all bool, each func(string) bool) {
- goObj := obj.value.(*goArrayObject)
- // .0, .1, .2, ...
-
- for index, length := 0, goObj.value.Len(); index < length; index++ {
- name := strconv.FormatInt(int64(index), 10)
- if !each(name) {
- return
- }
- }
-
- objectEnumerate(obj, all, each)
-}
-
-func goArrayDefineOwnProperty(obj *object, name string, descriptor property, throw bool) bool {
- if name == propertyLength {
- return obj.runtime.typeErrorResult(throw)
- } else if index := stringToArrayIndex(name); index >= 0 {
- goObj := obj.value.(*goArrayObject)
- if goObj.writable {
- if obj.value.(*goArrayObject).setValue(index, descriptor.value.(Value)) {
- return true
- }
- }
- return obj.runtime.typeErrorResult(throw)
- }
- return objectDefineOwnProperty(obj, name, descriptor, throw)
-}
-
-func goArrayDelete(obj *object, name string, throw bool) bool {
- // length
- if name == propertyLength {
- return obj.runtime.typeErrorResult(throw)
- }
-
- // .0, .1, .2, ...
- index := stringToArrayIndex(name)
- if index >= 0 {
- goObj := obj.value.(*goArrayObject)
- if goObj.writable {
- indexValue, exists := goObj.getValueIndex(index)
- if exists {
- indexValue.Set(reflect.Zero(reflect.Indirect(goObj.value).Type().Elem()))
- return true
- }
- }
- return obj.runtime.typeErrorResult(throw)
- }
-
- return obj.delete(name, throw)
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_go_map.go b/vendor/github.com/robertkrimen/otto/type_go_map.go
deleted file mode 100644
index 43845ea..0000000
--- a/vendor/github.com/robertkrimen/otto/type_go_map.go
+++ /dev/null
@@ -1,108 +0,0 @@
-package otto
-
-import (
- "reflect"
-)
-
-func (rt *runtime) newGoMapObject(value reflect.Value) *object {
- obj := rt.newObject()
- obj.class = classObjectName // TODO Should this be something else?
- obj.objectClass = classGoMap
- obj.value = newGoMapObject(value)
- return obj
-}
-
-type goMapObject struct {
- value reflect.Value
- keyType reflect.Type
- valueType reflect.Type
-}
-
-func newGoMapObject(value reflect.Value) *goMapObject {
- if value.Kind() != reflect.Map {
- dbgf("%/panic//%@: %v != reflect.Map", value.Kind())
- }
- return &goMapObject{
- value: value,
- keyType: value.Type().Key(),
- valueType: value.Type().Elem(),
- }
-}
-
-func (o goMapObject) toKey(name string) reflect.Value {
- reflectValue, err := stringToReflectValue(name, o.keyType.Kind())
- if err != nil {
- panic(err)
- }
- return reflectValue
-}
-
-func (o goMapObject) toValue(value Value) reflect.Value {
- reflectValue, err := value.toReflectValue(o.valueType)
- if err != nil {
- panic(err)
- }
- return reflectValue
-}
-
-func goMapGetOwnProperty(obj *object, name string) *property {
- goObj := obj.value.(*goMapObject)
-
- // an error here means that the key referenced by `name` could not possibly
- // be a property of this object, so it should be safe to ignore this error
- //
- // TODO: figure out if any cases from
- // https://go.dev/ref/spec#Comparison_operators meet the criteria of 1)
- // being possible to represent as a string, 2) being possible to reconstruct
- // from a string, and 3) having a meaningful failure case in this context
- // other than "key does not exist"
- key, err := stringToReflectValue(name, goObj.keyType.Kind())
- if err != nil {
- return nil
- }
-
- value := goObj.value.MapIndex(key)
- if value.IsValid() {
- return &property{obj.runtime.toValue(value.Interface()), 0o111}
- }
-
- // Other methods
- if method := obj.value.(*goMapObject).value.MethodByName(name); method.IsValid() {
- return &property{
- value: obj.runtime.toValue(method.Interface()),
- mode: 0o110,
- }
- }
-
- return nil
-}
-
-func goMapEnumerate(obj *object, all bool, each func(string) bool) {
- goObj := obj.value.(*goMapObject)
- keys := goObj.value.MapKeys()
- for _, key := range keys {
- if !each(toValue(key).String()) {
- return
- }
- }
-}
-
-func goMapDefineOwnProperty(obj *object, name string, descriptor property, throw bool) bool {
- goObj := obj.value.(*goMapObject)
- // TODO ...or 0222
- if descriptor.mode != 0o111 {
- return obj.runtime.typeErrorResult(throw)
- }
- if !descriptor.isDataDescriptor() {
- return obj.runtime.typeErrorResult(throw)
- }
- goObj.value.SetMapIndex(goObj.toKey(name), goObj.toValue(descriptor.value.(Value)))
- return true
-}
-
-func goMapDelete(obj *object, name string, throw bool) bool {
- goObj := obj.value.(*goMapObject)
- goObj.value.SetMapIndex(goObj.toKey(name), reflect.Value{})
- // FIXME
- return true
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_go_slice.go b/vendor/github.com/robertkrimen/otto/type_go_slice.go
deleted file mode 100644
index e9acfa3..0000000
--- a/vendor/github.com/robertkrimen/otto/type_go_slice.go
+++ /dev/null
@@ -1,153 +0,0 @@
-package otto
-
-import (
- "reflect"
- "strconv"
-)
-
-func (rt *runtime) newGoSliceObject(value reflect.Value) *object {
- o := rt.newObject()
- o.class = classGoSliceName
- o.objectClass = classGoSlice
- o.value = newGoSliceObject(value)
- return o
-}
-
-type goSliceObject struct {
- value reflect.Value
-}
-
-func newGoSliceObject(value reflect.Value) *goSliceObject {
- return &goSliceObject{
- value: value,
- }
-}
-
-func (o goSliceObject) getValue(index int64) (reflect.Value, bool) {
- if index < int64(o.value.Len()) {
- return o.value.Index(int(index)), true
- }
- return reflect.Value{}, false
-}
-
-func (o *goSliceObject) setLength(value Value) {
- want, err := value.ToInteger()
- if err != nil {
- panic(err)
- }
-
- wantInt := int(want)
- switch {
- case wantInt == o.value.Len():
- // No change needed.
- case wantInt < o.value.Cap():
- // Fits in current capacity.
- o.value.SetLen(wantInt)
- default:
- // Needs expanding.
- newSlice := reflect.MakeSlice(o.value.Type(), wantInt, wantInt)
- reflect.Copy(newSlice, o.value)
- o.value = newSlice
- }
-}
-
-func (o *goSliceObject) setValue(index int64, value Value) bool {
- reflectValue, err := value.toReflectValue(o.value.Type().Elem())
- if err != nil {
- panic(err)
- }
-
- indexValue, exists := o.getValue(index)
- if !exists {
- if int64(o.value.Len()) == index {
- // Trying to append e.g. slice.push(...), allow it.
- o.value = reflect.Append(o.value, reflectValue)
- return true
- }
- return false
- }
-
- indexValue.Set(reflectValue)
- return true
-}
-
-func goSliceGetOwnProperty(obj *object, name string) *property {
- // length
- if name == propertyLength {
- return &property{
- value: toValue(obj.value.(*goSliceObject).value.Len()),
- mode: 0o110,
- }
- }
-
- // .0, .1, .2, ...
- if index := stringToArrayIndex(name); index >= 0 {
- value := Value{}
- reflectValue, exists := obj.value.(*goSliceObject).getValue(index)
- if exists {
- value = obj.runtime.toValue(reflectValue.Interface())
- }
- return &property{
- value: value,
- mode: 0o110,
- }
- }
-
- // Other methods
- if method := obj.value.(*goSliceObject).value.MethodByName(name); method.IsValid() {
- return &property{
- value: obj.runtime.toValue(method.Interface()),
- mode: 0o110,
- }
- }
-
- return objectGetOwnProperty(obj, name)
-}
-
-func goSliceEnumerate(obj *object, all bool, each func(string) bool) {
- goObj := obj.value.(*goSliceObject)
- // .0, .1, .2, ...
-
- for index, length := 0, goObj.value.Len(); index < length; index++ {
- name := strconv.FormatInt(int64(index), 10)
- if !each(name) {
- return
- }
- }
-
- objectEnumerate(obj, all, each)
-}
-
-func goSliceDefineOwnProperty(obj *object, name string, descriptor property, throw bool) bool {
- if name == propertyLength {
- obj.value.(*goSliceObject).setLength(descriptor.value.(Value))
- return true
- } else if index := stringToArrayIndex(name); index >= 0 {
- if obj.value.(*goSliceObject).setValue(index, descriptor.value.(Value)) {
- return true
- }
- return obj.runtime.typeErrorResult(throw)
- }
- return objectDefineOwnProperty(obj, name, descriptor, throw)
-}
-
-func goSliceDelete(obj *object, name string, throw bool) bool {
- // length
- if name == propertyLength {
- return obj.runtime.typeErrorResult(throw)
- }
-
- // .0, .1, .2, ...
- index := stringToArrayIndex(name)
- if index >= 0 {
- goObj := obj.value.(*goSliceObject)
- indexValue, exists := goObj.getValue(index)
- if exists {
- indexValue.Set(reflect.Zero(goObj.value.Type().Elem()))
- return true
- }
- return obj.runtime.typeErrorResult(throw)
- }
-
- return obj.delete(name, throw)
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_go_struct.go b/vendor/github.com/robertkrimen/otto/type_go_struct.go
deleted file mode 100644
index e191c57..0000000
--- a/vendor/github.com/robertkrimen/otto/type_go_struct.go
+++ /dev/null
@@ -1,146 +0,0 @@
-package otto
-
-import (
- "encoding/json"
- "reflect"
-)
-
-// FIXME Make a note about not being able to modify a struct unless it was
-// passed as a pointer-to: &struct{ ... }
-// This seems to be a limitation of the reflect package.
-// This goes for the other Go constructs too.
-// I guess we could get around it by either:
-// 1. Creating a new struct every time
-// 2. Creating an addressable? struct in the constructor
-
-func (rt *runtime) newGoStructObject(value reflect.Value) *object {
- o := rt.newObject()
- o.class = classObjectName // TODO Should this be something else?
- o.objectClass = classGoStruct
- o.value = newGoStructObject(value)
- return o
-}
-
-type goStructObject struct {
- value reflect.Value
-}
-
-func newGoStructObject(value reflect.Value) *goStructObject {
- if reflect.Indirect(value).Kind() != reflect.Struct {
- dbgf("%/panic//%@: %v != reflect.Struct", value.Kind())
- }
- return &goStructObject{
- value: value,
- }
-}
-
-func (o goStructObject) getValue(name string) reflect.Value {
- if idx := fieldIndexByName(reflect.Indirect(o.value).Type(), name); len(idx) > 0 {
- return reflect.Indirect(o.value).FieldByIndex(idx)
- }
-
- if validGoStructName(name) {
- // Do not reveal hidden or unexported fields.
- if field := reflect.Indirect(o.value).FieldByName(name); field.IsValid() {
- return field
- }
-
- if method := o.value.MethodByName(name); method.IsValid() {
- return method
- }
- }
-
- return reflect.Value{}
-}
-
-func (o goStructObject) fieldIndex(name string) []int { //nolint: unused
- return fieldIndexByName(reflect.Indirect(o.value).Type(), name)
-}
-
-func (o goStructObject) method(name string) (reflect.Method, bool) { //nolint: unused
- return reflect.Indirect(o.value).Type().MethodByName(name)
-}
-
-func (o goStructObject) setValue(rt *runtime, name string, value Value) bool {
- if idx := fieldIndexByName(reflect.Indirect(o.value).Type(), name); len(idx) == 0 {
- return false
- }
-
- fieldValue := o.getValue(name)
- converted, err := rt.convertCallParameter(value, fieldValue.Type())
- if err != nil {
- panic(rt.panicTypeError("Object.setValue convertCallParameter: %s", err))
- }
- fieldValue.Set(converted)
-
- return true
-}
-
-func goStructGetOwnProperty(obj *object, name string) *property {
- goObj := obj.value.(*goStructObject)
- value := goObj.getValue(name)
- if value.IsValid() {
- return &property{obj.runtime.toValue(value), 0o110}
- }
-
- return objectGetOwnProperty(obj, name)
-}
-
-func validGoStructName(name string) bool {
- if name == "" {
- return false
- }
- return 'A' <= name[0] && name[0] <= 'Z' // TODO What about Unicode?
-}
-
-func goStructEnumerate(obj *object, all bool, each func(string) bool) {
- goObj := obj.value.(*goStructObject)
-
- // Enumerate fields
- for index := 0; index < reflect.Indirect(goObj.value).NumField(); index++ {
- name := reflect.Indirect(goObj.value).Type().Field(index).Name
- if validGoStructName(name) {
- if !each(name) {
- return
- }
- }
- }
-
- // Enumerate methods
- for index := 0; index < goObj.value.NumMethod(); index++ {
- name := goObj.value.Type().Method(index).Name
- if validGoStructName(name) {
- if !each(name) {
- return
- }
- }
- }
-
- objectEnumerate(obj, all, each)
-}
-
-func goStructCanPut(obj *object, name string) bool {
- goObj := obj.value.(*goStructObject)
- value := goObj.getValue(name)
- if value.IsValid() {
- return true
- }
-
- return objectCanPut(obj, name)
-}
-
-func goStructPut(obj *object, name string, value Value, throw bool) {
- goObj := obj.value.(*goStructObject)
- if goObj.setValue(obj.runtime, name, value) {
- return
- }
-
- objectPut(obj, name, value, throw)
-}
-
-func goStructMarshalJSON(obj *object) json.Marshaler {
- goObj := obj.value.(*goStructObject)
- goValue := reflect.Indirect(goObj.value).Interface()
- marshaler, _ := goValue.(json.Marshaler)
- return marshaler
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_number.go b/vendor/github.com/robertkrimen/otto/type_number.go
deleted file mode 100644
index 4201c92..0000000
--- a/vendor/github.com/robertkrimen/otto/type_number.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package otto
-
-func (rt *runtime) newNumberObject(value Value) *object {
- return rt.newPrimitiveObject(classNumberName, value.numberValue())
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_reference.go b/vendor/github.com/robertkrimen/otto/type_reference.go
deleted file mode 100644
index 3e45b42..0000000
--- a/vendor/github.com/robertkrimen/otto/type_reference.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package otto
-
-type referencer interface {
- invalid() bool // IsUnresolvableReference
- getValue() Value // getValue
- putValue(Value) string // PutValue
- delete() bool
-}
-
-// PropertyReference
-
-type propertyReference struct {
- name string
- strict bool
- base *object
- runtime *runtime
- at at
-}
-
-func newPropertyReference(rt *runtime, base *object, name string, strict bool, atv at) *propertyReference {
- return &propertyReference{
- runtime: rt,
- name: name,
- strict: strict,
- base: base,
- at: atv,
- }
-}
-
-func (pr *propertyReference) invalid() bool {
- return pr.base == nil
-}
-
-func (pr *propertyReference) getValue() Value {
- if pr.base == nil {
- panic(pr.runtime.panicReferenceError("'%s' is not defined", pr.name, pr.at))
- }
- return pr.base.get(pr.name)
-}
-
-func (pr *propertyReference) putValue(value Value) string {
- if pr.base == nil {
- return pr.name
- }
- pr.base.put(pr.name, value, pr.strict)
- return ""
-}
-
-func (pr *propertyReference) delete() bool {
- if pr.base == nil {
- // TODO Throw an error if strict
- return true
- }
- return pr.base.delete(pr.name, pr.strict)
-}
-
-type stashReference struct {
- name string
- strict bool
- base stasher
-}
-
-func (sr *stashReference) invalid() bool {
- return false // The base (an environment) will never be nil
-}
-
-func (sr *stashReference) getValue() Value {
- return sr.base.getBinding(sr.name, sr.strict)
-}
-
-func (sr *stashReference) putValue(value Value) string {
- sr.base.setValue(sr.name, value, sr.strict)
- return ""
-}
-
-func (sr *stashReference) delete() bool {
- if sr.base == nil {
- // This should never be reached, but just in case
- return false
- }
- return sr.base.deleteBinding(sr.name)
-}
-
-// getIdentifierReference.
-func getIdentifierReference(rt *runtime, stash stasher, name string, strict bool, atv at) referencer {
- if stash == nil {
- return newPropertyReference(rt, nil, name, strict, atv)
- }
- if stash.hasBinding(name) {
- return stash.newReference(name, strict, atv)
- }
- return getIdentifierReference(rt, stash.outer(), name, strict, atv)
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_regexp.go b/vendor/github.com/robertkrimen/otto/type_regexp.go
deleted file mode 100644
index 19001fe..0000000
--- a/vendor/github.com/robertkrimen/otto/type_regexp.go
+++ /dev/null
@@ -1,144 +0,0 @@
-package otto
-
-import (
- "fmt"
- "regexp"
-
- "github.com/robertkrimen/otto/parser"
-)
-
-type regExpObject struct {
- regularExpression *regexp.Regexp
- global bool
- ignoreCase bool
- multiline bool
- source string
- flags string
-}
-
-func (rt *runtime) newRegExpObject(pattern string, flags string) *object {
- o := rt.newObject()
- o.class = classRegExpName
-
- global := false
- ignoreCase := false
- multiline := false
- re2flags := ""
-
- // TODO Maybe clean up the panicking here... TypeError, SyntaxError, ?
-
- for _, chr := range flags {
- switch chr {
- case 'g':
- if global {
- panic(rt.panicSyntaxError("newRegExpObject: %s %s", pattern, flags))
- }
- global = true
- case 'm':
- if multiline {
- panic(rt.panicSyntaxError("newRegExpObject: %s %s", pattern, flags))
- }
- multiline = true
- re2flags += "m"
- case 'i':
- if ignoreCase {
- panic(rt.panicSyntaxError("newRegExpObject: %s %s", pattern, flags))
- }
- ignoreCase = true
- re2flags += "i"
- }
- }
-
- re2pattern, err := parser.TransformRegExp(pattern)
- if err != nil {
- panic(rt.panicTypeError("Invalid regular expression: %s", err.Error()))
- }
- if len(re2flags) > 0 {
- re2pattern = fmt.Sprintf("(?%s:%s)", re2flags, re2pattern)
- }
-
- regularExpression, err := regexp.Compile(re2pattern)
- if err != nil {
- panic(rt.panicSyntaxError("Invalid regular expression: %s", err.Error()[22:]))
- }
-
- o.value = regExpObject{
- regularExpression: regularExpression,
- global: global,
- ignoreCase: ignoreCase,
- multiline: multiline,
- source: pattern,
- flags: flags,
- }
- o.defineProperty("global", boolValue(global), 0, false)
- o.defineProperty("ignoreCase", boolValue(ignoreCase), 0, false)
- o.defineProperty("multiline", boolValue(multiline), 0, false)
- o.defineProperty("lastIndex", intValue(0), 0o100, false)
- o.defineProperty("source", stringValue(pattern), 0, false)
- return o
-}
-
-func (o *object) regExpValue() regExpObject {
- value, _ := o.value.(regExpObject)
- return value
-}
-
-func execRegExp(this *object, target string) (bool, []int) {
- if this.class != classRegExpName {
- panic(this.runtime.panicTypeError("Calling RegExp.exec on a non-RegExp object"))
- }
- lastIndex := this.get("lastIndex").number().int64
- index := lastIndex
- global := this.get("global").bool()
- if !global {
- index = 0
- }
-
- var result []int
- if 0 > index || index > int64(len(target)) {
- } else {
- result = this.regExpValue().regularExpression.FindStringSubmatchIndex(target[index:])
- }
-
- if result == nil {
- this.put("lastIndex", intValue(0), true)
- return false, nil
- }
-
- startIndex := index
- endIndex := int(lastIndex) + result[1]
- // We do this shift here because the .FindStringSubmatchIndex above
- // was done on a local subordinate slice of the string, not the whole string
- for index, offset := range result {
- if offset != -1 {
- result[index] += int(startIndex)
- }
- }
- if global {
- this.put("lastIndex", intValue(endIndex), true)
- }
-
- return true, result
-}
-
-func execResultToArray(rt *runtime, target string, result []int) *object {
- captureCount := len(result) / 2
- valueArray := make([]Value, captureCount)
- for index := 0; index < captureCount; index++ {
- offset := 2 * index
- if result[offset] != -1 {
- valueArray[index] = stringValue(target[result[offset]:result[offset+1]])
- } else {
- valueArray[index] = Value{}
- }
- }
- matchIndex := result[0]
- if matchIndex != 0 {
- // Find the utf16 index in the string, not the byte index.
- matchIndex = utf16Length(target[:matchIndex])
- }
- match := rt.newArrayOf(valueArray)
- match.defineProperty("input", stringValue(target), 0o111, false)
- match.defineProperty("index", intValue(matchIndex), 0o111, false)
- return match
-}
diff --git a/vendor/github.com/robertkrimen/otto/type_string.go b/vendor/github.com/robertkrimen/otto/type_string.go
deleted file mode 100644
index cea9fc4..0000000
--- a/vendor/github.com/robertkrimen/otto/type_string.go
+++ /dev/null
@@ -1,114 +0,0 @@
-package otto
-
-import (
- "strconv"
- "unicode/utf16"
- "unicode/utf8"
-)
-
-type stringObjecter interface {
- Length() int
- At(int) rune
- String() string
-}
-
-type stringASCII string
-
-func (str stringASCII) Length() int {
- return len(str)
-}
-
-func (str stringASCII) At(at int) rune {
- return rune(str[at])
-}
-
-func (str stringASCII) String() string {
- return string(str)
-}
-
-type stringWide struct {
- string string
- value16 []uint16
-}
-
-func (str stringWide) Length() int {
- if str.value16 == nil {
- str.value16 = utf16.Encode([]rune(str.string))
- }
- return len(str.value16)
-}
-
-func (str stringWide) At(at int) rune {
- if str.value16 == nil {
- str.value16 = utf16.Encode([]rune(str.string))
- }
- return rune(str.value16[at])
-}
-
-func (str stringWide) String() string {
- return str.string
-}
-
-func newStringObject(str string) stringObjecter {
- for i := 0; i < len(str); i++ {
- if str[i] >= utf8.RuneSelf {
- goto wide
- }
- }
-
- return stringASCII(str)
-
-wide:
- return &stringWide{
- string: str,
- }
-}
-
-func stringAt(str stringObjecter, index int) rune {
- if 0 <= index && index < str.Length() {
- return str.At(index)
- }
- return utf8.RuneError
-}
-
-func (rt *runtime) newStringObject(value Value) *object {
- str := newStringObject(value.string())
-
- obj := rt.newClassObject(classStringName)
- obj.defineProperty(propertyLength, intValue(str.Length()), 0, false)
- obj.objectClass = classString
- obj.value = str
- return obj
-}
-
-func (o *object) stringValue() stringObjecter {
- if str, ok := o.value.(stringObjecter); ok {
- return str
- }
- return nil
-}
-
-func stringEnumerate(obj *object, all bool, each func(string) bool) {
- if str := obj.stringValue(); str != nil {
- length := str.Length()
- for index := 0; index < length; index++ {
- if !each(strconv.FormatInt(int64(index), 10)) {
- return
- }
- }
- }
- objectEnumerate(obj, all, each)
-}
-
-func stringGetOwnProperty(obj *object, name string) *property {
- if prop := objectGetOwnProperty(obj, name); prop != nil {
- return prop
- }
- // TODO Test a string of length >= +int32 + 1?
- if index := stringToArrayIndex(name); index >= 0 {
- if chr := stringAt(obj.stringValue(), int(index)); chr != utf8.RuneError {
- return &property{stringValue(string(chr)), 0}
- }
- }
- return nil
-}
diff --git a/vendor/github.com/robertkrimen/otto/value.go b/vendor/github.com/robertkrimen/otto/value.go
deleted file mode 100644
index 1f86e14..0000000
--- a/vendor/github.com/robertkrimen/otto/value.go
+++ /dev/null
@@ -1,984 +0,0 @@
-package otto
-
-import (
- "encoding/json"
- "fmt"
- "math"
- "reflect"
- "strconv"
- "unicode/utf16"
-)
-
-type valueKind int
-
-const (
- valueUndefined valueKind = iota
- valueNull
- valueNumber
- valueString
- valueBoolean
- valueObject
-
- // These are invalid outside of the runtime.
- valueEmpty
- valueResult
- valueReference
-)
-
-// Value is the representation of a JavaScript value.
-type Value struct {
- kind valueKind
- value interface{}
-}
-
-func (v Value) safe() bool {
- return v.kind < valueEmpty
-}
-
-var (
- emptyValue = Value{kind: valueEmpty}
- nullValue = Value{kind: valueNull}
- falseValue = Value{kind: valueBoolean, value: false}
- trueValue = Value{kind: valueBoolean, value: true}
-)
-
-// ToValue will convert an interface{} value to a value digestible by otto/JavaScript
-//
-// This function will not work for advanced types (struct, map, slice/array, etc.) and
-// you should use Otto.ToValue instead.
-func ToValue(value interface{}) (Value, error) {
- result := Value{}
- err := catchPanic(func() {
- result = toValue(value)
- })
- return result, err
-}
-
-func (v Value) isEmpty() bool {
- return v.kind == valueEmpty
-}
-
-// Undefined
-
-// UndefinedValue will return a Value representing undefined.
-func UndefinedValue() Value {
- return Value{}
-}
-
-// IsDefined will return false if the value is undefined, and true otherwise.
-func (v Value) IsDefined() bool {
- return v.kind != valueUndefined
-}
-
-// IsUndefined will return true if the value is undefined, and false otherwise.
-func (v Value) IsUndefined() bool {
- return v.kind == valueUndefined
-}
-
-// NullValue will return a Value representing null.
-func NullValue() Value {
- return Value{kind: valueNull}
-}
-
-// IsNull will return true if the value is null, and false otherwise.
-func (v Value) IsNull() bool {
- return v.kind == valueNull
-}
-
-// ---
-
-func (v Value) isCallable() bool {
- o, ok := v.value.(*object)
- return ok && o.isCall()
-}
-
-// Call the value as a function with the given this value and argument list and
-// return the result of invocation. It is essentially equivalent to:
-//
-// value.apply(thisValue, argumentList)
-//
-// An undefined value and an error will result if:
-//
-// 1. There is an error during conversion of the argument list
-// 2. The value is not actually a function
-// 3. An (uncaught) exception is thrown
-func (v Value) Call(this Value, argumentList ...interface{}) (Value, error) {
- result := Value{}
- err := catchPanic(func() {
- // FIXME
- result = v.call(nil, this, argumentList...)
- })
- if !v.safe() {
- v = Value{}
- }
- return result, err
-}
-
-func (v Value) call(rt *runtime, this Value, argumentList ...interface{}) Value {
- if function, ok := v.value.(*object); ok {
- return function.call(this, function.runtime.toValueArray(argumentList...), false, nativeFrame)
- }
- panic(rt.panicTypeError("call %q is not an object", v.value))
-}
-
-func (v Value) constructSafe(rt *runtime, this Value, argumentList ...interface{}) (Value, error) {
- result := Value{}
- err := catchPanic(func() {
- result = v.construct(rt, this, argumentList...)
- })
- return result, err
-}
-
-func (v Value) construct(rt *runtime, this Value, argumentList ...interface{}) Value { //nolint: unparam
- if fn, ok := v.value.(*object); ok {
- return fn.construct(fn.runtime.toValueArray(argumentList...))
- }
- panic(rt.panicTypeError("construct %q is not an object", v.value))
-}
-
-// IsPrimitive will return true if value is a primitive (any kind of primitive).
-func (v Value) IsPrimitive() bool {
- return !v.IsObject()
-}
-
-// IsBoolean will return true if value is a boolean (primitive).
-func (v Value) IsBoolean() bool {
- return v.kind == valueBoolean
-}
-
-// IsNumber will return true if value is a number (primitive).
-func (v Value) IsNumber() bool {
- return v.kind == valueNumber
-}
-
-// IsNaN will return true if value is NaN (or would convert to NaN).
-func (v Value) IsNaN() bool {
- switch value := v.value.(type) {
- case float64:
- return math.IsNaN(value)
- case float32:
- return math.IsNaN(float64(value))
- case int, int8, int32, int64:
- return false
- case uint, uint8, uint32, uint64:
- return false
- }
-
- return math.IsNaN(v.float64())
-}
-
-// IsString will return true if value is a string (primitive).
-func (v Value) IsString() bool {
- return v.kind == valueString
-}
-
-// IsObject will return true if value is an object.
-func (v Value) IsObject() bool {
- return v.kind == valueObject
-}
-
-// IsFunction will return true if value is a function.
-func (v Value) IsFunction() bool {
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classFunctionName
-}
-
-// Class will return the class string of the value or the empty string if value is not an object.
-//
-// The return value will (generally) be one of:
-//
-// Object
-// Function
-// Array
-// String
-// Number
-// Boolean
-// Date
-// RegExp
-func (v Value) Class() string {
- if v.kind != valueObject {
- return ""
- }
- return v.value.(*object).class
-}
-
-func (v Value) isArray() bool { //nolint: unused
- if v.kind != valueObject {
- return false
- }
- return isArray(v.value.(*object))
-}
-
-func (v Value) isStringObject() bool { //nolint: unused
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classStringName
-}
-
-func (v Value) isBooleanObject() bool { //nolint: unused
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classBooleanName
-}
-
-func (v Value) isNumberObject() bool { //nolint: unused
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classNumberName
-}
-
-func (v Value) isDate() bool { //nolint: unused
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classDateName
-}
-
-func (v Value) isRegExp() bool {
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classRegExpName
-}
-
-func (v Value) isError() bool { //nolint: unused
- if v.kind != valueObject {
- return false
- }
- return v.value.(*object).class == classErrorName
-}
-
-// ---
-
-func reflectValuePanic(value interface{}, kind reflect.Kind) {
- // FIXME?
- switch kind {
- case reflect.Struct:
- panic(newError(nil, "TypeError", 0, "invalid value (struct): missing runtime: %v (%T)", value, value))
- case reflect.Map:
- panic(newError(nil, "TypeError", 0, "invalid value (map): missing runtime: %v (%T)", value, value))
- case reflect.Slice:
- panic(newError(nil, "TypeError", 0, "invalid value (slice): missing runtime: %v (%T)", value, value))
- }
-}
-
-func toValue(value interface{}) Value {
- switch value := value.(type) {
- case Value:
- return value
- case bool:
- return Value{valueBoolean, value}
- case int:
- return Value{valueNumber, value}
- case int8:
- return Value{valueNumber, value}
- case int16:
- return Value{valueNumber, value}
- case int32:
- return Value{valueNumber, value}
- case int64:
- return Value{valueNumber, value}
- case uint:
- return Value{valueNumber, value}
- case uint8:
- return Value{valueNumber, value}
- case uint16:
- return Value{valueNumber, value}
- case uint32:
- return Value{valueNumber, value}
- case uint64:
- return Value{valueNumber, value}
- case float32:
- return Value{valueNumber, float64(value)}
- case float64:
- return Value{valueNumber, value}
- case []uint16:
- return Value{valueString, value}
- case string:
- return Value{valueString, value}
- // A rune is actually an int32, which is handled above
- case *object:
- return Value{valueObject, value}
- case *Object:
- return Value{valueObject, value.object}
- case Object:
- return Value{valueObject, value.object}
- case referencer: // reference is an interface (already a pointer)
- return Value{valueReference, value}
- case result:
- return Value{valueResult, value}
- case nil:
- // TODO Ugh.
- return Value{}
- case reflect.Value:
- for value.Kind() == reflect.Ptr {
- // We were given a pointer, so we'll drill down until we get a non-pointer
- //
- // These semantics might change if we want to start supporting pointers to values transparently
- // (It would be best not to depend on this behavior)
- // FIXME: UNDEFINED
- if value.IsNil() {
- return Value{}
- }
- value = value.Elem()
- }
- switch value.Kind() {
- case reflect.Bool:
- return Value{valueBoolean, value.Bool()}
- case reflect.Int:
- return Value{valueNumber, int(value.Int())}
- case reflect.Int8:
- return Value{valueNumber, int8(value.Int())}
- case reflect.Int16:
- return Value{valueNumber, int16(value.Int())}
- case reflect.Int32:
- return Value{valueNumber, int32(value.Int())}
- case reflect.Int64:
- return Value{valueNumber, value.Int()}
- case reflect.Uint:
- return Value{valueNumber, uint(value.Uint())}
- case reflect.Uint8:
- return Value{valueNumber, uint8(value.Uint())}
- case reflect.Uint16:
- return Value{valueNumber, uint16(value.Uint())}
- case reflect.Uint32:
- return Value{valueNumber, uint32(value.Uint())}
- case reflect.Uint64:
- return Value{valueNumber, value.Uint()}
- case reflect.Float32:
- return Value{valueNumber, float32(value.Float())}
- case reflect.Float64:
- return Value{valueNumber, value.Float()}
- case reflect.String:
- return Value{valueString, value.String()}
- default:
- reflectValuePanic(value.Interface(), value.Kind())
- }
- default:
- return toValue(reflect.ValueOf(value))
- }
- // FIXME?
- panic(newError(nil, "TypeError", 0, "invalid value: %v (%T)", value, value))
-}
-
-// String will return the value as a string.
-//
-// This method will make return the empty string if there is an error.
-func (v Value) String() string {
- var result string
- catchPanic(func() { //nolint: errcheck, gosec
- result = v.string()
- })
- return result
-}
-
-// ToBoolean will convert the value to a boolean (bool).
-//
-// ToValue(0).ToBoolean() => false
-// ToValue("").ToBoolean() => false
-// ToValue(true).ToBoolean() => true
-// ToValue(1).ToBoolean() => true
-// ToValue("Nothing happens").ToBoolean() => true
-//
-// If there is an error during the conversion process (like an uncaught exception), then the result will be false and an error.
-func (v Value) ToBoolean() (bool, error) {
- result := false
- err := catchPanic(func() {
- result = v.bool()
- })
- return result, err
-}
-
-func (v Value) numberValue() Value {
- if v.kind == valueNumber {
- return v
- }
- return Value{valueNumber, v.float64()}
-}
-
-// ToFloat will convert the value to a number (float64).
-//
-// ToValue(0).ToFloat() => 0.
-// ToValue(1.1).ToFloat() => 1.1
-// ToValue("11").ToFloat() => 11.
-//
-// If there is an error during the conversion process (like an uncaught exception), then the result will be 0 and an error.
-func (v Value) ToFloat() (float64, error) {
- result := float64(0)
- err := catchPanic(func() {
- result = v.float64()
- })
- return result, err
-}
-
-// ToInteger will convert the value to a number (int64).
-//
-// ToValue(0).ToInteger() => 0
-// ToValue(1.1).ToInteger() => 1
-// ToValue("11").ToInteger() => 11
-//
-// If there is an error during the conversion process (like an uncaught exception), then the result will be 0 and an error.
-func (v Value) ToInteger() (int64, error) {
- result := int64(0)
- err := catchPanic(func() {
- result = v.number().int64
- })
- return result, err
-}
-
-// ToString will convert the value to a string (string).
-//
-// ToValue(0).ToString() => "0"
-// ToValue(false).ToString() => "false"
-// ToValue(1.1).ToString() => "1.1"
-// ToValue("11").ToString() => "11"
-// ToValue('Nothing happens.').ToString() => "Nothing happens."
-//
-// If there is an error during the conversion process (like an uncaught exception), then the result will be the empty string ("") and an error.
-func (v Value) ToString() (string, error) {
- result := ""
- err := catchPanic(func() {
- result = v.string()
- })
- return result, err
-}
-
-func (v Value) object() *object {
- if v, ok := v.value.(*object); ok {
- return v
- }
- return nil
-}
-
-// Object will return the object of the value, or nil if value is not an object.
-//
-// This method will not do any implicit conversion. For example, calling this method on a string primitive value will not return a String object.
-func (v Value) Object() *Object {
- if obj, ok := v.value.(*object); ok {
- return &Object{
- object: obj,
- value: v,
- }
- }
- return nil
-}
-
-func (v Value) reference() referencer {
- value, _ := v.value.(referencer)
- return value
-}
-
-func (v Value) resolve() Value {
- if value, ok := v.value.(referencer); ok {
- return value.getValue()
- }
- return v
-}
-
-var (
- nan float64 = math.NaN()
- positiveInfinity float64 = math.Inf(+1)
- negativeInfinity float64 = math.Inf(-1)
- positiveZero float64 = 0
- negativeZero float64 = math.Float64frombits(0 | (1 << 63))
-)
-
-// NaNValue will return a value representing NaN.
-//
-// It is equivalent to:
-//
-// ToValue(math.NaN())
-func NaNValue() Value {
- return Value{valueNumber, nan}
-}
-
-func positiveInfinityValue() Value {
- return Value{valueNumber, positiveInfinity}
-}
-
-func negativeInfinityValue() Value {
- return Value{valueNumber, negativeInfinity}
-}
-
-func positiveZeroValue() Value {
- return Value{valueNumber, positiveZero}
-}
-
-func negativeZeroValue() Value {
- return Value{valueNumber, negativeZero}
-}
-
-// TrueValue will return a value representing true.
-//
-// It is equivalent to:
-//
-// ToValue(true)
-func TrueValue() Value {
- return Value{valueBoolean, true}
-}
-
-// FalseValue will return a value representing false.
-//
-// It is equivalent to:
-//
-// ToValue(false)
-func FalseValue() Value {
- return Value{valueBoolean, false}
-}
-
-func sameValue(x Value, y Value) bool {
- if x.kind != y.kind {
- return false
- }
-
- switch x.kind {
- case valueUndefined, valueNull:
- return true
- case valueNumber:
- x := x.float64()
- y := y.float64()
- if math.IsNaN(x) && math.IsNaN(y) {
- return true
- }
-
- if x == y {
- if x == 0 {
- // Since +0 != -0
- return math.Signbit(x) == math.Signbit(y)
- }
- return true
- }
- return false
- case valueString:
- return x.string() == y.string()
- case valueBoolean:
- return x.bool() == y.bool()
- case valueObject:
- return x.object() == y.object()
- default:
- panic(hereBeDragons())
- }
-}
-
-func strictEqualityComparison(x Value, y Value) bool {
- if x.kind != y.kind {
- return false
- }
-
- switch x.kind {
- case valueUndefined, valueNull:
- return true
- case valueNumber:
- x := x.float64()
- y := y.float64()
- if math.IsNaN(x) && math.IsNaN(y) {
- return false
- }
- return x == y
- case valueString:
- return x.string() == y.string()
- case valueBoolean:
- return x.bool() == y.bool()
- case valueObject:
- return x.object() == y.object()
- default:
- panic(hereBeDragons())
- }
-}
-
-// Export will attempt to convert the value to a Go representation
-// and return it via an interface{} kind.
-//
-// Export returns an error, but it will always be nil. It is present
-// for backwards compatibility.
-//
-// If a reasonable conversion is not possible, then the original
-// value is returned.
-//
-// undefined -> nil (FIXME?: Should be Value{})
-// null -> nil
-// boolean -> bool
-// number -> A number type (int, float32, uint64, ...)
-// string -> string
-// Array -> []interface{}
-// Object -> map[string]interface{}
-func (v Value) Export() (interface{}, error) {
- return v.export(), nil
-}
-
-func (v Value) export() interface{} {
- switch v.kind {
- case valueUndefined:
- return nil
- case valueNull:
- return nil
- case valueNumber, valueBoolean:
- return v.value
- case valueString:
- switch value := v.value.(type) {
- case string:
- return value
- case []uint16:
- return string(utf16.Decode(value))
- }
- case valueObject:
- obj := v.object()
- switch value := obj.value.(type) {
- case *goStructObject:
- return value.value.Interface()
- case *goMapObject:
- return value.value.Interface()
- case *goArrayObject:
- return value.value.Interface()
- case *goSliceObject:
- return value.value.Interface()
- }
- if obj.class == classArrayName {
- result := make([]interface{}, 0)
- lengthValue := obj.get(propertyLength)
- length := lengthValue.value.(uint32)
- kind := reflect.Invalid
- keyKind := reflect.Invalid
- elemKind := reflect.Invalid
- state := 0
- var t reflect.Type
- for index := uint32(0); index < length; index++ {
- name := strconv.FormatInt(int64(index), 10)
- if !obj.hasProperty(name) {
- continue
- }
- value := obj.get(name).export()
-
- t = reflect.TypeOf(value)
-
- var k, kk, ek reflect.Kind
- if t != nil {
- k = t.Kind()
- switch k {
- case reflect.Map:
- kk = t.Key().Kind()
- fallthrough
- case reflect.Array, reflect.Chan, reflect.Ptr, reflect.Slice:
- ek = t.Elem().Kind()
- }
- }
-
- if state == 0 {
- kind = k
- keyKind = kk
- elemKind = ek
- state = 1
- } else if state == 1 && (kind != k || keyKind != kk || elemKind != ek) {
- state = 2
- }
-
- result = append(result, value)
- }
-
- if state != 1 || kind == reflect.Interface || t == nil {
- // No common type
- return result
- }
-
- // Convert to the common type
- val := reflect.MakeSlice(reflect.SliceOf(t), len(result), len(result))
- for i, v := range result {
- val.Index(i).Set(reflect.ValueOf(v))
- }
- return val.Interface()
- }
-
- result := make(map[string]interface{})
- // TODO Should we export everything? Or just what is enumerable?
- obj.enumerate(false, func(name string) bool {
- value := obj.get(name)
- if value.IsDefined() {
- result[name] = value.export()
- }
- return true
- })
- return result
- }
-
- if v.safe() {
- return v
- }
-
- return Value{}
-}
-
-func (v Value) evaluateBreakContinue(labels []string) resultKind {
- result := v.value.(result)
- if result.kind == resultBreak || result.kind == resultContinue {
- for _, label := range labels {
- if label == result.target {
- return result.kind
- }
- }
- }
- return resultReturn
-}
-
-func (v Value) evaluateBreak(labels []string) resultKind {
- result := v.value.(result)
- if result.kind == resultBreak {
- for _, label := range labels {
- if label == result.target {
- return result.kind
- }
- }
- }
- return resultReturn
-}
-
-// Make a best effort to return a reflect.Value corresponding to reflect.Kind, but
-// fallback to just returning the Go value we have handy.
-func (v Value) toReflectValue(typ reflect.Type) (reflect.Value, error) {
- kind := typ.Kind()
- switch kind {
- case reflect.Float32, reflect.Float64, reflect.Interface:
- default:
- switch value := v.value.(type) {
- case float32:
- _, frac := math.Modf(float64(value))
- if frac > 0 {
- return reflect.Value{}, fmt.Errorf("RangeError: %v to reflect.Kind: %v", value, kind)
- }
- case float64:
- _, frac := math.Modf(value)
- if frac > 0 {
- return reflect.Value{}, fmt.Errorf("RangeError: %v to reflect.Kind: %v", value, kind)
- }
- }
- }
-
- switch kind {
- case reflect.Bool: // Bool
- return reflect.ValueOf(v.bool()).Convert(typ), nil
- case reflect.Int: // Int
- // We convert to float64 here because converting to int64 will not tell us
- // if a value is outside the range of int64
- tmp := toIntegerFloat(v)
- if tmp < floatMinInt || tmp > floatMaxInt {
- return reflect.Value{}, fmt.Errorf("RangeError: %f (%v) to int", tmp, v)
- }
- return reflect.ValueOf(int(tmp)).Convert(typ), nil
- case reflect.Int8: // Int8
- tmp := v.number().int64
- if tmp < int64MinInt8 || tmp > int64MaxInt8 {
- return reflect.Value{}, fmt.Errorf("RangeError: %d (%v) to int8", tmp, v)
- }
- return reflect.ValueOf(int8(tmp)).Convert(typ), nil
- case reflect.Int16: // Int16
- tmp := v.number().int64
- if tmp < int64MinInt16 || tmp > int64MaxInt16 {
- return reflect.Value{}, fmt.Errorf("RangeError: %d (%v) to int16", tmp, v)
- }
- return reflect.ValueOf(int16(tmp)).Convert(typ), nil
- case reflect.Int32: // Int32
- tmp := v.number().int64
- if tmp < int64MinInt32 || tmp > int64MaxInt32 {
- return reflect.Value{}, fmt.Errorf("RangeError: %d (%v) to int32", tmp, v)
- }
- return reflect.ValueOf(int32(tmp)).Convert(typ), nil
- case reflect.Int64: // Int64
- // We convert to float64 here because converting to int64 will not tell us
- // if a value is outside the range of int64
- tmp := toIntegerFloat(v)
- if tmp < floatMinInt64 || tmp > floatMaxInt64 {
- return reflect.Value{}, fmt.Errorf("RangeError: %f (%v) to int", tmp, v)
- }
- return reflect.ValueOf(int64(tmp)).Convert(typ), nil
- case reflect.Uint: // Uint
- // We convert to float64 here because converting to int64 will not tell us
- // if a value is outside the range of uint
- tmp := toIntegerFloat(v)
- if tmp < 0 || tmp > floatMaxUint {
- return reflect.Value{}, fmt.Errorf("RangeError: %f (%v) to uint", tmp, v)
- }
- return reflect.ValueOf(uint(tmp)).Convert(typ), nil
- case reflect.Uint8: // Uint8
- tmp := v.number().int64
- if tmp < 0 || tmp > int64MaxUint8 {
- return reflect.Value{}, fmt.Errorf("RangeError: %d (%v) to uint8", tmp, v)
- }
- return reflect.ValueOf(uint8(tmp)).Convert(typ), nil
- case reflect.Uint16: // Uint16
- tmp := v.number().int64
- if tmp < 0 || tmp > int64MaxUint16 {
- return reflect.Value{}, fmt.Errorf("RangeError: %d (%v) to uint16", tmp, v)
- }
- return reflect.ValueOf(uint16(tmp)).Convert(typ), nil
- case reflect.Uint32: // Uint32
- tmp := v.number().int64
- if tmp < 0 || tmp > int64MaxUint32 {
- return reflect.Value{}, fmt.Errorf("RangeError: %d (%v) to uint32", tmp, v)
- }
- return reflect.ValueOf(uint32(tmp)).Convert(typ), nil
- case reflect.Uint64: // Uint64
- // We convert to float64 here because converting to int64 will not tell us
- // if a value is outside the range of uint64
- tmp := toIntegerFloat(v)
- if tmp < 0 || tmp > floatMaxUint64 {
- return reflect.Value{}, fmt.Errorf("RangeError: %f (%v) to uint64", tmp, v)
- }
- return reflect.ValueOf(uint64(tmp)).Convert(typ), nil
- case reflect.Float32: // Float32
- tmp := v.float64()
- tmp1 := tmp
- if 0 > tmp1 {
- tmp1 = -tmp1
- }
- if tmp1 > 0 && (tmp1 < math.SmallestNonzeroFloat32 || tmp1 > math.MaxFloat32) {
- return reflect.Value{}, fmt.Errorf("RangeError: %f (%v) to float32", tmp, v)
- }
- return reflect.ValueOf(float32(tmp)).Convert(typ), nil
- case reflect.Float64: // Float64
- value := v.float64()
- return reflect.ValueOf(value).Convert(typ), nil
- case reflect.String: // String
- return reflect.ValueOf(v.string()).Convert(typ), nil
- case reflect.Invalid: // Invalid
- case reflect.Complex64: // FIXME? Complex64
- case reflect.Complex128: // FIXME? Complex128
- case reflect.Chan: // FIXME? Chan
- case reflect.Func: // FIXME? Func
- case reflect.Ptr: // FIXME? Ptr
- case reflect.UnsafePointer: // FIXME? UnsafePointer
- default:
- switch v.kind {
- case valueObject:
- obj := v.object()
- switch vl := obj.value.(type) {
- case *goStructObject: // Struct
- return reflect.ValueOf(vl.value.Interface()), nil
- case *goMapObject: // Map
- return reflect.ValueOf(vl.value.Interface()), nil
- case *goArrayObject: // Array
- return reflect.ValueOf(vl.value.Interface()), nil
- case *goSliceObject: // Slice
- return reflect.ValueOf(vl.value.Interface()), nil
- }
- exported := reflect.ValueOf(v.export())
- if exported.Type().ConvertibleTo(typ) {
- return exported.Convert(typ), nil
- }
- return reflect.Value{}, fmt.Errorf("TypeError: could not convert %v to reflect.Type: %v", exported, typ)
- case valueEmpty, valueResult, valueReference:
- // These are invalid, and should panic
- default:
- return reflect.ValueOf(v.value), nil
- }
- }
-
- // FIXME Should this end up as a TypeError?
- panic(fmt.Errorf("invalid conversion of %v (%v) to reflect.Type: %v", v.kind, v, typ))
-}
-
-func stringToReflectValue(value string, kind reflect.Kind) (reflect.Value, error) {
- switch kind {
- case reflect.Bool:
- value, err := strconv.ParseBool(value)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(value), nil
- case reflect.Int:
- value, err := strconv.ParseInt(value, 0, 0)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(int(value)), nil
- case reflect.Int8:
- value, err := strconv.ParseInt(value, 0, 8)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(int8(value)), nil
- case reflect.Int16:
- value, err := strconv.ParseInt(value, 0, 16)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(int16(value)), nil
- case reflect.Int32:
- value, err := strconv.ParseInt(value, 0, 32)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(int32(value)), nil
- case reflect.Int64:
- value, err := strconv.ParseInt(value, 0, 64)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(value), nil
- case reflect.Uint:
- value, err := strconv.ParseUint(value, 0, 0)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(uint(value)), nil
- case reflect.Uint8:
- value, err := strconv.ParseUint(value, 0, 8)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(uint8(value)), nil
- case reflect.Uint16:
- value, err := strconv.ParseUint(value, 0, 16)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(uint16(value)), nil
- case reflect.Uint32:
- value, err := strconv.ParseUint(value, 0, 32)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(uint32(value)), nil
- case reflect.Uint64:
- value, err := strconv.ParseUint(value, 0, 64)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(value), nil
- case reflect.Float32:
- value, err := strconv.ParseFloat(value, 32)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(float32(value)), nil
- case reflect.Float64:
- value, err := strconv.ParseFloat(value, 64)
- if err != nil {
- return reflect.Value{}, err
- }
- return reflect.ValueOf(value), nil
- case reflect.String:
- return reflect.ValueOf(value), nil
- }
-
- // FIXME This should end up as a TypeError?
- panic(fmt.Errorf("invalid conversion of %q to reflect.Kind: %v", value, kind))
-}
-
-// MarshalJSON implements json.Marshaller.
-func (v Value) MarshalJSON() ([]byte, error) {
- switch v.kind {
- case valueUndefined, valueNull:
- return []byte("null"), nil
- case valueBoolean, valueNumber:
- return json.Marshal(v.value)
- case valueString:
- return json.Marshal(v.string())
- case valueObject:
- return v.Object().MarshalJSON()
- }
- return nil, fmt.Errorf("invalid type %v", v.kind)
-}
diff --git a/vendor/github.com/robertkrimen/otto/value_boolean.go b/vendor/github.com/robertkrimen/otto/value_boolean.go
deleted file mode 100644
index 670ecab..0000000
--- a/vendor/github.com/robertkrimen/otto/value_boolean.go
+++ /dev/null
@@ -1,40 +0,0 @@
-package otto
-
-import (
- "fmt"
- "math"
- "reflect"
- "unicode/utf16"
-)
-
-func (v Value) bool() bool {
- if v.kind == valueBoolean {
- return v.value.(bool)
- }
- if v.IsUndefined() || v.IsNull() {
- return false
- }
- switch value := v.value.(type) {
- case bool:
- return value
- case int, int8, int16, int32, int64:
- return reflect.ValueOf(value).Int() != 0
- case uint, uint8, uint16, uint32, uint64:
- return reflect.ValueOf(value).Uint() != 0
- case float32:
- return value != 0
- case float64:
- if math.IsNaN(value) || value == 0 {
- return false
- }
- return true
- case string:
- return len(value) != 0
- case []uint16:
- return len(utf16.Decode(value)) != 0
- }
- if v.IsObject() {
- return true
- }
- panic(fmt.Sprintf("unexpected boolean type %T", v.value))
-}
diff --git a/vendor/github.com/robertkrimen/otto/value_kind.gen.go b/vendor/github.com/robertkrimen/otto/value_kind.gen.go
deleted file mode 100644
index cf99c0a..0000000
--- a/vendor/github.com/robertkrimen/otto/value_kind.gen.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Code generated by "stringer -type=valueKind -trimprefix=value -output=value_kind.gen.go"; DO NOT EDIT.
-
-package otto
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[valueUndefined-0]
- _ = x[valueNull-1]
- _ = x[valueNumber-2]
- _ = x[valueString-3]
- _ = x[valueBoolean-4]
- _ = x[valueObject-5]
- _ = x[valueEmpty-6]
- _ = x[valueResult-7]
- _ = x[valueReference-8]
-}
-
-const _valueKind_name = "UndefinedNullNumberStringBooleanObjectEmptyResultReference"
-
-var _valueKind_index = [...]uint8{0, 9, 13, 19, 25, 32, 38, 43, 49, 58}
-
-func (i valueKind) String() string {
- if i < 0 || i >= valueKind(len(_valueKind_index)-1) {
- return "valueKind(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _valueKind_name[_valueKind_index[i]:_valueKind_index[i+1]]
-}
diff --git a/vendor/github.com/robertkrimen/otto/value_number.go b/vendor/github.com/robertkrimen/otto/value_number.go
deleted file mode 100644
index 6f14b4b..0000000
--- a/vendor/github.com/robertkrimen/otto/value_number.go
+++ /dev/null
@@ -1,336 +0,0 @@
-package otto
-
-import (
- "errors"
- "fmt"
- "math"
- "regexp"
- "strconv"
- "strings"
-)
-
-var stringToNumberParseInteger = regexp.MustCompile(`^(?:0[xX])`)
-
-func parseNumber(value string) float64 {
- value = strings.Trim(value, builtinStringTrimWhitespace)
-
- if value == "" {
- return 0
- }
-
- var parseFloat bool
- switch {
- case strings.ContainsRune(value, '.'):
- parseFloat = true
- case stringToNumberParseInteger.MatchString(value):
- parseFloat = false
- default:
- parseFloat = true
- }
-
- if parseFloat {
- number, err := strconv.ParseFloat(value, 64)
- if err != nil && !errors.Is(err, strconv.ErrRange) {
- return math.NaN()
- }
- return number
- }
-
- number, err := strconv.ParseInt(value, 0, 64)
- if err != nil {
- return math.NaN()
- }
- return float64(number)
-}
-
-func (v Value) float64() float64 {
- switch v.kind {
- case valueUndefined:
- return math.NaN()
- case valueNull:
- return 0
- }
- switch value := v.value.(type) {
- case bool:
- if value {
- return 1
- }
- return 0
- case int:
- return float64(value)
- case int8:
- return float64(value)
- case int16:
- return float64(value)
- case int32:
- return float64(value)
- case int64:
- return float64(value)
- case uint:
- return float64(value)
- case uint8:
- return float64(value)
- case uint16:
- return float64(value)
- case uint32:
- return float64(value)
- case uint64:
- return float64(value)
- case float64:
- return value
- case string:
- return parseNumber(value)
- case *object:
- return value.DefaultValue(defaultValueHintNumber).float64()
- }
- panic(fmt.Errorf("toFloat(%T)", v.value))
-}
-
-const (
- sqrt1_2 float64 = math.Sqrt2 / 2
-)
-
-const (
- maxUint32 = math.MaxUint32
- maxInt = int(^uint(0) >> 1)
-
- // int64.
- int64MaxInt8 int64 = math.MaxInt8
- int64MinInt8 int64 = math.MinInt8
- int64MaxInt16 int64 = math.MaxInt16
- int64MinInt16 int64 = math.MinInt16
- int64MaxInt32 int64 = math.MaxInt32
- int64MinInt32 int64 = math.MinInt32
- int64MaxUint8 int64 = math.MaxUint8
- int64MaxUint16 int64 = math.MaxUint16
- int64MaxUint32 int64 = math.MaxUint32
-
- // float64.
- floatMaxInt float64 = float64(int(^uint(0) >> 1))
- floatMinInt float64 = float64(-maxInt - 1)
- floatMaxUint float64 = float64(^uint(0))
- floatMaxUint64 float64 = math.MaxUint64
- floatMaxInt64 float64 = math.MaxInt64
- floatMinInt64 float64 = math.MinInt64
-)
-
-func toIntegerFloat(value Value) float64 {
- float := value.float64()
- switch {
- case math.IsInf(float, 0):
- return float
- case math.IsNaN(float):
- return 0
- case float > 0:
- return math.Floor(float)
- default:
- return math.Ceil(float)
- }
-}
-
-type numberKind int
-
-const (
- numberInteger numberKind = iota // 3.0 => 3.0
- numberFloat // 3.14159 => 3.0, 1+2**63 > 2**63-1
- numberInfinity // Infinity => 2**63-1
- numberNaN // NaN => 0
-)
-
-type _number struct {
- kind numberKind
- int64 int64
- float64 float64
-}
-
-// FIXME
-// http://www.goinggo.net/2013/08/gustavos-ieee-754-brain-teaser.html
-// http://bazaar.launchpad.net/~niemeyer/strepr/trunk/view/6/strepr.go#L160
-func (v Value) number() _number {
- var num _number
- switch value := v.value.(type) {
- case int8:
- num.int64 = int64(value)
- return num
- case int16:
- num.int64 = int64(value)
- return num
- case uint8:
- num.int64 = int64(value)
- return num
- case uint16:
- num.int64 = int64(value)
- return num
- case uint32:
- num.int64 = int64(value)
- return num
- case int:
- num.int64 = int64(value)
- return num
- case int64:
- num.int64 = value
- return num
- }
-
- float := v.float64()
- if float == 0 {
- return num
- }
-
- num.kind = numberFloat
- num.float64 = float
-
- if math.IsNaN(float) {
- num.kind = numberNaN
- return num
- }
-
- if math.IsInf(float, 0) {
- num.kind = numberInfinity
- }
-
- if float >= floatMaxInt64 {
- num.int64 = math.MaxInt64
- return num
- }
-
- if float <= floatMinInt64 {
- num.int64 = math.MinInt64
- return num
- }
-
- var integer float64
- if float > 0 {
- integer = math.Floor(float)
- } else {
- integer = math.Ceil(float)
- }
-
- if float == integer {
- num.kind = numberInteger
- }
- num.int64 = int64(float)
- return num
-}
-
-// ECMA 262: 9.5.
-func toInt32(value Value) int32 {
- switch value := value.value.(type) {
- case int8:
- return int32(value)
- case int16:
- return int32(value)
- case int32:
- return value
- }
-
- floatValue := value.float64()
- if math.IsNaN(floatValue) || math.IsInf(floatValue, 0) || floatValue == 0 {
- return 0
- }
-
- // Convert to int64 before int32 to force correct wrapping.
- return int32(int64(floatValue))
-}
-
-func toUint32(value Value) uint32 {
- switch value := value.value.(type) {
- case int8:
- return uint32(value)
- case int16:
- return uint32(value)
- case uint8:
- return uint32(value)
- case uint16:
- return uint32(value)
- case uint32:
- return value
- }
-
- floatValue := value.float64()
- if math.IsNaN(floatValue) || math.IsInf(floatValue, 0) || floatValue == 0 {
- return 0
- }
-
- // Convert to int64 before uint32 to force correct wrapping.
- return uint32(int64(floatValue))
-}
-
-// ECMA 262 - 6.0 - 7.1.8.
-func toUint16(value Value) uint16 {
- switch value := value.value.(type) {
- case int8:
- return uint16(value)
- case uint8:
- return uint16(value)
- case uint16:
- return value
- }
-
- floatValue := value.float64()
- if math.IsNaN(floatValue) || math.IsInf(floatValue, 0) || floatValue == 0 {
- return 0
- }
-
- // Convert to int64 before uint16 to force correct wrapping.
- return uint16(int64(floatValue))
-}
-
-// toIntSign returns sign of a number converted to -1, 0 ,1.
-func toIntSign(value Value) int {
- switch value := value.value.(type) {
- case int8:
- if value > 0 {
- return 1
- } else if value < 0 {
- return -1
- }
-
- return 0
- case int16:
- if value > 0 {
- return 1
- } else if value < 0 {
- return -1
- }
-
- return 0
- case int32:
- if value > 0 {
- return 1
- } else if value < 0 {
- return -1
- }
-
- return 0
- case uint8:
- if value > 0 {
- return 1
- }
-
- return 0
- case uint16:
- if value > 0 {
- return 1
- }
-
- return 0
- case uint32:
- if value > 0 {
- return 1
- }
-
- return 0
- }
- floatValue := value.float64()
- switch {
- case math.IsNaN(floatValue), math.IsInf(floatValue, 0):
- return 0
- case floatValue == 0:
- return 0
- case floatValue > 0:
- return 1
- default:
- return -1
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/value_primitive.go b/vendor/github.com/robertkrimen/otto/value_primitive.go
deleted file mode 100644
index 23f8e81..0000000
--- a/vendor/github.com/robertkrimen/otto/value_primitive.go
+++ /dev/null
@@ -1,20 +0,0 @@
-package otto
-
-func toNumberPrimitive(value Value) Value {
- return toPrimitive(value, defaultValueHintNumber)
-}
-
-func toPrimitiveValue(value Value) Value {
- return toPrimitive(value, defaultValueNoHint)
-}
-
-func toPrimitive(value Value, hint defaultValueHint) Value {
- switch value.kind {
- case valueNull, valueUndefined, valueNumber, valueString, valueBoolean:
- return value
- case valueObject:
- return value.object().DefaultValue(hint)
- default:
- panic(hereBeDragons(value.kind, value))
- }
-}
diff --git a/vendor/github.com/robertkrimen/otto/value_string.go b/vendor/github.com/robertkrimen/otto/value_string.go
deleted file mode 100644
index 2af5bc3..0000000
--- a/vendor/github.com/robertkrimen/otto/value_string.go
+++ /dev/null
@@ -1,106 +0,0 @@
-package otto
-
-import (
- "fmt"
- "math"
- "regexp"
- "strconv"
- "unicode/utf16"
-)
-
-var matchLeading0Exponent = regexp.MustCompile(`([eE][\+\-])0+([1-9])`) // 1e-07 => 1e-7
-
-// FIXME
-// https://code.google.com/p/v8/source/browse/branches/bleeding_edge/src/conversions.cc?spec=svn18082&r=18082
-func floatToString(value float64, bitsize int) string {
- // TODO Fit to ECMA-262 9.8.1 specification
- if math.IsNaN(value) {
- return "NaN"
- } else if math.IsInf(value, 0) {
- if math.Signbit(value) {
- return "-Infinity"
- }
- return "Infinity"
- }
- exponent := math.Log10(math.Abs(value))
- if exponent >= 21 || exponent < -6 {
- return matchLeading0Exponent.ReplaceAllString(strconv.FormatFloat(value, 'g', -1, bitsize), "$1$2")
- }
- return strconv.FormatFloat(value, 'f', -1, bitsize)
-}
-
-func numberToStringRadix(value Value, radix int) string {
- float := value.float64()
- switch {
- case math.IsNaN(float):
- return "NaN"
- case math.IsInf(float, 1):
- return "Infinity"
- case math.IsInf(float, -1):
- return "-Infinity"
- case float == 0:
- return "0"
- }
- // FIXME This is very broken
- // Need to do proper radix conversion for floats, ...
- // This truncates large floats (so bad).
- return strconv.FormatInt(int64(float), radix)
-}
-
-func (v Value) string() string {
- if v.kind == valueString {
- switch value := v.value.(type) {
- case string:
- return value
- case []uint16:
- return string(utf16.Decode(value))
- }
- }
- if v.IsUndefined() {
- return "undefined"
- }
- if v.IsNull() {
- return "null"
- }
- switch value := v.value.(type) {
- case bool:
- return strconv.FormatBool(value)
- case int:
- return strconv.FormatInt(int64(value), 10)
- case int8:
- return strconv.FormatInt(int64(value), 10)
- case int16:
- return strconv.FormatInt(int64(value), 10)
- case int32:
- return strconv.FormatInt(int64(value), 10)
- case int64:
- return strconv.FormatInt(value, 10)
- case uint:
- return strconv.FormatUint(uint64(value), 10)
- case uint8:
- return strconv.FormatUint(uint64(value), 10)
- case uint16:
- return strconv.FormatUint(uint64(value), 10)
- case uint32:
- return strconv.FormatUint(uint64(value), 10)
- case uint64:
- return strconv.FormatUint(value, 10)
- case float32:
- if value == 0 {
- return "0" // Take care not to return -0
- }
- return floatToString(float64(value), 32)
- case float64:
- if value == 0 {
- return "0" // Take care not to return -0
- }
- return floatToString(value, 64)
- case []uint16:
- return string(utf16.Decode(value))
- case string:
- return value
- case *object:
- return value.DefaultValue(defaultValueHintString).string()
- }
- panic(fmt.Errorf("%v.string( %T)", v.value, v.value))
-}
diff --git a/vendor/github.com/tylertravisty/go-utils/LICENSE b/vendor/github.com/tylertravisty/go-utils/LICENSE
deleted file mode 100644
index 978afcd..0000000
--- a/vendor/github.com/tylertravisty/go-utils/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2021 Tyler
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/tylertravisty/go-utils/random/random.go b/vendor/github.com/tylertravisty/go-utils/random/random.go
deleted file mode 100644
index 3cb1512..0000000
--- a/vendor/github.com/tylertravisty/go-utils/random/random.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package random
-
-import (
- "crypto/rand"
- "encoding/base64"
- "fmt"
-)
-
-// Bytes creates an array of random bytes with specified size.
-// If used to generate password salt, then size of 16 bytes (128 bits) is recommended.
-func Bytes(size int) ([]byte, error) {
- if size < 0 {
- return nil, fmt.Errorf("random: size cannot be less than zero")
- }
- random := make([]byte, size)
-
- _, err := rand.Read(random)
- if err != nil {
- return nil, fmt.Errorf("random: error while reading random bytes: %v", err)
- }
-
- return random, nil
-}
-
-// String creates a Base64-encoded string of random bytes with specified length.
-// If used to generate a session token, then length of 48 (36 bytes) is recommended.
-func String(length int) (string, error) {
- b, err := Bytes(length)
- if err != nil {
- return "", fmt.Errorf("random: error while generating random bytes: %v", err)
- }
-
- str := base64.URLEncoding.EncodeToString(b)
-
- return str[:length], nil
-}
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/.gitignore b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/.gitignore
deleted file mode 100644
index 3b735ec..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-# If you prefer the allow list template instead of the deny list, see community template:
-# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
-#
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-
-# Test binary, built with `go test -c`
-*.test
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
-# Dependency directories (remove the comment below to include it)
-# vendor/
-
-# Go workspace file
-go.work
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/LICENSE b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/LICENSE
deleted file mode 100644
index d86c037..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2023 Tyler Travis
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/README.md b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/README.md
deleted file mode 100644
index c9b6bdf..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# rumble-livestream-lib-go
-Go library for accessing Rumble's Live Stream API
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/chat.go b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/chat.go
deleted file mode 100644
index f06635c..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/chat.go
+++ /dev/null
@@ -1,408 +0,0 @@
-package rumblelivestreamlib
-
-import (
- "bufio"
- "bytes"
- "context"
- "encoding/csv"
- "encoding/json"
- "fmt"
- "net/http"
- "strconv"
- "strings"
- "time"
-
- "github.com/r3labs/sse/v2"
- "github.com/tylertravisty/go-utils/random"
- "gopkg.in/cenkalti/backoff.v1"
-)
-
-type ChatInfo struct {
- UrlPrefix string
- ChatID string
- ChannelID int
-}
-
-func (ci *ChatInfo) MessageUrl() string {
- return fmt.Sprintf("%s/chat/%s/message", ci.UrlPrefix, ci.ChatID)
-}
-
-func (ci *ChatInfo) StreamUrl() string {
- return fmt.Sprintf("%s/chat/%s/stream", ci.UrlPrefix, ci.ChatID)
-}
-
-func (c *Client) ChatInfo() error {
- ci, err := c.getChatInfo()
- if err != nil {
- return pkgErr("error getting chat info", err)
- }
-
- c.chatInfo = ci
- return nil
-}
-
-func (c *Client) getChatInfo() (*ChatInfo, error) {
- if c.StreamUrl == "" {
- return nil, fmt.Errorf("stream url is empty")
- }
-
- resp, err := c.getWebpage(c.StreamUrl)
- if err != nil {
- return nil, fmt.Errorf("error getting stream webpage: %v", err)
- }
- defer resp.Body.Close()
-
- r := bufio.NewReader(resp.Body)
- line, _, err := r.ReadLine()
- var lineS string
- for err == nil {
- lineS = string(line)
- if strings.Contains(lineS, "RumbleChat(") {
- start := strings.Index(lineS, "RumbleChat(") + len("RumbleChat(")
- end := strings.Index(lineS[start:], ");")
- argsS := strings.ReplaceAll(lineS[start:start+end], ", ", ",")
- argsS = strings.Replace(argsS, "[", "\"[", 1)
- n := strings.LastIndex(argsS, "]")
- argsS = argsS[:n] + "]\"" + argsS[n+1:]
- c := csv.NewReader(strings.NewReader(argsS))
- args, err := c.ReadAll()
- if err != nil {
- return nil, fmt.Errorf("error parsing csv: %v", err)
- }
- info := args[0]
- channelID, err := strconv.Atoi(info[5])
- if err != nil {
- return nil, fmt.Errorf("error converting channel ID argument string to int: %v", err)
- }
- return &ChatInfo{info[0], info[1], channelID}, nil
- }
- line, _, err = r.ReadLine()
- }
- if err != nil {
- return nil, fmt.Errorf("error reading line from stream webpage: %v", err)
- }
-
- return nil, fmt.Errorf("did not find RumbleChat function call")
-}
-
-type ChatMessage struct {
- Text string `json:"text"`
-}
-
-type ChatData struct {
- RequestID string `json:"request_id"`
- Message ChatMessage `json:"message"`
- Rant *string `json:"rant"`
- ChannelID *int `json:"channel_id"`
-}
-
-type ChatRequest struct {
- Data ChatData `json:"data"`
-}
-
-type Error struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Type string `json:"type"`
-}
-
-type ChatResponse struct {
- Errors []Error `json:"errors"`
-}
-
-func (c *Client) Chat(asChannel bool, message string) error {
- if c.httpClient == nil {
- return pkgErr("", fmt.Errorf("http client is nil"))
- }
-
- // chatInfo, err := c.streamChatInfo()
- // if err != nil {
- // return pkgErr("error getting stream chat info", err)
- // }
- if c.chatInfo == nil {
- err := c.ChatInfo()
- if err != nil {
- return err
- }
- }
-
- requestID, err := random.String(32)
- if err != nil {
- return pkgErr("error generating request ID", err)
- }
- body := ChatRequest{
- Data: ChatData{
- RequestID: requestID,
- Message: ChatMessage{
- Text: message,
- },
- Rant: nil,
- ChannelID: nil,
- },
- }
- if asChannel {
- body.Data.ChannelID = &c.chatInfo.ChannelID
- }
-
- bodyB, err := json.Marshal(body)
- if err != nil {
- return pkgErr("error marshaling request body into json", err)
- }
-
- resp, err := c.httpClient.Post(c.chatInfo.MessageUrl(), "application/json", bytes.NewReader(bodyB))
- if err != nil {
- return pkgErr("http Post request returned error", err)
- }
- defer resp.Body.Close()
-
- if resp.StatusCode != http.StatusOK {
- return fmt.Errorf("http Post response status not %s: %s", http.StatusText(http.StatusOK), resp.Status)
- }
-
- var cr ChatResponse
- err = json.NewDecoder(strings.NewReader(string(bodyB))).Decode(&cr)
- if err != nil {
- return fmt.Errorf("error decoding response body from server: %v", err)
- }
-
- if len(cr.Errors) != 0 {
- return fmt.Errorf("server returned an error: %s", cr.Errors[0].Message)
- }
-
- return nil
-}
-
-type ChatStream struct {
- sseClient *sse.Client
- sseEvent chan *sse.Event
- stop context.CancelFunc
-}
-
-type ChatEventChannel struct {
- ID string `json:"id"`
- Image1 string `json:"image.1"`
- Link string `json:"link"`
- Username string `json:"username"`
-}
-
-type ChatEventBlockData struct {
- Text string `json:"text"`
-}
-
-type ChatEventBlock struct {
- Data ChatEventBlockData `json:"data"`
- Type string `json:"type"`
-}
-
-type ChatEventRant struct {
- Duration int `json:"duration"`
- ExpiresOn string `json:"expires_on"`
- PriceCents int `json:"price_cents"`
-}
-
-type ChatEventMessage struct {
- Blocks []ChatEventBlock `json:"blocks"`
- ChannelID *int64 `json:"channel_id"`
- ID string `json:"id"`
- Rant *ChatEventRant `json:"rant"`
- Text string `json:"text"`
- Time string `json:"time"`
- UserID string `json:"user_id"`
-}
-
-type ChatEventUser struct {
- Badges []string `json:"badges"`
- Color string `json:"color"`
- ID string `json:"id"`
- Image1 string `json:"image.1"`
- IsFollower bool `json:"is_follower"`
- Link string `json:"link"`
- Username string `json:"username"`
-}
-
-type ChatEventData struct {
- Channels []ChatEventChannel `json:"channels"`
- Messages []ChatEventMessage `json:"messages"`
- Users []ChatEventUser `json:"users"`
-}
-
-type ChatEvent struct {
- Data ChatEventData `json:"data"`
- RequestID string `json:"request_id"`
- Type string `json:"type"`
-}
-
-type ChatEventDataNoChannels struct {
- // TODO: change [][]string to [][]any and test
- Channels [][]string `json:"channels"`
- Messages []ChatEventMessage `json:"messages"`
- Users []ChatEventUser `json:"users"`
-}
-
-type ChatEventNoChannels struct {
- Data ChatEventDataNoChannels `json:"data"`
- RequestID string `json:"request_id"`
- Type string `json:"type"`
-}
-
-func (c *Client) StartChatStream(handle func(cv ChatView), handleError func(err error)) error {
- c.chatStreamMu.Lock()
- defer c.chatStreamMu.Unlock()
- if c.chatStream != nil {
- return pkgErr("", fmt.Errorf("chat stream already started"))
- }
- sseEvent := make(chan *sse.Event)
- sseCl := sse.NewClient(c.chatInfo.StreamUrl())
- ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
- sseCl.ReconnectStrategy = backoff.WithContext(
- backoff.NewExponentialBackOff(),
- ctx,
- )
-
- err := sseCl.SubscribeChan("", sseEvent)
- if err != nil {
- cancel()
- return pkgErr(fmt.Sprintf("error subscribing to chat stream %s", c.chatInfo.StreamUrl()), err)
- }
-
- streamCtx, stop := context.WithCancel(context.Background())
-
- c.chatStream = &ChatStream{sseClient: sseCl, sseEvent: sseEvent, stop: stop}
- go startChatStream(streamCtx, sseEvent, handle, handleError)
-
- return nil
-}
-
-func (c *Client) StopChatStream() {
- c.chatStreamMu.Lock()
- defer c.chatStreamMu.Unlock()
-
- if c.chatStream == nil {
- return
- }
- // TODO: what order should these be in?
- if c.chatStream.sseClient != nil {
- c.chatStream.sseClient.Unsubscribe(c.chatStream.sseEvent)
- }
- if c.chatStream.stop != nil {
- c.chatStream.stop()
- }
-
- c.chatStream = nil
-}
-
-func startChatStream(ctx context.Context, event chan *sse.Event, handle func(cv ChatView), handleError func(err error)) {
- for {
- select {
- case <-ctx.Done():
- return
- case msg := <-event:
- if msg == nil {
- handleError(fmt.Errorf("received nil event"))
- } else {
- chats, err := parseEvent(msg.Data)
- if err != nil {
- handleError(err)
- } else {
- for _, chat := range chats {
- handle(chat)
- }
- }
- }
- }
- }
-}
-
-type ChatView struct {
- Badges []string
- ChannelName string
- Color string
- ImageUrl string
- Init bool
- IsFollower bool
- Rant int
- Text string
- Type string
- Username string
-}
-
-func parseEvent(event []byte) ([]ChatView, error) {
- var ce ChatEvent
- err := json.Unmarshal(event, &ce)
- if err != nil {
- var cenc ChatEventNoChannels
- errNC := json.Unmarshal(event, &cenc)
- if errNC != nil {
- return nil, fmt.Errorf("error un-marshaling event: %v", err)
- }
-
- ce.Data.Messages = cenc.Data.Messages
- ce.Data.Users = cenc.Data.Users
- ce.Type = cenc.Type
- }
-
- users := chatUsers(ce.Data.Users)
- channels := chatChannels(ce.Data.Channels)
-
- messages, err := parseMessages(ce.Type, ce.Data.Messages, users, channels)
- if err != nil {
- return nil, fmt.Errorf("error parsing messages: %v", err)
- }
-
- return messages, nil
-}
-
-func chatUsers(users []ChatEventUser) map[string]ChatEventUser {
- usersMap := map[string]ChatEventUser{}
- for _, user := range users {
- usersMap[user.ID] = user
- }
-
- return usersMap
-}
-
-func chatChannels(channels []ChatEventChannel) map[string]ChatEventChannel {
- channelsMap := map[string]ChatEventChannel{}
- for _, channel := range channels {
- channelsMap[channel.ID] = channel
- }
-
- return channelsMap
-}
-
-func parseMessages(eventType string, messages []ChatEventMessage, users map[string]ChatEventUser, channels map[string]ChatEventChannel) ([]ChatView, error) {
- views := []ChatView{}
- for _, message := range messages {
- var view ChatView
- user, exists := users[message.UserID]
- if !exists {
- return nil, fmt.Errorf("user ID does not exist: %s", message.UserID)
- }
-
- view.Badges = user.Badges
- view.Color = user.Color
- view.ImageUrl = user.Image1
- view.IsFollower = user.IsFollower
- if message.Rant != nil {
- view.Rant = message.Rant.PriceCents
- }
- view.Text = message.Text
- view.Type = eventType
- view.Username = user.Username
-
- if message.ChannelID != nil {
- cid := strconv.Itoa(int(*message.ChannelID))
- channel, exists := channels[cid]
- if !exists {
- return nil, fmt.Errorf("channel ID does not exist: %d", *message.ChannelID)
- }
-
- view.ImageUrl = channel.Image1
- view.ChannelName = channel.Username
- }
-
- views = append(views, view)
- }
-
- return views, nil
-}
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/client.go b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/client.go
deleted file mode 100644
index 499c23a..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/client.go
+++ /dev/null
@@ -1,303 +0,0 @@
-package rumblelivestreamlib
-
-import (
- "encoding/json"
- "fmt"
- "io"
- "net/http"
- "net/http/cookiejar"
- "net/url"
- "strings"
- "sync"
-
- "github.com/robertkrimen/otto"
-)
-
-const (
- domain = "rumble.com"
- urlWeb = "https://" + domain
- urlAccount = urlWeb + "/account/"
- urlGetSalts = urlWeb + "/service.php?name=user.get_salts"
- urlUserLogin = urlWeb + "/service.php?name=user.login"
- urlUserLogout = urlWeb + "/service.php?name=user.logout"
-)
-
-type Client struct {
- httpClient *http.Client
- chatInfo *ChatInfo
- chatStream *ChatStream
- chatStreamMu sync.Mutex
- StreamKey string
- StreamUrl string
-}
-
-func (c *Client) cookies() ([]*http.Cookie, error) {
- u, err := url.Parse(urlWeb)
- if err != nil {
- return nil, fmt.Errorf("error parsing domain: %v", err)
- }
- return c.httpClient.Jar.Cookies(u), nil
-}
-
-func (c *Client) PrintCookies() error {
- cookies, err := c.cookies()
- if err != nil {
- return pkgErr("error getting cookies", err)
- }
- fmt.Println("Cookies:", len(cookies))
- for _, cookie := range cookies {
- fmt.Println(cookie.String())
- }
-
- return nil
-}
-
-type NewClientOptions struct {
- Cookies []*http.Cookie `json:"cookies"`
- StreamKey string `json:"stream_key"`
- StreamUrl string `json:"stream_url"`
-}
-
-func NewClient(opts NewClientOptions) (*Client, error) {
- cl, err := newHttpClient(opts.Cookies)
- if err != nil {
- return nil, pkgErr("error creating http client", err)
- }
-
- return &Client{httpClient: cl, StreamKey: opts.StreamKey, StreamUrl: opts.StreamUrl}, nil
-}
-
-func newHttpClient(cookies []*http.Cookie) (*http.Client, error) {
- jar, err := cookiejar.New(nil)
- if err != nil {
- return nil, fmt.Errorf("error creating cookiejar: %v", err)
- }
-
- url, err := url.Parse(urlWeb)
- if err != nil {
- return nil, fmt.Errorf("error parsing domain: %v", err)
- }
- jar.SetCookies(url, cookies)
-
- return &http.Client{Jar: jar}, nil
-}
-
-type GetSaltsData struct {
- Salts []string `json:"salts"`
-}
-
-type GetSaltsResponse struct {
- Data GetSaltsData `json:"data"`
-}
-
-func (c *Client) Login(username string, password string) ([]*http.Cookie, error) {
- if c.httpClient == nil {
- return nil, pkgErr("", fmt.Errorf("http client is nil"))
- }
-
- salts, err := c.getSalts(username)
- if err != nil {
- return nil, pkgErr("error getting salts", err)
- }
-
- cookies, err := c.userLogin(username, password, salts)
- if err != nil {
- return nil, pkgErr("error logging in", err)
- }
-
- return cookies, nil
-}
-
-func (c *Client) getWebpage(url string) (*http.Response, error) {
- resp, err := c.httpClient.Get(url)
- if err != nil {
- return nil, fmt.Errorf("http Get request returned error: %v", err)
- }
- if resp.StatusCode != http.StatusOK {
- resp.Body.Close()
- return nil, fmt.Errorf("http Get response status not %s: %s", http.StatusText(http.StatusOK), resp.Status)
- }
-
- return resp, nil
-}
-
-func (c *Client) getSalts(username string) ([]string, error) {
- u := url.URL{}
- q := u.Query()
- q.Add("username", username)
- body := q.Encode()
- resp, err := c.httpClient.Post(urlGetSalts, "application/x-www-form-urlencoded", strings.NewReader(body))
- if err != nil {
- return nil, fmt.Errorf("http Post request returned error: %v", err)
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("http Post response status not %s: %s", http.StatusText(http.StatusOK), resp.Status)
- }
-
- bodyB, err := io.ReadAll(resp.Body)
- if err != nil {
- return nil, fmt.Errorf("error reading body bytes: %v", err)
- }
-
- var gsr GetSaltsResponse
- err = json.NewDecoder(strings.NewReader(string(bodyB))).Decode(&gsr)
- if err != nil {
- return nil, fmt.Errorf("error decoding response body from server: %v", err)
- }
-
- return gsr.Data.Salts, nil
-}
-
-type DataBool struct {
- Session bool `json:"session"`
-}
-
-type LoginResponseBool struct {
- Data DataBool `json:"data"`
-}
-
-type DataString struct {
- Session string `json:"session"`
-}
-
-type LoginResponseString struct {
- Data DataString `json:"data"`
-}
-
-func loginResponseSession(body []byte) (string, error) {
- bodyS := string(body)
-
- var lrs LoginResponseString
- err := json.NewDecoder(strings.NewReader(bodyS)).Decode(&lrs)
- if err == nil {
- return lrs.Data.Session, nil
- }
-
- var lrb LoginResponseBool
- err = json.NewDecoder(strings.NewReader(bodyS)).Decode(&lrb)
- if err == nil {
- return "false", nil
- }
-
- return "", fmt.Errorf("error decoding login response")
-}
-
-func (c *Client) userLogin(username string, password string, salts []string) ([]*http.Cookie, error) {
- hashes, err := generateHashes(password, salts)
- if err != nil {
- return nil, fmt.Errorf("error generating password hashes: %v", err)
- }
-
- u := url.URL{}
- q := u.Query()
- q.Add("username", username)
- q.Add("password_hashes", hashes)
- body := q.Encode()
- resp, err := c.httpClient.Post(urlUserLogin, "application/x-www-form-urlencoded", strings.NewReader(body))
- if err != nil {
- return nil, fmt.Errorf("http Post request returned error: %v", err)
- }
- defer resp.Body.Close()
-
- if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("http Post response status not %s: %s", http.StatusText(http.StatusOK), resp.Status)
- }
-
- bodyB, err := io.ReadAll(resp.Body)
- if err != nil {
- return nil, fmt.Errorf("error reading body bytes: %v", err)
- }
-
- session, err := loginResponseSession(bodyB)
- if err != nil {
- return nil, fmt.Errorf("error getting login response session: %v", err)
- }
-
- if session == "false" {
- return nil, fmt.Errorf("failed to log in")
- }
-
- return resp.Cookies(), nil
-}
-
-func generateHashes(password string, salts []string) (string, error) {
- vm := otto.New()
-
- vm.Set("password", password)
- vm.Set("salt0", salts[0])
- vm.Set("salt1", salts[1])
- vm.Set("salt2", salts[2])
-
- _, err := vm.Run(md5)
- if err != nil {
- return "", fmt.Errorf("error running md5 javascript: %v", err)
- }
-
- value, err := vm.Get("hashes")
- if err != nil {
- return "", fmt.Errorf("error getting hashes value: %v", err)
- }
-
- hashes, err := value.ToString()
- if err != nil {
- return "", fmt.Errorf("error converting hashes value to string: %v", err)
- }
-
- return hashes, nil
-}
-
-func (c *Client) Logout() error {
- if c.httpClient == nil {
- return pkgErr("", fmt.Errorf("http client is nil"))
- }
-
- err := c.userLogout()
- if err != nil {
- return pkgErr("error logging out", err)
- }
-
- return nil
-}
-
-func (c *Client) userLogout() error {
- resp, err := c.httpClient.Get(urlUserLogout)
- if err != nil {
- return fmt.Errorf("http Get request returned error: %v", err)
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- return fmt.Errorf("http Get response status not %s: %s", http.StatusText(http.StatusOK), resp.Status)
- }
-
- return nil
-}
-
-type LoggedInResponseUser struct {
- LoggedIn bool `json:"logged_in"`
-}
-
-type LoggedInResponse struct {
- User LoggedInResponseUser `json:"user"`
-}
-
-func (c *Client) LoggedIn() (bool, error) {
- resp, err := c.httpClient.Get(urlUserLogin)
- if err != nil {
- return false, pkgErr("error getting login service", err)
- }
- defer resp.Body.Close()
-
- bodyB, err := io.ReadAll(resp.Body)
- if err != nil {
- return false, pkgErr("error reading body bytes", err)
- }
-
- var lir LoggedInResponse
- err = json.NewDecoder(strings.NewReader(string(bodyB))).Decode(&lir)
- if err != nil {
- return false, pkgErr("error un-marshaling response body", err)
- }
-
- return lir.User.LoggedIn, nil
-}
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/error.go b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/error.go
deleted file mode 100644
index 179e9f0..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/error.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package rumblelivestreamlib
-
-import "fmt"
-
-const pkgName = "rumblelivestreamlib"
-
-func pkgErr(prefix string, err error) error {
- pkgErr := pkgName
- if prefix != "" {
- pkgErr = fmt.Sprintf("%s: %s", pkgErr, prefix)
- }
-
- return fmt.Errorf("%s: %v", pkgErr, err)
-}
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/livestream.go b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/livestream.go
deleted file mode 100644
index a36d109..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/livestream.go
+++ /dev/null
@@ -1,120 +0,0 @@
-package rumblelivestreamlib
-
-import (
- "encoding/json"
- "fmt"
- "io"
- "net/http"
- "time"
-)
-
-type Follower struct {
- Username string `json:"username"`
- FollowedOn string `json:"followed_on"`
-}
-
-type Followers struct {
- NumFollowers int64 `json:"num_followers"`
- NumFollowersTotal int64 `json:"num_followers_total"`
- LatestFollower Follower `json:"latest_follower"`
- RecentFollowers []Follower `json:"recent_followers"`
-}
-
-type Subscriber struct {
- User string `json:"user"`
- Username string `json:"username"`
- AmountCents int64 `json:"amount_cents"`
- AmountDollars int64 `json:"amount_dollars"`
- SubscribedOn string `json:"subscribed_on"`
-}
-
-type Subscribers struct {
- NumSubscribers int64 `json:"num_subscribers"`
- LatestSubscriber Subscriber `json:"latest_subscriber"`
- RecentSubscribers []Subscriber `json:"recent_subscribers"`
-}
-
-type Category struct {
- Slug string `json:"slug"`
- Title string `json:"title"`
-}
-
-type Categories struct {
- Primary Category `json:"primary"`
- Secondary Category `json:"secondary"`
-}
-
-type Badge string
-
-type Message struct {
- Username string `json:"username"`
- Badges []Badge `json:"badges"`
- Text string `json:"text"`
- CreatedOn string `json:"created_on"`
-}
-
-type Rant struct {
- Message
- ExpiresOn string `json:"expires_on"`
- AmountCents int64 `json:"amount_cents"`
- AmountDollars int64 `json:"amount_dollars"`
-}
-
-type Chat struct {
- LatestMessage Message `json:"latest_message"`
- RecentMessages []Message `json:"recent_messages"`
- LatestRant Rant `json:"latest_rant"`
- RecentRants []Rant `json:"recent_rants"`
-}
-
-type Livestream struct {
- ID string `json:"id"`
- Title string `json:"title"`
- CreatedOn string `json:"created_on"`
- IsLive bool `json:"is_live"`
- Categories Categories `json:"categories"`
- StreamKey string `json:"stream_key"`
- Likes int64 `json:"likes"`
- Dislikes int64 `json:"dislikes"`
- WatchingNow int64 `json:"watching_now"`
- Chat Chat `json:"chat"`
-}
-
-type LivestreamResponse struct {
- Now int64 `json:"now"`
- Type string `json:"type"`
- UserID string `json:"user_id"`
- Username string `json:"username"`
- ChannelID int64 `json:"channel_id"`
- ChannelName string `json:"channel_name"`
- MaxNumResults int64 `json:"max_num_results"`
- Followers Followers `json:"followers"`
- Subscribers Subscribers `json:"subscribers"`
- Livestreams []Livestream `json:"livestreams"`
-}
-
-func (c *Client) Request() (*LivestreamResponse, error) {
- hcl := http.Client{Timeout: 30 * time.Second}
- resp, err := hcl.Get(c.StreamKey)
- if err != nil {
- return nil, pkgErr("http Get request returned error", err)
- }
- defer resp.Body.Close()
-
- if resp.StatusCode != http.StatusOK {
- return nil, pkgErr(fmt.Sprintf("http response status not %s", http.StatusText(http.StatusOK)), fmt.Errorf("%s", resp.Status))
- }
-
- body, err := io.ReadAll(resp.Body)
- if err != nil {
- return nil, pkgErr("error reading response body", err)
- }
-
- var lr LivestreamResponse
- err = json.Unmarshal(body, &lr)
- if err != nil {
- return nil, pkgErr("error unmarshaling response body", err)
- }
-
- return &lr, nil
-}
diff --git a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/md5.js.go b/vendor/github.com/tylertravisty/rumble-livestream-lib-go/md5.js.go
deleted file mode 100644
index ffa943e..0000000
--- a/vendor/github.com/tylertravisty/rumble-livestream-lib-go/md5.js.go
+++ /dev/null
@@ -1,85 +0,0 @@
-package rumblelivestreamlib
-
-const md5 = `
-/* @license
- * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
- * Distributed under the BSD License
- * See http://pajhome.org.uk/crypt/md5 for more info.
- */
-
-md5 = function() {
- function n(){
- this.hex="0123456789abcdef".split("")
- }
- return n.prototype={
- hash:function(n){
- var h=this;
- return h.binHex(h.binHash(h.strBin(n),n.length<<3))
- },
- hashUTF8:function(n){
- return this.hash(this.encUTF8(n))
- },
- hashRaw:function(n){
- var h=this;
- return h.binStr(h.binHash(h.strBin(n),n.length<<3))
- },
- hashRawUTF8:function(n){
- return this.hashRaw(this.encUTF8(n))
- },
- hashStretch:function(n,h,i){
- return this.binHex(this.binHashStretch(n,h,i))
- },
- binHashStretch:function(n,h,i){
- var t,r,f=this,n=f.encUTF8(n),e=h+n,g=32+n.length<<3,o=f.strBin(n),a=o.length,e=f.binHash(f.strBin(e),e.length<<3);
- for(i=i||1024,t=0;t>>6&31,128|63&h):h<=65535?t+=String.fromCharCode(224|h>>>12&15,128|h>>>6&63,128|63&h):h<=2097151&&(t+=String.fromCharCode(240|h>>>18&7,128|h>>>12&63,128|h>>>6&63,128|63&h));
- return t
- },
- strBin:function(n){
- for(var h=n.length<<3,i=[],t=0;t>5]|=(255&n.charCodeAt(t>>3))<<(31&t);
- return i
- },
- binHex:function(n){
- for(var h,i,t="",r=n.length<<5,f=0;f>5]>>>(31&f)&255)>>>4&15,t+=this.hex[i]+this.hex[h&=15];
- return t
- },
- binStr:function(n){
- for(var h,i="",t=n.length<<5,r=0;r>5]>>>(31&r)&255,i+=String.fromCharCode(h);
- return i
- },
- binHexBin:function(n){
- for(var h,i,t=n.length<<5,r=[],f=0;f>5]>>>(31&f)&255)>>>4&15,r[f>>4]|=(9>16)+(i>>16)+(r>>16)+(e>>16)+(t>>16)<<16|65535&t)<>>32-f)>>16)+(h>>16)+((t=(65535&i)+(65535&h))>>16)<<16|65535&t
- },
- gg:function(n,h,i,t,r,f,e){
- i=h&t|i&~t,t=(65535&n)+(65535&i)+(65535&r)+(65535&e);
- return((i=(i=(n>>16)+(i>>16)+(r>>16)+(e>>16)+(t>>16)<<16|65535&t)<>>32-f)>>16)+(h>>16)+((t=(65535&i)+(65535&h))>>16)<<16|65535&t
- },
- hh:function(n,h,i,t,r,f,e){
- i=h^i^t,t=(65535&n)+(65535&i)+(65535&r)+(65535&e);
- return((i=(i=(n>>16)+(i>>16)+(r>>16)+(e>>16)+(t>>16)<<16|65535&t)<>>32-f)>>16)+(h>>16)+((t=(65535&i)+(65535&h))>>16)<<16|65535&t
- },
- ii:function(n,h,i,t,r,f,e){
- i^=h|~t,t=(65535&n)+(65535&i)+(65535&r)+(65535&e);
- return((i=(i=(n>>16)+(i>>16)+(r>>16)+(e>>16)+(t>>16)<<16|65535&t)<>>32-f)>>16)+(h>>16)+((t=(65535&i)+(65535&h))>>16)<<16|65535&t
- },
- binHash:function(n,h){
- var i,t,r,f,e,g,o=1732584193,a=-271733879,u=-1732584194,s=271733878,c=this;for(n[h>>5]|=128<<(31&h),n[14+(h+64>>>9<<4)]=h,i=n.length,t=0;t>16)+(g>>16)+((g=(65535&o)+(65535&g))>>16)<<16|65535&g,a=(a>>16)+(r>>16)+((g=(65535&a)+(65535&r))>>16)<<16|65535&g,u=(u>>16)+(f>>16)+((g=(65535&u)+(65535&f))>>16)<<16|65535&g,s=(s>>16)+(e>>16)+((g=(65535&s)+(65535&e))>>16)<<16|65535&g;
- return[o,a,u,s]
- }
- },
- new n
-}();
-
-hashes = [md5.hash(md5.hashStretch(password, salt0, 128) + salt1),md5.hashStretch(password, salt2, 128), salt1]
-`
diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go
deleted file mode 100644
index cf66309..0000000
--- a/vendor/golang.org/x/net/context/context.go
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package context defines the Context type, which carries deadlines,
-// cancelation signals, and other request-scoped values across API boundaries
-// and between processes.
-// As of Go 1.7 this package is available in the standard library under the
-// name context. https://golang.org/pkg/context.
-//
-// Incoming requests to a server should create a Context, and outgoing calls to
-// servers should accept a Context. The chain of function calls between must
-// propagate the Context, optionally replacing it with a modified copy created
-// using WithDeadline, WithTimeout, WithCancel, or WithValue.
-//
-// Programs that use Contexts should follow these rules to keep interfaces
-// consistent across packages and enable static analysis tools to check context
-// propagation:
-//
-// Do not store Contexts inside a struct type; instead, pass a Context
-// explicitly to each function that needs it. The Context should be the first
-// parameter, typically named ctx:
-//
-// func DoSomething(ctx context.Context, arg Arg) error {
-// // ... use ctx ...
-// }
-//
-// Do not pass a nil Context, even if a function permits it. Pass context.TODO
-// if you are unsure about which Context to use.
-//
-// Use context Values only for request-scoped data that transits processes and
-// APIs, not for passing optional parameters to functions.
-//
-// The same Context may be passed to functions running in different goroutines;
-// Contexts are safe for simultaneous use by multiple goroutines.
-//
-// See http://blog.golang.org/context for example code for a server that uses
-// Contexts.
-package context // import "golang.org/x/net/context"
-
-// Background returns a non-nil, empty Context. It is never canceled, has no
-// values, and has no deadline. It is typically used by the main function,
-// initialization, and tests, and as the top-level Context for incoming
-// requests.
-func Background() Context {
- return background
-}
-
-// TODO returns a non-nil, empty Context. Code should use context.TODO when
-// it's unclear which Context to use or it is not yet available (because the
-// surrounding function has not yet been extended to accept a Context
-// parameter). TODO is recognized by static analysis tools that determine
-// whether Contexts are propagated correctly in a program.
-func TODO() Context {
- return todo
-}
diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go
deleted file mode 100644
index 0c1b867..0000000
--- a/vendor/golang.org/x/net/context/go17.go
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.7
-
-package context
-
-import (
- "context" // standard library's context, as of Go 1.7
- "time"
-)
-
-var (
- todo = context.TODO()
- background = context.Background()
-)
-
-// Canceled is the error returned by Context.Err when the context is canceled.
-var Canceled = context.Canceled
-
-// DeadlineExceeded is the error returned by Context.Err when the context's
-// deadline passes.
-var DeadlineExceeded = context.DeadlineExceeded
-
-// WithCancel returns a copy of parent with a new Done channel. The returned
-// context's Done channel is closed when the returned cancel function is called
-// or when the parent context's Done channel is closed, whichever happens first.
-//
-// Canceling this context releases resources associated with it, so code should
-// call cancel as soon as the operations running in this Context complete.
-func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
- ctx, f := context.WithCancel(parent)
- return ctx, f
-}
-
-// WithDeadline returns a copy of the parent context with the deadline adjusted
-// to be no later than d. If the parent's deadline is already earlier than d,
-// WithDeadline(parent, d) is semantically equivalent to parent. The returned
-// context's Done channel is closed when the deadline expires, when the returned
-// cancel function is called, or when the parent context's Done channel is
-// closed, whichever happens first.
-//
-// Canceling this context releases resources associated with it, so code should
-// call cancel as soon as the operations running in this Context complete.
-func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
- ctx, f := context.WithDeadline(parent, deadline)
- return ctx, f
-}
-
-// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
-//
-// Canceling this context releases resources associated with it, so code should
-// call cancel as soon as the operations running in this Context complete:
-//
-// func slowOperationWithTimeout(ctx context.Context) (Result, error) {
-// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
-// defer cancel() // releases resources if slowOperation completes before timeout elapses
-// return slowOperation(ctx)
-// }
-func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
- return WithDeadline(parent, time.Now().Add(timeout))
-}
-
-// WithValue returns a copy of parent in which the value associated with key is
-// val.
-//
-// Use context Values only for request-scoped data that transits processes and
-// APIs, not for passing optional parameters to functions.
-func WithValue(parent Context, key interface{}, val interface{}) Context {
- return context.WithValue(parent, key, val)
-}
diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go
deleted file mode 100644
index e31e35a..0000000
--- a/vendor/golang.org/x/net/context/go19.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.9
-
-package context
-
-import "context" // standard library's context, as of Go 1.7
-
-// A Context carries a deadline, a cancelation signal, and other values across
-// API boundaries.
-//
-// Context's methods may be called by multiple goroutines simultaneously.
-type Context = context.Context
-
-// A CancelFunc tells an operation to abandon its work.
-// A CancelFunc does not wait for the work to stop.
-// After the first call, subsequent calls to a CancelFunc do nothing.
-type CancelFunc = context.CancelFunc
diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go
deleted file mode 100644
index 065ff3d..0000000
--- a/vendor/golang.org/x/net/context/pre_go17.go
+++ /dev/null
@@ -1,300 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !go1.7
-
-package context
-
-import (
- "errors"
- "fmt"
- "sync"
- "time"
-)
-
-// An emptyCtx is never canceled, has no values, and has no deadline. It is not
-// struct{}, since vars of this type must have distinct addresses.
-type emptyCtx int
-
-func (*emptyCtx) Deadline() (deadline time.Time, ok bool) {
- return
-}
-
-func (*emptyCtx) Done() <-chan struct{} {
- return nil
-}
-
-func (*emptyCtx) Err() error {
- return nil
-}
-
-func (*emptyCtx) Value(key interface{}) interface{} {
- return nil
-}
-
-func (e *emptyCtx) String() string {
- switch e {
- case background:
- return "context.Background"
- case todo:
- return "context.TODO"
- }
- return "unknown empty Context"
-}
-
-var (
- background = new(emptyCtx)
- todo = new(emptyCtx)
-)
-
-// Canceled is the error returned by Context.Err when the context is canceled.
-var Canceled = errors.New("context canceled")
-
-// DeadlineExceeded is the error returned by Context.Err when the context's
-// deadline passes.
-var DeadlineExceeded = errors.New("context deadline exceeded")
-
-// WithCancel returns a copy of parent with a new Done channel. The returned
-// context's Done channel is closed when the returned cancel function is called
-// or when the parent context's Done channel is closed, whichever happens first.
-//
-// Canceling this context releases resources associated with it, so code should
-// call cancel as soon as the operations running in this Context complete.
-func WithCancel(parent Context) (ctx Context, cancel CancelFunc) {
- c := newCancelCtx(parent)
- propagateCancel(parent, c)
- return c, func() { c.cancel(true, Canceled) }
-}
-
-// newCancelCtx returns an initialized cancelCtx.
-func newCancelCtx(parent Context) *cancelCtx {
- return &cancelCtx{
- Context: parent,
- done: make(chan struct{}),
- }
-}
-
-// propagateCancel arranges for child to be canceled when parent is.
-func propagateCancel(parent Context, child canceler) {
- if parent.Done() == nil {
- return // parent is never canceled
- }
- if p, ok := parentCancelCtx(parent); ok {
- p.mu.Lock()
- if p.err != nil {
- // parent has already been canceled
- child.cancel(false, p.err)
- } else {
- if p.children == nil {
- p.children = make(map[canceler]bool)
- }
- p.children[child] = true
- }
- p.mu.Unlock()
- } else {
- go func() {
- select {
- case <-parent.Done():
- child.cancel(false, parent.Err())
- case <-child.Done():
- }
- }()
- }
-}
-
-// parentCancelCtx follows a chain of parent references until it finds a
-// *cancelCtx. This function understands how each of the concrete types in this
-// package represents its parent.
-func parentCancelCtx(parent Context) (*cancelCtx, bool) {
- for {
- switch c := parent.(type) {
- case *cancelCtx:
- return c, true
- case *timerCtx:
- return c.cancelCtx, true
- case *valueCtx:
- parent = c.Context
- default:
- return nil, false
- }
- }
-}
-
-// removeChild removes a context from its parent.
-func removeChild(parent Context, child canceler) {
- p, ok := parentCancelCtx(parent)
- if !ok {
- return
- }
- p.mu.Lock()
- if p.children != nil {
- delete(p.children, child)
- }
- p.mu.Unlock()
-}
-
-// A canceler is a context type that can be canceled directly. The
-// implementations are *cancelCtx and *timerCtx.
-type canceler interface {
- cancel(removeFromParent bool, err error)
- Done() <-chan struct{}
-}
-
-// A cancelCtx can be canceled. When canceled, it also cancels any children
-// that implement canceler.
-type cancelCtx struct {
- Context
-
- done chan struct{} // closed by the first cancel call.
-
- mu sync.Mutex
- children map[canceler]bool // set to nil by the first cancel call
- err error // set to non-nil by the first cancel call
-}
-
-func (c *cancelCtx) Done() <-chan struct{} {
- return c.done
-}
-
-func (c *cancelCtx) Err() error {
- c.mu.Lock()
- defer c.mu.Unlock()
- return c.err
-}
-
-func (c *cancelCtx) String() string {
- return fmt.Sprintf("%v.WithCancel", c.Context)
-}
-
-// cancel closes c.done, cancels each of c's children, and, if
-// removeFromParent is true, removes c from its parent's children.
-func (c *cancelCtx) cancel(removeFromParent bool, err error) {
- if err == nil {
- panic("context: internal error: missing cancel error")
- }
- c.mu.Lock()
- if c.err != nil {
- c.mu.Unlock()
- return // already canceled
- }
- c.err = err
- close(c.done)
- for child := range c.children {
- // NOTE: acquiring the child's lock while holding parent's lock.
- child.cancel(false, err)
- }
- c.children = nil
- c.mu.Unlock()
-
- if removeFromParent {
- removeChild(c.Context, c)
- }
-}
-
-// WithDeadline returns a copy of the parent context with the deadline adjusted
-// to be no later than d. If the parent's deadline is already earlier than d,
-// WithDeadline(parent, d) is semantically equivalent to parent. The returned
-// context's Done channel is closed when the deadline expires, when the returned
-// cancel function is called, or when the parent context's Done channel is
-// closed, whichever happens first.
-//
-// Canceling this context releases resources associated with it, so code should
-// call cancel as soon as the operations running in this Context complete.
-func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) {
- if cur, ok := parent.Deadline(); ok && cur.Before(deadline) {
- // The current deadline is already sooner than the new one.
- return WithCancel(parent)
- }
- c := &timerCtx{
- cancelCtx: newCancelCtx(parent),
- deadline: deadline,
- }
- propagateCancel(parent, c)
- d := deadline.Sub(time.Now())
- if d <= 0 {
- c.cancel(true, DeadlineExceeded) // deadline has already passed
- return c, func() { c.cancel(true, Canceled) }
- }
- c.mu.Lock()
- defer c.mu.Unlock()
- if c.err == nil {
- c.timer = time.AfterFunc(d, func() {
- c.cancel(true, DeadlineExceeded)
- })
- }
- return c, func() { c.cancel(true, Canceled) }
-}
-
-// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to
-// implement Done and Err. It implements cancel by stopping its timer then
-// delegating to cancelCtx.cancel.
-type timerCtx struct {
- *cancelCtx
- timer *time.Timer // Under cancelCtx.mu.
-
- deadline time.Time
-}
-
-func (c *timerCtx) Deadline() (deadline time.Time, ok bool) {
- return c.deadline, true
-}
-
-func (c *timerCtx) String() string {
- return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now()))
-}
-
-func (c *timerCtx) cancel(removeFromParent bool, err error) {
- c.cancelCtx.cancel(false, err)
- if removeFromParent {
- // Remove this timerCtx from its parent cancelCtx's children.
- removeChild(c.cancelCtx.Context, c)
- }
- c.mu.Lock()
- if c.timer != nil {
- c.timer.Stop()
- c.timer = nil
- }
- c.mu.Unlock()
-}
-
-// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)).
-//
-// Canceling this context releases resources associated with it, so code should
-// call cancel as soon as the operations running in this Context complete:
-//
-// func slowOperationWithTimeout(ctx context.Context) (Result, error) {
-// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
-// defer cancel() // releases resources if slowOperation completes before timeout elapses
-// return slowOperation(ctx)
-// }
-func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
- return WithDeadline(parent, time.Now().Add(timeout))
-}
-
-// WithValue returns a copy of parent in which the value associated with key is
-// val.
-//
-// Use context Values only for request-scoped data that transits processes and
-// APIs, not for passing optional parameters to functions.
-func WithValue(parent Context, key interface{}, val interface{}) Context {
- return &valueCtx{parent, key, val}
-}
-
-// A valueCtx carries a key-value pair. It implements Value for that key and
-// delegates all other calls to the embedded Context.
-type valueCtx struct {
- Context
- key, val interface{}
-}
-
-func (c *valueCtx) String() string {
- return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val)
-}
-
-func (c *valueCtx) Value(key interface{}) interface{} {
- if c.key == key {
- return c.val
- }
- return c.Context.Value(key)
-}
diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go
deleted file mode 100644
index ec5a638..0000000
--- a/vendor/golang.org/x/net/context/pre_go19.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !go1.9
-
-package context
-
-import "time"
-
-// A Context carries a deadline, a cancelation signal, and other values across
-// API boundaries.
-//
-// Context's methods may be called by multiple goroutines simultaneously.
-type Context interface {
- // Deadline returns the time when work done on behalf of this context
- // should be canceled. Deadline returns ok==false when no deadline is
- // set. Successive calls to Deadline return the same results.
- Deadline() (deadline time.Time, ok bool)
-
- // Done returns a channel that's closed when work done on behalf of this
- // context should be canceled. Done may return nil if this context can
- // never be canceled. Successive calls to Done return the same value.
- //
- // WithCancel arranges for Done to be closed when cancel is called;
- // WithDeadline arranges for Done to be closed when the deadline
- // expires; WithTimeout arranges for Done to be closed when the timeout
- // elapses.
- //
- // Done is provided for use in select statements:
- //
- // // Stream generates values with DoSomething and sends them to out
- // // until DoSomething returns an error or ctx.Done is closed.
- // func Stream(ctx context.Context, out chan<- Value) error {
- // for {
- // v, err := DoSomething(ctx)
- // if err != nil {
- // return err
- // }
- // select {
- // case <-ctx.Done():
- // return ctx.Err()
- // case out <- v:
- // }
- // }
- // }
- //
- // See http://blog.golang.org/pipelines for more examples of how to use
- // a Done channel for cancelation.
- Done() <-chan struct{}
-
- // Err returns a non-nil error value after Done is closed. Err returns
- // Canceled if the context was canceled or DeadlineExceeded if the
- // context's deadline passed. No other values for Err are defined.
- // After Done is closed, successive calls to Err return the same value.
- Err() error
-
- // Value returns the value associated with this context for key, or nil
- // if no value is associated with key. Successive calls to Value with
- // the same key returns the same result.
- //
- // Use context values only for request-scoped data that transits
- // processes and API boundaries, not for passing optional parameters to
- // functions.
- //
- // A key identifies a specific value in a Context. Functions that wish
- // to store values in Context typically allocate a key in a global
- // variable then use that key as the argument to context.WithValue and
- // Context.Value. A key can be any type that supports equality;
- // packages should define keys as an unexported type to avoid
- // collisions.
- //
- // Packages that define a Context key should provide type-safe accessors
- // for the values stores using that key:
- //
- // // Package user defines a User type that's stored in Contexts.
- // package user
- //
- // import "golang.org/x/net/context"
- //
- // // User is the type of value stored in the Contexts.
- // type User struct {...}
- //
- // // key is an unexported type for keys defined in this package.
- // // This prevents collisions with keys defined in other packages.
- // type key int
- //
- // // userKey is the key for user.User values in Contexts. It is
- // // unexported; clients use user.NewContext and user.FromContext
- // // instead of using this key directly.
- // var userKey key = 0
- //
- // // NewContext returns a new Context that carries value u.
- // func NewContext(ctx context.Context, u *User) context.Context {
- // return context.WithValue(ctx, userKey, u)
- // }
- //
- // // FromContext returns the User value stored in ctx, if any.
- // func FromContext(ctx context.Context) (*User, bool) {
- // u, ok := ctx.Value(userKey).(*User)
- // return u, ok
- // }
- Value(key interface{}) interface{}
-}
-
-// A CancelFunc tells an operation to abandon its work.
-// A CancelFunc does not wait for the work to stop.
-// After the first call, subsequent calls to a CancelFunc do nothing.
-type CancelFunc func()
diff --git a/vendor/golang.org/x/text/feature/plural/common.go b/vendor/golang.org/x/text/feature/plural/common.go
deleted file mode 100644
index fdcb373..0000000
--- a/vendor/golang.org/x/text/feature/plural/common.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package plural
-
-// Form defines a plural form.
-//
-// Not all languages support all forms. Also, the meaning of each form varies
-// per language. It is important to note that the name of a form does not
-// necessarily correspond one-to-one with the set of numbers. For instance,
-// for Croation, One matches not only 1, but also 11, 21, etc.
-//
-// Each language must at least support the form "other".
-type Form byte
-
-const (
- Other Form = iota
- Zero
- One
- Two
- Few
- Many
-)
-
-var countMap = map[string]Form{
- "other": Other,
- "zero": Zero,
- "one": One,
- "two": Two,
- "few": Few,
- "many": Many,
-}
-
-type pluralCheck struct {
- // category:
- // 3..7: opID
- // 0..2: category
- cat byte
- setID byte
-}
-
-// opID identifies the type of operand in the plural rule, being i, n or f.
-// (v, w, and t are treated as filters in our implementation.)
-type opID byte
-
-const (
- opMod opID = 0x1 // is '%' used?
- opNotEqual opID = 0x2 // using "!=" to compare
- opI opID = 0 << 2 // integers after taking the absolute value
- opN opID = 1 << 2 // full number (must be integer)
- opF opID = 2 << 2 // fraction
- opV opID = 3 << 2 // number of visible digits
- opW opID = 4 << 2 // number of visible digits without trailing zeros
- opBretonM opID = 5 << 2 // hard-wired rule for Breton
- opItalian800 opID = 6 << 2 // hard-wired rule for Italian
- opAzerbaijan00s opID = 7 << 2 // hard-wired rule for Azerbaijan
-)
-const (
- // Use this plural form to indicate the next rule needs to match as well.
- // The last condition in the list will have the correct plural form.
- andNext = 0x7
- formMask = 0x7
-
- opShift = 3
-
- // numN indicates the maximum integer, or maximum mod value, for which we
- // have inclusion masks.
- numN = 100
- // The common denominator of the modulo that is taken.
- maxMod = 100
-)
diff --git a/vendor/golang.org/x/text/feature/plural/message.go b/vendor/golang.org/x/text/feature/plural/message.go
deleted file mode 100644
index 56d518c..0000000
--- a/vendor/golang.org/x/text/feature/plural/message.go
+++ /dev/null
@@ -1,244 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package plural
-
-import (
- "fmt"
- "io"
- "reflect"
- "strconv"
-
- "golang.org/x/text/internal/catmsg"
- "golang.org/x/text/internal/number"
- "golang.org/x/text/language"
- "golang.org/x/text/message/catalog"
-)
-
-// TODO: consider deleting this interface. Maybe VisibleDigits is always
-// sufficient and practical.
-
-// Interface is used for types that can determine their own plural form.
-type Interface interface {
- // PluralForm reports the plural form for the given language of the
- // underlying value. It also returns the integer value. If the integer value
- // is larger than fits in n, PluralForm may return a value modulo
- // 10,000,000.
- PluralForm(t language.Tag, scale int) (f Form, n int)
-}
-
-// Selectf returns the first case for which its selector is a match for the
-// arg-th substitution argument to a formatting call, formatting it as indicated
-// by format.
-//
-// The cases argument are pairs of selectors and messages. Selectors are of type
-// string or Form. Messages are of type string or catalog.Message. A selector
-// matches an argument if:
-// - it is "other" or Other
-// - it matches the plural form of the argument: "zero", "one", "two", "few",
-// or "many", or the equivalent Form
-// - it is of the form "=x" where x is an integer that matches the value of
-// the argument.
-// - it is of the form " kindDefault {
- e.EncodeUint(uint64(m.scale))
- }
-
- forms := validForms(cardinal, e.Language())
-
- for i := 0; i < len(m.cases); {
- if err := compileSelector(e, forms, m.cases[i]); err != nil {
- return err
- }
- if i++; i >= len(m.cases) {
- return fmt.Errorf("plural: no message defined for selector %v", m.cases[i-1])
- }
- var msg catalog.Message
- switch x := m.cases[i].(type) {
- case string:
- msg = catalog.String(x)
- case catalog.Message:
- msg = x
- default:
- return fmt.Errorf("plural: message of type %T; must be string or catalog.Message", x)
- }
- if err := e.EncodeMessage(msg); err != nil {
- return err
- }
- i++
- }
- return nil
-}
-
-func compileSelector(e *catmsg.Encoder, valid []Form, selector interface{}) error {
- form := Other
- switch x := selector.(type) {
- case string:
- if x == "" {
- return fmt.Errorf("plural: empty selector")
- }
- if c := x[0]; c == '=' || c == '<' {
- val, err := strconv.ParseUint(x[1:], 10, 16)
- if err != nil {
- return fmt.Errorf("plural: invalid number in selector %q: %v", selector, err)
- }
- e.EncodeUint(uint64(c))
- e.EncodeUint(val)
- return nil
- }
- var ok bool
- form, ok = countMap[x]
- if !ok {
- return fmt.Errorf("plural: invalid plural form %q", selector)
- }
- case Form:
- form = x
- default:
- return fmt.Errorf("plural: selector of type %T; want string or Form", selector)
- }
-
- ok := false
- for _, f := range valid {
- if f == form {
- ok = true
- break
- }
- }
- if !ok {
- return fmt.Errorf("plural: form %q not supported for language %q", selector, e.Language())
- }
- e.EncodeUint(uint64(form))
- return nil
-}
-
-func execute(d *catmsg.Decoder) bool {
- lang := d.Language()
- argN := int(d.DecodeUint())
- kind := int(d.DecodeUint())
- scale := -1 // default
- if kind > kindDefault {
- scale = int(d.DecodeUint())
- }
- form := Other
- n := -1
- if arg := d.Arg(argN); arg == nil {
- // Default to Other.
- } else if x, ok := arg.(number.VisibleDigits); ok {
- d := x.Digits(nil, lang, scale)
- form, n = cardinal.matchDisplayDigits(lang, &d)
- } else if x, ok := arg.(Interface); ok {
- // This covers lists and formatters from the number package.
- form, n = x.PluralForm(lang, scale)
- } else {
- var f number.Formatter
- switch kind {
- case kindScale:
- f.InitDecimal(lang)
- f.SetScale(scale)
- case kindScientific:
- f.InitScientific(lang)
- f.SetScale(scale)
- case kindPrecision:
- f.InitDecimal(lang)
- f.SetPrecision(scale)
- case kindDefault:
- // sensible default
- f.InitDecimal(lang)
- if k := reflect.TypeOf(arg).Kind(); reflect.Int <= k && k <= reflect.Uintptr {
- f.SetScale(0)
- } else {
- f.SetScale(2)
- }
- }
- var dec number.Decimal // TODO: buffer in Printer
- dec.Convert(f.RoundingContext, arg)
- v := number.FormatDigits(&dec, f.RoundingContext)
- if !v.NaN && !v.Inf {
- form, n = cardinal.matchDisplayDigits(d.Language(), &v)
- }
- }
- for !d.Done() {
- f := d.DecodeUint()
- if (f == '=' && n == int(d.DecodeUint())) ||
- (f == '<' && 0 <= n && n < int(d.DecodeUint())) ||
- form == Form(f) ||
- Other == Form(f) {
- return d.ExecuteMessage()
- }
- d.SkipMessage()
- }
- return false
-}
diff --git a/vendor/golang.org/x/text/feature/plural/plural.go b/vendor/golang.org/x/text/feature/plural/plural.go
deleted file mode 100644
index e9f2d42..0000000
--- a/vendor/golang.org/x/text/feature/plural/plural.go
+++ /dev/null
@@ -1,262 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:generate go run gen.go gen_common.go
-
-// Package plural provides utilities for handling linguistic plurals in text.
-//
-// The definitions in this package are based on the plural rule handling defined
-// in CLDR. See
-// https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules for
-// details.
-package plural
-
-import (
- "golang.org/x/text/internal/language/compact"
- "golang.org/x/text/internal/number"
- "golang.org/x/text/language"
-)
-
-// Rules defines the plural rules for all languages for a certain plural type.
-//
-// This package is UNDER CONSTRUCTION and its API may change.
-type Rules struct {
- rules []pluralCheck
- index []byte
- langToIndex []byte
- inclusionMasks []uint64
-}
-
-var (
- // Cardinal defines the plural rules for numbers indicating quantities.
- Cardinal *Rules = cardinal
-
- // Ordinal defines the plural rules for numbers indicating position
- // (first, second, etc.).
- Ordinal *Rules = ordinal
-
- ordinal = &Rules{
- ordinalRules,
- ordinalIndex,
- ordinalLangToIndex,
- ordinalInclusionMasks[:],
- }
-
- cardinal = &Rules{
- cardinalRules,
- cardinalIndex,
- cardinalLangToIndex,
- cardinalInclusionMasks[:],
- }
-)
-
-// getIntApprox converts the digits in slice digits[start:end] to an integer
-// according to the following rules:
-// - Let i be asInt(digits[start:end]), where out-of-range digits are assumed
-// to be zero.
-// - Result n is big if i / 10^nMod > 1.
-// - Otherwise the result is i % 10^nMod.
-//
-// For example, if digits is {1, 2, 3} and start:end is 0:5, then the result
-// for various values of nMod is:
-// - when nMod == 2, n == big
-// - when nMod == 3, n == big
-// - when nMod == 4, n == big
-// - when nMod == 5, n == 12300
-// - when nMod == 6, n == 12300
-// - when nMod == 7, n == 12300
-func getIntApprox(digits []byte, start, end, nMod, big int) (n int) {
- // Leading 0 digits just result in 0.
- p := start
- if p < 0 {
- p = 0
- }
- // Range only over the part for which we have digits.
- mid := end
- if mid >= len(digits) {
- mid = len(digits)
- }
- // Check digits more significant that nMod.
- if q := end - nMod; q > 0 {
- if q > mid {
- q = mid
- }
- for ; p < q; p++ {
- if digits[p] != 0 {
- return big
- }
- }
- }
- for ; p < mid; p++ {
- n = 10*n + int(digits[p])
- }
- // Multiply for trailing zeros.
- for ; p < end; p++ {
- n *= 10
- }
- return n
-}
-
-// MatchDigits computes the plural form for the given language and the given
-// decimal floating point digits. The digits are stored in big-endian order and
-// are of value byte(0) - byte(9). The floating point position is indicated by
-// exp and the number of visible decimals is scale. All leading and trailing
-// zeros may be omitted from digits.
-//
-// The following table contains examples of possible arguments to represent
-// the given numbers.
-//
-// decimal digits exp scale
-// 123 []byte{1, 2, 3} 3 0
-// 123.4 []byte{1, 2, 3, 4} 3 1
-// 123.40 []byte{1, 2, 3, 4} 3 2
-// 100000 []byte{1} 6 0
-// 100000.00 []byte{1} 6 3
-func (p *Rules) MatchDigits(t language.Tag, digits []byte, exp, scale int) Form {
- index := tagToID(t)
-
- // Differentiate up to including mod 1000000 for the integer part.
- n := getIntApprox(digits, 0, exp, 6, 1000000)
-
- // Differentiate up to including mod 100 for the fractional part.
- f := getIntApprox(digits, exp, exp+scale, 2, 100)
-
- return matchPlural(p, index, n, f, scale)
-}
-
-func (p *Rules) matchDisplayDigits(t language.Tag, d *number.Digits) (Form, int) {
- n := getIntApprox(d.Digits, 0, int(d.Exp), 6, 1000000)
- return p.MatchDigits(t, d.Digits, int(d.Exp), d.NumFracDigits()), n
-}
-
-func validForms(p *Rules, t language.Tag) (forms []Form) {
- offset := p.langToIndex[tagToID(t)]
- rules := p.rules[p.index[offset]:p.index[offset+1]]
-
- forms = append(forms, Other)
- last := Other
- for _, r := range rules {
- if cat := Form(r.cat & formMask); cat != andNext && last != cat {
- forms = append(forms, cat)
- last = cat
- }
- }
- return forms
-}
-
-func (p *Rules) matchComponents(t language.Tag, n, f, scale int) Form {
- return matchPlural(p, tagToID(t), n, f, scale)
-}
-
-// MatchPlural returns the plural form for the given language and plural
-// operands (as defined in
-// https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules):
-//
-// where
-// n absolute value of the source number (integer and decimals)
-// input
-// i integer digits of n.
-// v number of visible fraction digits in n, with trailing zeros.
-// w number of visible fraction digits in n, without trailing zeros.
-// f visible fractional digits in n, with trailing zeros (f = t * 10^(v-w))
-// t visible fractional digits in n, without trailing zeros.
-//
-// If any of the operand values is too large to fit in an int, it is okay to
-// pass the value modulo 10,000,000.
-func (p *Rules) MatchPlural(lang language.Tag, i, v, w, f, t int) Form {
- return matchPlural(p, tagToID(lang), i, f, v)
-}
-
-func matchPlural(p *Rules, index compact.ID, n, f, v int) Form {
- nMask := p.inclusionMasks[n%maxMod]
- // Compute the fMask inline in the rules below, as it is relatively rare.
- // fMask := p.inclusionMasks[f%maxMod]
- vMask := p.inclusionMasks[v%maxMod]
-
- // Do the matching
- offset := p.langToIndex[index]
- rules := p.rules[p.index[offset]:p.index[offset+1]]
- for i := 0; i < len(rules); i++ {
- rule := rules[i]
- setBit := uint64(1 << rule.setID)
- var skip bool
- switch op := opID(rule.cat >> opShift); op {
- case opI: // i = x
- skip = n >= numN || nMask&setBit == 0
-
- case opI | opNotEqual: // i != x
- skip = n < numN && nMask&setBit != 0
-
- case opI | opMod: // i % m = x
- skip = nMask&setBit == 0
-
- case opI | opMod | opNotEqual: // i % m != x
- skip = nMask&setBit != 0
-
- case opN: // n = x
- skip = f != 0 || n >= numN || nMask&setBit == 0
-
- case opN | opNotEqual: // n != x
- skip = f == 0 && n < numN && nMask&setBit != 0
-
- case opN | opMod: // n % m = x
- skip = f != 0 || nMask&setBit == 0
-
- case opN | opMod | opNotEqual: // n % m != x
- skip = f == 0 && nMask&setBit != 0
-
- case opF: // f = x
- skip = f >= numN || p.inclusionMasks[f%maxMod]&setBit == 0
-
- case opF | opNotEqual: // f != x
- skip = f < numN && p.inclusionMasks[f%maxMod]&setBit != 0
-
- case opF | opMod: // f % m = x
- skip = p.inclusionMasks[f%maxMod]&setBit == 0
-
- case opF | opMod | opNotEqual: // f % m != x
- skip = p.inclusionMasks[f%maxMod]&setBit != 0
-
- case opV: // v = x
- skip = v < numN && vMask&setBit == 0
-
- case opV | opNotEqual: // v != x
- skip = v < numN && vMask&setBit != 0
-
- case opW: // w == 0
- skip = f != 0
-
- case opW | opNotEqual: // w != 0
- skip = f == 0
-
- // Hard-wired rules that cannot be handled by our algorithm.
-
- case opBretonM:
- skip = f != 0 || n == 0 || n%1000000 != 0
-
- case opAzerbaijan00s:
- // 100,200,300,400,500,600,700,800,900
- skip = n == 0 || n >= 1000 || n%100 != 0
-
- case opItalian800:
- skip = (f != 0 || n >= numN || nMask&setBit == 0) && n != 800
- }
- if skip {
- // advance over AND entries.
- for ; i < len(rules) && rules[i].cat&formMask == andNext; i++ {
- }
- continue
- }
- // return if we have a final entry.
- if cat := rule.cat & formMask; cat != andNext {
- return Form(cat)
- }
- }
- return Other
-}
-
-func tagToID(t language.Tag) compact.ID {
- id, _ := compact.RegionalID(compact.Tag(t))
- return id
-}
diff --git a/vendor/golang.org/x/text/feature/plural/tables.go b/vendor/golang.org/x/text/feature/plural/tables.go
deleted file mode 100644
index b06b9cb..0000000
--- a/vendor/golang.org/x/text/feature/plural/tables.go
+++ /dev/null
@@ -1,552 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package plural
-
-// CLDRVersion is the CLDR version from which the tables in this package are derived.
-const CLDRVersion = "32"
-
-var ordinalRules = []pluralCheck{ // 64 elements
- 0: {cat: 0x2f, setID: 0x4},
- 1: {cat: 0x3a, setID: 0x5},
- 2: {cat: 0x22, setID: 0x1},
- 3: {cat: 0x22, setID: 0x6},
- 4: {cat: 0x22, setID: 0x7},
- 5: {cat: 0x2f, setID: 0x8},
- 6: {cat: 0x3c, setID: 0x9},
- 7: {cat: 0x2f, setID: 0xa},
- 8: {cat: 0x3c, setID: 0xb},
- 9: {cat: 0x2c, setID: 0xc},
- 10: {cat: 0x24, setID: 0xd},
- 11: {cat: 0x2d, setID: 0xe},
- 12: {cat: 0x2d, setID: 0xf},
- 13: {cat: 0x2f, setID: 0x10},
- 14: {cat: 0x35, setID: 0x3},
- 15: {cat: 0xc5, setID: 0x11},
- 16: {cat: 0x2, setID: 0x1},
- 17: {cat: 0x5, setID: 0x3},
- 18: {cat: 0xd, setID: 0x12},
- 19: {cat: 0x22, setID: 0x1},
- 20: {cat: 0x2f, setID: 0x13},
- 21: {cat: 0x3d, setID: 0x14},
- 22: {cat: 0x2f, setID: 0x15},
- 23: {cat: 0x3a, setID: 0x16},
- 24: {cat: 0x2f, setID: 0x17},
- 25: {cat: 0x3b, setID: 0x18},
- 26: {cat: 0x2f, setID: 0xa},
- 27: {cat: 0x3c, setID: 0xb},
- 28: {cat: 0x22, setID: 0x1},
- 29: {cat: 0x23, setID: 0x19},
- 30: {cat: 0x24, setID: 0x1a},
- 31: {cat: 0x22, setID: 0x1b},
- 32: {cat: 0x23, setID: 0x2},
- 33: {cat: 0x24, setID: 0x1a},
- 34: {cat: 0xf, setID: 0x15},
- 35: {cat: 0x1a, setID: 0x16},
- 36: {cat: 0xf, setID: 0x17},
- 37: {cat: 0x1b, setID: 0x18},
- 38: {cat: 0xf, setID: 0x1c},
- 39: {cat: 0x1d, setID: 0x1d},
- 40: {cat: 0xa, setID: 0x1e},
- 41: {cat: 0xa, setID: 0x1f},
- 42: {cat: 0xc, setID: 0x20},
- 43: {cat: 0xe4, setID: 0x0},
- 44: {cat: 0x5, setID: 0x3},
- 45: {cat: 0xd, setID: 0xe},
- 46: {cat: 0xd, setID: 0x21},
- 47: {cat: 0x22, setID: 0x1},
- 48: {cat: 0x23, setID: 0x19},
- 49: {cat: 0x24, setID: 0x1a},
- 50: {cat: 0x25, setID: 0x22},
- 51: {cat: 0x22, setID: 0x23},
- 52: {cat: 0x23, setID: 0x19},
- 53: {cat: 0x24, setID: 0x1a},
- 54: {cat: 0x25, setID: 0x22},
- 55: {cat: 0x22, setID: 0x24},
- 56: {cat: 0x23, setID: 0x19},
- 57: {cat: 0x24, setID: 0x1a},
- 58: {cat: 0x25, setID: 0x22},
- 59: {cat: 0x21, setID: 0x25},
- 60: {cat: 0x22, setID: 0x1},
- 61: {cat: 0x23, setID: 0x2},
- 62: {cat: 0x24, setID: 0x26},
- 63: {cat: 0x25, setID: 0x27},
-} // Size: 152 bytes
-
-var ordinalIndex = []uint8{ // 22 elements
- 0x00, 0x00, 0x02, 0x03, 0x04, 0x05, 0x07, 0x09,
- 0x0b, 0x0f, 0x10, 0x13, 0x16, 0x1c, 0x1f, 0x22,
- 0x28, 0x2f, 0x33, 0x37, 0x3b, 0x40,
-} // Size: 46 bytes
-
-var ordinalLangToIndex = []uint8{ // 775 elements
- // Entry 0 - 3F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,
- 0x10, 0x10, 0x10, 0x00, 0x00, 0x05, 0x05, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 40 - 7F
- 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e,
- 0x0e, 0x0e, 0x0e, 0x0e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 80 - BF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- // Entry C0 - FF
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c,
- 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 100 - 13F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
- 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 140 - 17F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
- 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03,
- 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 180 - 1BF
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x09,
- 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 1C0 - 1FF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00,
- 0x00, 0x00, 0x02, 0x0d, 0x0d, 0x02, 0x02, 0x02,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 200 - 23F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x13, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 240 - 27F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 280 - 2BF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x0b, 0x0b, 0x0b, 0x0b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x07, 0x07, 0x02, 0x00, 0x00, 0x00, 0x00,
- // Entry 2C0 - 2FF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 300 - 33F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x0c,
-} // Size: 799 bytes
-
-var ordinalInclusionMasks = []uint64{ // 100 elements
- // Entry 0 - 1F
- 0x0000002000010009, 0x00000018482000d3, 0x0000000042840195, 0x000000410a040581,
- 0x00000041040c0081, 0x0000009840040041, 0x0000008400045001, 0x0000003850040001,
- 0x0000003850060001, 0x0000003800049001, 0x0000000800052001, 0x0000000040660031,
- 0x0000000041840331, 0x0000000100040f01, 0x00000001001c0001, 0x0000000040040001,
- 0x0000000000045001, 0x0000000070040001, 0x0000000070040001, 0x0000000000049001,
- 0x0000000080050001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501,
- 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001,
- 0x0000000050000001, 0x0000000000009001, 0x0000000000010001, 0x0000000040200011,
- // Entry 20 - 3F
- 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001,
- 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001,
- 0x0000000200050001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501,
- 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001,
- 0x0000000050000001, 0x0000000000009001, 0x0000000080010001, 0x0000000040200011,
- 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001,
- 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001,
- 0x0000000200050001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501,
- // Entry 40 - 5F
- 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001,
- 0x0000000050000001, 0x0000000000009001, 0x0000000080010001, 0x0000000040200011,
- 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001,
- 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001,
- 0x0000000080070001, 0x0000000040200011, 0x0000000040800111, 0x0000000100000501,
- 0x0000000100080001, 0x0000000040000001, 0x0000000000005001, 0x0000000050000001,
- 0x0000000050000001, 0x0000000000009001, 0x0000000200010001, 0x0000000040200011,
- 0x0000000040800111, 0x0000000100000501, 0x0000000100080001, 0x0000000040000001,
- // Entry 60 - 7F
- 0x0000000000005001, 0x0000000050000001, 0x0000000050000001, 0x0000000000009001,
-} // Size: 824 bytes
-
-// Slots used for ordinal: 40 of 0xFF rules; 16 of 0xFF indexes; 40 of 64 sets
-
-var cardinalRules = []pluralCheck{ // 166 elements
- 0: {cat: 0x2, setID: 0x3},
- 1: {cat: 0x22, setID: 0x1},
- 2: {cat: 0x2, setID: 0x4},
- 3: {cat: 0x2, setID: 0x4},
- 4: {cat: 0x7, setID: 0x1},
- 5: {cat: 0x62, setID: 0x3},
- 6: {cat: 0x22, setID: 0x4},
- 7: {cat: 0x7, setID: 0x3},
- 8: {cat: 0x42, setID: 0x1},
- 9: {cat: 0x22, setID: 0x4},
- 10: {cat: 0x22, setID: 0x4},
- 11: {cat: 0x22, setID: 0x5},
- 12: {cat: 0x22, setID: 0x1},
- 13: {cat: 0x22, setID: 0x1},
- 14: {cat: 0x7, setID: 0x4},
- 15: {cat: 0x92, setID: 0x3},
- 16: {cat: 0xf, setID: 0x6},
- 17: {cat: 0x1f, setID: 0x7},
- 18: {cat: 0x82, setID: 0x3},
- 19: {cat: 0x92, setID: 0x3},
- 20: {cat: 0xf, setID: 0x6},
- 21: {cat: 0x62, setID: 0x3},
- 22: {cat: 0x4a, setID: 0x6},
- 23: {cat: 0x7, setID: 0x8},
- 24: {cat: 0x62, setID: 0x3},
- 25: {cat: 0x1f, setID: 0x9},
- 26: {cat: 0x62, setID: 0x3},
- 27: {cat: 0x5f, setID: 0x9},
- 28: {cat: 0x72, setID: 0x3},
- 29: {cat: 0x29, setID: 0xa},
- 30: {cat: 0x29, setID: 0xb},
- 31: {cat: 0x4f, setID: 0xb},
- 32: {cat: 0x61, setID: 0x2},
- 33: {cat: 0x2f, setID: 0x6},
- 34: {cat: 0x3a, setID: 0x7},
- 35: {cat: 0x4f, setID: 0x6},
- 36: {cat: 0x5f, setID: 0x7},
- 37: {cat: 0x62, setID: 0x2},
- 38: {cat: 0x4f, setID: 0x6},
- 39: {cat: 0x72, setID: 0x2},
- 40: {cat: 0x21, setID: 0x3},
- 41: {cat: 0x7, setID: 0x4},
- 42: {cat: 0x32, setID: 0x3},
- 43: {cat: 0x21, setID: 0x3},
- 44: {cat: 0x22, setID: 0x1},
- 45: {cat: 0x22, setID: 0x1},
- 46: {cat: 0x23, setID: 0x2},
- 47: {cat: 0x2, setID: 0x3},
- 48: {cat: 0x22, setID: 0x1},
- 49: {cat: 0x24, setID: 0xc},
- 50: {cat: 0x7, setID: 0x1},
- 51: {cat: 0x62, setID: 0x3},
- 52: {cat: 0x74, setID: 0x3},
- 53: {cat: 0x24, setID: 0x3},
- 54: {cat: 0x2f, setID: 0xd},
- 55: {cat: 0x34, setID: 0x1},
- 56: {cat: 0xf, setID: 0x6},
- 57: {cat: 0x1f, setID: 0x7},
- 58: {cat: 0x62, setID: 0x3},
- 59: {cat: 0x4f, setID: 0x6},
- 60: {cat: 0x5a, setID: 0x7},
- 61: {cat: 0xf, setID: 0xe},
- 62: {cat: 0x1f, setID: 0xf},
- 63: {cat: 0x64, setID: 0x3},
- 64: {cat: 0x4f, setID: 0xe},
- 65: {cat: 0x5c, setID: 0xf},
- 66: {cat: 0x22, setID: 0x10},
- 67: {cat: 0x23, setID: 0x11},
- 68: {cat: 0x24, setID: 0x12},
- 69: {cat: 0xf, setID: 0x1},
- 70: {cat: 0x62, setID: 0x3},
- 71: {cat: 0xf, setID: 0x2},
- 72: {cat: 0x63, setID: 0x3},
- 73: {cat: 0xf, setID: 0x13},
- 74: {cat: 0x64, setID: 0x3},
- 75: {cat: 0x74, setID: 0x3},
- 76: {cat: 0xf, setID: 0x1},
- 77: {cat: 0x62, setID: 0x3},
- 78: {cat: 0x4a, setID: 0x1},
- 79: {cat: 0xf, setID: 0x2},
- 80: {cat: 0x63, setID: 0x3},
- 81: {cat: 0x4b, setID: 0x2},
- 82: {cat: 0xf, setID: 0x13},
- 83: {cat: 0x64, setID: 0x3},
- 84: {cat: 0x4c, setID: 0x13},
- 85: {cat: 0x7, setID: 0x1},
- 86: {cat: 0x62, setID: 0x3},
- 87: {cat: 0x7, setID: 0x2},
- 88: {cat: 0x63, setID: 0x3},
- 89: {cat: 0x2f, setID: 0xa},
- 90: {cat: 0x37, setID: 0x14},
- 91: {cat: 0x65, setID: 0x3},
- 92: {cat: 0x7, setID: 0x1},
- 93: {cat: 0x62, setID: 0x3},
- 94: {cat: 0x7, setID: 0x15},
- 95: {cat: 0x64, setID: 0x3},
- 96: {cat: 0x75, setID: 0x3},
- 97: {cat: 0x7, setID: 0x1},
- 98: {cat: 0x62, setID: 0x3},
- 99: {cat: 0xf, setID: 0xe},
- 100: {cat: 0x1f, setID: 0xf},
- 101: {cat: 0x64, setID: 0x3},
- 102: {cat: 0xf, setID: 0x16},
- 103: {cat: 0x17, setID: 0x1},
- 104: {cat: 0x65, setID: 0x3},
- 105: {cat: 0xf, setID: 0x17},
- 106: {cat: 0x65, setID: 0x3},
- 107: {cat: 0xf, setID: 0xf},
- 108: {cat: 0x65, setID: 0x3},
- 109: {cat: 0x2f, setID: 0x6},
- 110: {cat: 0x3a, setID: 0x7},
- 111: {cat: 0x2f, setID: 0xe},
- 112: {cat: 0x3c, setID: 0xf},
- 113: {cat: 0x2d, setID: 0xa},
- 114: {cat: 0x2d, setID: 0x17},
- 115: {cat: 0x2d, setID: 0x18},
- 116: {cat: 0x2f, setID: 0x6},
- 117: {cat: 0x3a, setID: 0xb},
- 118: {cat: 0x2f, setID: 0x19},
- 119: {cat: 0x3c, setID: 0xb},
- 120: {cat: 0x55, setID: 0x3},
- 121: {cat: 0x22, setID: 0x1},
- 122: {cat: 0x24, setID: 0x3},
- 123: {cat: 0x2c, setID: 0xc},
- 124: {cat: 0x2d, setID: 0xb},
- 125: {cat: 0xf, setID: 0x6},
- 126: {cat: 0x1f, setID: 0x7},
- 127: {cat: 0x62, setID: 0x3},
- 128: {cat: 0xf, setID: 0xe},
- 129: {cat: 0x1f, setID: 0xf},
- 130: {cat: 0x64, setID: 0x3},
- 131: {cat: 0xf, setID: 0xa},
- 132: {cat: 0x65, setID: 0x3},
- 133: {cat: 0xf, setID: 0x17},
- 134: {cat: 0x65, setID: 0x3},
- 135: {cat: 0xf, setID: 0x18},
- 136: {cat: 0x65, setID: 0x3},
- 137: {cat: 0x2f, setID: 0x6},
- 138: {cat: 0x3a, setID: 0x1a},
- 139: {cat: 0x2f, setID: 0x1b},
- 140: {cat: 0x3b, setID: 0x1c},
- 141: {cat: 0x2f, setID: 0x1d},
- 142: {cat: 0x3c, setID: 0x1e},
- 143: {cat: 0x37, setID: 0x3},
- 144: {cat: 0xa5, setID: 0x0},
- 145: {cat: 0x22, setID: 0x1},
- 146: {cat: 0x23, setID: 0x2},
- 147: {cat: 0x24, setID: 0x1f},
- 148: {cat: 0x25, setID: 0x20},
- 149: {cat: 0xf, setID: 0x6},
- 150: {cat: 0x62, setID: 0x3},
- 151: {cat: 0xf, setID: 0x1b},
- 152: {cat: 0x63, setID: 0x3},
- 153: {cat: 0xf, setID: 0x21},
- 154: {cat: 0x64, setID: 0x3},
- 155: {cat: 0x75, setID: 0x3},
- 156: {cat: 0x21, setID: 0x3},
- 157: {cat: 0x22, setID: 0x1},
- 158: {cat: 0x23, setID: 0x2},
- 159: {cat: 0x2c, setID: 0x22},
- 160: {cat: 0x2d, setID: 0x5},
- 161: {cat: 0x21, setID: 0x3},
- 162: {cat: 0x22, setID: 0x1},
- 163: {cat: 0x23, setID: 0x2},
- 164: {cat: 0x24, setID: 0x23},
- 165: {cat: 0x25, setID: 0x24},
-} // Size: 356 bytes
-
-var cardinalIndex = []uint8{ // 36 elements
- 0x00, 0x00, 0x02, 0x03, 0x04, 0x06, 0x09, 0x0a,
- 0x0c, 0x0d, 0x10, 0x14, 0x17, 0x1d, 0x28, 0x2b,
- 0x2d, 0x2f, 0x32, 0x38, 0x42, 0x45, 0x4c, 0x55,
- 0x5c, 0x61, 0x6d, 0x74, 0x79, 0x7d, 0x89, 0x91,
- 0x95, 0x9c, 0xa1, 0xa6,
-} // Size: 60 bytes
-
-var cardinalLangToIndex = []uint8{ // 775 elements
- // Entry 0 - 3F
- 0x00, 0x08, 0x08, 0x08, 0x00, 0x00, 0x06, 0x06,
- 0x01, 0x01, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
- 0x01, 0x01, 0x08, 0x08, 0x04, 0x04, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x00, 0x00, 0x1a, 0x1a, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x06, 0x00, 0x00,
- // Entry 40 - 7F
- 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x1e, 0x1e,
- 0x08, 0x08, 0x13, 0x13, 0x13, 0x13, 0x13, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
- 0x18, 0x18, 0x00, 0x00, 0x22, 0x22, 0x09, 0x09,
- 0x09, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x00, 0x00, 0x16, 0x16, 0x00,
- 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 80 - BF
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry C0 - FF
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
- // Entry 100 - 13F
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x04, 0x04,
- 0x08, 0x08, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x04, 0x04, 0x0c, 0x0c,
- 0x08, 0x08, 0x08, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 140 - 17F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x08, 0x08, 0x04, 0x04, 0x1f, 0x1f,
- 0x14, 0x14, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08,
- 0x01, 0x01, 0x06, 0x00, 0x00, 0x20, 0x20, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x17, 0x17, 0x01,
- 0x01, 0x13, 0x13, 0x13, 0x16, 0x16, 0x08, 0x08,
- 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 180 - 1BF
- 0x00, 0x04, 0x0a, 0x0a, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x10, 0x17, 0x00, 0x00, 0x00, 0x08, 0x08,
- 0x04, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x02,
- 0x02, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08,
- 0x08, 0x08, 0x00, 0x00, 0x0f, 0x0f, 0x08, 0x10,
- // Entry 1C0 - 1FF
- 0x10, 0x08, 0x08, 0x0e, 0x0e, 0x08, 0x08, 0x08,
- 0x08, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x1b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0d, 0x08,
- 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06,
- 0x00, 0x00, 0x08, 0x08, 0x0b, 0x0b, 0x08, 0x08,
- 0x08, 0x08, 0x12, 0x01, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 200 - 23F
- 0x00, 0x08, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00,
- 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x08,
- 0x06, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x08, 0x19, 0x19, 0x0d, 0x0d,
- 0x08, 0x08, 0x03, 0x04, 0x03, 0x04, 0x04, 0x04,
- // Entry 240 - 27F
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x12,
- 0x12, 0x12, 0x08, 0x08, 0x1d, 0x1d, 0x1d, 0x1d,
- 0x1d, 0x1d, 0x1d, 0x00, 0x00, 0x08, 0x08, 0x00,
- 0x00, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08,
- 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x00, 0x00,
- 0x00, 0x00, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11,
- 0x05, 0x05, 0x18, 0x18, 0x15, 0x15, 0x10, 0x10,
- // Entry 280 - 2BF
- 0x10, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x13,
- 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13,
- 0x13, 0x13, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x08,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06,
- 0x08, 0x08, 0x08, 0x0c, 0x08, 0x00, 0x00, 0x08,
- // Entry 2C0 - 2FF
- 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x07,
- 0x07, 0x08, 0x08, 0x1d, 0x1d, 0x04, 0x04, 0x04,
- 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08,
- 0x08, 0x08, 0x08, 0x06, 0x08, 0x08, 0x00, 0x00,
- 0x08, 0x08, 0x08, 0x00, 0x00, 0x04, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 300 - 33F
- 0x00, 0x00, 0x00, 0x01, 0x01, 0x04, 0x04,
-} // Size: 799 bytes
-
-var cardinalInclusionMasks = []uint64{ // 100 elements
- // Entry 0 - 1F
- 0x0000000200500419, 0x0000000000512153, 0x000000000a327105, 0x0000000ca23c7101,
- 0x00000004a23c7201, 0x0000000482943001, 0x0000001482943201, 0x0000000502943001,
- 0x0000000502943001, 0x0000000522943201, 0x0000000540543401, 0x00000000454128e1,
- 0x000000005b02e821, 0x000000006304e821, 0x000000006304ea21, 0x0000000042842821,
- 0x0000000042842a21, 0x0000000042842821, 0x0000000042842821, 0x0000000062842a21,
- 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021,
- 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021,
- 0x0000000002800021, 0x0000000022800221, 0x0000000000400421, 0x0000000000400061,
- // Entry 20 - 3F
- 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021,
- 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221,
- 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021,
- 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021,
- 0x0000000002800021, 0x0000000022800221, 0x0000000000400421, 0x0000000000400061,
- 0x000000000a004021, 0x0000000022004021, 0x0000000022004221, 0x0000000002800021,
- 0x0000000002800221, 0x0000000002800021, 0x0000000002800021, 0x0000000022800221,
- 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021,
- // Entry 40 - 5F
- 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021,
- 0x0000000002800021, 0x0000000022800221, 0x0000000040400421, 0x0000000044400061,
- 0x000000005a004021, 0x0000000062004021, 0x0000000062004221, 0x0000000042800021,
- 0x0000000042800221, 0x0000000042800021, 0x0000000042800021, 0x0000000062800221,
- 0x0000000200400421, 0x0000000000400061, 0x000000000a004021, 0x0000000022004021,
- 0x0000000022004221, 0x0000000002800021, 0x0000000002800221, 0x0000000002800021,
- 0x0000000002800021, 0x0000000022800221, 0x0000000040400421, 0x0000000044400061,
- 0x000000005a004021, 0x0000000062004021, 0x0000000062004221, 0x0000000042800021,
- // Entry 60 - 7F
- 0x0000000042800221, 0x0000000042800021, 0x0000000042800021, 0x0000000062800221,
-} // Size: 824 bytes
-
-// Slots used for cardinal: A6 of 0xFF rules; 24 of 0xFF indexes; 37 of 64 sets
-
-// Total table size 3860 bytes (3KiB); checksum: AAFBF21
diff --git a/vendor/golang.org/x/text/internal/catmsg/catmsg.go b/vendor/golang.org/x/text/internal/catmsg/catmsg.go
deleted file mode 100644
index 1b257a7..0000000
--- a/vendor/golang.org/x/text/internal/catmsg/catmsg.go
+++ /dev/null
@@ -1,417 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package catmsg contains support types for package x/text/message/catalog.
-//
-// This package contains the low-level implementations of Message used by the
-// catalog package and provides primitives for other packages to implement their
-// own. For instance, the plural package provides functionality for selecting
-// translation strings based on the plural category of substitution arguments.
-//
-// # Encoding and Decoding
-//
-// Catalogs store Messages encoded as a single string. Compiling a message into
-// a string both results in compacter representation and speeds up evaluation.
-//
-// A Message must implement a Compile method to convert its arbitrary
-// representation to a string. The Compile method takes an Encoder which
-// facilitates serializing the message. Encoders also provide more context of
-// the messages's creation (such as for which language the message is intended),
-// which may not be known at the time of the creation of the message.
-//
-// Each message type must also have an accompanying decoder registered to decode
-// the message. This decoder takes a Decoder argument which provides the
-// counterparts for the decoding.
-//
-// # Renderers
-//
-// A Decoder must be initialized with a Renderer implementation. These
-// implementations must be provided by packages that use Catalogs, typically
-// formatting packages such as x/text/message. A typical user will not need to
-// worry about this type; it is only relevant to packages that do string
-// formatting and want to use the catalog package to handle localized strings.
-//
-// A package that uses catalogs for selecting strings receives selection results
-// as sequence of substrings passed to the Renderer. The following snippet shows
-// how to express the above example using the message package.
-//
-// message.Set(language.English, "You are %d minute(s) late.",
-// catalog.Var("minutes", plural.Select(1, "one", "minute")),
-// catalog.String("You are %[1]d ${minutes} late."))
-//
-// p := message.NewPrinter(language.English)
-// p.Printf("You are %d minute(s) late.", 5) // always 5 minutes late.
-//
-// To evaluate the Printf, package message wraps the arguments in a Renderer
-// that is passed to the catalog for message decoding. The call sequence that
-// results from evaluating the above message, assuming the person is rather
-// tardy, is:
-//
-// Render("You are %[1]d ")
-// Arg(1)
-// Render("minutes")
-// Render(" late.")
-//
-// The calls to Arg is caused by the plural.Select execution, which evaluates
-// the argument to determine whether the singular or plural message form should
-// be selected. The calls to Render reports the partial results to the message
-// package for further evaluation.
-package catmsg
-
-import (
- "errors"
- "fmt"
- "strconv"
- "strings"
- "sync"
-
- "golang.org/x/text/language"
-)
-
-// A Handle refers to a registered message type.
-type Handle int
-
-// A Handler decodes and evaluates data compiled by a Message and sends the
-// result to the Decoder. The output may depend on the value of the substitution
-// arguments, accessible by the Decoder's Arg method. The Handler returns false
-// if there is no translation for the given substitution arguments.
-type Handler func(d *Decoder) bool
-
-// Register records the existence of a message type and returns a Handle that
-// can be used in the Encoder's EncodeMessageType method to create such
-// messages. The prefix of the name should be the package path followed by
-// an optional disambiguating string.
-// Register will panic if a handle for the same name was already registered.
-func Register(name string, handler Handler) Handle {
- mutex.Lock()
- defer mutex.Unlock()
-
- if _, ok := names[name]; ok {
- panic(fmt.Errorf("catmsg: handler for %q already exists", name))
- }
- h := Handle(len(handlers))
- names[name] = h
- handlers = append(handlers, handler)
- return h
-}
-
-// These handlers require fixed positions in the handlers slice.
-const (
- msgVars Handle = iota
- msgFirst
- msgRaw
- msgString
- msgAffix
- // Leave some arbitrary room for future expansion: 20 should suffice.
- numInternal = 20
-)
-
-const prefix = "golang.org/x/text/internal/catmsg."
-
-var (
- // TODO: find a more stable way to link handles to message types.
- mutex sync.Mutex
- names = map[string]Handle{
- prefix + "Vars": msgVars,
- prefix + "First": msgFirst,
- prefix + "Raw": msgRaw,
- prefix + "String": msgString,
- prefix + "Affix": msgAffix,
- }
- handlers = make([]Handler, numInternal)
-)
-
-func init() {
- // This handler is a message type wrapper that initializes a decoder
- // with a variable block. This message type, if present, is always at the
- // start of an encoded message.
- handlers[msgVars] = func(d *Decoder) bool {
- blockSize := int(d.DecodeUint())
- d.vars = d.data[:blockSize]
- d.data = d.data[blockSize:]
- return d.executeMessage()
- }
-
- // First takes the first message in a sequence that results in a match for
- // the given substitution arguments.
- handlers[msgFirst] = func(d *Decoder) bool {
- for !d.Done() {
- if d.ExecuteMessage() {
- return true
- }
- }
- return false
- }
-
- handlers[msgRaw] = func(d *Decoder) bool {
- d.Render(d.data)
- return true
- }
-
- // A String message alternates between a string constant and a variable
- // substitution.
- handlers[msgString] = func(d *Decoder) bool {
- for !d.Done() {
- if str := d.DecodeString(); str != "" {
- d.Render(str)
- }
- if d.Done() {
- break
- }
- d.ExecuteSubstitution()
- }
- return true
- }
-
- handlers[msgAffix] = func(d *Decoder) bool {
- // TODO: use an alternative method for common cases.
- prefix := d.DecodeString()
- suffix := d.DecodeString()
- if prefix != "" {
- d.Render(prefix)
- }
- ret := d.ExecuteMessage()
- if suffix != "" {
- d.Render(suffix)
- }
- return ret
- }
-}
-
-var (
- // ErrIncomplete indicates a compiled message does not define translations
- // for all possible argument values. If this message is returned, evaluating
- // a message may result in the ErrNoMatch error.
- ErrIncomplete = errors.New("catmsg: incomplete message; may not give result for all inputs")
-
- // ErrNoMatch indicates no translation message matched the given input
- // parameters when evaluating a message.
- ErrNoMatch = errors.New("catmsg: no translation for inputs")
-)
-
-// A Message holds a collection of translations for the same phrase that may
-// vary based on the values of substitution arguments.
-type Message interface {
- // Compile encodes the format string(s) of the message as a string for later
- // evaluation.
- //
- // The first call Compile makes on the encoder must be EncodeMessageType.
- // The handle passed to this call may either be a handle returned by
- // Register to encode a single custom message, or HandleFirst followed by
- // a sequence of calls to EncodeMessage.
- //
- // Compile must return ErrIncomplete if it is possible for evaluation to
- // not match any translation for a given set of formatting parameters.
- // For example, selecting a translation based on plural form may not yield
- // a match if the form "Other" is not one of the selectors.
- //
- // Compile may return any other application-specific error. For backwards
- // compatibility with package like fmt, which often do not do sanity
- // checking of format strings ahead of time, Compile should still make an
- // effort to have some sensible fallback in case of an error.
- Compile(e *Encoder) error
-}
-
-// Compile converts a Message to a data string that can be stored in a Catalog.
-// The resulting string can subsequently be decoded by passing to the Execute
-// method of a Decoder.
-func Compile(tag language.Tag, macros Dictionary, m Message) (data string, err error) {
- // TODO: pass macros so they can be used for validation.
- v := &Encoder{inBody: true} // encoder for variables
- v.root = v
- e := &Encoder{root: v, parent: v, tag: tag} // encoder for messages
- err = m.Compile(e)
- // This package serves te message package, which in turn is meant to be a
- // drop-in replacement for fmt. With the fmt package, format strings are
- // evaluated lazily and errors are handled by substituting strings in the
- // result, rather then returning an error. Dealing with multiple languages
- // makes it more important to check errors ahead of time. We chose to be
- // consistent and compatible and allow graceful degradation in case of
- // errors.
- buf := e.buf[stripPrefix(e.buf):]
- if len(v.buf) > 0 {
- // Prepend variable block.
- b := make([]byte, 1+maxVarintBytes+len(v.buf)+len(buf))
- b[0] = byte(msgVars)
- b = b[:1+encodeUint(b[1:], uint64(len(v.buf)))]
- b = append(b, v.buf...)
- b = append(b, buf...)
- buf = b
- }
- if err == nil {
- err = v.err
- }
- return string(buf), err
-}
-
-// FirstOf is a message type that prints the first message in the sequence that
-// resolves to a match for the given substitution arguments.
-type FirstOf []Message
-
-// Compile implements Message.
-func (s FirstOf) Compile(e *Encoder) error {
- e.EncodeMessageType(msgFirst)
- err := ErrIncomplete
- for i, m := range s {
- if err == nil {
- return fmt.Errorf("catalog: message argument %d is complete and blocks subsequent messages", i-1)
- }
- err = e.EncodeMessage(m)
- }
- return err
-}
-
-// Var defines a message that can be substituted for a placeholder of the same
-// name. If an expression does not result in a string after evaluation, Name is
-// used as the substitution. For example:
-//
-// Var{
-// Name: "minutes",
-// Message: plural.Select(1, "one", "minute"),
-// }
-//
-// will resolve to minute for singular and minutes for plural forms.
-type Var struct {
- Name string
- Message Message
-}
-
-var errIsVar = errors.New("catmsg: variable used as message")
-
-// Compile implements Message.
-//
-// Note that this method merely registers a variable; it does not create an
-// encoded message.
-func (v *Var) Compile(e *Encoder) error {
- if err := e.addVar(v.Name, v.Message); err != nil {
- return err
- }
- // Using a Var by itself is an error. If it is in a sequence followed by
- // other messages referring to it, this error will be ignored.
- return errIsVar
-}
-
-// Raw is a message consisting of a single format string that is passed as is
-// to the Renderer.
-//
-// Note that a Renderer may still do its own variable substitution.
-type Raw string
-
-// Compile implements Message.
-func (r Raw) Compile(e *Encoder) (err error) {
- e.EncodeMessageType(msgRaw)
- // Special case: raw strings don't have a size encoding and so don't use
- // EncodeString.
- e.buf = append(e.buf, r...)
- return nil
-}
-
-// String is a message consisting of a single format string which contains
-// placeholders that may be substituted with variables.
-//
-// Variable substitutions are marked with placeholders and a variable name of
-// the form ${name}. Any other substitutions such as Go templates or
-// printf-style substitutions are left to be done by the Renderer.
-//
-// When evaluation a string interpolation, a Renderer will receive separate
-// calls for each placeholder and interstitial string. For example, for the
-// message: "%[1]v ${invites} %[2]v to ${their} party." The sequence of calls
-// is:
-//
-// d.Render("%[1]v ")
-// d.Arg(1)
-// d.Render(resultOfInvites)
-// d.Render(" %[2]v to ")
-// d.Arg(2)
-// d.Render(resultOfTheir)
-// d.Render(" party.")
-//
-// where the messages for "invites" and "their" both use a plural.Select
-// referring to the first argument.
-//
-// Strings may also invoke macros. Macros are essentially variables that can be
-// reused. Macros may, for instance, be used to make selections between
-// different conjugations of a verb. See the catalog package description for an
-// overview of macros.
-type String string
-
-// Compile implements Message. It parses the placeholder formats and returns
-// any error.
-func (s String) Compile(e *Encoder) (err error) {
- msg := string(s)
- const subStart = "${"
- hasHeader := false
- p := 0
- b := []byte{}
- for {
- i := strings.Index(msg[p:], subStart)
- if i == -1 {
- break
- }
- b = append(b, msg[p:p+i]...)
- p += i + len(subStart)
- if i = strings.IndexByte(msg[p:], '}'); i == -1 {
- b = append(b, "$!(MISSINGBRACE)"...)
- err = fmt.Errorf("catmsg: missing '}'")
- p = len(msg)
- break
- }
- name := strings.TrimSpace(msg[p : p+i])
- if q := strings.IndexByte(name, '('); q == -1 {
- if !hasHeader {
- hasHeader = true
- e.EncodeMessageType(msgString)
- }
- e.EncodeString(string(b))
- e.EncodeSubstitution(name)
- b = b[:0]
- } else if j := strings.IndexByte(name[q:], ')'); j == -1 {
- // TODO: what should the error be?
- b = append(b, "$!(MISSINGPAREN)"...)
- err = fmt.Errorf("catmsg: missing ')'")
- } else if x, sErr := strconv.ParseUint(strings.TrimSpace(name[q+1:q+j]), 10, 32); sErr != nil {
- // TODO: handle more than one argument
- b = append(b, "$!(BADNUM)"...)
- err = fmt.Errorf("catmsg: invalid number %q", strings.TrimSpace(name[q+1:q+j]))
- } else {
- if !hasHeader {
- hasHeader = true
- e.EncodeMessageType(msgString)
- }
- e.EncodeString(string(b))
- e.EncodeSubstitution(name[:q], int(x))
- b = b[:0]
- }
- p += i + 1
- }
- b = append(b, msg[p:]...)
- if !hasHeader {
- // Simplify string to a raw string.
- Raw(string(b)).Compile(e)
- } else if len(b) > 0 {
- e.EncodeString(string(b))
- }
- return err
-}
-
-// Affix is a message that adds a prefix and suffix to another message.
-// This is mostly used add back whitespace to a translation that was stripped
-// before sending it out.
-type Affix struct {
- Message Message
- Prefix string
- Suffix string
-}
-
-// Compile implements Message.
-func (a Affix) Compile(e *Encoder) (err error) {
- // TODO: consider adding a special message type that just adds a single
- // return. This is probably common enough to handle the majority of cases.
- // Get some stats first, though.
- e.EncodeMessageType(msgAffix)
- e.EncodeString(a.Prefix)
- e.EncodeString(a.Suffix)
- e.EncodeMessage(a.Message)
- return nil
-}
diff --git a/vendor/golang.org/x/text/internal/catmsg/codec.go b/vendor/golang.org/x/text/internal/catmsg/codec.go
deleted file mode 100644
index 49c9fc9..0000000
--- a/vendor/golang.org/x/text/internal/catmsg/codec.go
+++ /dev/null
@@ -1,407 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package catmsg
-
-import (
- "errors"
- "fmt"
-
- "golang.org/x/text/language"
-)
-
-// A Renderer renders a Message.
-type Renderer interface {
- // Render renders the given string. The given string may be interpreted as a
- // format string, such as the one used by the fmt package or a template.
- Render(s string)
-
- // Arg returns the i-th argument passed to format a message. This method
- // should return nil if there is no such argument. Messages need access to
- // arguments to allow selecting a message based on linguistic features of
- // those arguments.
- Arg(i int) interface{}
-}
-
-// A Dictionary specifies a source of messages, including variables or macros.
-type Dictionary interface {
- // Lookup returns the message for the given key. It returns false for ok if
- // such a message could not be found.
- Lookup(key string) (data string, ok bool)
-
- // TODO: consider returning an interface, instead of a string. This will
- // allow implementations to do their own message type decoding.
-}
-
-// An Encoder serializes a Message to a string.
-type Encoder struct {
- // The root encoder is used for storing encoded variables.
- root *Encoder
- // The parent encoder provides the surrounding scopes for resolving variable
- // names.
- parent *Encoder
-
- tag language.Tag
-
- // buf holds the encoded message so far. After a message completes encoding,
- // the contents of buf, prefixed by the encoded length, are flushed to the
- // parent buffer.
- buf []byte
-
- // vars is the lookup table of variables in the current scope.
- vars []keyVal
-
- err error
- inBody bool // if false next call must be EncodeMessageType
-}
-
-type keyVal struct {
- key string
- offset int
-}
-
-// Language reports the language for which the encoded message will be stored
-// in the Catalog.
-func (e *Encoder) Language() language.Tag { return e.tag }
-
-func (e *Encoder) setError(err error) {
- if e.root.err == nil {
- e.root.err = err
- }
-}
-
-// EncodeUint encodes x.
-func (e *Encoder) EncodeUint(x uint64) {
- e.checkInBody()
- var buf [maxVarintBytes]byte
- n := encodeUint(buf[:], x)
- e.buf = append(e.buf, buf[:n]...)
-}
-
-// EncodeString encodes s.
-func (e *Encoder) EncodeString(s string) {
- e.checkInBody()
- e.EncodeUint(uint64(len(s)))
- e.buf = append(e.buf, s...)
-}
-
-// EncodeMessageType marks the current message to be of type h.
-//
-// It must be the first call of a Message's Compile method.
-func (e *Encoder) EncodeMessageType(h Handle) {
- if e.inBody {
- panic("catmsg: EncodeMessageType not the first method called")
- }
- e.inBody = true
- e.EncodeUint(uint64(h))
-}
-
-// EncodeMessage serializes the given message inline at the current position.
-func (e *Encoder) EncodeMessage(m Message) error {
- e = &Encoder{root: e.root, parent: e, tag: e.tag}
- err := m.Compile(e)
- if _, ok := m.(*Var); !ok {
- e.flushTo(e.parent)
- }
- return err
-}
-
-func (e *Encoder) checkInBody() {
- if !e.inBody {
- panic("catmsg: expected prior call to EncodeMessageType")
- }
-}
-
-// stripPrefix indicates the number of prefix bytes that must be stripped to
-// turn a single-element sequence into a message that is just this single member
-// without its size prefix. If the message can be stripped, b[1:n] contains the
-// size prefix.
-func stripPrefix(b []byte) (n int) {
- if len(b) > 0 && Handle(b[0]) == msgFirst {
- x, n, _ := decodeUint(b[1:])
- if 1+n+int(x) == len(b) {
- return 1 + n
- }
- }
- return 0
-}
-
-func (e *Encoder) flushTo(dst *Encoder) {
- data := e.buf
- p := stripPrefix(data)
- if p > 0 {
- data = data[1:]
- } else {
- // Prefix the size.
- dst.EncodeUint(uint64(len(data)))
- }
- dst.buf = append(dst.buf, data...)
-}
-
-func (e *Encoder) addVar(key string, m Message) error {
- for _, v := range e.parent.vars {
- if v.key == key {
- err := fmt.Errorf("catmsg: duplicate variable %q", key)
- e.setError(err)
- return err
- }
- }
- scope := e.parent
- // If a variable message is Incomplete, and does not evaluate to a message
- // during execution, we fall back to the variable name. We encode this by
- // appending the variable name if the message reports it's incomplete.
-
- err := m.Compile(e)
- if err != ErrIncomplete {
- e.setError(err)
- }
- switch {
- case len(e.buf) == 1 && Handle(e.buf[0]) == msgFirst: // empty sequence
- e.buf = e.buf[:0]
- e.inBody = false
- fallthrough
- case len(e.buf) == 0:
- // Empty message.
- if err := String(key).Compile(e); err != nil {
- e.setError(err)
- }
- case err == ErrIncomplete:
- if Handle(e.buf[0]) != msgFirst {
- seq := &Encoder{root: e.root, parent: e}
- seq.EncodeMessageType(msgFirst)
- e.flushTo(seq)
- e = seq
- }
- // e contains a sequence; append the fallback string.
- e.EncodeMessage(String(key))
- }
-
- // Flush result to variable heap.
- offset := len(e.root.buf)
- e.flushTo(e.root)
- e.buf = e.buf[:0]
-
- // Record variable offset in current scope.
- scope.vars = append(scope.vars, keyVal{key: key, offset: offset})
- return err
-}
-
-const (
- substituteVar = iota
- substituteMacro
- substituteError
-)
-
-// EncodeSubstitution inserts a resolved reference to a variable or macro.
-//
-// This call must be matched with a call to ExecuteSubstitution at decoding
-// time.
-func (e *Encoder) EncodeSubstitution(name string, arguments ...int) {
- if arity := len(arguments); arity > 0 {
- // TODO: also resolve macros.
- e.EncodeUint(substituteMacro)
- e.EncodeString(name)
- for _, a := range arguments {
- e.EncodeUint(uint64(a))
- }
- return
- }
- for scope := e; scope != nil; scope = scope.parent {
- for _, v := range scope.vars {
- if v.key != name {
- continue
- }
- e.EncodeUint(substituteVar) // TODO: support arity > 0
- e.EncodeUint(uint64(v.offset))
- return
- }
- }
- // TODO: refer to dictionary-wide scoped variables.
- e.EncodeUint(substituteError)
- e.EncodeString(name)
- e.setError(fmt.Errorf("catmsg: unknown var %q", name))
-}
-
-// A Decoder deserializes and evaluates messages that are encoded by an encoder.
-type Decoder struct {
- tag language.Tag
- dst Renderer
- macros Dictionary
-
- err error
- vars string
- data string
-
- macroArg int // TODO: allow more than one argument
-}
-
-// NewDecoder returns a new Decoder.
-//
-// Decoders are designed to be reused for multiple invocations of Execute.
-// Only one goroutine may call Execute concurrently.
-func NewDecoder(tag language.Tag, r Renderer, macros Dictionary) *Decoder {
- return &Decoder{
- tag: tag,
- dst: r,
- macros: macros,
- }
-}
-
-func (d *Decoder) setError(err error) {
- if d.err == nil {
- d.err = err
- }
-}
-
-// Language returns the language in which the message is being rendered.
-//
-// The destination language may be a child language of the language used for
-// encoding. For instance, a decoding language of "pt-PT"" is consistent with an
-// encoding language of "pt".
-func (d *Decoder) Language() language.Tag { return d.tag }
-
-// Done reports whether there are more bytes to process in this message.
-func (d *Decoder) Done() bool { return len(d.data) == 0 }
-
-// Render implements Renderer.
-func (d *Decoder) Render(s string) { d.dst.Render(s) }
-
-// Arg implements Renderer.
-//
-// During evaluation of macros, the argument positions may be mapped to
-// arguments that differ from the original call.
-func (d *Decoder) Arg(i int) interface{} {
- if d.macroArg != 0 {
- if i != 1 {
- panic("catmsg: only macros with single argument supported")
- }
- i = d.macroArg
- }
- return d.dst.Arg(i)
-}
-
-// DecodeUint decodes a number that was encoded with EncodeUint and advances the
-// position.
-func (d *Decoder) DecodeUint() uint64 {
- x, n, err := decodeUintString(d.data)
- d.data = d.data[n:]
- if err != nil {
- d.setError(err)
- }
- return x
-}
-
-// DecodeString decodes a string that was encoded with EncodeString and advances
-// the position.
-func (d *Decoder) DecodeString() string {
- size := d.DecodeUint()
- s := d.data[:size]
- d.data = d.data[size:]
- return s
-}
-
-// SkipMessage skips the message at the current location and advances the
-// position.
-func (d *Decoder) SkipMessage() {
- n := int(d.DecodeUint())
- d.data = d.data[n:]
-}
-
-// Execute decodes and evaluates msg.
-//
-// Only one goroutine may call execute.
-func (d *Decoder) Execute(msg string) error {
- d.err = nil
- if !d.execute(msg) {
- return ErrNoMatch
- }
- return d.err
-}
-
-func (d *Decoder) execute(msg string) bool {
- saved := d.data
- d.data = msg
- ok := d.executeMessage()
- d.data = saved
- return ok
-}
-
-// executeMessageFromData is like execute, but also decodes a leading message
-// size and clips the given string accordingly.
-//
-// It reports the number of bytes consumed and whether a message was selected.
-func (d *Decoder) executeMessageFromData(s string) (n int, ok bool) {
- saved := d.data
- d.data = s
- size := int(d.DecodeUint())
- n = len(s) - len(d.data)
- // Sanitize the setting. This allows skipping a size argument for
- // RawString and method Done.
- d.data = d.data[:size]
- ok = d.executeMessage()
- n += size - len(d.data)
- d.data = saved
- return n, ok
-}
-
-var errUnknownHandler = errors.New("catmsg: string contains unsupported handler")
-
-// executeMessage reads the handle id, initializes the decoder and executes the
-// message. It is assumed that all of d.data[d.p:] is the single message.
-func (d *Decoder) executeMessage() bool {
- if d.Done() {
- // We interpret no data as a valid empty message.
- return true
- }
- handle := d.DecodeUint()
-
- var fn Handler
- mutex.Lock()
- if int(handle) < len(handlers) {
- fn = handlers[handle]
- }
- mutex.Unlock()
- if fn == nil {
- d.setError(errUnknownHandler)
- d.execute(fmt.Sprintf("\x02$!(UNKNOWNMSGHANDLER=%#x)", handle))
- return true
- }
- return fn(d)
-}
-
-// ExecuteMessage decodes and executes the message at the current position.
-func (d *Decoder) ExecuteMessage() bool {
- n, ok := d.executeMessageFromData(d.data)
- d.data = d.data[n:]
- return ok
-}
-
-// ExecuteSubstitution executes the message corresponding to the substitution
-// as encoded by EncodeSubstitution.
-func (d *Decoder) ExecuteSubstitution() {
- switch x := d.DecodeUint(); x {
- case substituteVar:
- offset := d.DecodeUint()
- d.executeMessageFromData(d.vars[offset:])
- case substituteMacro:
- name := d.DecodeString()
- data, ok := d.macros.Lookup(name)
- old := d.macroArg
- // TODO: support macros of arity other than 1.
- d.macroArg = int(d.DecodeUint())
- switch {
- case !ok:
- // TODO: detect this at creation time.
- d.setError(fmt.Errorf("catmsg: undefined macro %q", name))
- fallthrough
- case !d.execute(data):
- d.dst.Render(name) // fall back to macro name.
- }
- d.macroArg = old
- case substituteError:
- d.dst.Render(d.DecodeString())
- default:
- panic("catmsg: unreachable")
- }
-}
diff --git a/vendor/golang.org/x/text/internal/catmsg/varint.go b/vendor/golang.org/x/text/internal/catmsg/varint.go
deleted file mode 100644
index a2cee2c..0000000
--- a/vendor/golang.org/x/text/internal/catmsg/varint.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package catmsg
-
-// This file implements varint encoding analogous to the one in encoding/binary.
-// We need a string version of this function, so we add that here and then add
-// the rest for consistency.
-
-import "errors"
-
-var (
- errIllegalVarint = errors.New("catmsg: illegal varint")
- errVarintTooLarge = errors.New("catmsg: varint too large for uint64")
-)
-
-const maxVarintBytes = 10 // maximum length of a varint
-
-// encodeUint encodes x as a variable-sized integer into buf and returns the
-// number of bytes written. buf must be at least maxVarintBytes long
-func encodeUint(buf []byte, x uint64) (n int) {
- for ; x > 127; n++ {
- buf[n] = 0x80 | uint8(x&0x7F)
- x >>= 7
- }
- buf[n] = uint8(x)
- n++
- return n
-}
-
-func decodeUintString(s string) (x uint64, size int, err error) {
- i := 0
- for shift := uint(0); shift < 64; shift += 7 {
- if i >= len(s) {
- return 0, i, errIllegalVarint
- }
- b := uint64(s[i])
- i++
- x |= (b & 0x7F) << shift
- if b&0x80 == 0 {
- return x, i, nil
- }
- }
- return 0, i, errVarintTooLarge
-}
-
-func decodeUint(b []byte) (x uint64, size int, err error) {
- i := 0
- for shift := uint(0); shift < 64; shift += 7 {
- if i >= len(b) {
- return 0, i, errIllegalVarint
- }
- c := uint64(b[i])
- i++
- x |= (c & 0x7F) << shift
- if c&0x80 == 0 {
- return x, i, nil
- }
- }
- return 0, i, errVarintTooLarge
-}
diff --git a/vendor/golang.org/x/text/internal/format/format.go b/vendor/golang.org/x/text/internal/format/format.go
deleted file mode 100644
index ee1c57a..0000000
--- a/vendor/golang.org/x/text/internal/format/format.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package format contains types for defining language-specific formatting of
-// values.
-//
-// This package is internal now, but will eventually be exposed after the API
-// settles.
-package format // import "golang.org/x/text/internal/format"
-
-import (
- "fmt"
-
- "golang.org/x/text/language"
-)
-
-// State represents the printer state passed to custom formatters. It provides
-// access to the fmt.State interface and the sentence and language-related
-// context.
-type State interface {
- fmt.State
-
- // Language reports the requested language in which to render a message.
- Language() language.Tag
-
- // TODO: consider this and removing rune from the Format method in the
- // Formatter interface.
- //
- // Verb returns the format variant to render, analogous to the types used
- // in fmt. Use 'v' for the default or only variant.
- // Verb() rune
-
- // TODO: more info:
- // - sentence context such as linguistic features passed by the translator.
-}
-
-// Formatter is analogous to fmt.Formatter.
-type Formatter interface {
- Format(state State, verb rune)
-}
diff --git a/vendor/golang.org/x/text/internal/format/parser.go b/vendor/golang.org/x/text/internal/format/parser.go
deleted file mode 100644
index 855aed7..0000000
--- a/vendor/golang.org/x/text/internal/format/parser.go
+++ /dev/null
@@ -1,358 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package format
-
-import (
- "reflect"
- "unicode/utf8"
-)
-
-// A Parser parses a format string. The result from the parse are set in the
-// struct fields.
-type Parser struct {
- Verb rune
-
- WidthPresent bool
- PrecPresent bool
- Minus bool
- Plus bool
- Sharp bool
- Space bool
- Zero bool
-
- // For the formats %+v %#v, we set the plusV/sharpV flags
- // and clear the plus/sharp flags since %+v and %#v are in effect
- // different, flagless formats set at the top level.
- PlusV bool
- SharpV bool
-
- HasIndex bool
-
- Width int
- Prec int // precision
-
- // retain arguments across calls.
- Args []interface{}
- // retain current argument number across calls
- ArgNum int
-
- // reordered records whether the format string used argument reordering.
- Reordered bool
- // goodArgNum records whether the most recent reordering directive was valid.
- goodArgNum bool
-
- // position info
- format string
- startPos int
- endPos int
- Status Status
-}
-
-// Reset initializes a parser to scan format strings for the given args.
-func (p *Parser) Reset(args []interface{}) {
- p.Args = args
- p.ArgNum = 0
- p.startPos = 0
- p.Reordered = false
-}
-
-// Text returns the part of the format string that was parsed by the last call
-// to Scan. It returns the original substitution clause if the current scan
-// parsed a substitution.
-func (p *Parser) Text() string { return p.format[p.startPos:p.endPos] }
-
-// SetFormat sets a new format string to parse. It does not reset the argument
-// count.
-func (p *Parser) SetFormat(format string) {
- p.format = format
- p.startPos = 0
- p.endPos = 0
-}
-
-// Status indicates the result type of a call to Scan.
-type Status int
-
-const (
- StatusText Status = iota
- StatusSubstitution
- StatusBadWidthSubstitution
- StatusBadPrecSubstitution
- StatusNoVerb
- StatusBadArgNum
- StatusMissingArg
-)
-
-// ClearFlags reset the parser to default behavior.
-func (p *Parser) ClearFlags() {
- p.WidthPresent = false
- p.PrecPresent = false
- p.Minus = false
- p.Plus = false
- p.Sharp = false
- p.Space = false
- p.Zero = false
-
- p.PlusV = false
- p.SharpV = false
-
- p.HasIndex = false
-}
-
-// Scan scans the next part of the format string and sets the status to
-// indicate whether it scanned a string literal, substitution or error.
-func (p *Parser) Scan() bool {
- p.Status = StatusText
- format := p.format
- end := len(format)
- if p.endPos >= end {
- return false
- }
- afterIndex := false // previous item in format was an index like [3].
-
- p.startPos = p.endPos
- p.goodArgNum = true
- i := p.startPos
- for i < end && format[i] != '%' {
- i++
- }
- if i > p.startPos {
- p.endPos = i
- return true
- }
- // Process one verb
- i++
-
- p.Status = StatusSubstitution
-
- // Do we have flags?
- p.ClearFlags()
-
-simpleFormat:
- for ; i < end; i++ {
- c := p.format[i]
- switch c {
- case '#':
- p.Sharp = true
- case '0':
- p.Zero = !p.Minus // Only allow zero padding to the left.
- case '+':
- p.Plus = true
- case '-':
- p.Minus = true
- p.Zero = false // Do not pad with zeros to the right.
- case ' ':
- p.Space = true
- default:
- // Fast path for common case of ascii lower case simple verbs
- // without precision or width or argument indices.
- if 'a' <= c && c <= 'z' && p.ArgNum < len(p.Args) {
- if c == 'v' {
- // Go syntax
- p.SharpV = p.Sharp
- p.Sharp = false
- // Struct-field syntax
- p.PlusV = p.Plus
- p.Plus = false
- }
- p.Verb = rune(c)
- p.ArgNum++
- p.endPos = i + 1
- return true
- }
- // Format is more complex than simple flags and a verb or is malformed.
- break simpleFormat
- }
- }
-
- // Do we have an explicit argument index?
- i, afterIndex = p.updateArgNumber(format, i)
-
- // Do we have width?
- if i < end && format[i] == '*' {
- i++
- p.Width, p.WidthPresent = p.intFromArg()
-
- if !p.WidthPresent {
- p.Status = StatusBadWidthSubstitution
- }
-
- // We have a negative width, so take its value and ensure
- // that the minus flag is set
- if p.Width < 0 {
- p.Width = -p.Width
- p.Minus = true
- p.Zero = false // Do not pad with zeros to the right.
- }
- afterIndex = false
- } else {
- p.Width, p.WidthPresent, i = parsenum(format, i, end)
- if afterIndex && p.WidthPresent { // "%[3]2d"
- p.goodArgNum = false
- }
- }
-
- // Do we have precision?
- if i+1 < end && format[i] == '.' {
- i++
- if afterIndex { // "%[3].2d"
- p.goodArgNum = false
- }
- i, afterIndex = p.updateArgNumber(format, i)
- if i < end && format[i] == '*' {
- i++
- p.Prec, p.PrecPresent = p.intFromArg()
- // Negative precision arguments don't make sense
- if p.Prec < 0 {
- p.Prec = 0
- p.PrecPresent = false
- }
- if !p.PrecPresent {
- p.Status = StatusBadPrecSubstitution
- }
- afterIndex = false
- } else {
- p.Prec, p.PrecPresent, i = parsenum(format, i, end)
- if !p.PrecPresent {
- p.Prec = 0
- p.PrecPresent = true
- }
- }
- }
-
- if !afterIndex {
- i, afterIndex = p.updateArgNumber(format, i)
- }
- p.HasIndex = afterIndex
-
- if i >= end {
- p.endPos = i
- p.Status = StatusNoVerb
- return true
- }
-
- verb, w := utf8.DecodeRuneInString(format[i:])
- p.endPos = i + w
- p.Verb = verb
-
- switch {
- case verb == '%': // Percent does not absorb operands and ignores f.wid and f.prec.
- p.startPos = p.endPos - 1
- p.Status = StatusText
- case !p.goodArgNum:
- p.Status = StatusBadArgNum
- case p.ArgNum >= len(p.Args): // No argument left over to print for the current verb.
- p.Status = StatusMissingArg
- p.ArgNum++
- case verb == 'v':
- // Go syntax
- p.SharpV = p.Sharp
- p.Sharp = false
- // Struct-field syntax
- p.PlusV = p.Plus
- p.Plus = false
- fallthrough
- default:
- p.ArgNum++
- }
- return true
-}
-
-// intFromArg gets the ArgNumth element of Args. On return, isInt reports
-// whether the argument has integer type.
-func (p *Parser) intFromArg() (num int, isInt bool) {
- if p.ArgNum < len(p.Args) {
- arg := p.Args[p.ArgNum]
- num, isInt = arg.(int) // Almost always OK.
- if !isInt {
- // Work harder.
- switch v := reflect.ValueOf(arg); v.Kind() {
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- n := v.Int()
- if int64(int(n)) == n {
- num = int(n)
- isInt = true
- }
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- n := v.Uint()
- if int64(n) >= 0 && uint64(int(n)) == n {
- num = int(n)
- isInt = true
- }
- default:
- // Already 0, false.
- }
- }
- p.ArgNum++
- if tooLarge(num) {
- num = 0
- isInt = false
- }
- }
- return
-}
-
-// parseArgNumber returns the value of the bracketed number, minus 1
-// (explicit argument numbers are one-indexed but we want zero-indexed).
-// The opening bracket is known to be present at format[0].
-// The returned values are the index, the number of bytes to consume
-// up to the closing paren, if present, and whether the number parsed
-// ok. The bytes to consume will be 1 if no closing paren is present.
-func parseArgNumber(format string) (index int, wid int, ok bool) {
- // There must be at least 3 bytes: [n].
- if len(format) < 3 {
- return 0, 1, false
- }
-
- // Find closing bracket.
- for i := 1; i < len(format); i++ {
- if format[i] == ']' {
- width, ok, newi := parsenum(format, 1, i)
- if !ok || newi != i {
- return 0, i + 1, false
- }
- return width - 1, i + 1, true // arg numbers are one-indexed and skip paren.
- }
- }
- return 0, 1, false
-}
-
-// updateArgNumber returns the next argument to evaluate, which is either the value of the passed-in
-// argNum or the value of the bracketed integer that begins format[i:]. It also returns
-// the new value of i, that is, the index of the next byte of the format to process.
-func (p *Parser) updateArgNumber(format string, i int) (newi int, found bool) {
- if len(format) <= i || format[i] != '[' {
- return i, false
- }
- p.Reordered = true
- index, wid, ok := parseArgNumber(format[i:])
- if ok && 0 <= index && index < len(p.Args) {
- p.ArgNum = index
- return i + wid, true
- }
- p.goodArgNum = false
- return i + wid, ok
-}
-
-// tooLarge reports whether the magnitude of the integer is
-// too large to be used as a formatting width or precision.
-func tooLarge(x int) bool {
- const max int = 1e6
- return x > max || x < -max
-}
-
-// parsenum converts ASCII to integer. num is 0 (and isnum is false) if no number present.
-func parsenum(s string, start, end int) (num int, isnum bool, newi int) {
- if start >= end {
- return 0, false, end
- }
- for newi = start; newi < end && '0' <= s[newi] && s[newi] <= '9'; newi++ {
- if tooLarge(num) {
- return 0, false, end // Overflow; crazy long number most likely.
- }
- num = num*10 + int(s[newi]-'0')
- isnum = true
- }
- return
-}
diff --git a/vendor/golang.org/x/text/internal/internal.go b/vendor/golang.org/x/text/internal/internal.go
deleted file mode 100644
index 3cddbbd..0000000
--- a/vendor/golang.org/x/text/internal/internal.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package internal contains non-exported functionality that are used by
-// packages in the text repository.
-package internal // import "golang.org/x/text/internal"
-
-import (
- "sort"
-
- "golang.org/x/text/language"
-)
-
-// SortTags sorts tags in place.
-func SortTags(tags []language.Tag) {
- sort.Sort(sorter(tags))
-}
-
-type sorter []language.Tag
-
-func (s sorter) Len() int {
- return len(s)
-}
-
-func (s sorter) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-
-func (s sorter) Less(i, j int) bool {
- return s[i].String() < s[j].String()
-}
-
-// UniqueTags sorts and filters duplicate tags in place and returns a slice with
-// only unique tags.
-func UniqueTags(tags []language.Tag) []language.Tag {
- if len(tags) <= 1 {
- return tags
- }
- SortTags(tags)
- k := 0
- for i := 1; i < len(tags); i++ {
- if tags[k].String() < tags[i].String() {
- k++
- tags[k] = tags[i]
- }
- }
- return tags[:k+1]
-}
diff --git a/vendor/golang.org/x/text/internal/language/common.go b/vendor/golang.org/x/text/internal/language/common.go
deleted file mode 100644
index cdfdb74..0000000
--- a/vendor/golang.org/x/text/internal/language/common.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package language
-
-// This file contains code common to the maketables.go and the package code.
-
-// AliasType is the type of an alias in AliasMap.
-type AliasType int8
-
-const (
- Deprecated AliasType = iota
- Macro
- Legacy
-
- AliasTypeUnknown AliasType = -1
-)
diff --git a/vendor/golang.org/x/text/internal/language/compact.go b/vendor/golang.org/x/text/internal/language/compact.go
deleted file mode 100644
index 46a0015..0000000
--- a/vendor/golang.org/x/text/internal/language/compact.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-// CompactCoreInfo is a compact integer with the three core tags encoded.
-type CompactCoreInfo uint32
-
-// GetCompactCore generates a uint32 value that is guaranteed to be unique for
-// different language, region, and script values.
-func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) {
- if t.LangID > langNoIndexOffset {
- return 0, false
- }
- cci |= CompactCoreInfo(t.LangID) << (8 + 12)
- cci |= CompactCoreInfo(t.ScriptID) << 12
- cci |= CompactCoreInfo(t.RegionID)
- return cci, true
-}
-
-// Tag generates a tag from c.
-func (c CompactCoreInfo) Tag() Tag {
- return Tag{
- LangID: Language(c >> 20),
- RegionID: Region(c & 0x3ff),
- ScriptID: Script(c>>12) & 0xff,
- }
-}
diff --git a/vendor/golang.org/x/text/internal/language/compact/compact.go b/vendor/golang.org/x/text/internal/language/compact/compact.go
deleted file mode 100644
index 1b36935..0000000
--- a/vendor/golang.org/x/text/internal/language/compact/compact.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package compact defines a compact representation of language tags.
-//
-// Common language tags (at least all for which locale information is defined
-// in CLDR) are assigned a unique index. Each Tag is associated with such an
-// ID for selecting language-related resources (such as translations) as well
-// as one for selecting regional defaults (currency, number formatting, etc.)
-//
-// It may want to export this functionality at some point, but at this point
-// this is only available for use within x/text.
-package compact // import "golang.org/x/text/internal/language/compact"
-
-import (
- "sort"
- "strings"
-
- "golang.org/x/text/internal/language"
-)
-
-// ID is an integer identifying a single tag.
-type ID uint16
-
-func getCoreIndex(t language.Tag) (id ID, ok bool) {
- cci, ok := language.GetCompactCore(t)
- if !ok {
- return 0, false
- }
- i := sort.Search(len(coreTags), func(i int) bool {
- return cci <= coreTags[i]
- })
- if i == len(coreTags) || coreTags[i] != cci {
- return 0, false
- }
- return ID(i), true
-}
-
-// Parent returns the ID of the parent or the root ID if id is already the root.
-func (id ID) Parent() ID {
- return parents[id]
-}
-
-// Tag converts id to an internal language Tag.
-func (id ID) Tag() language.Tag {
- if int(id) >= len(coreTags) {
- return specialTags[int(id)-len(coreTags)]
- }
- return coreTags[id].Tag()
-}
-
-var specialTags []language.Tag
-
-func init() {
- tags := strings.Split(specialTagsStr, " ")
- specialTags = make([]language.Tag, len(tags))
- for i, t := range tags {
- specialTags[i] = language.MustParse(t)
- }
-}
diff --git a/vendor/golang.org/x/text/internal/language/compact/language.go b/vendor/golang.org/x/text/internal/language/compact/language.go
deleted file mode 100644
index 8c1b666..0000000
--- a/vendor/golang.org/x/text/internal/language/compact/language.go
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:generate go run gen.go gen_index.go -output tables.go
-//go:generate go run gen_parents.go
-
-package compact
-
-// TODO: Remove above NOTE after:
-// - verifying that tables are dropped correctly (most notably matcher tables).
-
-import (
- "strings"
-
- "golang.org/x/text/internal/language"
-)
-
-// Tag represents a BCP 47 language tag. It is used to specify an instance of a
-// specific language or locale. All language tag values are guaranteed to be
-// well-formed.
-type Tag struct {
- // NOTE: exported tags will become part of the public API.
- language ID
- locale ID
- full fullTag // always a language.Tag for now.
-}
-
-const _und = 0
-
-type fullTag interface {
- IsRoot() bool
- Parent() language.Tag
-}
-
-// Make a compact Tag from a fully specified internal language Tag.
-func Make(t language.Tag) (tag Tag) {
- if region := t.TypeForKey("rg"); len(region) == 6 && region[2:] == "zzzz" {
- if r, err := language.ParseRegion(region[:2]); err == nil {
- tFull := t
- t, _ = t.SetTypeForKey("rg", "")
- // TODO: should we not consider "va" for the language tag?
- var exact1, exact2 bool
- tag.language, exact1 = FromTag(t)
- t.RegionID = r
- tag.locale, exact2 = FromTag(t)
- if !exact1 || !exact2 {
- tag.full = tFull
- }
- return tag
- }
- }
- lang, ok := FromTag(t)
- tag.language = lang
- tag.locale = lang
- if !ok {
- tag.full = t
- }
- return tag
-}
-
-// Tag returns an internal language Tag version of this tag.
-func (t Tag) Tag() language.Tag {
- if t.full != nil {
- return t.full.(language.Tag)
- }
- tag := t.language.Tag()
- if t.language != t.locale {
- loc := t.locale.Tag()
- tag, _ = tag.SetTypeForKey("rg", strings.ToLower(loc.RegionID.String())+"zzzz")
- }
- return tag
-}
-
-// IsCompact reports whether this tag is fully defined in terms of ID.
-func (t *Tag) IsCompact() bool {
- return t.full == nil
-}
-
-// MayHaveVariants reports whether a tag may have variants. If it returns false
-// it is guaranteed the tag does not have variants.
-func (t Tag) MayHaveVariants() bool {
- return t.full != nil || int(t.language) >= len(coreTags)
-}
-
-// MayHaveExtensions reports whether a tag may have extensions. If it returns
-// false it is guaranteed the tag does not have them.
-func (t Tag) MayHaveExtensions() bool {
- return t.full != nil ||
- int(t.language) >= len(coreTags) ||
- t.language != t.locale
-}
-
-// IsRoot returns true if t is equal to language "und".
-func (t Tag) IsRoot() bool {
- if t.full != nil {
- return t.full.IsRoot()
- }
- return t.language == _und
-}
-
-// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a
-// specific language are substituted with fields from the parent language.
-// The parent for a language may change for newer versions of CLDR.
-func (t Tag) Parent() Tag {
- if t.full != nil {
- return Make(t.full.Parent())
- }
- if t.language != t.locale {
- // Simulate stripping -u-rg-xxxxxx
- return Tag{language: t.language, locale: t.language}
- }
- // TODO: use parent lookup table once cycle from internal package is
- // removed. Probably by internalizing the table and declaring this fast
- // enough.
- // lang := compactID(internal.Parent(uint16(t.language)))
- lang, _ := FromTag(t.language.Tag().Parent())
- return Tag{language: lang, locale: lang}
-}
-
-// nextToken returns token t and the rest of the string.
-func nextToken(s string) (t, tail string) {
- p := strings.Index(s[1:], "-")
- if p == -1 {
- return s[1:], ""
- }
- p++
- return s[1:p], s[p:]
-}
-
-// LanguageID returns an index, where 0 <= index < NumCompactTags, for tags
-// for which data exists in the text repository.The index will change over time
-// and should not be stored in persistent storage. If t does not match a compact
-// index, exact will be false and the compact index will be returned for the
-// first match after repeatedly taking the Parent of t.
-func LanguageID(t Tag) (id ID, exact bool) {
- return t.language, t.full == nil
-}
-
-// RegionalID returns the ID for the regional variant of this tag. This index is
-// used to indicate region-specific overrides, such as default currency, default
-// calendar and week data, default time cycle, and default measurement system
-// and unit preferences.
-//
-// For instance, the tag en-GB-u-rg-uszzzz specifies British English with US
-// settings for currency, number formatting, etc. The CompactIndex for this tag
-// will be that for en-GB, while the RegionalID will be the one corresponding to
-// en-US.
-func RegionalID(t Tag) (id ID, exact bool) {
- return t.locale, t.full == nil
-}
-
-// LanguageTag returns t stripped of regional variant indicators.
-//
-// At the moment this means it is stripped of a regional and variant subtag "rg"
-// and "va" in the "u" extension.
-func (t Tag) LanguageTag() Tag {
- if t.full == nil {
- return Tag{language: t.language, locale: t.language}
- }
- tt := t.Tag()
- tt.SetTypeForKey("rg", "")
- tt.SetTypeForKey("va", "")
- return Make(tt)
-}
-
-// RegionalTag returns the regional variant of the tag.
-//
-// At the moment this means that the region is set from the regional subtag
-// "rg" in the "u" extension.
-func (t Tag) RegionalTag() Tag {
- rt := Tag{language: t.locale, locale: t.locale}
- if t.full == nil {
- return rt
- }
- b := language.Builder{}
- tag := t.Tag()
- // tag, _ = tag.SetTypeForKey("rg", "")
- b.SetTag(t.locale.Tag())
- if v := tag.Variants(); v != "" {
- for _, v := range strings.Split(v, "-") {
- b.AddVariant(v)
- }
- }
- for _, e := range tag.Extensions() {
- b.AddExt(e)
- }
- return t
-}
-
-// FromTag reports closest matching ID for an internal language Tag.
-func FromTag(t language.Tag) (id ID, exact bool) {
- // TODO: perhaps give more frequent tags a lower index.
- // TODO: we could make the indexes stable. This will excluded some
- // possibilities for optimization, so don't do this quite yet.
- exact = true
-
- b, s, r := t.Raw()
- if t.HasString() {
- if t.IsPrivateUse() {
- // We have no entries for user-defined tags.
- return 0, false
- }
- hasExtra := false
- if t.HasVariants() {
- if t.HasExtensions() {
- build := language.Builder{}
- build.SetTag(language.Tag{LangID: b, ScriptID: s, RegionID: r})
- build.AddVariant(t.Variants())
- exact = false
- t = build.Make()
- }
- hasExtra = true
- } else if _, ok := t.Extension('u'); ok {
- // TODO: va may mean something else. Consider not considering it.
- // Strip all but the 'va' entry.
- old := t
- variant := t.TypeForKey("va")
- t = language.Tag{LangID: b, ScriptID: s, RegionID: r}
- if variant != "" {
- t, _ = t.SetTypeForKey("va", variant)
- hasExtra = true
- }
- exact = old == t
- } else {
- exact = false
- }
- if hasExtra {
- // We have some variants.
- for i, s := range specialTags {
- if s == t {
- return ID(i + len(coreTags)), exact
- }
- }
- exact = false
- }
- }
- if x, ok := getCoreIndex(t); ok {
- return x, exact
- }
- exact = false
- if r != 0 && s == 0 {
- // Deal with cases where an extra script is inserted for the region.
- t, _ := t.Maximize()
- if x, ok := getCoreIndex(t); ok {
- return x, exact
- }
- }
- for t = t.Parent(); t != root; t = t.Parent() {
- // No variants specified: just compare core components.
- // The key has the form lllssrrr, where l, s, and r are nibbles for
- // respectively the langID, scriptID, and regionID.
- if x, ok := getCoreIndex(t); ok {
- return x, exact
- }
- }
- return 0, exact
-}
-
-var root = language.Tag{}
diff --git a/vendor/golang.org/x/text/internal/language/compact/parents.go b/vendor/golang.org/x/text/internal/language/compact/parents.go
deleted file mode 100644
index 8d81072..0000000
--- a/vendor/golang.org/x/text/internal/language/compact/parents.go
+++ /dev/null
@@ -1,120 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package compact
-
-// parents maps a compact index of a tag to the compact index of the parent of
-// this tag.
-var parents = []ID{ // 775 elements
- // Entry 0 - 3F
- 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0004, 0x0000, 0x0006,
- 0x0000, 0x0008, 0x0000, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a,
- 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a,
- 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a,
- 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x000a, 0x0000,
- 0x0000, 0x0028, 0x0000, 0x002a, 0x0000, 0x002c, 0x0000, 0x0000,
- 0x002f, 0x002e, 0x002e, 0x0000, 0x0033, 0x0000, 0x0035, 0x0000,
- 0x0037, 0x0000, 0x0039, 0x0000, 0x003b, 0x0000, 0x0000, 0x003e,
- // Entry 40 - 7F
- 0x0000, 0x0040, 0x0040, 0x0000, 0x0043, 0x0043, 0x0000, 0x0046,
- 0x0000, 0x0048, 0x0000, 0x0000, 0x004b, 0x004a, 0x004a, 0x0000,
- 0x004f, 0x004f, 0x004f, 0x004f, 0x0000, 0x0054, 0x0054, 0x0000,
- 0x0057, 0x0000, 0x0059, 0x0000, 0x005b, 0x0000, 0x005d, 0x005d,
- 0x0000, 0x0060, 0x0000, 0x0062, 0x0000, 0x0064, 0x0000, 0x0066,
- 0x0066, 0x0000, 0x0069, 0x0000, 0x006b, 0x006b, 0x006b, 0x006b,
- 0x006b, 0x006b, 0x006b, 0x0000, 0x0073, 0x0000, 0x0075, 0x0000,
- 0x0077, 0x0000, 0x0000, 0x007a, 0x0000, 0x007c, 0x0000, 0x007e,
- // Entry 80 - BF
- 0x0000, 0x0080, 0x0080, 0x0000, 0x0083, 0x0083, 0x0000, 0x0086,
- 0x0087, 0x0087, 0x0087, 0x0086, 0x0088, 0x0087, 0x0087, 0x0087,
- 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088,
- 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087, 0x0088, 0x0087,
- 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
- 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087,
- 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
- 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0087, 0x0086,
- // Entry C0 - FF
- 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
- 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
- 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0088, 0x0087,
- 0x0087, 0x0088, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087,
- 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0086, 0x0086, 0x0087,
- 0x0087, 0x0086, 0x0087, 0x0087, 0x0087, 0x0087, 0x0087, 0x0000,
- 0x00ef, 0x0000, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2,
- 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f1, 0x00f1,
- // Entry 100 - 13F
- 0x00f2, 0x00f2, 0x00f1, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f1,
- 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x00f2, 0x0000, 0x010e,
- 0x0000, 0x0110, 0x0000, 0x0112, 0x0000, 0x0114, 0x0114, 0x0000,
- 0x0117, 0x0117, 0x0117, 0x0117, 0x0000, 0x011c, 0x0000, 0x011e,
- 0x0000, 0x0120, 0x0120, 0x0000, 0x0123, 0x0123, 0x0123, 0x0123,
- 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
- 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
- 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
- // Entry 140 - 17F
- 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
- 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123, 0x0123,
- 0x0123, 0x0123, 0x0000, 0x0152, 0x0000, 0x0154, 0x0000, 0x0156,
- 0x0000, 0x0158, 0x0000, 0x015a, 0x0000, 0x015c, 0x015c, 0x015c,
- 0x0000, 0x0160, 0x0000, 0x0000, 0x0163, 0x0000, 0x0165, 0x0000,
- 0x0167, 0x0167, 0x0167, 0x0000, 0x016b, 0x0000, 0x016d, 0x0000,
- 0x016f, 0x0000, 0x0171, 0x0171, 0x0000, 0x0174, 0x0000, 0x0176,
- 0x0000, 0x0178, 0x0000, 0x017a, 0x0000, 0x017c, 0x0000, 0x017e,
- // Entry 180 - 1BF
- 0x0000, 0x0000, 0x0000, 0x0182, 0x0000, 0x0184, 0x0184, 0x0184,
- 0x0184, 0x0000, 0x0000, 0x0000, 0x018b, 0x0000, 0x0000, 0x018e,
- 0x0000, 0x0000, 0x0191, 0x0000, 0x0000, 0x0000, 0x0195, 0x0000,
- 0x0197, 0x0000, 0x0000, 0x019a, 0x0000, 0x0000, 0x019d, 0x0000,
- 0x019f, 0x0000, 0x01a1, 0x0000, 0x01a3, 0x0000, 0x01a5, 0x0000,
- 0x01a7, 0x0000, 0x01a9, 0x0000, 0x01ab, 0x0000, 0x01ad, 0x0000,
- 0x01af, 0x0000, 0x01b1, 0x01b1, 0x0000, 0x01b4, 0x0000, 0x01b6,
- 0x0000, 0x01b8, 0x0000, 0x01ba, 0x0000, 0x01bc, 0x0000, 0x0000,
- // Entry 1C0 - 1FF
- 0x01bf, 0x0000, 0x01c1, 0x0000, 0x01c3, 0x0000, 0x01c5, 0x0000,
- 0x01c7, 0x0000, 0x01c9, 0x0000, 0x01cb, 0x01cb, 0x01cb, 0x01cb,
- 0x0000, 0x01d0, 0x0000, 0x01d2, 0x01d2, 0x0000, 0x01d5, 0x0000,
- 0x01d7, 0x0000, 0x01d9, 0x0000, 0x01db, 0x0000, 0x01dd, 0x0000,
- 0x01df, 0x01df, 0x0000, 0x01e2, 0x0000, 0x01e4, 0x0000, 0x01e6,
- 0x0000, 0x01e8, 0x0000, 0x01ea, 0x0000, 0x01ec, 0x0000, 0x01ee,
- 0x0000, 0x01f0, 0x0000, 0x0000, 0x01f3, 0x0000, 0x01f5, 0x01f5,
- 0x01f5, 0x0000, 0x01f9, 0x0000, 0x01fb, 0x0000, 0x01fd, 0x0000,
- // Entry 200 - 23F
- 0x01ff, 0x0000, 0x0000, 0x0202, 0x0000, 0x0204, 0x0204, 0x0000,
- 0x0207, 0x0000, 0x0209, 0x0209, 0x0000, 0x020c, 0x020c, 0x0000,
- 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x020f, 0x0000,
- 0x0217, 0x0000, 0x0219, 0x0000, 0x021b, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0221, 0x0000, 0x0000, 0x0224, 0x0000, 0x0226,
- 0x0226, 0x0000, 0x0229, 0x0000, 0x022b, 0x022b, 0x0000, 0x0000,
- 0x022f, 0x022e, 0x022e, 0x0000, 0x0000, 0x0234, 0x0000, 0x0236,
- 0x0000, 0x0238, 0x0000, 0x0244, 0x023a, 0x0244, 0x0244, 0x0244,
- // Entry 240 - 27F
- 0x0244, 0x0244, 0x0244, 0x0244, 0x023a, 0x0244, 0x0244, 0x0000,
- 0x0247, 0x0247, 0x0247, 0x0000, 0x024b, 0x0000, 0x024d, 0x0000,
- 0x024f, 0x024f, 0x0000, 0x0252, 0x0000, 0x0254, 0x0254, 0x0254,
- 0x0254, 0x0254, 0x0254, 0x0000, 0x025b, 0x0000, 0x025d, 0x0000,
- 0x025f, 0x0000, 0x0261, 0x0000, 0x0263, 0x0000, 0x0265, 0x0000,
- 0x0000, 0x0268, 0x0268, 0x0268, 0x0000, 0x026c, 0x0000, 0x026e,
- 0x0000, 0x0270, 0x0000, 0x0000, 0x0000, 0x0274, 0x0273, 0x0273,
- 0x0000, 0x0278, 0x0000, 0x027a, 0x0000, 0x027c, 0x0000, 0x0000,
- // Entry 280 - 2BF
- 0x0000, 0x0000, 0x0281, 0x0000, 0x0000, 0x0284, 0x0000, 0x0286,
- 0x0286, 0x0286, 0x0286, 0x0000, 0x028b, 0x028b, 0x028b, 0x0000,
- 0x028f, 0x028f, 0x028f, 0x028f, 0x028f, 0x0000, 0x0295, 0x0295,
- 0x0295, 0x0295, 0x0000, 0x0000, 0x0000, 0x0000, 0x029d, 0x029d,
- 0x029d, 0x0000, 0x02a1, 0x02a1, 0x02a1, 0x02a1, 0x0000, 0x0000,
- 0x02a7, 0x02a7, 0x02a7, 0x02a7, 0x0000, 0x02ac, 0x0000, 0x02ae,
- 0x02ae, 0x0000, 0x02b1, 0x0000, 0x02b3, 0x0000, 0x02b5, 0x02b5,
- 0x0000, 0x0000, 0x02b9, 0x0000, 0x0000, 0x0000, 0x02bd, 0x0000,
- // Entry 2C0 - 2FF
- 0x02bf, 0x02bf, 0x0000, 0x0000, 0x02c3, 0x0000, 0x02c5, 0x0000,
- 0x02c7, 0x0000, 0x02c9, 0x0000, 0x02cb, 0x0000, 0x02cd, 0x02cd,
- 0x0000, 0x0000, 0x02d1, 0x0000, 0x02d3, 0x02d0, 0x02d0, 0x0000,
- 0x0000, 0x02d8, 0x02d7, 0x02d7, 0x0000, 0x0000, 0x02dd, 0x0000,
- 0x02df, 0x0000, 0x02e1, 0x0000, 0x0000, 0x02e4, 0x0000, 0x02e6,
- 0x0000, 0x0000, 0x02e9, 0x0000, 0x02eb, 0x0000, 0x02ed, 0x0000,
- 0x02ef, 0x02ef, 0x0000, 0x0000, 0x02f3, 0x02f2, 0x02f2, 0x0000,
- 0x02f7, 0x0000, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x02f9, 0x0000,
- // Entry 300 - 33F
- 0x02ff, 0x0300, 0x02ff, 0x0000, 0x0303, 0x0051, 0x00e6,
-} // Size: 1574 bytes
-
-// Total table size 1574 bytes (1KiB); checksum: 895AAF0B
diff --git a/vendor/golang.org/x/text/internal/language/compact/tables.go b/vendor/golang.org/x/text/internal/language/compact/tables.go
deleted file mode 100644
index a09ed19..0000000
--- a/vendor/golang.org/x/text/internal/language/compact/tables.go
+++ /dev/null
@@ -1,1015 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package compact
-
-import "golang.org/x/text/internal/language"
-
-// CLDRVersion is the CLDR version from which the tables in this package are derived.
-const CLDRVersion = "32"
-
-// NumCompactTags is the number of common tags. The maximum tag is
-// NumCompactTags-1.
-const NumCompactTags = 775
-const (
- undIndex ID = 0
- afIndex ID = 1
- afNAIndex ID = 2
- afZAIndex ID = 3
- agqIndex ID = 4
- agqCMIndex ID = 5
- akIndex ID = 6
- akGHIndex ID = 7
- amIndex ID = 8
- amETIndex ID = 9
- arIndex ID = 10
- ar001Index ID = 11
- arAEIndex ID = 12
- arBHIndex ID = 13
- arDJIndex ID = 14
- arDZIndex ID = 15
- arEGIndex ID = 16
- arEHIndex ID = 17
- arERIndex ID = 18
- arILIndex ID = 19
- arIQIndex ID = 20
- arJOIndex ID = 21
- arKMIndex ID = 22
- arKWIndex ID = 23
- arLBIndex ID = 24
- arLYIndex ID = 25
- arMAIndex ID = 26
- arMRIndex ID = 27
- arOMIndex ID = 28
- arPSIndex ID = 29
- arQAIndex ID = 30
- arSAIndex ID = 31
- arSDIndex ID = 32
- arSOIndex ID = 33
- arSSIndex ID = 34
- arSYIndex ID = 35
- arTDIndex ID = 36
- arTNIndex ID = 37
- arYEIndex ID = 38
- arsIndex ID = 39
- asIndex ID = 40
- asINIndex ID = 41
- asaIndex ID = 42
- asaTZIndex ID = 43
- astIndex ID = 44
- astESIndex ID = 45
- azIndex ID = 46
- azCyrlIndex ID = 47
- azCyrlAZIndex ID = 48
- azLatnIndex ID = 49
- azLatnAZIndex ID = 50
- basIndex ID = 51
- basCMIndex ID = 52
- beIndex ID = 53
- beBYIndex ID = 54
- bemIndex ID = 55
- bemZMIndex ID = 56
- bezIndex ID = 57
- bezTZIndex ID = 58
- bgIndex ID = 59
- bgBGIndex ID = 60
- bhIndex ID = 61
- bmIndex ID = 62
- bmMLIndex ID = 63
- bnIndex ID = 64
- bnBDIndex ID = 65
- bnINIndex ID = 66
- boIndex ID = 67
- boCNIndex ID = 68
- boINIndex ID = 69
- brIndex ID = 70
- brFRIndex ID = 71
- brxIndex ID = 72
- brxINIndex ID = 73
- bsIndex ID = 74
- bsCyrlIndex ID = 75
- bsCyrlBAIndex ID = 76
- bsLatnIndex ID = 77
- bsLatnBAIndex ID = 78
- caIndex ID = 79
- caADIndex ID = 80
- caESIndex ID = 81
- caFRIndex ID = 82
- caITIndex ID = 83
- ccpIndex ID = 84
- ccpBDIndex ID = 85
- ccpINIndex ID = 86
- ceIndex ID = 87
- ceRUIndex ID = 88
- cggIndex ID = 89
- cggUGIndex ID = 90
- chrIndex ID = 91
- chrUSIndex ID = 92
- ckbIndex ID = 93
- ckbIQIndex ID = 94
- ckbIRIndex ID = 95
- csIndex ID = 96
- csCZIndex ID = 97
- cuIndex ID = 98
- cuRUIndex ID = 99
- cyIndex ID = 100
- cyGBIndex ID = 101
- daIndex ID = 102
- daDKIndex ID = 103
- daGLIndex ID = 104
- davIndex ID = 105
- davKEIndex ID = 106
- deIndex ID = 107
- deATIndex ID = 108
- deBEIndex ID = 109
- deCHIndex ID = 110
- deDEIndex ID = 111
- deITIndex ID = 112
- deLIIndex ID = 113
- deLUIndex ID = 114
- djeIndex ID = 115
- djeNEIndex ID = 116
- dsbIndex ID = 117
- dsbDEIndex ID = 118
- duaIndex ID = 119
- duaCMIndex ID = 120
- dvIndex ID = 121
- dyoIndex ID = 122
- dyoSNIndex ID = 123
- dzIndex ID = 124
- dzBTIndex ID = 125
- ebuIndex ID = 126
- ebuKEIndex ID = 127
- eeIndex ID = 128
- eeGHIndex ID = 129
- eeTGIndex ID = 130
- elIndex ID = 131
- elCYIndex ID = 132
- elGRIndex ID = 133
- enIndex ID = 134
- en001Index ID = 135
- en150Index ID = 136
- enAGIndex ID = 137
- enAIIndex ID = 138
- enASIndex ID = 139
- enATIndex ID = 140
- enAUIndex ID = 141
- enBBIndex ID = 142
- enBEIndex ID = 143
- enBIIndex ID = 144
- enBMIndex ID = 145
- enBSIndex ID = 146
- enBWIndex ID = 147
- enBZIndex ID = 148
- enCAIndex ID = 149
- enCCIndex ID = 150
- enCHIndex ID = 151
- enCKIndex ID = 152
- enCMIndex ID = 153
- enCXIndex ID = 154
- enCYIndex ID = 155
- enDEIndex ID = 156
- enDGIndex ID = 157
- enDKIndex ID = 158
- enDMIndex ID = 159
- enERIndex ID = 160
- enFIIndex ID = 161
- enFJIndex ID = 162
- enFKIndex ID = 163
- enFMIndex ID = 164
- enGBIndex ID = 165
- enGDIndex ID = 166
- enGGIndex ID = 167
- enGHIndex ID = 168
- enGIIndex ID = 169
- enGMIndex ID = 170
- enGUIndex ID = 171
- enGYIndex ID = 172
- enHKIndex ID = 173
- enIEIndex ID = 174
- enILIndex ID = 175
- enIMIndex ID = 176
- enINIndex ID = 177
- enIOIndex ID = 178
- enJEIndex ID = 179
- enJMIndex ID = 180
- enKEIndex ID = 181
- enKIIndex ID = 182
- enKNIndex ID = 183
- enKYIndex ID = 184
- enLCIndex ID = 185
- enLRIndex ID = 186
- enLSIndex ID = 187
- enMGIndex ID = 188
- enMHIndex ID = 189
- enMOIndex ID = 190
- enMPIndex ID = 191
- enMSIndex ID = 192
- enMTIndex ID = 193
- enMUIndex ID = 194
- enMWIndex ID = 195
- enMYIndex ID = 196
- enNAIndex ID = 197
- enNFIndex ID = 198
- enNGIndex ID = 199
- enNLIndex ID = 200
- enNRIndex ID = 201
- enNUIndex ID = 202
- enNZIndex ID = 203
- enPGIndex ID = 204
- enPHIndex ID = 205
- enPKIndex ID = 206
- enPNIndex ID = 207
- enPRIndex ID = 208
- enPWIndex ID = 209
- enRWIndex ID = 210
- enSBIndex ID = 211
- enSCIndex ID = 212
- enSDIndex ID = 213
- enSEIndex ID = 214
- enSGIndex ID = 215
- enSHIndex ID = 216
- enSIIndex ID = 217
- enSLIndex ID = 218
- enSSIndex ID = 219
- enSXIndex ID = 220
- enSZIndex ID = 221
- enTCIndex ID = 222
- enTKIndex ID = 223
- enTOIndex ID = 224
- enTTIndex ID = 225
- enTVIndex ID = 226
- enTZIndex ID = 227
- enUGIndex ID = 228
- enUMIndex ID = 229
- enUSIndex ID = 230
- enVCIndex ID = 231
- enVGIndex ID = 232
- enVIIndex ID = 233
- enVUIndex ID = 234
- enWSIndex ID = 235
- enZAIndex ID = 236
- enZMIndex ID = 237
- enZWIndex ID = 238
- eoIndex ID = 239
- eo001Index ID = 240
- esIndex ID = 241
- es419Index ID = 242
- esARIndex ID = 243
- esBOIndex ID = 244
- esBRIndex ID = 245
- esBZIndex ID = 246
- esCLIndex ID = 247
- esCOIndex ID = 248
- esCRIndex ID = 249
- esCUIndex ID = 250
- esDOIndex ID = 251
- esEAIndex ID = 252
- esECIndex ID = 253
- esESIndex ID = 254
- esGQIndex ID = 255
- esGTIndex ID = 256
- esHNIndex ID = 257
- esICIndex ID = 258
- esMXIndex ID = 259
- esNIIndex ID = 260
- esPAIndex ID = 261
- esPEIndex ID = 262
- esPHIndex ID = 263
- esPRIndex ID = 264
- esPYIndex ID = 265
- esSVIndex ID = 266
- esUSIndex ID = 267
- esUYIndex ID = 268
- esVEIndex ID = 269
- etIndex ID = 270
- etEEIndex ID = 271
- euIndex ID = 272
- euESIndex ID = 273
- ewoIndex ID = 274
- ewoCMIndex ID = 275
- faIndex ID = 276
- faAFIndex ID = 277
- faIRIndex ID = 278
- ffIndex ID = 279
- ffCMIndex ID = 280
- ffGNIndex ID = 281
- ffMRIndex ID = 282
- ffSNIndex ID = 283
- fiIndex ID = 284
- fiFIIndex ID = 285
- filIndex ID = 286
- filPHIndex ID = 287
- foIndex ID = 288
- foDKIndex ID = 289
- foFOIndex ID = 290
- frIndex ID = 291
- frBEIndex ID = 292
- frBFIndex ID = 293
- frBIIndex ID = 294
- frBJIndex ID = 295
- frBLIndex ID = 296
- frCAIndex ID = 297
- frCDIndex ID = 298
- frCFIndex ID = 299
- frCGIndex ID = 300
- frCHIndex ID = 301
- frCIIndex ID = 302
- frCMIndex ID = 303
- frDJIndex ID = 304
- frDZIndex ID = 305
- frFRIndex ID = 306
- frGAIndex ID = 307
- frGFIndex ID = 308
- frGNIndex ID = 309
- frGPIndex ID = 310
- frGQIndex ID = 311
- frHTIndex ID = 312
- frKMIndex ID = 313
- frLUIndex ID = 314
- frMAIndex ID = 315
- frMCIndex ID = 316
- frMFIndex ID = 317
- frMGIndex ID = 318
- frMLIndex ID = 319
- frMQIndex ID = 320
- frMRIndex ID = 321
- frMUIndex ID = 322
- frNCIndex ID = 323
- frNEIndex ID = 324
- frPFIndex ID = 325
- frPMIndex ID = 326
- frREIndex ID = 327
- frRWIndex ID = 328
- frSCIndex ID = 329
- frSNIndex ID = 330
- frSYIndex ID = 331
- frTDIndex ID = 332
- frTGIndex ID = 333
- frTNIndex ID = 334
- frVUIndex ID = 335
- frWFIndex ID = 336
- frYTIndex ID = 337
- furIndex ID = 338
- furITIndex ID = 339
- fyIndex ID = 340
- fyNLIndex ID = 341
- gaIndex ID = 342
- gaIEIndex ID = 343
- gdIndex ID = 344
- gdGBIndex ID = 345
- glIndex ID = 346
- glESIndex ID = 347
- gswIndex ID = 348
- gswCHIndex ID = 349
- gswFRIndex ID = 350
- gswLIIndex ID = 351
- guIndex ID = 352
- guINIndex ID = 353
- guwIndex ID = 354
- guzIndex ID = 355
- guzKEIndex ID = 356
- gvIndex ID = 357
- gvIMIndex ID = 358
- haIndex ID = 359
- haGHIndex ID = 360
- haNEIndex ID = 361
- haNGIndex ID = 362
- hawIndex ID = 363
- hawUSIndex ID = 364
- heIndex ID = 365
- heILIndex ID = 366
- hiIndex ID = 367
- hiINIndex ID = 368
- hrIndex ID = 369
- hrBAIndex ID = 370
- hrHRIndex ID = 371
- hsbIndex ID = 372
- hsbDEIndex ID = 373
- huIndex ID = 374
- huHUIndex ID = 375
- hyIndex ID = 376
- hyAMIndex ID = 377
- idIndex ID = 378
- idIDIndex ID = 379
- igIndex ID = 380
- igNGIndex ID = 381
- iiIndex ID = 382
- iiCNIndex ID = 383
- inIndex ID = 384
- ioIndex ID = 385
- isIndex ID = 386
- isISIndex ID = 387
- itIndex ID = 388
- itCHIndex ID = 389
- itITIndex ID = 390
- itSMIndex ID = 391
- itVAIndex ID = 392
- iuIndex ID = 393
- iwIndex ID = 394
- jaIndex ID = 395
- jaJPIndex ID = 396
- jboIndex ID = 397
- jgoIndex ID = 398
- jgoCMIndex ID = 399
- jiIndex ID = 400
- jmcIndex ID = 401
- jmcTZIndex ID = 402
- jvIndex ID = 403
- jwIndex ID = 404
- kaIndex ID = 405
- kaGEIndex ID = 406
- kabIndex ID = 407
- kabDZIndex ID = 408
- kajIndex ID = 409
- kamIndex ID = 410
- kamKEIndex ID = 411
- kcgIndex ID = 412
- kdeIndex ID = 413
- kdeTZIndex ID = 414
- keaIndex ID = 415
- keaCVIndex ID = 416
- khqIndex ID = 417
- khqMLIndex ID = 418
- kiIndex ID = 419
- kiKEIndex ID = 420
- kkIndex ID = 421
- kkKZIndex ID = 422
- kkjIndex ID = 423
- kkjCMIndex ID = 424
- klIndex ID = 425
- klGLIndex ID = 426
- klnIndex ID = 427
- klnKEIndex ID = 428
- kmIndex ID = 429
- kmKHIndex ID = 430
- knIndex ID = 431
- knINIndex ID = 432
- koIndex ID = 433
- koKPIndex ID = 434
- koKRIndex ID = 435
- kokIndex ID = 436
- kokINIndex ID = 437
- ksIndex ID = 438
- ksINIndex ID = 439
- ksbIndex ID = 440
- ksbTZIndex ID = 441
- ksfIndex ID = 442
- ksfCMIndex ID = 443
- kshIndex ID = 444
- kshDEIndex ID = 445
- kuIndex ID = 446
- kwIndex ID = 447
- kwGBIndex ID = 448
- kyIndex ID = 449
- kyKGIndex ID = 450
- lagIndex ID = 451
- lagTZIndex ID = 452
- lbIndex ID = 453
- lbLUIndex ID = 454
- lgIndex ID = 455
- lgUGIndex ID = 456
- lktIndex ID = 457
- lktUSIndex ID = 458
- lnIndex ID = 459
- lnAOIndex ID = 460
- lnCDIndex ID = 461
- lnCFIndex ID = 462
- lnCGIndex ID = 463
- loIndex ID = 464
- loLAIndex ID = 465
- lrcIndex ID = 466
- lrcIQIndex ID = 467
- lrcIRIndex ID = 468
- ltIndex ID = 469
- ltLTIndex ID = 470
- luIndex ID = 471
- luCDIndex ID = 472
- luoIndex ID = 473
- luoKEIndex ID = 474
- luyIndex ID = 475
- luyKEIndex ID = 476
- lvIndex ID = 477
- lvLVIndex ID = 478
- masIndex ID = 479
- masKEIndex ID = 480
- masTZIndex ID = 481
- merIndex ID = 482
- merKEIndex ID = 483
- mfeIndex ID = 484
- mfeMUIndex ID = 485
- mgIndex ID = 486
- mgMGIndex ID = 487
- mghIndex ID = 488
- mghMZIndex ID = 489
- mgoIndex ID = 490
- mgoCMIndex ID = 491
- mkIndex ID = 492
- mkMKIndex ID = 493
- mlIndex ID = 494
- mlINIndex ID = 495
- mnIndex ID = 496
- mnMNIndex ID = 497
- moIndex ID = 498
- mrIndex ID = 499
- mrINIndex ID = 500
- msIndex ID = 501
- msBNIndex ID = 502
- msMYIndex ID = 503
- msSGIndex ID = 504
- mtIndex ID = 505
- mtMTIndex ID = 506
- muaIndex ID = 507
- muaCMIndex ID = 508
- myIndex ID = 509
- myMMIndex ID = 510
- mznIndex ID = 511
- mznIRIndex ID = 512
- nahIndex ID = 513
- naqIndex ID = 514
- naqNAIndex ID = 515
- nbIndex ID = 516
- nbNOIndex ID = 517
- nbSJIndex ID = 518
- ndIndex ID = 519
- ndZWIndex ID = 520
- ndsIndex ID = 521
- ndsDEIndex ID = 522
- ndsNLIndex ID = 523
- neIndex ID = 524
- neINIndex ID = 525
- neNPIndex ID = 526
- nlIndex ID = 527
- nlAWIndex ID = 528
- nlBEIndex ID = 529
- nlBQIndex ID = 530
- nlCWIndex ID = 531
- nlNLIndex ID = 532
- nlSRIndex ID = 533
- nlSXIndex ID = 534
- nmgIndex ID = 535
- nmgCMIndex ID = 536
- nnIndex ID = 537
- nnNOIndex ID = 538
- nnhIndex ID = 539
- nnhCMIndex ID = 540
- noIndex ID = 541
- nqoIndex ID = 542
- nrIndex ID = 543
- nsoIndex ID = 544
- nusIndex ID = 545
- nusSSIndex ID = 546
- nyIndex ID = 547
- nynIndex ID = 548
- nynUGIndex ID = 549
- omIndex ID = 550
- omETIndex ID = 551
- omKEIndex ID = 552
- orIndex ID = 553
- orINIndex ID = 554
- osIndex ID = 555
- osGEIndex ID = 556
- osRUIndex ID = 557
- paIndex ID = 558
- paArabIndex ID = 559
- paArabPKIndex ID = 560
- paGuruIndex ID = 561
- paGuruINIndex ID = 562
- papIndex ID = 563
- plIndex ID = 564
- plPLIndex ID = 565
- prgIndex ID = 566
- prg001Index ID = 567
- psIndex ID = 568
- psAFIndex ID = 569
- ptIndex ID = 570
- ptAOIndex ID = 571
- ptBRIndex ID = 572
- ptCHIndex ID = 573
- ptCVIndex ID = 574
- ptGQIndex ID = 575
- ptGWIndex ID = 576
- ptLUIndex ID = 577
- ptMOIndex ID = 578
- ptMZIndex ID = 579
- ptPTIndex ID = 580
- ptSTIndex ID = 581
- ptTLIndex ID = 582
- quIndex ID = 583
- quBOIndex ID = 584
- quECIndex ID = 585
- quPEIndex ID = 586
- rmIndex ID = 587
- rmCHIndex ID = 588
- rnIndex ID = 589
- rnBIIndex ID = 590
- roIndex ID = 591
- roMDIndex ID = 592
- roROIndex ID = 593
- rofIndex ID = 594
- rofTZIndex ID = 595
- ruIndex ID = 596
- ruBYIndex ID = 597
- ruKGIndex ID = 598
- ruKZIndex ID = 599
- ruMDIndex ID = 600
- ruRUIndex ID = 601
- ruUAIndex ID = 602
- rwIndex ID = 603
- rwRWIndex ID = 604
- rwkIndex ID = 605
- rwkTZIndex ID = 606
- sahIndex ID = 607
- sahRUIndex ID = 608
- saqIndex ID = 609
- saqKEIndex ID = 610
- sbpIndex ID = 611
- sbpTZIndex ID = 612
- sdIndex ID = 613
- sdPKIndex ID = 614
- sdhIndex ID = 615
- seIndex ID = 616
- seFIIndex ID = 617
- seNOIndex ID = 618
- seSEIndex ID = 619
- sehIndex ID = 620
- sehMZIndex ID = 621
- sesIndex ID = 622
- sesMLIndex ID = 623
- sgIndex ID = 624
- sgCFIndex ID = 625
- shIndex ID = 626
- shiIndex ID = 627
- shiLatnIndex ID = 628
- shiLatnMAIndex ID = 629
- shiTfngIndex ID = 630
- shiTfngMAIndex ID = 631
- siIndex ID = 632
- siLKIndex ID = 633
- skIndex ID = 634
- skSKIndex ID = 635
- slIndex ID = 636
- slSIIndex ID = 637
- smaIndex ID = 638
- smiIndex ID = 639
- smjIndex ID = 640
- smnIndex ID = 641
- smnFIIndex ID = 642
- smsIndex ID = 643
- snIndex ID = 644
- snZWIndex ID = 645
- soIndex ID = 646
- soDJIndex ID = 647
- soETIndex ID = 648
- soKEIndex ID = 649
- soSOIndex ID = 650
- sqIndex ID = 651
- sqALIndex ID = 652
- sqMKIndex ID = 653
- sqXKIndex ID = 654
- srIndex ID = 655
- srCyrlIndex ID = 656
- srCyrlBAIndex ID = 657
- srCyrlMEIndex ID = 658
- srCyrlRSIndex ID = 659
- srCyrlXKIndex ID = 660
- srLatnIndex ID = 661
- srLatnBAIndex ID = 662
- srLatnMEIndex ID = 663
- srLatnRSIndex ID = 664
- srLatnXKIndex ID = 665
- ssIndex ID = 666
- ssyIndex ID = 667
- stIndex ID = 668
- svIndex ID = 669
- svAXIndex ID = 670
- svFIIndex ID = 671
- svSEIndex ID = 672
- swIndex ID = 673
- swCDIndex ID = 674
- swKEIndex ID = 675
- swTZIndex ID = 676
- swUGIndex ID = 677
- syrIndex ID = 678
- taIndex ID = 679
- taINIndex ID = 680
- taLKIndex ID = 681
- taMYIndex ID = 682
- taSGIndex ID = 683
- teIndex ID = 684
- teINIndex ID = 685
- teoIndex ID = 686
- teoKEIndex ID = 687
- teoUGIndex ID = 688
- tgIndex ID = 689
- tgTJIndex ID = 690
- thIndex ID = 691
- thTHIndex ID = 692
- tiIndex ID = 693
- tiERIndex ID = 694
- tiETIndex ID = 695
- tigIndex ID = 696
- tkIndex ID = 697
- tkTMIndex ID = 698
- tlIndex ID = 699
- tnIndex ID = 700
- toIndex ID = 701
- toTOIndex ID = 702
- trIndex ID = 703
- trCYIndex ID = 704
- trTRIndex ID = 705
- tsIndex ID = 706
- ttIndex ID = 707
- ttRUIndex ID = 708
- twqIndex ID = 709
- twqNEIndex ID = 710
- tzmIndex ID = 711
- tzmMAIndex ID = 712
- ugIndex ID = 713
- ugCNIndex ID = 714
- ukIndex ID = 715
- ukUAIndex ID = 716
- urIndex ID = 717
- urINIndex ID = 718
- urPKIndex ID = 719
- uzIndex ID = 720
- uzArabIndex ID = 721
- uzArabAFIndex ID = 722
- uzCyrlIndex ID = 723
- uzCyrlUZIndex ID = 724
- uzLatnIndex ID = 725
- uzLatnUZIndex ID = 726
- vaiIndex ID = 727
- vaiLatnIndex ID = 728
- vaiLatnLRIndex ID = 729
- vaiVaiiIndex ID = 730
- vaiVaiiLRIndex ID = 731
- veIndex ID = 732
- viIndex ID = 733
- viVNIndex ID = 734
- voIndex ID = 735
- vo001Index ID = 736
- vunIndex ID = 737
- vunTZIndex ID = 738
- waIndex ID = 739
- waeIndex ID = 740
- waeCHIndex ID = 741
- woIndex ID = 742
- woSNIndex ID = 743
- xhIndex ID = 744
- xogIndex ID = 745
- xogUGIndex ID = 746
- yavIndex ID = 747
- yavCMIndex ID = 748
- yiIndex ID = 749
- yi001Index ID = 750
- yoIndex ID = 751
- yoBJIndex ID = 752
- yoNGIndex ID = 753
- yueIndex ID = 754
- yueHansIndex ID = 755
- yueHansCNIndex ID = 756
- yueHantIndex ID = 757
- yueHantHKIndex ID = 758
- zghIndex ID = 759
- zghMAIndex ID = 760
- zhIndex ID = 761
- zhHansIndex ID = 762
- zhHansCNIndex ID = 763
- zhHansHKIndex ID = 764
- zhHansMOIndex ID = 765
- zhHansSGIndex ID = 766
- zhHantIndex ID = 767
- zhHantHKIndex ID = 768
- zhHantMOIndex ID = 769
- zhHantTWIndex ID = 770
- zuIndex ID = 771
- zuZAIndex ID = 772
- caESvalenciaIndex ID = 773
- enUSuvaposixIndex ID = 774
-)
-
-var coreTags = []language.CompactCoreInfo{ // 773 elements
- // Entry 0 - 1F
- 0x00000000, 0x01600000, 0x016000d3, 0x01600162,
- 0x01c00000, 0x01c00052, 0x02100000, 0x02100081,
- 0x02700000, 0x02700070, 0x03a00000, 0x03a00001,
- 0x03a00023, 0x03a00039, 0x03a00063, 0x03a00068,
- 0x03a0006c, 0x03a0006d, 0x03a0006e, 0x03a00098,
- 0x03a0009c, 0x03a000a2, 0x03a000a9, 0x03a000ad,
- 0x03a000b1, 0x03a000ba, 0x03a000bb, 0x03a000ca,
- 0x03a000e2, 0x03a000ee, 0x03a000f4, 0x03a00109,
- // Entry 20 - 3F
- 0x03a0010c, 0x03a00116, 0x03a00118, 0x03a0011d,
- 0x03a00121, 0x03a00129, 0x03a0015f, 0x04000000,
- 0x04300000, 0x0430009a, 0x04400000, 0x04400130,
- 0x04800000, 0x0480006f, 0x05800000, 0x05820000,
- 0x05820032, 0x0585b000, 0x0585b032, 0x05e00000,
- 0x05e00052, 0x07100000, 0x07100047, 0x07500000,
- 0x07500163, 0x07900000, 0x07900130, 0x07e00000,
- 0x07e00038, 0x08200000, 0x0a000000, 0x0a0000c4,
- // Entry 40 - 5F
- 0x0a500000, 0x0a500035, 0x0a50009a, 0x0a900000,
- 0x0a900053, 0x0a90009a, 0x0b200000, 0x0b200079,
- 0x0b500000, 0x0b50009a, 0x0b700000, 0x0b720000,
- 0x0b720033, 0x0b75b000, 0x0b75b033, 0x0d700000,
- 0x0d700022, 0x0d70006f, 0x0d700079, 0x0d70009f,
- 0x0db00000, 0x0db00035, 0x0db0009a, 0x0dc00000,
- 0x0dc00107, 0x0df00000, 0x0df00132, 0x0e500000,
- 0x0e500136, 0x0e900000, 0x0e90009c, 0x0e90009d,
- // Entry 60 - 7F
- 0x0fa00000, 0x0fa0005f, 0x0fe00000, 0x0fe00107,
- 0x10000000, 0x1000007c, 0x10100000, 0x10100064,
- 0x10100083, 0x10800000, 0x108000a5, 0x10d00000,
- 0x10d0002e, 0x10d00036, 0x10d0004e, 0x10d00061,
- 0x10d0009f, 0x10d000b3, 0x10d000b8, 0x11700000,
- 0x117000d5, 0x11f00000, 0x11f00061, 0x12400000,
- 0x12400052, 0x12800000, 0x12b00000, 0x12b00115,
- 0x12d00000, 0x12d00043, 0x12f00000, 0x12f000a5,
- // Entry 80 - 9F
- 0x13000000, 0x13000081, 0x13000123, 0x13600000,
- 0x1360005e, 0x13600088, 0x13900000, 0x13900001,
- 0x1390001a, 0x13900025, 0x13900026, 0x1390002d,
- 0x1390002e, 0x1390002f, 0x13900034, 0x13900036,
- 0x1390003a, 0x1390003d, 0x13900042, 0x13900046,
- 0x13900048, 0x13900049, 0x1390004a, 0x1390004e,
- 0x13900050, 0x13900052, 0x1390005d, 0x1390005e,
- 0x13900061, 0x13900062, 0x13900064, 0x13900065,
- // Entry A0 - BF
- 0x1390006e, 0x13900073, 0x13900074, 0x13900075,
- 0x13900076, 0x1390007c, 0x1390007d, 0x13900080,
- 0x13900081, 0x13900082, 0x13900084, 0x1390008b,
- 0x1390008d, 0x1390008e, 0x13900097, 0x13900098,
- 0x13900099, 0x1390009a, 0x1390009b, 0x139000a0,
- 0x139000a1, 0x139000a5, 0x139000a8, 0x139000aa,
- 0x139000ae, 0x139000b2, 0x139000b5, 0x139000b6,
- 0x139000c0, 0x139000c1, 0x139000c7, 0x139000c8,
- // Entry C0 - DF
- 0x139000cb, 0x139000cc, 0x139000cd, 0x139000cf,
- 0x139000d1, 0x139000d3, 0x139000d6, 0x139000d7,
- 0x139000da, 0x139000de, 0x139000e0, 0x139000e1,
- 0x139000e7, 0x139000e8, 0x139000e9, 0x139000ec,
- 0x139000ed, 0x139000f1, 0x13900108, 0x1390010a,
- 0x1390010b, 0x1390010c, 0x1390010d, 0x1390010e,
- 0x1390010f, 0x13900110, 0x13900113, 0x13900118,
- 0x1390011c, 0x1390011e, 0x13900120, 0x13900126,
- // Entry E0 - FF
- 0x1390012a, 0x1390012d, 0x1390012e, 0x13900130,
- 0x13900132, 0x13900134, 0x13900136, 0x1390013a,
- 0x1390013d, 0x1390013e, 0x13900140, 0x13900143,
- 0x13900162, 0x13900163, 0x13900165, 0x13c00000,
- 0x13c00001, 0x13e00000, 0x13e0001f, 0x13e0002c,
- 0x13e0003f, 0x13e00041, 0x13e00048, 0x13e00051,
- 0x13e00054, 0x13e00057, 0x13e0005a, 0x13e00066,
- 0x13e00069, 0x13e0006a, 0x13e0006f, 0x13e00087,
- // Entry 100 - 11F
- 0x13e0008a, 0x13e00090, 0x13e00095, 0x13e000d0,
- 0x13e000d9, 0x13e000e3, 0x13e000e5, 0x13e000e8,
- 0x13e000ed, 0x13e000f2, 0x13e0011b, 0x13e00136,
- 0x13e00137, 0x13e0013c, 0x14000000, 0x1400006b,
- 0x14500000, 0x1450006f, 0x14600000, 0x14600052,
- 0x14800000, 0x14800024, 0x1480009d, 0x14e00000,
- 0x14e00052, 0x14e00085, 0x14e000ca, 0x14e00115,
- 0x15100000, 0x15100073, 0x15300000, 0x153000e8,
- // Entry 120 - 13F
- 0x15800000, 0x15800064, 0x15800077, 0x15e00000,
- 0x15e00036, 0x15e00037, 0x15e0003a, 0x15e0003b,
- 0x15e0003c, 0x15e00049, 0x15e0004b, 0x15e0004c,
- 0x15e0004d, 0x15e0004e, 0x15e0004f, 0x15e00052,
- 0x15e00063, 0x15e00068, 0x15e00079, 0x15e0007b,
- 0x15e0007f, 0x15e00085, 0x15e00086, 0x15e00087,
- 0x15e00092, 0x15e000a9, 0x15e000b8, 0x15e000bb,
- 0x15e000bc, 0x15e000bf, 0x15e000c0, 0x15e000c4,
- // Entry 140 - 15F
- 0x15e000c9, 0x15e000ca, 0x15e000cd, 0x15e000d4,
- 0x15e000d5, 0x15e000e6, 0x15e000eb, 0x15e00103,
- 0x15e00108, 0x15e0010b, 0x15e00115, 0x15e0011d,
- 0x15e00121, 0x15e00123, 0x15e00129, 0x15e00140,
- 0x15e00141, 0x15e00160, 0x16900000, 0x1690009f,
- 0x16d00000, 0x16d000da, 0x16e00000, 0x16e00097,
- 0x17e00000, 0x17e0007c, 0x19000000, 0x1900006f,
- 0x1a300000, 0x1a30004e, 0x1a300079, 0x1a3000b3,
- // Entry 160 - 17F
- 0x1a400000, 0x1a40009a, 0x1a900000, 0x1ab00000,
- 0x1ab000a5, 0x1ac00000, 0x1ac00099, 0x1b400000,
- 0x1b400081, 0x1b4000d5, 0x1b4000d7, 0x1b800000,
- 0x1b800136, 0x1bc00000, 0x1bc00098, 0x1be00000,
- 0x1be0009a, 0x1d100000, 0x1d100033, 0x1d100091,
- 0x1d200000, 0x1d200061, 0x1d500000, 0x1d500093,
- 0x1d700000, 0x1d700028, 0x1e100000, 0x1e100096,
- 0x1e700000, 0x1e7000d7, 0x1ea00000, 0x1ea00053,
- // Entry 180 - 19F
- 0x1f300000, 0x1f500000, 0x1f800000, 0x1f80009e,
- 0x1f900000, 0x1f90004e, 0x1f90009f, 0x1f900114,
- 0x1f900139, 0x1fa00000, 0x1fb00000, 0x20000000,
- 0x200000a3, 0x20300000, 0x20700000, 0x20700052,
- 0x20800000, 0x20a00000, 0x20a00130, 0x20e00000,
- 0x20f00000, 0x21000000, 0x2100007e, 0x21200000,
- 0x21200068, 0x21600000, 0x21700000, 0x217000a5,
- 0x21f00000, 0x22300000, 0x22300130, 0x22700000,
- // Entry 1A0 - 1BF
- 0x2270005b, 0x23400000, 0x234000c4, 0x23900000,
- 0x239000a5, 0x24200000, 0x242000af, 0x24400000,
- 0x24400052, 0x24500000, 0x24500083, 0x24600000,
- 0x246000a5, 0x24a00000, 0x24a000a7, 0x25100000,
- 0x2510009a, 0x25400000, 0x254000ab, 0x254000ac,
- 0x25600000, 0x2560009a, 0x26a00000, 0x26a0009a,
- 0x26b00000, 0x26b00130, 0x26d00000, 0x26d00052,
- 0x26e00000, 0x26e00061, 0x27400000, 0x28100000,
- // Entry 1C0 - 1DF
- 0x2810007c, 0x28a00000, 0x28a000a6, 0x29100000,
- 0x29100130, 0x29500000, 0x295000b8, 0x2a300000,
- 0x2a300132, 0x2af00000, 0x2af00136, 0x2b500000,
- 0x2b50002a, 0x2b50004b, 0x2b50004c, 0x2b50004d,
- 0x2b800000, 0x2b8000b0, 0x2bf00000, 0x2bf0009c,
- 0x2bf0009d, 0x2c000000, 0x2c0000b7, 0x2c200000,
- 0x2c20004b, 0x2c400000, 0x2c4000a5, 0x2c500000,
- 0x2c5000a5, 0x2c700000, 0x2c7000b9, 0x2d100000,
- // Entry 1E0 - 1FF
- 0x2d1000a5, 0x2d100130, 0x2e900000, 0x2e9000a5,
- 0x2ed00000, 0x2ed000cd, 0x2f100000, 0x2f1000c0,
- 0x2f200000, 0x2f2000d2, 0x2f400000, 0x2f400052,
- 0x2ff00000, 0x2ff000c3, 0x30400000, 0x3040009a,
- 0x30b00000, 0x30b000c6, 0x31000000, 0x31b00000,
- 0x31b0009a, 0x31f00000, 0x31f0003e, 0x31f000d1,
- 0x31f0010e, 0x32000000, 0x320000cc, 0x32500000,
- 0x32500052, 0x33100000, 0x331000c5, 0x33a00000,
- // Entry 200 - 21F
- 0x33a0009d, 0x34100000, 0x34500000, 0x345000d3,
- 0x34700000, 0x347000db, 0x34700111, 0x34e00000,
- 0x34e00165, 0x35000000, 0x35000061, 0x350000da,
- 0x35100000, 0x3510009a, 0x351000dc, 0x36700000,
- 0x36700030, 0x36700036, 0x36700040, 0x3670005c,
- 0x367000da, 0x36700117, 0x3670011c, 0x36800000,
- 0x36800052, 0x36a00000, 0x36a000db, 0x36c00000,
- 0x36c00052, 0x36f00000, 0x37500000, 0x37600000,
- // Entry 220 - 23F
- 0x37a00000, 0x38000000, 0x38000118, 0x38700000,
- 0x38900000, 0x38900132, 0x39000000, 0x39000070,
- 0x390000a5, 0x39500000, 0x3950009a, 0x39800000,
- 0x3980007e, 0x39800107, 0x39d00000, 0x39d05000,
- 0x39d050e9, 0x39d36000, 0x39d3609a, 0x3a100000,
- 0x3b300000, 0x3b3000ea, 0x3bd00000, 0x3bd00001,
- 0x3be00000, 0x3be00024, 0x3c000000, 0x3c00002a,
- 0x3c000041, 0x3c00004e, 0x3c00005b, 0x3c000087,
- // Entry 240 - 25F
- 0x3c00008c, 0x3c0000b8, 0x3c0000c7, 0x3c0000d2,
- 0x3c0000ef, 0x3c000119, 0x3c000127, 0x3c400000,
- 0x3c40003f, 0x3c40006a, 0x3c4000e5, 0x3d400000,
- 0x3d40004e, 0x3d900000, 0x3d90003a, 0x3dc00000,
- 0x3dc000bd, 0x3dc00105, 0x3de00000, 0x3de00130,
- 0x3e200000, 0x3e200047, 0x3e2000a6, 0x3e2000af,
- 0x3e2000bd, 0x3e200107, 0x3e200131, 0x3e500000,
- 0x3e500108, 0x3e600000, 0x3e600130, 0x3eb00000,
- // Entry 260 - 27F
- 0x3eb00107, 0x3ec00000, 0x3ec000a5, 0x3f300000,
- 0x3f300130, 0x3fa00000, 0x3fa000e9, 0x3fc00000,
- 0x3fd00000, 0x3fd00073, 0x3fd000db, 0x3fd0010d,
- 0x3ff00000, 0x3ff000d2, 0x40100000, 0x401000c4,
- 0x40200000, 0x4020004c, 0x40700000, 0x40800000,
- 0x4085b000, 0x4085b0bb, 0x408eb000, 0x408eb0bb,
- 0x40c00000, 0x40c000b4, 0x41200000, 0x41200112,
- 0x41600000, 0x41600110, 0x41c00000, 0x41d00000,
- // Entry 280 - 29F
- 0x41e00000, 0x41f00000, 0x41f00073, 0x42200000,
- 0x42300000, 0x42300165, 0x42900000, 0x42900063,
- 0x42900070, 0x429000a5, 0x42900116, 0x43100000,
- 0x43100027, 0x431000c3, 0x4310014e, 0x43200000,
- 0x43220000, 0x43220033, 0x432200be, 0x43220106,
- 0x4322014e, 0x4325b000, 0x4325b033, 0x4325b0be,
- 0x4325b106, 0x4325b14e, 0x43700000, 0x43a00000,
- 0x43b00000, 0x44400000, 0x44400031, 0x44400073,
- // Entry 2A0 - 2BF
- 0x4440010d, 0x44500000, 0x4450004b, 0x445000a5,
- 0x44500130, 0x44500132, 0x44e00000, 0x45000000,
- 0x4500009a, 0x450000b4, 0x450000d1, 0x4500010e,
- 0x46100000, 0x4610009a, 0x46400000, 0x464000a5,
- 0x46400132, 0x46700000, 0x46700125, 0x46b00000,
- 0x46b00124, 0x46f00000, 0x46f0006e, 0x46f00070,
- 0x47100000, 0x47600000, 0x47600128, 0x47a00000,
- 0x48000000, 0x48200000, 0x4820012a, 0x48a00000,
- // Entry 2C0 - 2DF
- 0x48a0005e, 0x48a0012c, 0x48e00000, 0x49400000,
- 0x49400107, 0x4a400000, 0x4a4000d5, 0x4a900000,
- 0x4a9000bb, 0x4ac00000, 0x4ac00053, 0x4ae00000,
- 0x4ae00131, 0x4b400000, 0x4b40009a, 0x4b4000e9,
- 0x4bc00000, 0x4bc05000, 0x4bc05024, 0x4bc20000,
- 0x4bc20138, 0x4bc5b000, 0x4bc5b138, 0x4be00000,
- 0x4be5b000, 0x4be5b0b5, 0x4bef4000, 0x4bef40b5,
- 0x4c000000, 0x4c300000, 0x4c30013f, 0x4c900000,
- // Entry 2E0 - 2FF
- 0x4c900001, 0x4cc00000, 0x4cc00130, 0x4ce00000,
- 0x4cf00000, 0x4cf0004e, 0x4e500000, 0x4e500115,
- 0x4f200000, 0x4fb00000, 0x4fb00132, 0x50900000,
- 0x50900052, 0x51200000, 0x51200001, 0x51800000,
- 0x5180003b, 0x518000d7, 0x51f00000, 0x51f3b000,
- 0x51f3b053, 0x51f3c000, 0x51f3c08e, 0x52800000,
- 0x528000bb, 0x52900000, 0x5293b000, 0x5293b053,
- 0x5293b08e, 0x5293b0c7, 0x5293b10e, 0x5293c000,
- // Entry 300 - 31F
- 0x5293c08e, 0x5293c0c7, 0x5293c12f, 0x52f00000,
- 0x52f00162,
-} // Size: 3116 bytes
-
-const specialTagsStr string = "ca-ES-valencia en-US-u-va-posix"
-
-// Total table size 3147 bytes (3KiB); checksum: 5A8FFFA5
diff --git a/vendor/golang.org/x/text/internal/language/compact/tags.go b/vendor/golang.org/x/text/internal/language/compact/tags.go
deleted file mode 100644
index ca135d2..0000000
--- a/vendor/golang.org/x/text/internal/language/compact/tags.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package compact
-
-var (
- und = Tag{}
-
- Und Tag = Tag{}
-
- Afrikaans Tag = Tag{language: afIndex, locale: afIndex}
- Amharic Tag = Tag{language: amIndex, locale: amIndex}
- Arabic Tag = Tag{language: arIndex, locale: arIndex}
- ModernStandardArabic Tag = Tag{language: ar001Index, locale: ar001Index}
- Azerbaijani Tag = Tag{language: azIndex, locale: azIndex}
- Bulgarian Tag = Tag{language: bgIndex, locale: bgIndex}
- Bengali Tag = Tag{language: bnIndex, locale: bnIndex}
- Catalan Tag = Tag{language: caIndex, locale: caIndex}
- Czech Tag = Tag{language: csIndex, locale: csIndex}
- Danish Tag = Tag{language: daIndex, locale: daIndex}
- German Tag = Tag{language: deIndex, locale: deIndex}
- Greek Tag = Tag{language: elIndex, locale: elIndex}
- English Tag = Tag{language: enIndex, locale: enIndex}
- AmericanEnglish Tag = Tag{language: enUSIndex, locale: enUSIndex}
- BritishEnglish Tag = Tag{language: enGBIndex, locale: enGBIndex}
- Spanish Tag = Tag{language: esIndex, locale: esIndex}
- EuropeanSpanish Tag = Tag{language: esESIndex, locale: esESIndex}
- LatinAmericanSpanish Tag = Tag{language: es419Index, locale: es419Index}
- Estonian Tag = Tag{language: etIndex, locale: etIndex}
- Persian Tag = Tag{language: faIndex, locale: faIndex}
- Finnish Tag = Tag{language: fiIndex, locale: fiIndex}
- Filipino Tag = Tag{language: filIndex, locale: filIndex}
- French Tag = Tag{language: frIndex, locale: frIndex}
- CanadianFrench Tag = Tag{language: frCAIndex, locale: frCAIndex}
- Gujarati Tag = Tag{language: guIndex, locale: guIndex}
- Hebrew Tag = Tag{language: heIndex, locale: heIndex}
- Hindi Tag = Tag{language: hiIndex, locale: hiIndex}
- Croatian Tag = Tag{language: hrIndex, locale: hrIndex}
- Hungarian Tag = Tag{language: huIndex, locale: huIndex}
- Armenian Tag = Tag{language: hyIndex, locale: hyIndex}
- Indonesian Tag = Tag{language: idIndex, locale: idIndex}
- Icelandic Tag = Tag{language: isIndex, locale: isIndex}
- Italian Tag = Tag{language: itIndex, locale: itIndex}
- Japanese Tag = Tag{language: jaIndex, locale: jaIndex}
- Georgian Tag = Tag{language: kaIndex, locale: kaIndex}
- Kazakh Tag = Tag{language: kkIndex, locale: kkIndex}
- Khmer Tag = Tag{language: kmIndex, locale: kmIndex}
- Kannada Tag = Tag{language: knIndex, locale: knIndex}
- Korean Tag = Tag{language: koIndex, locale: koIndex}
- Kirghiz Tag = Tag{language: kyIndex, locale: kyIndex}
- Lao Tag = Tag{language: loIndex, locale: loIndex}
- Lithuanian Tag = Tag{language: ltIndex, locale: ltIndex}
- Latvian Tag = Tag{language: lvIndex, locale: lvIndex}
- Macedonian Tag = Tag{language: mkIndex, locale: mkIndex}
- Malayalam Tag = Tag{language: mlIndex, locale: mlIndex}
- Mongolian Tag = Tag{language: mnIndex, locale: mnIndex}
- Marathi Tag = Tag{language: mrIndex, locale: mrIndex}
- Malay Tag = Tag{language: msIndex, locale: msIndex}
- Burmese Tag = Tag{language: myIndex, locale: myIndex}
- Nepali Tag = Tag{language: neIndex, locale: neIndex}
- Dutch Tag = Tag{language: nlIndex, locale: nlIndex}
- Norwegian Tag = Tag{language: noIndex, locale: noIndex}
- Punjabi Tag = Tag{language: paIndex, locale: paIndex}
- Polish Tag = Tag{language: plIndex, locale: plIndex}
- Portuguese Tag = Tag{language: ptIndex, locale: ptIndex}
- BrazilianPortuguese Tag = Tag{language: ptBRIndex, locale: ptBRIndex}
- EuropeanPortuguese Tag = Tag{language: ptPTIndex, locale: ptPTIndex}
- Romanian Tag = Tag{language: roIndex, locale: roIndex}
- Russian Tag = Tag{language: ruIndex, locale: ruIndex}
- Sinhala Tag = Tag{language: siIndex, locale: siIndex}
- Slovak Tag = Tag{language: skIndex, locale: skIndex}
- Slovenian Tag = Tag{language: slIndex, locale: slIndex}
- Albanian Tag = Tag{language: sqIndex, locale: sqIndex}
- Serbian Tag = Tag{language: srIndex, locale: srIndex}
- SerbianLatin Tag = Tag{language: srLatnIndex, locale: srLatnIndex}
- Swedish Tag = Tag{language: svIndex, locale: svIndex}
- Swahili Tag = Tag{language: swIndex, locale: swIndex}
- Tamil Tag = Tag{language: taIndex, locale: taIndex}
- Telugu Tag = Tag{language: teIndex, locale: teIndex}
- Thai Tag = Tag{language: thIndex, locale: thIndex}
- Turkish Tag = Tag{language: trIndex, locale: trIndex}
- Ukrainian Tag = Tag{language: ukIndex, locale: ukIndex}
- Urdu Tag = Tag{language: urIndex, locale: urIndex}
- Uzbek Tag = Tag{language: uzIndex, locale: uzIndex}
- Vietnamese Tag = Tag{language: viIndex, locale: viIndex}
- Chinese Tag = Tag{language: zhIndex, locale: zhIndex}
- SimplifiedChinese Tag = Tag{language: zhHansIndex, locale: zhHansIndex}
- TraditionalChinese Tag = Tag{language: zhHantIndex, locale: zhHantIndex}
- Zulu Tag = Tag{language: zuIndex, locale: zuIndex}
-)
diff --git a/vendor/golang.org/x/text/internal/language/compose.go b/vendor/golang.org/x/text/internal/language/compose.go
deleted file mode 100644
index 4ae78e0..0000000
--- a/vendor/golang.org/x/text/internal/language/compose.go
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import (
- "sort"
- "strings"
-)
-
-// A Builder allows constructing a Tag from individual components.
-// Its main user is Compose in the top-level language package.
-type Builder struct {
- Tag Tag
-
- private string // the x extension
- variants []string
- extensions []string
-}
-
-// Make returns a new Tag from the current settings.
-func (b *Builder) Make() Tag {
- t := b.Tag
-
- if len(b.extensions) > 0 || len(b.variants) > 0 {
- sort.Sort(sortVariants(b.variants))
- sort.Strings(b.extensions)
-
- if b.private != "" {
- b.extensions = append(b.extensions, b.private)
- }
- n := maxCoreSize + tokenLen(b.variants...) + tokenLen(b.extensions...)
- buf := make([]byte, n)
- p := t.genCoreBytes(buf)
- t.pVariant = byte(p)
- p += appendTokens(buf[p:], b.variants...)
- t.pExt = uint16(p)
- p += appendTokens(buf[p:], b.extensions...)
- t.str = string(buf[:p])
- // We may not always need to remake the string, but when or when not
- // to do so is rather tricky.
- scan := makeScanner(buf[:p])
- t, _ = parse(&scan, "")
- return t
-
- } else if b.private != "" {
- t.str = b.private
- t.RemakeString()
- }
- return t
-}
-
-// SetTag copies all the settings from a given Tag. Any previously set values
-// are discarded.
-func (b *Builder) SetTag(t Tag) {
- b.Tag.LangID = t.LangID
- b.Tag.RegionID = t.RegionID
- b.Tag.ScriptID = t.ScriptID
- // TODO: optimize
- b.variants = b.variants[:0]
- if variants := t.Variants(); variants != "" {
- for _, vr := range strings.Split(variants[1:], "-") {
- b.variants = append(b.variants, vr)
- }
- }
- b.extensions, b.private = b.extensions[:0], ""
- for _, e := range t.Extensions() {
- b.AddExt(e)
- }
-}
-
-// AddExt adds extension e to the tag. e must be a valid extension as returned
-// by Tag.Extension. If the extension already exists, it will be discarded,
-// except for a -u extension, where non-existing key-type pairs will added.
-func (b *Builder) AddExt(e string) {
- if e[0] == 'x' {
- if b.private == "" {
- b.private = e
- }
- return
- }
- for i, s := range b.extensions {
- if s[0] == e[0] {
- if e[0] == 'u' {
- b.extensions[i] += e[1:]
- }
- return
- }
- }
- b.extensions = append(b.extensions, e)
-}
-
-// SetExt sets the extension e to the tag. e must be a valid extension as
-// returned by Tag.Extension. If the extension already exists, it will be
-// overwritten, except for a -u extension, where the individual key-type pairs
-// will be set.
-func (b *Builder) SetExt(e string) {
- if e[0] == 'x' {
- b.private = e
- return
- }
- for i, s := range b.extensions {
- if s[0] == e[0] {
- if e[0] == 'u' {
- b.extensions[i] = e + s[1:]
- } else {
- b.extensions[i] = e
- }
- return
- }
- }
- b.extensions = append(b.extensions, e)
-}
-
-// AddVariant adds any number of variants.
-func (b *Builder) AddVariant(v ...string) {
- for _, v := range v {
- if v != "" {
- b.variants = append(b.variants, v)
- }
- }
-}
-
-// ClearVariants removes any variants previously added, including those
-// copied from a Tag in SetTag.
-func (b *Builder) ClearVariants() {
- b.variants = b.variants[:0]
-}
-
-// ClearExtensions removes any extensions previously added, including those
-// copied from a Tag in SetTag.
-func (b *Builder) ClearExtensions() {
- b.private = ""
- b.extensions = b.extensions[:0]
-}
-
-func tokenLen(token ...string) (n int) {
- for _, t := range token {
- n += len(t) + 1
- }
- return
-}
-
-func appendTokens(b []byte, token ...string) int {
- p := 0
- for _, t := range token {
- b[p] = '-'
- copy(b[p+1:], t)
- p += 1 + len(t)
- }
- return p
-}
-
-type sortVariants []string
-
-func (s sortVariants) Len() int {
- return len(s)
-}
-
-func (s sortVariants) Swap(i, j int) {
- s[j], s[i] = s[i], s[j]
-}
-
-func (s sortVariants) Less(i, j int) bool {
- return variantIndex[s[i]] < variantIndex[s[j]]
-}
diff --git a/vendor/golang.org/x/text/internal/language/coverage.go b/vendor/golang.org/x/text/internal/language/coverage.go
deleted file mode 100644
index 9b20b88..0000000
--- a/vendor/golang.org/x/text/internal/language/coverage.go
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-// BaseLanguages returns the list of all supported base languages. It generates
-// the list by traversing the internal structures.
-func BaseLanguages() []Language {
- base := make([]Language, 0, NumLanguages)
- for i := 0; i < langNoIndexOffset; i++ {
- // We included "und" already for the value 0.
- if i != nonCanonicalUnd {
- base = append(base, Language(i))
- }
- }
- i := langNoIndexOffset
- for _, v := range langNoIndex {
- for k := 0; k < 8; k++ {
- if v&1 == 1 {
- base = append(base, Language(i))
- }
- v >>= 1
- i++
- }
- }
- return base
-}
diff --git a/vendor/golang.org/x/text/internal/language/language.go b/vendor/golang.org/x/text/internal/language/language.go
deleted file mode 100644
index 09d41c7..0000000
--- a/vendor/golang.org/x/text/internal/language/language.go
+++ /dev/null
@@ -1,627 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:generate go run gen.go gen_common.go -output tables.go
-
-package language // import "golang.org/x/text/internal/language"
-
-// TODO: Remove above NOTE after:
-// - verifying that tables are dropped correctly (most notably matcher tables).
-
-import (
- "errors"
- "fmt"
- "strings"
-)
-
-const (
- // maxCoreSize is the maximum size of a BCP 47 tag without variants and
- // extensions. Equals max lang (3) + script (4) + max reg (3) + 2 dashes.
- maxCoreSize = 12
-
- // max99thPercentileSize is a somewhat arbitrary buffer size that presumably
- // is large enough to hold at least 99% of the BCP 47 tags.
- max99thPercentileSize = 32
-
- // maxSimpleUExtensionSize is the maximum size of a -u extension with one
- // key-type pair. Equals len("-u-") + key (2) + dash + max value (8).
- maxSimpleUExtensionSize = 14
-)
-
-// Tag represents a BCP 47 language tag. It is used to specify an instance of a
-// specific language or locale. All language tag values are guaranteed to be
-// well-formed. The zero value of Tag is Und.
-type Tag struct {
- // TODO: the following fields have the form TagTypeID. This name is chosen
- // to allow refactoring the public package without conflicting with its
- // Base, Script, and Region methods. Once the transition is fully completed
- // the ID can be stripped from the name.
-
- LangID Language
- RegionID Region
- // TODO: we will soon run out of positions for ScriptID. Idea: instead of
- // storing lang, region, and ScriptID codes, store only the compact index and
- // have a lookup table from this code to its expansion. This greatly speeds
- // up table lookup, speed up common variant cases.
- // This will also immediately free up 3 extra bytes. Also, the pVariant
- // field can now be moved to the lookup table, as the compact index uniquely
- // determines the offset of a possible variant.
- ScriptID Script
- pVariant byte // offset in str, includes preceding '-'
- pExt uint16 // offset of first extension, includes preceding '-'
-
- // str is the string representation of the Tag. It will only be used if the
- // tag has variants or extensions.
- str string
-}
-
-// Make is a convenience wrapper for Parse that omits the error.
-// In case of an error, a sensible default is returned.
-func Make(s string) Tag {
- t, _ := Parse(s)
- return t
-}
-
-// Raw returns the raw base language, script and region, without making an
-// attempt to infer their values.
-// TODO: consider removing
-func (t Tag) Raw() (b Language, s Script, r Region) {
- return t.LangID, t.ScriptID, t.RegionID
-}
-
-// equalTags compares language, script and region subtags only.
-func (t Tag) equalTags(a Tag) bool {
- return t.LangID == a.LangID && t.ScriptID == a.ScriptID && t.RegionID == a.RegionID
-}
-
-// IsRoot returns true if t is equal to language "und".
-func (t Tag) IsRoot() bool {
- if int(t.pVariant) < len(t.str) {
- return false
- }
- return t.equalTags(Und)
-}
-
-// IsPrivateUse reports whether the Tag consists solely of an IsPrivateUse use
-// tag.
-func (t Tag) IsPrivateUse() bool {
- return t.str != "" && t.pVariant == 0
-}
-
-// RemakeString is used to update t.str in case lang, script or region changed.
-// It is assumed that pExt and pVariant still point to the start of the
-// respective parts.
-func (t *Tag) RemakeString() {
- if t.str == "" {
- return
- }
- extra := t.str[t.pVariant:]
- if t.pVariant > 0 {
- extra = extra[1:]
- }
- if t.equalTags(Und) && strings.HasPrefix(extra, "x-") {
- t.str = extra
- t.pVariant = 0
- t.pExt = 0
- return
- }
- var buf [max99thPercentileSize]byte // avoid extra memory allocation in most cases.
- b := buf[:t.genCoreBytes(buf[:])]
- if extra != "" {
- diff := len(b) - int(t.pVariant)
- b = append(b, '-')
- b = append(b, extra...)
- t.pVariant = uint8(int(t.pVariant) + diff)
- t.pExt = uint16(int(t.pExt) + diff)
- } else {
- t.pVariant = uint8(len(b))
- t.pExt = uint16(len(b))
- }
- t.str = string(b)
-}
-
-// genCoreBytes writes a string for the base languages, script and region tags
-// to the given buffer and returns the number of bytes written. It will never
-// write more than maxCoreSize bytes.
-func (t *Tag) genCoreBytes(buf []byte) int {
- n := t.LangID.StringToBuf(buf[:])
- if t.ScriptID != 0 {
- n += copy(buf[n:], "-")
- n += copy(buf[n:], t.ScriptID.String())
- }
- if t.RegionID != 0 {
- n += copy(buf[n:], "-")
- n += copy(buf[n:], t.RegionID.String())
- }
- return n
-}
-
-// String returns the canonical string representation of the language tag.
-func (t Tag) String() string {
- if t.str != "" {
- return t.str
- }
- if t.ScriptID == 0 && t.RegionID == 0 {
- return t.LangID.String()
- }
- buf := [maxCoreSize]byte{}
- return string(buf[:t.genCoreBytes(buf[:])])
-}
-
-// MarshalText implements encoding.TextMarshaler.
-func (t Tag) MarshalText() (text []byte, err error) {
- if t.str != "" {
- text = append(text, t.str...)
- } else if t.ScriptID == 0 && t.RegionID == 0 {
- text = append(text, t.LangID.String()...)
- } else {
- buf := [maxCoreSize]byte{}
- text = buf[:t.genCoreBytes(buf[:])]
- }
- return text, nil
-}
-
-// UnmarshalText implements encoding.TextUnmarshaler.
-func (t *Tag) UnmarshalText(text []byte) error {
- tag, err := Parse(string(text))
- *t = tag
- return err
-}
-
-// Variants returns the part of the tag holding all variants or the empty string
-// if there are no variants defined.
-func (t Tag) Variants() string {
- if t.pVariant == 0 {
- return ""
- }
- return t.str[t.pVariant:t.pExt]
-}
-
-// VariantOrPrivateUseTags returns variants or private use tags.
-func (t Tag) VariantOrPrivateUseTags() string {
- if t.pExt > 0 {
- return t.str[t.pVariant:t.pExt]
- }
- return t.str[t.pVariant:]
-}
-
-// HasString reports whether this tag defines more than just the raw
-// components.
-func (t Tag) HasString() bool {
- return t.str != ""
-}
-
-// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a
-// specific language are substituted with fields from the parent language.
-// The parent for a language may change for newer versions of CLDR.
-func (t Tag) Parent() Tag {
- if t.str != "" {
- // Strip the variants and extensions.
- b, s, r := t.Raw()
- t = Tag{LangID: b, ScriptID: s, RegionID: r}
- if t.RegionID == 0 && t.ScriptID != 0 && t.LangID != 0 {
- base, _ := addTags(Tag{LangID: t.LangID})
- if base.ScriptID == t.ScriptID {
- return Tag{LangID: t.LangID}
- }
- }
- return t
- }
- if t.LangID != 0 {
- if t.RegionID != 0 {
- maxScript := t.ScriptID
- if maxScript == 0 {
- max, _ := addTags(t)
- maxScript = max.ScriptID
- }
-
- for i := range parents {
- if Language(parents[i].lang) == t.LangID && Script(parents[i].maxScript) == maxScript {
- for _, r := range parents[i].fromRegion {
- if Region(r) == t.RegionID {
- return Tag{
- LangID: t.LangID,
- ScriptID: Script(parents[i].script),
- RegionID: Region(parents[i].toRegion),
- }
- }
- }
- }
- }
-
- // Strip the script if it is the default one.
- base, _ := addTags(Tag{LangID: t.LangID})
- if base.ScriptID != maxScript {
- return Tag{LangID: t.LangID, ScriptID: maxScript}
- }
- return Tag{LangID: t.LangID}
- } else if t.ScriptID != 0 {
- // The parent for an base-script pair with a non-default script is
- // "und" instead of the base language.
- base, _ := addTags(Tag{LangID: t.LangID})
- if base.ScriptID != t.ScriptID {
- return Und
- }
- return Tag{LangID: t.LangID}
- }
- }
- return Und
-}
-
-// ParseExtension parses s as an extension and returns it on success.
-func ParseExtension(s string) (ext string, err error) {
- defer func() {
- if recover() != nil {
- ext = ""
- err = ErrSyntax
- }
- }()
-
- scan := makeScannerString(s)
- var end int
- if n := len(scan.token); n != 1 {
- return "", ErrSyntax
- }
- scan.toLower(0, len(scan.b))
- end = parseExtension(&scan)
- if end != len(s) {
- return "", ErrSyntax
- }
- return string(scan.b), nil
-}
-
-// HasVariants reports whether t has variants.
-func (t Tag) HasVariants() bool {
- return uint16(t.pVariant) < t.pExt
-}
-
-// HasExtensions reports whether t has extensions.
-func (t Tag) HasExtensions() bool {
- return int(t.pExt) < len(t.str)
-}
-
-// Extension returns the extension of type x for tag t. It will return
-// false for ok if t does not have the requested extension. The returned
-// extension will be invalid in this case.
-func (t Tag) Extension(x byte) (ext string, ok bool) {
- for i := int(t.pExt); i < len(t.str)-1; {
- var ext string
- i, ext = getExtension(t.str, i)
- if ext[0] == x {
- return ext, true
- }
- }
- return "", false
-}
-
-// Extensions returns all extensions of t.
-func (t Tag) Extensions() []string {
- e := []string{}
- for i := int(t.pExt); i < len(t.str)-1; {
- var ext string
- i, ext = getExtension(t.str, i)
- e = append(e, ext)
- }
- return e
-}
-
-// TypeForKey returns the type associated with the given key, where key and type
-// are of the allowed values defined for the Unicode locale extension ('u') in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-// TypeForKey will traverse the inheritance chain to get the correct value.
-//
-// If there are multiple types associated with a key, only the first will be
-// returned. If there is no type associated with a key, it returns the empty
-// string.
-func (t Tag) TypeForKey(key string) string {
- if _, start, end, _ := t.findTypeForKey(key); end != start {
- s := t.str[start:end]
- if p := strings.IndexByte(s, '-'); p >= 0 {
- s = s[:p]
- }
- return s
- }
- return ""
-}
-
-var (
- errPrivateUse = errors.New("cannot set a key on a private use tag")
- errInvalidArguments = errors.New("invalid key or type")
-)
-
-// SetTypeForKey returns a new Tag with the key set to type, where key and type
-// are of the allowed values defined for the Unicode locale extension ('u') in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-// An empty value removes an existing pair with the same key.
-func (t Tag) SetTypeForKey(key, value string) (Tag, error) {
- if t.IsPrivateUse() {
- return t, errPrivateUse
- }
- if len(key) != 2 {
- return t, errInvalidArguments
- }
-
- // Remove the setting if value is "".
- if value == "" {
- start, sep, end, _ := t.findTypeForKey(key)
- if start != sep {
- // Remove a possible empty extension.
- switch {
- case t.str[start-2] != '-': // has previous elements.
- case end == len(t.str), // end of string
- end+2 < len(t.str) && t.str[end+2] == '-': // end of extension
- start -= 2
- }
- if start == int(t.pVariant) && end == len(t.str) {
- t.str = ""
- t.pVariant, t.pExt = 0, 0
- } else {
- t.str = fmt.Sprintf("%s%s", t.str[:start], t.str[end:])
- }
- }
- return t, nil
- }
-
- if len(value) < 3 || len(value) > 8 {
- return t, errInvalidArguments
- }
-
- var (
- buf [maxCoreSize + maxSimpleUExtensionSize]byte
- uStart int // start of the -u extension.
- )
-
- // Generate the tag string if needed.
- if t.str == "" {
- uStart = t.genCoreBytes(buf[:])
- buf[uStart] = '-'
- uStart++
- }
-
- // Create new key-type pair and parse it to verify.
- b := buf[uStart:]
- copy(b, "u-")
- copy(b[2:], key)
- b[4] = '-'
- b = b[:5+copy(b[5:], value)]
- scan := makeScanner(b)
- if parseExtensions(&scan); scan.err != nil {
- return t, scan.err
- }
-
- // Assemble the replacement string.
- if t.str == "" {
- t.pVariant, t.pExt = byte(uStart-1), uint16(uStart-1)
- t.str = string(buf[:uStart+len(b)])
- } else {
- s := t.str
- start, sep, end, hasExt := t.findTypeForKey(key)
- if start == sep {
- if hasExt {
- b = b[2:]
- }
- t.str = fmt.Sprintf("%s-%s%s", s[:sep], b, s[end:])
- } else {
- t.str = fmt.Sprintf("%s-%s%s", s[:start+3], value, s[end:])
- }
- }
- return t, nil
-}
-
-// findTypeForKey returns the start and end position for the type corresponding
-// to key or the point at which to insert the key-value pair if the type
-// wasn't found. The hasExt return value reports whether an -u extension was present.
-// Note: the extensions are typically very small and are likely to contain
-// only one key-type pair.
-func (t Tag) findTypeForKey(key string) (start, sep, end int, hasExt bool) {
- p := int(t.pExt)
- if len(key) != 2 || p == len(t.str) || p == 0 {
- return p, p, p, false
- }
- s := t.str
-
- // Find the correct extension.
- for p++; s[p] != 'u'; p++ {
- if s[p] > 'u' {
- p--
- return p, p, p, false
- }
- if p = nextExtension(s, p); p == len(s) {
- return len(s), len(s), len(s), false
- }
- }
- // Proceed to the hyphen following the extension name.
- p++
-
- // curKey is the key currently being processed.
- curKey := ""
-
- // Iterate over keys until we get the end of a section.
- for {
- end = p
- for p++; p < len(s) && s[p] != '-'; p++ {
- }
- n := p - end - 1
- if n <= 2 && curKey == key {
- if sep < end {
- sep++
- }
- return start, sep, end, true
- }
- switch n {
- case 0, // invalid string
- 1: // next extension
- return end, end, end, true
- case 2:
- // next key
- curKey = s[end+1 : p]
- if curKey > key {
- return end, end, end, true
- }
- start = end
- sep = p
- }
- }
-}
-
-// ParseBase parses a 2- or 3-letter ISO 639 code.
-// It returns a ValueError if s is a well-formed but unknown language identifier
-// or another error if another error occurred.
-func ParseBase(s string) (l Language, err error) {
- defer func() {
- if recover() != nil {
- l = 0
- err = ErrSyntax
- }
- }()
-
- if n := len(s); n < 2 || 3 < n {
- return 0, ErrSyntax
- }
- var buf [3]byte
- return getLangID(buf[:copy(buf[:], s)])
-}
-
-// ParseScript parses a 4-letter ISO 15924 code.
-// It returns a ValueError if s is a well-formed but unknown script identifier
-// or another error if another error occurred.
-func ParseScript(s string) (scr Script, err error) {
- defer func() {
- if recover() != nil {
- scr = 0
- err = ErrSyntax
- }
- }()
-
- if len(s) != 4 {
- return 0, ErrSyntax
- }
- var buf [4]byte
- return getScriptID(script, buf[:copy(buf[:], s)])
-}
-
-// EncodeM49 returns the Region for the given UN M.49 code.
-// It returns an error if r is not a valid code.
-func EncodeM49(r int) (Region, error) {
- return getRegionM49(r)
-}
-
-// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
-// It returns a ValueError if s is a well-formed but unknown region identifier
-// or another error if another error occurred.
-func ParseRegion(s string) (r Region, err error) {
- defer func() {
- if recover() != nil {
- r = 0
- err = ErrSyntax
- }
- }()
-
- if n := len(s); n < 2 || 3 < n {
- return 0, ErrSyntax
- }
- var buf [3]byte
- return getRegionID(buf[:copy(buf[:], s)])
-}
-
-// IsCountry returns whether this region is a country or autonomous area. This
-// includes non-standard definitions from CLDR.
-func (r Region) IsCountry() bool {
- if r == 0 || r.IsGroup() || r.IsPrivateUse() && r != _XK {
- return false
- }
- return true
-}
-
-// IsGroup returns whether this region defines a collection of regions. This
-// includes non-standard definitions from CLDR.
-func (r Region) IsGroup() bool {
- if r == 0 {
- return false
- }
- return int(regionInclusion[r]) < len(regionContainment)
-}
-
-// Contains returns whether Region c is contained by Region r. It returns true
-// if c == r.
-func (r Region) Contains(c Region) bool {
- if r == c {
- return true
- }
- g := regionInclusion[r]
- if g >= nRegionGroups {
- return false
- }
- m := regionContainment[g]
-
- d := regionInclusion[c]
- b := regionInclusionBits[d]
-
- // A contained country may belong to multiple disjoint groups. Matching any
- // of these indicates containment. If the contained region is a group, it
- // must strictly be a subset.
- if d >= nRegionGroups {
- return b&m != 0
- }
- return b&^m == 0
-}
-
-var errNoTLD = errors.New("language: region is not a valid ccTLD")
-
-// TLD returns the country code top-level domain (ccTLD). UK is returned for GB.
-// In all other cases it returns either the region itself or an error.
-//
-// This method may return an error for a region for which there exists a
-// canonical form with a ccTLD. To get that ccTLD canonicalize r first. The
-// region will already be canonicalized it was obtained from a Tag that was
-// obtained using any of the default methods.
-func (r Region) TLD() (Region, error) {
- // See http://en.wikipedia.org/wiki/Country_code_top-level_domain for the
- // difference between ISO 3166-1 and IANA ccTLD.
- if r == _GB {
- r = _UK
- }
- if (r.typ() & ccTLD) == 0 {
- return 0, errNoTLD
- }
- return r, nil
-}
-
-// Canonicalize returns the region or a possible replacement if the region is
-// deprecated. It will not return a replacement for deprecated regions that
-// are split into multiple regions.
-func (r Region) Canonicalize() Region {
- if cr := normRegion(r); cr != 0 {
- return cr
- }
- return r
-}
-
-// Variant represents a registered variant of a language as defined by BCP 47.
-type Variant struct {
- ID uint8
- str string
-}
-
-// ParseVariant parses and returns a Variant. An error is returned if s is not
-// a valid variant.
-func ParseVariant(s string) (v Variant, err error) {
- defer func() {
- if recover() != nil {
- v = Variant{}
- err = ErrSyntax
- }
- }()
-
- s = strings.ToLower(s)
- if id, ok := variantIndex[s]; ok {
- return Variant{id, s}, nil
- }
- return Variant{}, NewValueError([]byte(s))
-}
-
-// String returns the string representation of the variant.
-func (v Variant) String() string {
- return v.str
-}
diff --git a/vendor/golang.org/x/text/internal/language/lookup.go b/vendor/golang.org/x/text/internal/language/lookup.go
deleted file mode 100644
index 231b4fb..0000000
--- a/vendor/golang.org/x/text/internal/language/lookup.go
+++ /dev/null
@@ -1,412 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import (
- "bytes"
- "fmt"
- "sort"
- "strconv"
-
- "golang.org/x/text/internal/tag"
-)
-
-// findIndex tries to find the given tag in idx and returns a standardized error
-// if it could not be found.
-func findIndex(idx tag.Index, key []byte, form string) (index int, err error) {
- if !tag.FixCase(form, key) {
- return 0, ErrSyntax
- }
- i := idx.Index(key)
- if i == -1 {
- return 0, NewValueError(key)
- }
- return i, nil
-}
-
-func searchUint(imap []uint16, key uint16) int {
- return sort.Search(len(imap), func(i int) bool {
- return imap[i] >= key
- })
-}
-
-type Language uint16
-
-// getLangID returns the langID of s if s is a canonical subtag
-// or langUnknown if s is not a canonical subtag.
-func getLangID(s []byte) (Language, error) {
- if len(s) == 2 {
- return getLangISO2(s)
- }
- return getLangISO3(s)
-}
-
-// TODO language normalization as well as the AliasMaps could be moved to the
-// higher level package, but it is a bit tricky to separate the generation.
-
-func (id Language) Canonicalize() (Language, AliasType) {
- return normLang(id)
-}
-
-// normLang returns the mapped langID of id according to mapping m.
-func normLang(id Language) (Language, AliasType) {
- k := sort.Search(len(AliasMap), func(i int) bool {
- return AliasMap[i].From >= uint16(id)
- })
- if k < len(AliasMap) && AliasMap[k].From == uint16(id) {
- return Language(AliasMap[k].To), AliasTypes[k]
- }
- return id, AliasTypeUnknown
-}
-
-// getLangISO2 returns the langID for the given 2-letter ISO language code
-// or unknownLang if this does not exist.
-func getLangISO2(s []byte) (Language, error) {
- if !tag.FixCase("zz", s) {
- return 0, ErrSyntax
- }
- if i := lang.Index(s); i != -1 && lang.Elem(i)[3] != 0 {
- return Language(i), nil
- }
- return 0, NewValueError(s)
-}
-
-const base = 'z' - 'a' + 1
-
-func strToInt(s []byte) uint {
- v := uint(0)
- for i := 0; i < len(s); i++ {
- v *= base
- v += uint(s[i] - 'a')
- }
- return v
-}
-
-// converts the given integer to the original ASCII string passed to strToInt.
-// len(s) must match the number of characters obtained.
-func intToStr(v uint, s []byte) {
- for i := len(s) - 1; i >= 0; i-- {
- s[i] = byte(v%base) + 'a'
- v /= base
- }
-}
-
-// getLangISO3 returns the langID for the given 3-letter ISO language code
-// or unknownLang if this does not exist.
-func getLangISO3(s []byte) (Language, error) {
- if tag.FixCase("und", s) {
- // first try to match canonical 3-letter entries
- for i := lang.Index(s[:2]); i != -1; i = lang.Next(s[:2], i) {
- if e := lang.Elem(i); e[3] == 0 && e[2] == s[2] {
- // We treat "und" as special and always translate it to "unspecified".
- // Note that ZZ and Zzzz are private use and are not treated as
- // unspecified by default.
- id := Language(i)
- if id == nonCanonicalUnd {
- return 0, nil
- }
- return id, nil
- }
- }
- if i := altLangISO3.Index(s); i != -1 {
- return Language(altLangIndex[altLangISO3.Elem(i)[3]]), nil
- }
- n := strToInt(s)
- if langNoIndex[n/8]&(1<<(n%8)) != 0 {
- return Language(n) + langNoIndexOffset, nil
- }
- // Check for non-canonical uses of ISO3.
- for i := lang.Index(s[:1]); i != -1; i = lang.Next(s[:1], i) {
- if e := lang.Elem(i); e[2] == s[1] && e[3] == s[2] {
- return Language(i), nil
- }
- }
- return 0, NewValueError(s)
- }
- return 0, ErrSyntax
-}
-
-// StringToBuf writes the string to b and returns the number of bytes
-// written. cap(b) must be >= 3.
-func (id Language) StringToBuf(b []byte) int {
- if id >= langNoIndexOffset {
- intToStr(uint(id)-langNoIndexOffset, b[:3])
- return 3
- } else if id == 0 {
- return copy(b, "und")
- }
- l := lang[id<<2:]
- if l[3] == 0 {
- return copy(b, l[:3])
- }
- return copy(b, l[:2])
-}
-
-// String returns the BCP 47 representation of the langID.
-// Use b as variable name, instead of id, to ensure the variable
-// used is consistent with that of Base in which this type is embedded.
-func (b Language) String() string {
- if b == 0 {
- return "und"
- } else if b >= langNoIndexOffset {
- b -= langNoIndexOffset
- buf := [3]byte{}
- intToStr(uint(b), buf[:])
- return string(buf[:])
- }
- l := lang.Elem(int(b))
- if l[3] == 0 {
- return l[:3]
- }
- return l[:2]
-}
-
-// ISO3 returns the ISO 639-3 language code.
-func (b Language) ISO3() string {
- if b == 0 || b >= langNoIndexOffset {
- return b.String()
- }
- l := lang.Elem(int(b))
- if l[3] == 0 {
- return l[:3]
- } else if l[2] == 0 {
- return altLangISO3.Elem(int(l[3]))[:3]
- }
- // This allocation will only happen for 3-letter ISO codes
- // that are non-canonical BCP 47 language identifiers.
- return l[0:1] + l[2:4]
-}
-
-// IsPrivateUse reports whether this language code is reserved for private use.
-func (b Language) IsPrivateUse() bool {
- return langPrivateStart <= b && b <= langPrivateEnd
-}
-
-// SuppressScript returns the script marked as SuppressScript in the IANA
-// language tag repository, or 0 if there is no such script.
-func (b Language) SuppressScript() Script {
- if b < langNoIndexOffset {
- return Script(suppressScript[b])
- }
- return 0
-}
-
-type Region uint16
-
-// getRegionID returns the region id for s if s is a valid 2-letter region code
-// or unknownRegion.
-func getRegionID(s []byte) (Region, error) {
- if len(s) == 3 {
- if isAlpha(s[0]) {
- return getRegionISO3(s)
- }
- if i, err := strconv.ParseUint(string(s), 10, 10); err == nil {
- return getRegionM49(int(i))
- }
- }
- return getRegionISO2(s)
-}
-
-// getRegionISO2 returns the regionID for the given 2-letter ISO country code
-// or unknownRegion if this does not exist.
-func getRegionISO2(s []byte) (Region, error) {
- i, err := findIndex(regionISO, s, "ZZ")
- if err != nil {
- return 0, err
- }
- return Region(i) + isoRegionOffset, nil
-}
-
-// getRegionISO3 returns the regionID for the given 3-letter ISO country code
-// or unknownRegion if this does not exist.
-func getRegionISO3(s []byte) (Region, error) {
- if tag.FixCase("ZZZ", s) {
- for i := regionISO.Index(s[:1]); i != -1; i = regionISO.Next(s[:1], i) {
- if e := regionISO.Elem(i); e[2] == s[1] && e[3] == s[2] {
- return Region(i) + isoRegionOffset, nil
- }
- }
- for i := 0; i < len(altRegionISO3); i += 3 {
- if tag.Compare(altRegionISO3[i:i+3], s) == 0 {
- return Region(altRegionIDs[i/3]), nil
- }
- }
- return 0, NewValueError(s)
- }
- return 0, ErrSyntax
-}
-
-func getRegionM49(n int) (Region, error) {
- if 0 < n && n <= 999 {
- const (
- searchBits = 7
- regionBits = 9
- regionMask = 1<> searchBits
- buf := fromM49[m49Index[idx]:m49Index[idx+1]]
- val := uint16(n) << regionBits // we rely on bits shifting out
- i := sort.Search(len(buf), func(i int) bool {
- return buf[i] >= val
- })
- if r := fromM49[int(m49Index[idx])+i]; r&^regionMask == val {
- return Region(r & regionMask), nil
- }
- }
- var e ValueError
- fmt.Fprint(bytes.NewBuffer([]byte(e.v[:])), n)
- return 0, e
-}
-
-// normRegion returns a region if r is deprecated or 0 otherwise.
-// TODO: consider supporting BYS (-> BLR), CSK (-> 200 or CZ), PHI (-> PHL) and AFI (-> DJ).
-// TODO: consider mapping split up regions to new most populous one (like CLDR).
-func normRegion(r Region) Region {
- m := regionOldMap
- k := sort.Search(len(m), func(i int) bool {
- return m[i].From >= uint16(r)
- })
- if k < len(m) && m[k].From == uint16(r) {
- return Region(m[k].To)
- }
- return 0
-}
-
-const (
- iso3166UserAssigned = 1 << iota
- ccTLD
- bcp47Region
-)
-
-func (r Region) typ() byte {
- return regionTypes[r]
-}
-
-// String returns the BCP 47 representation for the region.
-// It returns "ZZ" for an unspecified region.
-func (r Region) String() string {
- if r < isoRegionOffset {
- if r == 0 {
- return "ZZ"
- }
- return fmt.Sprintf("%03d", r.M49())
- }
- r -= isoRegionOffset
- return regionISO.Elem(int(r))[:2]
-}
-
-// ISO3 returns the 3-letter ISO code of r.
-// Note that not all regions have a 3-letter ISO code.
-// In such cases this method returns "ZZZ".
-func (r Region) ISO3() string {
- if r < isoRegionOffset {
- return "ZZZ"
- }
- r -= isoRegionOffset
- reg := regionISO.Elem(int(r))
- switch reg[2] {
- case 0:
- return altRegionISO3[reg[3]:][:3]
- case ' ':
- return "ZZZ"
- }
- return reg[0:1] + reg[2:4]
-}
-
-// M49 returns the UN M.49 encoding of r, or 0 if this encoding
-// is not defined for r.
-func (r Region) M49() int {
- return int(m49[r])
-}
-
-// IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This
-// may include private-use tags that are assigned by CLDR and used in this
-// implementation. So IsPrivateUse and IsCountry can be simultaneously true.
-func (r Region) IsPrivateUse() bool {
- return r.typ()&iso3166UserAssigned != 0
-}
-
-type Script uint16
-
-// getScriptID returns the script id for string s. It assumes that s
-// is of the format [A-Z][a-z]{3}.
-func getScriptID(idx tag.Index, s []byte) (Script, error) {
- i, err := findIndex(idx, s, "Zzzz")
- return Script(i), err
-}
-
-// String returns the script code in title case.
-// It returns "Zzzz" for an unspecified script.
-func (s Script) String() string {
- if s == 0 {
- return "Zzzz"
- }
- return script.Elem(int(s))
-}
-
-// IsPrivateUse reports whether this script code is reserved for private use.
-func (s Script) IsPrivateUse() bool {
- return _Qaaa <= s && s <= _Qabx
-}
-
-const (
- maxAltTaglen = len("en-US-POSIX")
- maxLen = maxAltTaglen
-)
-
-var (
- // grandfatheredMap holds a mapping from legacy and grandfathered tags to
- // their base language or index to more elaborate tag.
- grandfatheredMap = map[[maxLen]byte]int16{
- [maxLen]byte{'a', 'r', 't', '-', 'l', 'o', 'j', 'b', 'a', 'n'}: _jbo, // art-lojban
- [maxLen]byte{'i', '-', 'a', 'm', 'i'}: _ami, // i-ami
- [maxLen]byte{'i', '-', 'b', 'n', 'n'}: _bnn, // i-bnn
- [maxLen]byte{'i', '-', 'h', 'a', 'k'}: _hak, // i-hak
- [maxLen]byte{'i', '-', 'k', 'l', 'i', 'n', 'g', 'o', 'n'}: _tlh, // i-klingon
- [maxLen]byte{'i', '-', 'l', 'u', 'x'}: _lb, // i-lux
- [maxLen]byte{'i', '-', 'n', 'a', 'v', 'a', 'j', 'o'}: _nv, // i-navajo
- [maxLen]byte{'i', '-', 'p', 'w', 'n'}: _pwn, // i-pwn
- [maxLen]byte{'i', '-', 't', 'a', 'o'}: _tao, // i-tao
- [maxLen]byte{'i', '-', 't', 'a', 'y'}: _tay, // i-tay
- [maxLen]byte{'i', '-', 't', 's', 'u'}: _tsu, // i-tsu
- [maxLen]byte{'n', 'o', '-', 'b', 'o', 'k'}: _nb, // no-bok
- [maxLen]byte{'n', 'o', '-', 'n', 'y', 'n'}: _nn, // no-nyn
- [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'f', 'r'}: _sfb, // sgn-BE-FR
- [maxLen]byte{'s', 'g', 'n', '-', 'b', 'e', '-', 'n', 'l'}: _vgt, // sgn-BE-NL
- [maxLen]byte{'s', 'g', 'n', '-', 'c', 'h', '-', 'd', 'e'}: _sgg, // sgn-CH-DE
- [maxLen]byte{'z', 'h', '-', 'g', 'u', 'o', 'y', 'u'}: _cmn, // zh-guoyu
- [maxLen]byte{'z', 'h', '-', 'h', 'a', 'k', 'k', 'a'}: _hak, // zh-hakka
- [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n', '-', 'n', 'a', 'n'}: _nan, // zh-min-nan
- [maxLen]byte{'z', 'h', '-', 'x', 'i', 'a', 'n', 'g'}: _hsn, // zh-xiang
-
- // Grandfathered tags with no modern replacement will be converted as
- // follows:
- [maxLen]byte{'c', 'e', 'l', '-', 'g', 'a', 'u', 'l', 'i', 's', 'h'}: -1, // cel-gaulish
- [maxLen]byte{'e', 'n', '-', 'g', 'b', '-', 'o', 'e', 'd'}: -2, // en-GB-oed
- [maxLen]byte{'i', '-', 'd', 'e', 'f', 'a', 'u', 'l', 't'}: -3, // i-default
- [maxLen]byte{'i', '-', 'e', 'n', 'o', 'c', 'h', 'i', 'a', 'n'}: -4, // i-enochian
- [maxLen]byte{'i', '-', 'm', 'i', 'n', 'g', 'o'}: -5, // i-mingo
- [maxLen]byte{'z', 'h', '-', 'm', 'i', 'n'}: -6, // zh-min
-
- // CLDR-specific tag.
- [maxLen]byte{'r', 'o', 'o', 't'}: 0, // root
- [maxLen]byte{'e', 'n', '-', 'u', 's', '-', 'p', 'o', 's', 'i', 'x'}: -7, // en_US_POSIX"
- }
-
- altTagIndex = [...]uint8{0, 17, 31, 45, 61, 74, 86, 102}
-
- altTags = "xtg-x-cel-gaulishen-GB-oxendicten-x-i-defaultund-x-i-enochiansee-x-i-mingonan-x-zh-minen-US-u-va-posix"
-)
-
-func grandfathered(s [maxAltTaglen]byte) (t Tag, ok bool) {
- if v, ok := grandfatheredMap[s]; ok {
- if v < 0 {
- return Make(altTags[altTagIndex[-v-1]:altTagIndex[-v]]), true
- }
- t.LangID = Language(v)
- return t, true
- }
- return t, false
-}
diff --git a/vendor/golang.org/x/text/internal/language/match.go b/vendor/golang.org/x/text/internal/language/match.go
deleted file mode 100644
index 75a2dbc..0000000
--- a/vendor/golang.org/x/text/internal/language/match.go
+++ /dev/null
@@ -1,226 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import "errors"
-
-type scriptRegionFlags uint8
-
-const (
- isList = 1 << iota
- scriptInFrom
- regionInFrom
-)
-
-func (t *Tag) setUndefinedLang(id Language) {
- if t.LangID == 0 {
- t.LangID = id
- }
-}
-
-func (t *Tag) setUndefinedScript(id Script) {
- if t.ScriptID == 0 {
- t.ScriptID = id
- }
-}
-
-func (t *Tag) setUndefinedRegion(id Region) {
- if t.RegionID == 0 || t.RegionID.Contains(id) {
- t.RegionID = id
- }
-}
-
-// ErrMissingLikelyTagsData indicates no information was available
-// to compute likely values of missing tags.
-var ErrMissingLikelyTagsData = errors.New("missing likely tags data")
-
-// addLikelySubtags sets subtags to their most likely value, given the locale.
-// In most cases this means setting fields for unknown values, but in some
-// cases it may alter a value. It returns an ErrMissingLikelyTagsData error
-// if the given locale cannot be expanded.
-func (t Tag) addLikelySubtags() (Tag, error) {
- id, err := addTags(t)
- if err != nil {
- return t, err
- } else if id.equalTags(t) {
- return t, nil
- }
- id.RemakeString()
- return id, nil
-}
-
-// specializeRegion attempts to specialize a group region.
-func specializeRegion(t *Tag) bool {
- if i := regionInclusion[t.RegionID]; i < nRegionGroups {
- x := likelyRegionGroup[i]
- if Language(x.lang) == t.LangID && Script(x.script) == t.ScriptID {
- t.RegionID = Region(x.region)
- }
- return true
- }
- return false
-}
-
-// Maximize returns a new tag with missing tags filled in.
-func (t Tag) Maximize() (Tag, error) {
- return addTags(t)
-}
-
-func addTags(t Tag) (Tag, error) {
- // We leave private use identifiers alone.
- if t.IsPrivateUse() {
- return t, nil
- }
- if t.ScriptID != 0 && t.RegionID != 0 {
- if t.LangID != 0 {
- // already fully specified
- specializeRegion(&t)
- return t, nil
- }
- // Search matches for und-script-region. Note that for these cases
- // region will never be a group so there is no need to check for this.
- list := likelyRegion[t.RegionID : t.RegionID+1]
- if x := list[0]; x.flags&isList != 0 {
- list = likelyRegionList[x.lang : x.lang+uint16(x.script)]
- }
- for _, x := range list {
- // Deviating from the spec. See match_test.go for details.
- if Script(x.script) == t.ScriptID {
- t.setUndefinedLang(Language(x.lang))
- return t, nil
- }
- }
- }
- if t.LangID != 0 {
- // Search matches for lang-script and lang-region, where lang != und.
- if t.LangID < langNoIndexOffset {
- x := likelyLang[t.LangID]
- if x.flags&isList != 0 {
- list := likelyLangList[x.region : x.region+uint16(x.script)]
- if t.ScriptID != 0 {
- for _, x := range list {
- if Script(x.script) == t.ScriptID && x.flags&scriptInFrom != 0 {
- t.setUndefinedRegion(Region(x.region))
- return t, nil
- }
- }
- } else if t.RegionID != 0 {
- count := 0
- goodScript := true
- tt := t
- for _, x := range list {
- // We visit all entries for which the script was not
- // defined, including the ones where the region was not
- // defined. This allows for proper disambiguation within
- // regions.
- if x.flags&scriptInFrom == 0 && t.RegionID.Contains(Region(x.region)) {
- tt.RegionID = Region(x.region)
- tt.setUndefinedScript(Script(x.script))
- goodScript = goodScript && tt.ScriptID == Script(x.script)
- count++
- }
- }
- if count == 1 {
- return tt, nil
- }
- // Even if we fail to find a unique Region, we might have
- // an unambiguous script.
- if goodScript {
- t.ScriptID = tt.ScriptID
- }
- }
- }
- }
- } else {
- // Search matches for und-script.
- if t.ScriptID != 0 {
- x := likelyScript[t.ScriptID]
- if x.region != 0 {
- t.setUndefinedRegion(Region(x.region))
- t.setUndefinedLang(Language(x.lang))
- return t, nil
- }
- }
- // Search matches for und-region. If und-script-region exists, it would
- // have been found earlier.
- if t.RegionID != 0 {
- if i := regionInclusion[t.RegionID]; i < nRegionGroups {
- x := likelyRegionGroup[i]
- if x.region != 0 {
- t.setUndefinedLang(Language(x.lang))
- t.setUndefinedScript(Script(x.script))
- t.RegionID = Region(x.region)
- }
- } else {
- x := likelyRegion[t.RegionID]
- if x.flags&isList != 0 {
- x = likelyRegionList[x.lang]
- }
- if x.script != 0 && x.flags != scriptInFrom {
- t.setUndefinedLang(Language(x.lang))
- t.setUndefinedScript(Script(x.script))
- return t, nil
- }
- }
- }
- }
-
- // Search matches for lang.
- if t.LangID < langNoIndexOffset {
- x := likelyLang[t.LangID]
- if x.flags&isList != 0 {
- x = likelyLangList[x.region]
- }
- if x.region != 0 {
- t.setUndefinedScript(Script(x.script))
- t.setUndefinedRegion(Region(x.region))
- }
- specializeRegion(&t)
- if t.LangID == 0 {
- t.LangID = _en // default language
- }
- return t, nil
- }
- return t, ErrMissingLikelyTagsData
-}
-
-func (t *Tag) setTagsFrom(id Tag) {
- t.LangID = id.LangID
- t.ScriptID = id.ScriptID
- t.RegionID = id.RegionID
-}
-
-// minimize removes the region or script subtags from t such that
-// t.addLikelySubtags() == t.minimize().addLikelySubtags().
-func (t Tag) minimize() (Tag, error) {
- t, err := minimizeTags(t)
- if err != nil {
- return t, err
- }
- t.RemakeString()
- return t, nil
-}
-
-// minimizeTags mimics the behavior of the ICU 51 C implementation.
-func minimizeTags(t Tag) (Tag, error) {
- if t.equalTags(Und) {
- return t, nil
- }
- max, err := addTags(t)
- if err != nil {
- return t, err
- }
- for _, id := range [...]Tag{
- {LangID: t.LangID},
- {LangID: t.LangID, RegionID: t.RegionID},
- {LangID: t.LangID, ScriptID: t.ScriptID},
- } {
- if x, err := addTags(id); err == nil && max.equalTags(x) {
- t.setTagsFrom(id)
- break
- }
- }
- return t, nil
-}
diff --git a/vendor/golang.org/x/text/internal/language/parse.go b/vendor/golang.org/x/text/internal/language/parse.go
deleted file mode 100644
index aad1e0a..0000000
--- a/vendor/golang.org/x/text/internal/language/parse.go
+++ /dev/null
@@ -1,608 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import (
- "bytes"
- "errors"
- "fmt"
- "sort"
-
- "golang.org/x/text/internal/tag"
-)
-
-// isAlpha returns true if the byte is not a digit.
-// b must be an ASCII letter or digit.
-func isAlpha(b byte) bool {
- return b > '9'
-}
-
-// isAlphaNum returns true if the string contains only ASCII letters or digits.
-func isAlphaNum(s []byte) bool {
- for _, c := range s {
- if !('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9') {
- return false
- }
- }
- return true
-}
-
-// ErrSyntax is returned by any of the parsing functions when the
-// input is not well-formed, according to BCP 47.
-// TODO: return the position at which the syntax error occurred?
-var ErrSyntax = errors.New("language: tag is not well-formed")
-
-// ErrDuplicateKey is returned when a tag contains the same key twice with
-// different values in the -u section.
-var ErrDuplicateKey = errors.New("language: different values for same key in -u extension")
-
-// ValueError is returned by any of the parsing functions when the
-// input is well-formed but the respective subtag is not recognized
-// as a valid value.
-type ValueError struct {
- v [8]byte
-}
-
-// NewValueError creates a new ValueError.
-func NewValueError(tag []byte) ValueError {
- var e ValueError
- copy(e.v[:], tag)
- return e
-}
-
-func (e ValueError) tag() []byte {
- n := bytes.IndexByte(e.v[:], 0)
- if n == -1 {
- n = 8
- }
- return e.v[:n]
-}
-
-// Error implements the error interface.
-func (e ValueError) Error() string {
- return fmt.Sprintf("language: subtag %q is well-formed but unknown", e.tag())
-}
-
-// Subtag returns the subtag for which the error occurred.
-func (e ValueError) Subtag() string {
- return string(e.tag())
-}
-
-// scanner is used to scan BCP 47 tokens, which are separated by _ or -.
-type scanner struct {
- b []byte
- bytes [max99thPercentileSize]byte
- token []byte
- start int // start position of the current token
- end int // end position of the current token
- next int // next point for scan
- err error
- done bool
-}
-
-func makeScannerString(s string) scanner {
- scan := scanner{}
- if len(s) <= len(scan.bytes) {
- scan.b = scan.bytes[:copy(scan.bytes[:], s)]
- } else {
- scan.b = []byte(s)
- }
- scan.init()
- return scan
-}
-
-// makeScanner returns a scanner using b as the input buffer.
-// b is not copied and may be modified by the scanner routines.
-func makeScanner(b []byte) scanner {
- scan := scanner{b: b}
- scan.init()
- return scan
-}
-
-func (s *scanner) init() {
- for i, c := range s.b {
- if c == '_' {
- s.b[i] = '-'
- }
- }
- s.scan()
-}
-
-// restToLower converts the string between start and end to lower case.
-func (s *scanner) toLower(start, end int) {
- for i := start; i < end; i++ {
- c := s.b[i]
- if 'A' <= c && c <= 'Z' {
- s.b[i] += 'a' - 'A'
- }
- }
-}
-
-func (s *scanner) setError(e error) {
- if s.err == nil || (e == ErrSyntax && s.err != ErrSyntax) {
- s.err = e
- }
-}
-
-// resizeRange shrinks or grows the array at position oldStart such that
-// a new string of size newSize can fit between oldStart and oldEnd.
-// Sets the scan point to after the resized range.
-func (s *scanner) resizeRange(oldStart, oldEnd, newSize int) {
- s.start = oldStart
- if end := oldStart + newSize; end != oldEnd {
- diff := end - oldEnd
- var b []byte
- if n := len(s.b) + diff; n > cap(s.b) {
- b = make([]byte, n)
- copy(b, s.b[:oldStart])
- } else {
- b = s.b[:n]
- }
- copy(b[end:], s.b[oldEnd:])
- s.b = b
- s.next = end + (s.next - s.end)
- s.end = end
- }
-}
-
-// replace replaces the current token with repl.
-func (s *scanner) replace(repl string) {
- s.resizeRange(s.start, s.end, len(repl))
- copy(s.b[s.start:], repl)
-}
-
-// gobble removes the current token from the input.
-// Caller must call scan after calling gobble.
-func (s *scanner) gobble(e error) {
- s.setError(e)
- if s.start == 0 {
- s.b = s.b[:+copy(s.b, s.b[s.next:])]
- s.end = 0
- } else {
- s.b = s.b[:s.start-1+copy(s.b[s.start-1:], s.b[s.end:])]
- s.end = s.start - 1
- }
- s.next = s.start
-}
-
-// deleteRange removes the given range from s.b before the current token.
-func (s *scanner) deleteRange(start, end int) {
- s.b = s.b[:start+copy(s.b[start:], s.b[end:])]
- diff := end - start
- s.next -= diff
- s.start -= diff
- s.end -= diff
-}
-
-// scan parses the next token of a BCP 47 string. Tokens that are larger
-// than 8 characters or include non-alphanumeric characters result in an error
-// and are gobbled and removed from the output.
-// It returns the end position of the last token consumed.
-func (s *scanner) scan() (end int) {
- end = s.end
- s.token = nil
- for s.start = s.next; s.next < len(s.b); {
- i := bytes.IndexByte(s.b[s.next:], '-')
- if i == -1 {
- s.end = len(s.b)
- s.next = len(s.b)
- i = s.end - s.start
- } else {
- s.end = s.next + i
- s.next = s.end + 1
- }
- token := s.b[s.start:s.end]
- if i < 1 || i > 8 || !isAlphaNum(token) {
- s.gobble(ErrSyntax)
- continue
- }
- s.token = token
- return end
- }
- if n := len(s.b); n > 0 && s.b[n-1] == '-' {
- s.setError(ErrSyntax)
- s.b = s.b[:len(s.b)-1]
- }
- s.done = true
- return end
-}
-
-// acceptMinSize parses multiple tokens of the given size or greater.
-// It returns the end position of the last token consumed.
-func (s *scanner) acceptMinSize(min int) (end int) {
- end = s.end
- s.scan()
- for ; len(s.token) >= min; s.scan() {
- end = s.end
- }
- return end
-}
-
-// Parse parses the given BCP 47 string and returns a valid Tag. If parsing
-// failed it returns an error and any part of the tag that could be parsed.
-// If parsing succeeded but an unknown value was found, it returns
-// ValueError. The Tag returned in this case is just stripped of the unknown
-// value. All other values are preserved. It accepts tags in the BCP 47 format
-// and extensions to this standard defined in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-func Parse(s string) (t Tag, err error) {
- // TODO: consider supporting old-style locale key-value pairs.
- if s == "" {
- return Und, ErrSyntax
- }
- defer func() {
- if recover() != nil {
- t = Und
- err = ErrSyntax
- return
- }
- }()
- if len(s) <= maxAltTaglen {
- b := [maxAltTaglen]byte{}
- for i, c := range s {
- // Generating invalid UTF-8 is okay as it won't match.
- if 'A' <= c && c <= 'Z' {
- c += 'a' - 'A'
- } else if c == '_' {
- c = '-'
- }
- b[i] = byte(c)
- }
- if t, ok := grandfathered(b); ok {
- return t, nil
- }
- }
- scan := makeScannerString(s)
- return parse(&scan, s)
-}
-
-func parse(scan *scanner, s string) (t Tag, err error) {
- t = Und
- var end int
- if n := len(scan.token); n <= 1 {
- scan.toLower(0, len(scan.b))
- if n == 0 || scan.token[0] != 'x' {
- return t, ErrSyntax
- }
- end = parseExtensions(scan)
- } else if n >= 4 {
- return Und, ErrSyntax
- } else { // the usual case
- t, end = parseTag(scan, true)
- if n := len(scan.token); n == 1 {
- t.pExt = uint16(end)
- end = parseExtensions(scan)
- } else if end < len(scan.b) {
- scan.setError(ErrSyntax)
- scan.b = scan.b[:end]
- }
- }
- if int(t.pVariant) < len(scan.b) {
- if end < len(s) {
- s = s[:end]
- }
- if len(s) > 0 && tag.Compare(s, scan.b) == 0 {
- t.str = s
- } else {
- t.str = string(scan.b)
- }
- } else {
- t.pVariant, t.pExt = 0, 0
- }
- return t, scan.err
-}
-
-// parseTag parses language, script, region and variants.
-// It returns a Tag and the end position in the input that was parsed.
-// If doNorm is true, then - will be normalized to .
-func parseTag(scan *scanner, doNorm bool) (t Tag, end int) {
- var e error
- // TODO: set an error if an unknown lang, script or region is encountered.
- t.LangID, e = getLangID(scan.token)
- scan.setError(e)
- scan.replace(t.LangID.String())
- langStart := scan.start
- end = scan.scan()
- for len(scan.token) == 3 && isAlpha(scan.token[0]) {
- // From http://tools.ietf.org/html/bcp47, - tags are equivalent
- // to a tag of the form .
- if doNorm {
- lang, e := getLangID(scan.token)
- if lang != 0 {
- t.LangID = lang
- langStr := lang.String()
- copy(scan.b[langStart:], langStr)
- scan.b[langStart+len(langStr)] = '-'
- scan.start = langStart + len(langStr) + 1
- }
- scan.gobble(e)
- }
- end = scan.scan()
- }
- if len(scan.token) == 4 && isAlpha(scan.token[0]) {
- t.ScriptID, e = getScriptID(script, scan.token)
- if t.ScriptID == 0 {
- scan.gobble(e)
- }
- end = scan.scan()
- }
- if n := len(scan.token); n >= 2 && n <= 3 {
- t.RegionID, e = getRegionID(scan.token)
- if t.RegionID == 0 {
- scan.gobble(e)
- } else {
- scan.replace(t.RegionID.String())
- }
- end = scan.scan()
- }
- scan.toLower(scan.start, len(scan.b))
- t.pVariant = byte(end)
- end = parseVariants(scan, end, t)
- t.pExt = uint16(end)
- return t, end
-}
-
-var separator = []byte{'-'}
-
-// parseVariants scans tokens as long as each token is a valid variant string.
-// Duplicate variants are removed.
-func parseVariants(scan *scanner, end int, t Tag) int {
- start := scan.start
- varIDBuf := [4]uint8{}
- variantBuf := [4][]byte{}
- varID := varIDBuf[:0]
- variant := variantBuf[:0]
- last := -1
- needSort := false
- for ; len(scan.token) >= 4; scan.scan() {
- // TODO: measure the impact of needing this conversion and redesign
- // the data structure if there is an issue.
- v, ok := variantIndex[string(scan.token)]
- if !ok {
- // unknown variant
- // TODO: allow user-defined variants?
- scan.gobble(NewValueError(scan.token))
- continue
- }
- varID = append(varID, v)
- variant = append(variant, scan.token)
- if !needSort {
- if last < int(v) {
- last = int(v)
- } else {
- needSort = true
- // There is no legal combinations of more than 7 variants
- // (and this is by no means a useful sequence).
- const maxVariants = 8
- if len(varID) > maxVariants {
- break
- }
- }
- }
- end = scan.end
- }
- if needSort {
- sort.Sort(variantsSort{varID, variant})
- k, l := 0, -1
- for i, v := range varID {
- w := int(v)
- if l == w {
- // Remove duplicates.
- continue
- }
- varID[k] = varID[i]
- variant[k] = variant[i]
- k++
- l = w
- }
- if str := bytes.Join(variant[:k], separator); len(str) == 0 {
- end = start - 1
- } else {
- scan.resizeRange(start, end, len(str))
- copy(scan.b[scan.start:], str)
- end = scan.end
- }
- }
- return end
-}
-
-type variantsSort struct {
- i []uint8
- v [][]byte
-}
-
-func (s variantsSort) Len() int {
- return len(s.i)
-}
-
-func (s variantsSort) Swap(i, j int) {
- s.i[i], s.i[j] = s.i[j], s.i[i]
- s.v[i], s.v[j] = s.v[j], s.v[i]
-}
-
-func (s variantsSort) Less(i, j int) bool {
- return s.i[i] < s.i[j]
-}
-
-type bytesSort struct {
- b [][]byte
- n int // first n bytes to compare
-}
-
-func (b bytesSort) Len() int {
- return len(b.b)
-}
-
-func (b bytesSort) Swap(i, j int) {
- b.b[i], b.b[j] = b.b[j], b.b[i]
-}
-
-func (b bytesSort) Less(i, j int) bool {
- for k := 0; k < b.n; k++ {
- if b.b[i][k] == b.b[j][k] {
- continue
- }
- return b.b[i][k] < b.b[j][k]
- }
- return false
-}
-
-// parseExtensions parses and normalizes the extensions in the buffer.
-// It returns the last position of scan.b that is part of any extension.
-// It also trims scan.b to remove excess parts accordingly.
-func parseExtensions(scan *scanner) int {
- start := scan.start
- exts := [][]byte{}
- private := []byte{}
- end := scan.end
- for len(scan.token) == 1 {
- extStart := scan.start
- ext := scan.token[0]
- end = parseExtension(scan)
- extension := scan.b[extStart:end]
- if len(extension) < 3 || (ext != 'x' && len(extension) < 4) {
- scan.setError(ErrSyntax)
- end = extStart
- continue
- } else if start == extStart && (ext == 'x' || scan.start == len(scan.b)) {
- scan.b = scan.b[:end]
- return end
- } else if ext == 'x' {
- private = extension
- break
- }
- exts = append(exts, extension)
- }
- sort.Sort(bytesSort{exts, 1})
- if len(private) > 0 {
- exts = append(exts, private)
- }
- scan.b = scan.b[:start]
- if len(exts) > 0 {
- scan.b = append(scan.b, bytes.Join(exts, separator)...)
- } else if start > 0 {
- // Strip trailing '-'.
- scan.b = scan.b[:start-1]
- }
- return end
-}
-
-// parseExtension parses a single extension and returns the position of
-// the extension end.
-func parseExtension(scan *scanner) int {
- start, end := scan.start, scan.end
- switch scan.token[0] {
- case 'u': // https://www.ietf.org/rfc/rfc6067.txt
- attrStart := end
- scan.scan()
- for last := []byte{}; len(scan.token) > 2; scan.scan() {
- if bytes.Compare(scan.token, last) != -1 {
- // Attributes are unsorted. Start over from scratch.
- p := attrStart + 1
- scan.next = p
- attrs := [][]byte{}
- for scan.scan(); len(scan.token) > 2; scan.scan() {
- attrs = append(attrs, scan.token)
- end = scan.end
- }
- sort.Sort(bytesSort{attrs, 3})
- copy(scan.b[p:], bytes.Join(attrs, separator))
- break
- }
- last = scan.token
- end = scan.end
- }
- // Scan key-type sequences. A key is of length 2 and may be followed
- // by 0 or more "type" subtags from 3 to the maximum of 8 letters.
- var last, key []byte
- for attrEnd := end; len(scan.token) == 2; last = key {
- key = scan.token
- end = scan.end
- for scan.scan(); end < scan.end && len(scan.token) > 2; scan.scan() {
- end = scan.end
- }
- // TODO: check key value validity
- if bytes.Compare(key, last) != 1 || scan.err != nil {
- // We have an invalid key or the keys are not sorted.
- // Start scanning keys from scratch and reorder.
- p := attrEnd + 1
- scan.next = p
- keys := [][]byte{}
- for scan.scan(); len(scan.token) == 2; {
- keyStart := scan.start
- end = scan.end
- for scan.scan(); end < scan.end && len(scan.token) > 2; scan.scan() {
- end = scan.end
- }
- keys = append(keys, scan.b[keyStart:end])
- }
- sort.Stable(bytesSort{keys, 2})
- if n := len(keys); n > 0 {
- k := 0
- for i := 1; i < n; i++ {
- if !bytes.Equal(keys[k][:2], keys[i][:2]) {
- k++
- keys[k] = keys[i]
- } else if !bytes.Equal(keys[k], keys[i]) {
- scan.setError(ErrDuplicateKey)
- }
- }
- keys = keys[:k+1]
- }
- reordered := bytes.Join(keys, separator)
- if e := p + len(reordered); e < end {
- scan.deleteRange(e, end)
- end = e
- }
- copy(scan.b[p:], reordered)
- break
- }
- }
- case 't': // https://www.ietf.org/rfc/rfc6497.txt
- scan.scan()
- if n := len(scan.token); n >= 2 && n <= 3 && isAlpha(scan.token[1]) {
- _, end = parseTag(scan, false)
- scan.toLower(start, end)
- }
- for len(scan.token) == 2 && !isAlpha(scan.token[1]) {
- end = scan.acceptMinSize(3)
- }
- case 'x':
- end = scan.acceptMinSize(1)
- default:
- end = scan.acceptMinSize(2)
- }
- return end
-}
-
-// getExtension returns the name, body and end position of the extension.
-func getExtension(s string, p int) (end int, ext string) {
- if s[p] == '-' {
- p++
- }
- if s[p] == 'x' {
- return len(s), s[p:]
- }
- end = nextExtension(s, p)
- return end, s[p:end]
-}
-
-// nextExtension finds the next extension within the string, searching
-// for the -- pattern from position p.
-// In the fast majority of cases, language tags will have at most
-// one extension and extensions tend to be small.
-func nextExtension(s string, p int) int {
- for n := len(s) - 3; p < n; {
- if s[p] == '-' {
- if s[p+2] == '-' {
- return p
- }
- p += 3
- } else {
- p++
- }
- }
- return len(s)
-}
diff --git a/vendor/golang.org/x/text/internal/language/tables.go b/vendor/golang.org/x/text/internal/language/tables.go
deleted file mode 100644
index 14167e7..0000000
--- a/vendor/golang.org/x/text/internal/language/tables.go
+++ /dev/null
@@ -1,3494 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package language
-
-import "golang.org/x/text/internal/tag"
-
-// CLDRVersion is the CLDR version from which the tables in this package are derived.
-const CLDRVersion = "32"
-
-const NumLanguages = 8798
-
-const NumScripts = 261
-
-const NumRegions = 358
-
-type FromTo struct {
- From uint16
- To uint16
-}
-
-const nonCanonicalUnd = 1201
-const (
- _af = 22
- _am = 39
- _ar = 58
- _az = 88
- _bg = 126
- _bn = 165
- _ca = 215
- _cs = 250
- _da = 257
- _de = 269
- _el = 310
- _en = 313
- _es = 318
- _et = 320
- _fa = 328
- _fi = 337
- _fil = 339
- _fr = 350
- _gu = 420
- _he = 444
- _hi = 446
- _hr = 465
- _hu = 469
- _hy = 471
- _id = 481
- _is = 504
- _it = 505
- _ja = 512
- _ka = 528
- _kk = 578
- _km = 586
- _kn = 593
- _ko = 596
- _ky = 650
- _lo = 696
- _lt = 704
- _lv = 711
- _mk = 767
- _ml = 772
- _mn = 779
- _mo = 784
- _mr = 795
- _ms = 799
- _mul = 806
- _my = 817
- _nb = 839
- _ne = 849
- _nl = 871
- _no = 879
- _pa = 925
- _pl = 947
- _pt = 960
- _ro = 988
- _ru = 994
- _sh = 1031
- _si = 1036
- _sk = 1042
- _sl = 1046
- _sq = 1073
- _sr = 1074
- _sv = 1092
- _sw = 1093
- _ta = 1104
- _te = 1121
- _th = 1131
- _tl = 1146
- _tn = 1152
- _tr = 1162
- _uk = 1198
- _ur = 1204
- _uz = 1212
- _vi = 1219
- _zh = 1321
- _zu = 1327
- _jbo = 515
- _ami = 1650
- _bnn = 2357
- _hak = 438
- _tlh = 14467
- _lb = 661
- _nv = 899
- _pwn = 12055
- _tao = 14188
- _tay = 14198
- _tsu = 14662
- _nn = 874
- _sfb = 13629
- _vgt = 15701
- _sgg = 13660
- _cmn = 3007
- _nan = 835
- _hsn = 467
-)
-
-const langPrivateStart = 0x2f72
-
-const langPrivateEnd = 0x3179
-
-// lang holds an alphabetically sorted list of ISO-639 language identifiers.
-// All entries are 4 bytes. The index of the identifier (divided by 4) is the language tag.
-// For 2-byte language identifiers, the two successive bytes have the following meaning:
-// - if the first letter of the 2- and 3-letter ISO codes are the same:
-// the second and third letter of the 3-letter ISO code.
-// - otherwise: a 0 and a by 2 bits right-shifted index into altLangISO3.
-//
-// For 3-byte language identifiers the 4th byte is 0.
-const lang tag.Index = "" + // Size: 5324 bytes
- "---\x00aaaraai\x00aak\x00aau\x00abbkabi\x00abq\x00abr\x00abt\x00aby\x00a" +
- "cd\x00ace\x00ach\x00ada\x00ade\x00adj\x00ady\x00adz\x00aeveaeb\x00aey" +
- "\x00affragc\x00agd\x00agg\x00agm\x00ago\x00agq\x00aha\x00ahl\x00aho\x00a" +
- "jg\x00akkaakk\x00ala\x00ali\x00aln\x00alt\x00ammhamm\x00amn\x00amo\x00am" +
- "p\x00anrganc\x00ank\x00ann\x00any\x00aoj\x00aom\x00aoz\x00apc\x00apd\x00" +
- "ape\x00apr\x00aps\x00apz\x00arraarc\x00arh\x00arn\x00aro\x00arq\x00ars" +
- "\x00ary\x00arz\x00assmasa\x00ase\x00asg\x00aso\x00ast\x00ata\x00atg\x00a" +
- "tj\x00auy\x00avvaavl\x00avn\x00avt\x00avu\x00awa\x00awb\x00awo\x00awx" +
- "\x00ayymayb\x00azzebaakbal\x00ban\x00bap\x00bar\x00bas\x00bav\x00bax\x00" +
- "bba\x00bbb\x00bbc\x00bbd\x00bbj\x00bbp\x00bbr\x00bcf\x00bch\x00bci\x00bc" +
- "m\x00bcn\x00bco\x00bcq\x00bcu\x00bdd\x00beelbef\x00beh\x00bej\x00bem\x00" +
- "bet\x00bew\x00bex\x00bez\x00bfd\x00bfq\x00bft\x00bfy\x00bgulbgc\x00bgn" +
- "\x00bgx\x00bhihbhb\x00bhg\x00bhi\x00bhk\x00bhl\x00bho\x00bhy\x00biisbib" +
- "\x00big\x00bik\x00bim\x00bin\x00bio\x00biq\x00bjh\x00bji\x00bjj\x00bjn" +
- "\x00bjo\x00bjr\x00bjt\x00bjz\x00bkc\x00bkm\x00bkq\x00bku\x00bkv\x00blt" +
- "\x00bmambmh\x00bmk\x00bmq\x00bmu\x00bnenbng\x00bnm\x00bnp\x00boodboj\x00" +
- "bom\x00bon\x00bpy\x00bqc\x00bqi\x00bqp\x00bqv\x00brrebra\x00brh\x00brx" +
- "\x00brz\x00bsosbsj\x00bsq\x00bss\x00bst\x00bto\x00btt\x00btv\x00bua\x00b" +
- "uc\x00bud\x00bug\x00buk\x00bum\x00buo\x00bus\x00buu\x00bvb\x00bwd\x00bwr" +
- "\x00bxh\x00bye\x00byn\x00byr\x00bys\x00byv\x00byx\x00bza\x00bze\x00bzf" +
- "\x00bzh\x00bzw\x00caatcan\x00cbj\x00cch\x00ccp\x00ceheceb\x00cfa\x00cgg" +
- "\x00chhachk\x00chm\x00cho\x00chp\x00chr\x00cja\x00cjm\x00cjv\x00ckb\x00c" +
- "kl\x00cko\x00cky\x00cla\x00cme\x00cmg\x00cooscop\x00cps\x00crrecrh\x00cr" +
- "j\x00crk\x00crl\x00crm\x00crs\x00csescsb\x00csw\x00ctd\x00cuhucvhvcyymda" +
- "andad\x00daf\x00dag\x00dah\x00dak\x00dar\x00dav\x00dbd\x00dbq\x00dcc\x00" +
- "ddn\x00deeuded\x00den\x00dga\x00dgh\x00dgi\x00dgl\x00dgr\x00dgz\x00dia" +
- "\x00dje\x00dnj\x00dob\x00doi\x00dop\x00dow\x00dri\x00drs\x00dsb\x00dtm" +
- "\x00dtp\x00dts\x00dty\x00dua\x00duc\x00dud\x00dug\x00dvivdva\x00dww\x00d" +
- "yo\x00dyu\x00dzzodzg\x00ebu\x00eeweefi\x00egl\x00egy\x00eka\x00eky\x00el" +
- "llema\x00emi\x00enngenn\x00enq\x00eopoeri\x00es\x00\x05esu\x00etstetr" +
- "\x00ett\x00etu\x00etx\x00euusewo\x00ext\x00faasfaa\x00fab\x00fag\x00fai" +
- "\x00fan\x00ffulffi\x00ffm\x00fiinfia\x00fil\x00fit\x00fjijflr\x00fmp\x00" +
- "foaofod\x00fon\x00for\x00fpe\x00fqs\x00frrafrc\x00frp\x00frr\x00frs\x00f" +
- "ub\x00fud\x00fue\x00fuf\x00fuh\x00fuq\x00fur\x00fuv\x00fuy\x00fvr\x00fyr" +
- "ygalegaa\x00gaf\x00gag\x00gah\x00gaj\x00gam\x00gan\x00gaw\x00gay\x00gba" +
- "\x00gbf\x00gbm\x00gby\x00gbz\x00gcr\x00gdlagde\x00gdn\x00gdr\x00geb\x00g" +
- "ej\x00gel\x00gez\x00gfk\x00ggn\x00ghs\x00gil\x00gim\x00gjk\x00gjn\x00gju" +
- "\x00gkn\x00gkp\x00gllgglk\x00gmm\x00gmv\x00gnrngnd\x00gng\x00god\x00gof" +
- "\x00goi\x00gom\x00gon\x00gor\x00gos\x00got\x00grb\x00grc\x00grt\x00grw" +
- "\x00gsw\x00guujgub\x00guc\x00gud\x00gur\x00guw\x00gux\x00guz\x00gvlvgvf" +
- "\x00gvr\x00gvs\x00gwc\x00gwi\x00gwt\x00gyi\x00haauhag\x00hak\x00ham\x00h" +
- "aw\x00haz\x00hbb\x00hdy\x00heebhhy\x00hiinhia\x00hif\x00hig\x00hih\x00hi" +
- "l\x00hla\x00hlu\x00hmd\x00hmt\x00hnd\x00hne\x00hnj\x00hnn\x00hno\x00homo" +
- "hoc\x00hoj\x00hot\x00hrrvhsb\x00hsn\x00htathuunhui\x00hyyehzerianaian" +
- "\x00iar\x00iba\x00ibb\x00iby\x00ica\x00ich\x00idndidd\x00idi\x00idu\x00i" +
- "eleife\x00igboigb\x00ige\x00iiiiijj\x00ikpkikk\x00ikt\x00ikw\x00ikx\x00i" +
- "lo\x00imo\x00inndinh\x00iodoiou\x00iri\x00isslittaiukuiw\x00\x03iwm\x00i" +
- "ws\x00izh\x00izi\x00japnjab\x00jam\x00jbo\x00jbu\x00jen\x00jgk\x00jgo" +
- "\x00ji\x00\x06jib\x00jmc\x00jml\x00jra\x00jut\x00jvavjwavkaatkaa\x00kab" +
- "\x00kac\x00kad\x00kai\x00kaj\x00kam\x00kao\x00kbd\x00kbm\x00kbp\x00kbq" +
- "\x00kbx\x00kby\x00kcg\x00kck\x00kcl\x00kct\x00kde\x00kdh\x00kdl\x00kdt" +
- "\x00kea\x00ken\x00kez\x00kfo\x00kfr\x00kfy\x00kgonkge\x00kgf\x00kgp\x00k" +
- "ha\x00khb\x00khn\x00khq\x00khs\x00kht\x00khw\x00khz\x00kiikkij\x00kiu" +
- "\x00kiw\x00kjuakjd\x00kjg\x00kjs\x00kjy\x00kkazkkc\x00kkj\x00klalkln\x00" +
- "klq\x00klt\x00klx\x00kmhmkmb\x00kmh\x00kmo\x00kms\x00kmu\x00kmw\x00knank" +
- "nf\x00knp\x00koorkoi\x00kok\x00kol\x00kos\x00koz\x00kpe\x00kpf\x00kpo" +
- "\x00kpr\x00kpx\x00kqb\x00kqf\x00kqs\x00kqy\x00kraukrc\x00kri\x00krj\x00k" +
- "rl\x00krs\x00kru\x00ksasksb\x00ksd\x00ksf\x00ksh\x00ksj\x00ksr\x00ktb" +
- "\x00ktm\x00kto\x00kuurkub\x00kud\x00kue\x00kuj\x00kum\x00kun\x00kup\x00k" +
- "us\x00kvomkvg\x00kvr\x00kvx\x00kw\x00\x01kwj\x00kwo\x00kxa\x00kxc\x00kxm" +
- "\x00kxp\x00kxw\x00kxz\x00kyirkye\x00kyx\x00kzr\x00laatlab\x00lad\x00lag" +
- "\x00lah\x00laj\x00las\x00lbtzlbe\x00lbu\x00lbw\x00lcm\x00lcp\x00ldb\x00l" +
- "ed\x00lee\x00lem\x00lep\x00leq\x00leu\x00lez\x00lguglgg\x00liimlia\x00li" +
- "d\x00lif\x00lig\x00lih\x00lij\x00lis\x00ljp\x00lki\x00lkt\x00lle\x00lln" +
- "\x00lmn\x00lmo\x00lmp\x00lninlns\x00lnu\x00loaoloj\x00lok\x00lol\x00lor" +
- "\x00los\x00loz\x00lrc\x00ltitltg\x00luublua\x00luo\x00luy\x00luz\x00lvav" +
- "lwl\x00lzh\x00lzz\x00mad\x00maf\x00mag\x00mai\x00mak\x00man\x00mas\x00ma" +
- "w\x00maz\x00mbh\x00mbo\x00mbq\x00mbu\x00mbw\x00mci\x00mcp\x00mcq\x00mcr" +
- "\x00mcu\x00mda\x00mde\x00mdf\x00mdh\x00mdj\x00mdr\x00mdx\x00med\x00mee" +
- "\x00mek\x00men\x00mer\x00met\x00meu\x00mfa\x00mfe\x00mfn\x00mfo\x00mfq" +
- "\x00mglgmgh\x00mgl\x00mgo\x00mgp\x00mgy\x00mhahmhi\x00mhl\x00mirimif\x00" +
- "min\x00mis\x00miw\x00mkkdmki\x00mkl\x00mkp\x00mkw\x00mlalmle\x00mlp\x00m" +
- "ls\x00mmo\x00mmu\x00mmx\x00mnonmna\x00mnf\x00mni\x00mnw\x00moolmoa\x00mo" +
- "e\x00moh\x00mos\x00mox\x00mpp\x00mps\x00mpt\x00mpx\x00mql\x00mrarmrd\x00" +
- "mrj\x00mro\x00mssamtltmtc\x00mtf\x00mti\x00mtr\x00mua\x00mul\x00mur\x00m" +
- "us\x00mva\x00mvn\x00mvy\x00mwk\x00mwr\x00mwv\x00mxc\x00mxm\x00myyamyk" +
- "\x00mym\x00myv\x00myw\x00myx\x00myz\x00mzk\x00mzm\x00mzn\x00mzp\x00mzw" +
- "\x00mzz\x00naaunac\x00naf\x00nah\x00nak\x00nan\x00nap\x00naq\x00nas\x00n" +
- "bobnca\x00nce\x00ncf\x00nch\x00nco\x00ncu\x00nddendc\x00nds\x00neepneb" +
- "\x00new\x00nex\x00nfr\x00ngdonga\x00ngb\x00ngl\x00nhb\x00nhe\x00nhw\x00n" +
- "if\x00nii\x00nij\x00nin\x00niu\x00niy\x00niz\x00njo\x00nkg\x00nko\x00nll" +
- "dnmg\x00nmz\x00nnnonnf\x00nnh\x00nnk\x00nnm\x00noornod\x00noe\x00non\x00" +
- "nop\x00nou\x00nqo\x00nrblnrb\x00nsk\x00nsn\x00nso\x00nss\x00ntm\x00ntr" +
- "\x00nui\x00nup\x00nus\x00nuv\x00nux\x00nvavnwb\x00nxq\x00nxr\x00nyyanym" +
- "\x00nyn\x00nzi\x00occiogc\x00ojjiokr\x00okv\x00omrmong\x00onn\x00ons\x00" +
- "opm\x00orrioro\x00oru\x00osssosa\x00ota\x00otk\x00ozm\x00paanpag\x00pal" +
- "\x00pam\x00pap\x00pau\x00pbi\x00pcd\x00pcm\x00pdc\x00pdt\x00ped\x00peo" +
- "\x00pex\x00pfl\x00phl\x00phn\x00pilipil\x00pip\x00pka\x00pko\x00plolpla" +
- "\x00pms\x00png\x00pnn\x00pnt\x00pon\x00ppo\x00pra\x00prd\x00prg\x00psusp" +
- "ss\x00ptorptp\x00puu\x00pwa\x00quuequc\x00qug\x00rai\x00raj\x00rao\x00rc" +
- "f\x00rej\x00rel\x00res\x00rgn\x00rhg\x00ria\x00rif\x00rjs\x00rkt\x00rmoh" +
- "rmf\x00rmo\x00rmt\x00rmu\x00rnunrna\x00rng\x00roonrob\x00rof\x00roo\x00r" +
- "ro\x00rtm\x00ruusrue\x00rug\x00rw\x00\x04rwk\x00rwo\x00ryu\x00saansaf" +
- "\x00sah\x00saq\x00sas\x00sat\x00sav\x00saz\x00sba\x00sbe\x00sbp\x00scrds" +
- "ck\x00scl\x00scn\x00sco\x00scs\x00sdndsdc\x00sdh\x00semesef\x00seh\x00se" +
- "i\x00ses\x00sgagsga\x00sgs\x00sgw\x00sgz\x00sh\x00\x02shi\x00shk\x00shn" +
- "\x00shu\x00siinsid\x00sig\x00sil\x00sim\x00sjr\x00sklkskc\x00skr\x00sks" +
- "\x00sllvsld\x00sli\x00sll\x00sly\x00smmosma\x00smi\x00smj\x00smn\x00smp" +
- "\x00smq\x00sms\x00snnasnc\x00snk\x00snp\x00snx\x00sny\x00soomsok\x00soq" +
- "\x00sou\x00soy\x00spd\x00spl\x00sps\x00sqqisrrpsrb\x00srn\x00srr\x00srx" +
- "\x00ssswssd\x00ssg\x00ssy\x00stotstk\x00stq\x00suunsua\x00sue\x00suk\x00" +
- "sur\x00sus\x00svweswwaswb\x00swc\x00swg\x00swp\x00swv\x00sxn\x00sxw\x00s" +
- "yl\x00syr\x00szl\x00taamtaj\x00tal\x00tan\x00taq\x00tbc\x00tbd\x00tbf" +
- "\x00tbg\x00tbo\x00tbw\x00tbz\x00tci\x00tcy\x00tdd\x00tdg\x00tdh\x00teelt" +
- "ed\x00tem\x00teo\x00tet\x00tfi\x00tggktgc\x00tgo\x00tgu\x00thhathl\x00th" +
- "q\x00thr\x00tiirtif\x00tig\x00tik\x00tim\x00tio\x00tiv\x00tkuktkl\x00tkr" +
- "\x00tkt\x00tlgltlf\x00tlx\x00tly\x00tmh\x00tmy\x00tnsntnh\x00toontof\x00" +
- "tog\x00toq\x00tpi\x00tpm\x00tpz\x00tqo\x00trurtru\x00trv\x00trw\x00tssot" +
- "sd\x00tsf\x00tsg\x00tsj\x00tsw\x00ttatttd\x00tte\x00ttj\x00ttr\x00tts" +
- "\x00ttt\x00tuh\x00tul\x00tum\x00tuq\x00tvd\x00tvl\x00tvu\x00twwitwh\x00t" +
- "wq\x00txg\x00tyahtya\x00tyv\x00tzm\x00ubu\x00udm\x00ugiguga\x00ukkruli" +
- "\x00umb\x00und\x00unr\x00unx\x00urrduri\x00urt\x00urw\x00usa\x00utr\x00u" +
- "vh\x00uvl\x00uzzbvag\x00vai\x00van\x00veenvec\x00vep\x00viievic\x00viv" +
- "\x00vls\x00vmf\x00vmw\x00voolvot\x00vro\x00vun\x00vut\x00walnwae\x00waj" +
- "\x00wal\x00wan\x00war\x00wbp\x00wbq\x00wbr\x00wci\x00wer\x00wgi\x00whg" +
- "\x00wib\x00wiu\x00wiv\x00wja\x00wji\x00wls\x00wmo\x00wnc\x00wni\x00wnu" +
- "\x00woolwob\x00wos\x00wrs\x00wsk\x00wtm\x00wuu\x00wuv\x00wwa\x00xav\x00x" +
- "bi\x00xcr\x00xes\x00xhhoxla\x00xlc\x00xld\x00xmf\x00xmn\x00xmr\x00xna" +
- "\x00xnr\x00xog\x00xon\x00xpr\x00xrb\x00xsa\x00xsi\x00xsm\x00xsr\x00xwe" +
- "\x00yam\x00yao\x00yap\x00yas\x00yat\x00yav\x00yay\x00yaz\x00yba\x00ybb" +
- "\x00yby\x00yer\x00ygr\x00ygw\x00yiidyko\x00yle\x00ylg\x00yll\x00yml\x00y" +
- "ooryon\x00yrb\x00yre\x00yrl\x00yss\x00yua\x00yue\x00yuj\x00yut\x00yuw" +
- "\x00zahazag\x00zbl\x00zdj\x00zea\x00zgh\x00zhhozhx\x00zia\x00zlm\x00zmi" +
- "\x00zne\x00zuulzxx\x00zza\x00\xff\xff\xff\xff"
-
-const langNoIndexOffset = 1330
-
-// langNoIndex is a bit vector of all 3-letter language codes that are not used as an index
-// in lookup tables. The language ids for these language codes are derived directly
-// from the letters and are not consecutive.
-// Size: 2197 bytes, 2197 elements
-var langNoIndex = [2197]uint8{
- // Entry 0 - 3F
- 0xff, 0xf8, 0xed, 0xfe, 0xeb, 0xd3, 0x3b, 0xd2,
- 0xfb, 0xbf, 0x7a, 0xfa, 0x37, 0x1d, 0x3c, 0x57,
- 0x6e, 0x97, 0x73, 0x38, 0xfb, 0xea, 0xbf, 0x70,
- 0xad, 0x03, 0xff, 0xff, 0xcf, 0x05, 0x84, 0x72,
- 0xe9, 0xbf, 0xfd, 0xbf, 0xbf, 0xf7, 0xfd, 0x77,
- 0x0f, 0xff, 0xef, 0x6f, 0xff, 0xfb, 0xdf, 0xe2,
- 0xc9, 0xf8, 0x7f, 0x7e, 0x4d, 0xbc, 0x0a, 0x6a,
- 0x7c, 0xea, 0xe3, 0xfa, 0x7a, 0xbf, 0x67, 0xff,
- // Entry 40 - 7F
- 0xff, 0xff, 0xff, 0xdf, 0x2a, 0x54, 0x91, 0xc0,
- 0x5d, 0xe3, 0x97, 0x14, 0x07, 0x20, 0xdd, 0xed,
- 0x9f, 0x3f, 0xc9, 0x21, 0xf8, 0x3f, 0x94, 0x35,
- 0x7c, 0x5f, 0xff, 0x5f, 0x8e, 0x6e, 0xdf, 0xff,
- 0xff, 0xff, 0x55, 0x7c, 0xd3, 0xfd, 0xbf, 0xb5,
- 0x7b, 0xdf, 0x7f, 0xf7, 0xca, 0xfe, 0xdb, 0xa3,
- 0xa8, 0xff, 0x1f, 0x67, 0x7d, 0xeb, 0xef, 0xce,
- 0xff, 0xff, 0x9f, 0xff, 0xb7, 0xef, 0xfe, 0xcf,
- // Entry 80 - BF
- 0xdb, 0xff, 0xf3, 0xcd, 0xfb, 0x7f, 0xff, 0xff,
- 0xbb, 0xee, 0xf7, 0xbd, 0xdb, 0xff, 0x5f, 0xf7,
- 0xfd, 0xf2, 0xfd, 0xff, 0x5e, 0x2f, 0x3b, 0xba,
- 0x7e, 0xff, 0xff, 0xfe, 0xf7, 0xff, 0xdd, 0xff,
- 0xfd, 0xdf, 0xfb, 0xfe, 0x9d, 0xb4, 0xd3, 0xff,
- 0xef, 0xff, 0xdf, 0xf7, 0x7f, 0xb7, 0xfd, 0xd5,
- 0xa5, 0x77, 0x40, 0xff, 0x9c, 0xc1, 0x41, 0x2c,
- 0x08, 0x21, 0x41, 0x00, 0x50, 0x40, 0x00, 0x80,
- // Entry C0 - FF
- 0xfb, 0x4a, 0xf2, 0x9f, 0xb4, 0x42, 0x41, 0x96,
- 0x1b, 0x14, 0x08, 0xf3, 0x2b, 0xe7, 0x17, 0x56,
- 0x05, 0x7d, 0x0e, 0x1c, 0x37, 0x7f, 0xf3, 0xef,
- 0x97, 0xff, 0x5d, 0x38, 0x64, 0x08, 0x00, 0x10,
- 0xbc, 0x85, 0xaf, 0xdf, 0xff, 0xff, 0x7b, 0x35,
- 0x3e, 0xc7, 0xc7, 0xdf, 0xff, 0x01, 0x81, 0x00,
- 0xb0, 0x05, 0x80, 0x00, 0x20, 0x00, 0x00, 0x03,
- 0x40, 0x00, 0x40, 0x92, 0x21, 0x50, 0xb1, 0x5d,
- // Entry 100 - 13F
- 0xfd, 0xdc, 0xbe, 0x5e, 0x00, 0x00, 0x02, 0x64,
- 0x0d, 0x19, 0x41, 0xdf, 0x79, 0x22, 0x00, 0x00,
- 0x00, 0x5e, 0x64, 0xdc, 0x24, 0xe5, 0xd9, 0xe3,
- 0xfe, 0xff, 0xfd, 0xcb, 0x9f, 0x14, 0x41, 0x0c,
- 0x86, 0x00, 0xd1, 0x00, 0xf0, 0xc7, 0x67, 0x5f,
- 0x56, 0x99, 0x5e, 0xb5, 0x6c, 0xaf, 0x03, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xc0, 0x37, 0xda, 0x56,
- 0x90, 0x6d, 0x01, 0x2e, 0x96, 0x69, 0x20, 0xfb,
- // Entry 140 - 17F
- 0xff, 0x3f, 0x00, 0x00, 0x00, 0x01, 0x0c, 0x16,
- 0x03, 0x00, 0x00, 0xb0, 0x14, 0x23, 0x50, 0x06,
- 0x0a, 0x00, 0x01, 0x00, 0x00, 0x10, 0x11, 0x09,
- 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x10,
- 0x00, 0x00, 0x44, 0x00, 0x00, 0x10, 0x00, 0x05,
- 0x08, 0x00, 0x00, 0x05, 0x00, 0x80, 0x28, 0x04,
- 0x00, 0x00, 0x40, 0xd5, 0x2d, 0x00, 0x64, 0x35,
- 0x24, 0x52, 0xf4, 0xd5, 0xbf, 0x62, 0xc9, 0x03,
- // Entry 180 - 1BF
- 0x00, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x13, 0x39, 0x01, 0xdd, 0x57, 0x98,
- 0x21, 0x18, 0x81, 0x08, 0x00, 0x01, 0x40, 0x82,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x44, 0x00, 0x00, 0x80, 0xea,
- 0xa9, 0x39, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- // Entry 1C0 - 1FF
- 0x00, 0x03, 0x28, 0x05, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x20, 0x04, 0xa6, 0x00, 0x04, 0x00, 0x00,
- 0x81, 0x50, 0x00, 0x00, 0x00, 0x11, 0x84, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x55,
- 0x02, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x40,
- 0x30, 0x83, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x1e, 0xcd, 0xbf, 0x7a, 0xbf,
- // Entry 200 - 23F
- 0xdf, 0xc3, 0x83, 0x82, 0xc0, 0xfb, 0x57, 0x27,
- 0xed, 0x55, 0xe7, 0x01, 0x00, 0x20, 0xb2, 0xc5,
- 0xa4, 0x45, 0x25, 0x9b, 0x02, 0xdf, 0xe1, 0xdf,
- 0x03, 0x44, 0x08, 0x90, 0x01, 0x04, 0x81, 0xe3,
- 0x92, 0x54, 0xdb, 0x28, 0xd3, 0x5f, 0xfe, 0x6d,
- 0x79, 0xed, 0x1c, 0x7f, 0x04, 0x08, 0x00, 0x01,
- 0x21, 0x12, 0x64, 0x5f, 0xdd, 0x0e, 0x85, 0x4f,
- 0x40, 0x40, 0x00, 0x04, 0xf1, 0xfd, 0x3d, 0x54,
- // Entry 240 - 27F
- 0xe8, 0x03, 0xb4, 0x27, 0x23, 0x0d, 0x00, 0x00,
- 0x20, 0x7b, 0x78, 0x02, 0x07, 0x84, 0x00, 0xf0,
- 0xbb, 0x7e, 0x5a, 0x00, 0x18, 0x04, 0x81, 0x00,
- 0x00, 0x00, 0x80, 0x10, 0x90, 0x1c, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x04,
- 0x08, 0xa0, 0x70, 0xa5, 0x0c, 0x40, 0x00, 0x00,
- 0x91, 0x24, 0x04, 0x68, 0x00, 0x20, 0x70, 0xff,
- 0x7b, 0x7f, 0x70, 0x00, 0x05, 0x9b, 0xdd, 0x66,
- // Entry 280 - 2BF
- 0x03, 0x00, 0x11, 0x00, 0x00, 0x00, 0x40, 0x05,
- 0xb5, 0xb6, 0x80, 0x08, 0x04, 0x00, 0x04, 0x51,
- 0xe2, 0xef, 0xfd, 0x3f, 0x05, 0x09, 0x08, 0x05,
- 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x60,
- 0xe7, 0x48, 0x00, 0x81, 0x20, 0xc0, 0x05, 0x80,
- 0x03, 0x00, 0x00, 0x00, 0x8c, 0x50, 0x40, 0x04,
- 0x84, 0x47, 0x84, 0x40, 0x20, 0x10, 0x00, 0x20,
- // Entry 2C0 - 2FF
- 0x02, 0x50, 0x80, 0x11, 0x00, 0x99, 0x6c, 0xe2,
- 0x50, 0x27, 0x1d, 0x11, 0x29, 0x0e, 0x59, 0xe9,
- 0x33, 0x08, 0x00, 0x20, 0x04, 0x40, 0x10, 0x00,
- 0x00, 0x00, 0x50, 0x44, 0x92, 0x49, 0xd6, 0x5d,
- 0xa7, 0x81, 0x47, 0x97, 0xfb, 0x00, 0x10, 0x00,
- 0x08, 0x00, 0x80, 0x00, 0x40, 0x04, 0x00, 0x01,
- 0x02, 0x00, 0x01, 0x40, 0x80, 0x00, 0x40, 0x08,
- 0xd8, 0xeb, 0xf6, 0x39, 0xc4, 0x8d, 0x12, 0x00,
- // Entry 300 - 33F
- 0x00, 0x0c, 0x04, 0x01, 0x20, 0x20, 0xdd, 0xa0,
- 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x04, 0x10, 0xd0, 0x9d, 0x95, 0x13, 0x04, 0x80,
- 0x00, 0x01, 0xd0, 0x16, 0x40, 0x00, 0x10, 0xb0,
- 0x10, 0x62, 0x4c, 0xd2, 0x02, 0x01, 0x4a, 0x00,
- 0x46, 0x04, 0x00, 0x08, 0x02, 0x00, 0x20, 0x80,
- 0x00, 0x80, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0xf0, 0xd8, 0x6f, 0x15, 0x02, 0x08, 0x00,
- // Entry 340 - 37F
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0xf0, 0x84, 0xe3,
- 0xdd, 0xbf, 0xf9, 0xf9, 0x3b, 0x7f, 0x7f, 0xdb,
- 0xfd, 0xfc, 0xfe, 0xdf, 0xff, 0xfd, 0xff, 0xf6,
- 0xfb, 0xfc, 0xf7, 0x1f, 0xff, 0xb3, 0x6c, 0xff,
- 0xd9, 0xad, 0xdf, 0xfe, 0xef, 0xba, 0xdf, 0xff,
- 0xff, 0xff, 0xb7, 0xdd, 0x7d, 0xbf, 0xab, 0x7f,
- 0xfd, 0xfd, 0xdf, 0x2f, 0x9c, 0xdf, 0xf3, 0x6f,
- // Entry 380 - 3BF
- 0xdf, 0xdd, 0xff, 0xfb, 0xee, 0xd2, 0xab, 0x5f,
- 0xd5, 0xdf, 0x7f, 0xff, 0xeb, 0xff, 0xe4, 0x4d,
- 0xf9, 0xff, 0xfe, 0xf7, 0xfd, 0xdf, 0xfb, 0xbf,
- 0xee, 0xdb, 0x6f, 0xef, 0xff, 0x7f, 0xff, 0xff,
- 0xf7, 0x5f, 0xd3, 0x3b, 0xfd, 0xd9, 0xdf, 0xeb,
- 0xbc, 0x08, 0x05, 0x24, 0xff, 0x07, 0x70, 0xfe,
- 0xe6, 0x5e, 0x00, 0x08, 0x00, 0x83, 0x7d, 0x1f,
- 0x06, 0xe6, 0x72, 0x60, 0xd1, 0x3c, 0x7f, 0x44,
- // Entry 3C0 - 3FF
- 0x02, 0x30, 0x9f, 0x7a, 0x16, 0xbd, 0x7f, 0x57,
- 0xf2, 0xff, 0x31, 0xff, 0xf2, 0x1e, 0x90, 0xf7,
- 0xf1, 0xf9, 0x45, 0x80, 0x01, 0x02, 0x00, 0x20,
- 0x40, 0x54, 0x9f, 0x8a, 0xdf, 0xf9, 0x6e, 0x11,
- 0x86, 0x51, 0xc0, 0xf3, 0xfb, 0x47, 0x40, 0x03,
- 0x05, 0xd1, 0x50, 0x5c, 0x00, 0x40, 0x00, 0x10,
- 0x04, 0x02, 0x00, 0x00, 0x0a, 0x00, 0x17, 0xd2,
- 0xb9, 0xfd, 0xfc, 0xba, 0xfe, 0xef, 0xc7, 0xbe,
- // Entry 400 - 43F
- 0x53, 0x6f, 0xdf, 0xe7, 0xdb, 0x65, 0xbb, 0x7f,
- 0xfa, 0xff, 0x77, 0xf3, 0xef, 0xbf, 0xfd, 0xf7,
- 0xdf, 0xdf, 0x9b, 0x7f, 0xff, 0xff, 0x7f, 0x6f,
- 0xf7, 0xfb, 0xeb, 0xdf, 0xbc, 0xff, 0xbf, 0x6b,
- 0x7b, 0xfb, 0xff, 0xce, 0x76, 0xbd, 0xf7, 0xf7,
- 0xdf, 0xdc, 0xf7, 0xf7, 0xff, 0xdf, 0xf3, 0xfe,
- 0xef, 0xff, 0xff, 0xff, 0xb6, 0x7f, 0x7f, 0xde,
- 0xf7, 0xb9, 0xeb, 0x77, 0xff, 0xfb, 0xbf, 0xdf,
- // Entry 440 - 47F
- 0xfd, 0xfe, 0xfb, 0xff, 0xfe, 0xeb, 0x1f, 0x7d,
- 0x2f, 0xfd, 0xb6, 0xb5, 0xa5, 0xfc, 0xff, 0xfd,
- 0x7f, 0x4e, 0xbf, 0x8f, 0xae, 0xff, 0xee, 0xdf,
- 0x7f, 0xf7, 0x73, 0x02, 0x02, 0x04, 0xfc, 0xf7,
- 0xff, 0xb7, 0xd7, 0xef, 0xfe, 0xcd, 0xf5, 0xce,
- 0xe2, 0x8e, 0xe7, 0xbf, 0xb7, 0xff, 0x56, 0xfd,
- 0xcd, 0xff, 0xfb, 0xff, 0xdf, 0xd7, 0xea, 0xff,
- 0xe5, 0x5f, 0x6d, 0x0f, 0xa7, 0x51, 0x06, 0xc4,
- // Entry 480 - 4BF
- 0x93, 0x50, 0x5d, 0xaf, 0xa6, 0xff, 0x99, 0xfb,
- 0x63, 0x1d, 0x53, 0xff, 0xef, 0xb7, 0x35, 0x20,
- 0x14, 0x00, 0x55, 0x51, 0xc2, 0x65, 0xf5, 0x41,
- 0xe2, 0xff, 0xfc, 0xdf, 0x02, 0x85, 0xc5, 0x05,
- 0x00, 0x22, 0x00, 0x74, 0x69, 0x10, 0x08, 0x05,
- 0x41, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x51, 0x20, 0x05, 0x04, 0x01, 0x00, 0x00,
- 0x06, 0x11, 0x20, 0x00, 0x18, 0x01, 0x92, 0xf1,
- // Entry 4C0 - 4FF
- 0xfd, 0x47, 0x69, 0x06, 0x95, 0x06, 0x57, 0xed,
- 0xfb, 0x4d, 0x1c, 0x6b, 0x83, 0x04, 0x62, 0x40,
- 0x00, 0x11, 0x42, 0x00, 0x00, 0x00, 0x54, 0x83,
- 0xb8, 0x4f, 0x10, 0x8e, 0x89, 0x46, 0xde, 0xf7,
- 0x13, 0x31, 0x00, 0x20, 0x00, 0x00, 0x00, 0x90,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0xf0, 0x5b, 0xf4, 0xbe, 0x3d,
- 0xbe, 0xcf, 0xf7, 0xaf, 0x42, 0x04, 0x84, 0x41,
- // Entry 500 - 53F
- 0x30, 0xff, 0x79, 0x72, 0x04, 0x00, 0x00, 0x49,
- 0x2d, 0x14, 0x27, 0x5f, 0xed, 0xf1, 0x3f, 0xe7,
- 0x3f, 0x00, 0x00, 0x02, 0xc6, 0xa0, 0x1e, 0xf8,
- 0xbb, 0xff, 0xfd, 0xfb, 0xb7, 0xfd, 0xe7, 0xf7,
- 0xfd, 0xfc, 0xd5, 0xed, 0x47, 0xf4, 0x7e, 0x10,
- 0x01, 0x01, 0x84, 0x6d, 0xff, 0xf7, 0xdd, 0xf9,
- 0x5b, 0x05, 0x86, 0xed, 0xf5, 0x77, 0xbd, 0x3c,
- 0x00, 0x00, 0x00, 0x42, 0x71, 0x42, 0x00, 0x40,
- // Entry 540 - 57F
- 0x00, 0x00, 0x01, 0x43, 0x19, 0x24, 0x08, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- // Entry 580 - 5BF
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xab, 0xbd, 0xe7, 0x57, 0xee, 0x13, 0x5d,
- 0x09, 0xc1, 0x40, 0x21, 0xfa, 0x17, 0x01, 0x80,
- 0x00, 0x00, 0x00, 0x00, 0xf0, 0xce, 0xfb, 0xbf,
- 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
- 0x00, 0x30, 0x15, 0xa3, 0x10, 0x00, 0x00, 0x00,
- 0x11, 0x04, 0x16, 0x00, 0x00, 0x02, 0x20, 0x81,
- 0xa3, 0x01, 0x50, 0x00, 0x00, 0x83, 0x11, 0x40,
- // Entry 5C0 - 5FF
- 0x00, 0x00, 0x00, 0xf0, 0xdd, 0x7b, 0xbe, 0x02,
- 0xaa, 0x10, 0x5d, 0x98, 0x52, 0x00, 0x80, 0x20,
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x02,
- 0x3d, 0x40, 0x10, 0x02, 0x10, 0x61, 0x5a, 0x9d,
- 0x31, 0x00, 0x00, 0x00, 0x01, 0x18, 0x02, 0x20,
- 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x20, 0x00,
- 0x00, 0x1f, 0xdf, 0xd2, 0xb9, 0xff, 0xfd, 0x3f,
- 0x1f, 0x98, 0xcf, 0x9c, 0xff, 0xaf, 0x5f, 0xfe,
- // Entry 600 - 63F
- 0x7b, 0x4b, 0x40, 0x10, 0xe1, 0xfd, 0xaf, 0xd9,
- 0xb7, 0xf6, 0xfb, 0xb3, 0xc7, 0xff, 0x6f, 0xf1,
- 0x73, 0xb1, 0x7f, 0x9f, 0x7f, 0xbd, 0xfc, 0xb7,
- 0xee, 0x1c, 0xfa, 0xcb, 0xef, 0xdd, 0xf9, 0xbd,
- 0x6e, 0xae, 0x55, 0xfd, 0x6e, 0x81, 0x76, 0x9f,
- 0xd4, 0x77, 0xf5, 0x7d, 0xfb, 0xff, 0xeb, 0xfe,
- 0xbe, 0x5f, 0x46, 0x5b, 0xe9, 0x5f, 0x50, 0x18,
- 0x02, 0xfa, 0xf7, 0x9d, 0x15, 0x97, 0x05, 0x0f,
- // Entry 640 - 67F
- 0x75, 0xc4, 0x7d, 0x81, 0x92, 0xf5, 0x57, 0x6c,
- 0xff, 0xe4, 0xef, 0x6f, 0xff, 0xfc, 0xdd, 0xde,
- 0xfc, 0xfd, 0x76, 0x5f, 0x7a, 0x3f, 0x00, 0x98,
- 0x02, 0xfb, 0xa3, 0xef, 0xf3, 0xd6, 0xf2, 0xff,
- 0xb9, 0xda, 0x7d, 0xd0, 0x3e, 0x15, 0x7b, 0xb4,
- 0xf5, 0x3e, 0xff, 0xff, 0xf1, 0xf7, 0xff, 0xe7,
- 0x5f, 0xff, 0xff, 0x9e, 0xdf, 0xf6, 0xd7, 0xb9,
- 0xef, 0x27, 0x80, 0xbb, 0xc5, 0xff, 0xff, 0xe3,
- // Entry 680 - 6BF
- 0x97, 0x9d, 0xbf, 0x9f, 0xf7, 0xc7, 0xfd, 0x37,
- 0xce, 0x7f, 0x44, 0x1d, 0x73, 0x7f, 0xf8, 0xda,
- 0x5d, 0xce, 0x7d, 0x06, 0xb9, 0xea, 0x79, 0xa0,
- 0x1a, 0x20, 0x00, 0x30, 0x02, 0x04, 0x24, 0x08,
- 0x04, 0x00, 0x00, 0x40, 0xd4, 0x02, 0x04, 0x00,
- 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x09, 0x06,
- 0x50, 0x00, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00,
- 0x04, 0x00, 0x10, 0xdc, 0x58, 0xd7, 0x0d, 0x0f,
- // Entry 6C0 - 6FF
- 0x54, 0x4d, 0xf1, 0x16, 0x44, 0xd5, 0x42, 0x08,
- 0x40, 0x02, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00,
- 0x00, 0xdc, 0xfb, 0xcb, 0x0e, 0x58, 0x48, 0x41,
- 0x24, 0x20, 0x04, 0x00, 0x30, 0x12, 0x40, 0x00,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x80, 0x10, 0x10, 0xab,
- 0x6d, 0x93, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x80, 0x25, 0x00, 0x00,
- // Entry 700 - 73F
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x80, 0x86, 0xc2, 0x00, 0x00, 0x01, 0x00, 0x01,
- 0xff, 0x18, 0x02, 0x00, 0x02, 0xf0, 0xfd, 0x79,
- 0x3b, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
- 0x03, 0x00, 0x09, 0x20, 0x00, 0x00, 0x01, 0x00,
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 740 - 77F
- 0x00, 0x00, 0x00, 0xef, 0xd5, 0xfd, 0xcf, 0x7e,
- 0xb0, 0x11, 0x00, 0x00, 0x00, 0x92, 0x01, 0x46,
- 0xcd, 0xf9, 0x5c, 0x00, 0x01, 0x00, 0x30, 0x04,
- 0x04, 0x55, 0x00, 0x01, 0x04, 0xf4, 0x3f, 0x4a,
- 0x01, 0x00, 0x00, 0xb0, 0x80, 0x20, 0x55, 0x75,
- 0x97, 0x7c, 0xdf, 0x31, 0xcc, 0x68, 0xd1, 0x03,
- 0xd5, 0x57, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x2c, 0xf7, 0xcb, 0x1f, 0x14, 0x60,
- // Entry 780 - 7BF
- 0x83, 0x68, 0x01, 0x10, 0x8b, 0x38, 0x8a, 0x01,
- 0x00, 0x00, 0x20, 0x00, 0x24, 0x44, 0x00, 0x00,
- 0x10, 0x03, 0x31, 0x02, 0x01, 0x00, 0x00, 0xf0,
- 0xf5, 0xff, 0xd5, 0x97, 0xbc, 0x70, 0xd6, 0x78,
- 0x78, 0x15, 0x50, 0x05, 0xa4, 0x84, 0xa9, 0x41,
- 0x00, 0x00, 0x00, 0x6b, 0x39, 0x52, 0x74, 0x40,
- 0xe8, 0x30, 0x90, 0x6a, 0x92, 0x00, 0x00, 0x02,
- 0xff, 0xef, 0xff, 0x4b, 0x85, 0x53, 0xf4, 0xed,
- // Entry 7C0 - 7FF
- 0xdd, 0xbf, 0xf2, 0x5d, 0xc7, 0x0c, 0xd5, 0x42,
- 0xfc, 0xff, 0xf7, 0x1f, 0x00, 0x80, 0x40, 0x56,
- 0xcc, 0x16, 0x9e, 0xea, 0x35, 0x7d, 0xef, 0xff,
- 0xbd, 0xa4, 0xaf, 0x01, 0x44, 0x18, 0x01, 0x4d,
- 0x4e, 0x4a, 0x08, 0x50, 0x28, 0x30, 0xe0, 0x80,
- 0x10, 0x20, 0x24, 0x00, 0xff, 0x2f, 0xd3, 0x60,
- 0xfe, 0x01, 0x02, 0x88, 0x2a, 0x40, 0x16, 0x01,
- 0x01, 0x15, 0x2b, 0x3c, 0x01, 0x00, 0x00, 0x10,
- // Entry 800 - 83F
- 0x90, 0x49, 0x41, 0x02, 0x02, 0x01, 0xe1, 0xbf,
- 0xbf, 0x03, 0x00, 0x00, 0x10, 0xdc, 0xa3, 0xd1,
- 0x40, 0x9c, 0x44, 0xdf, 0xf5, 0x8f, 0x66, 0xb3,
- 0x55, 0x20, 0xd4, 0xc1, 0xd8, 0x30, 0x3d, 0x80,
- 0x00, 0x00, 0x00, 0x04, 0xd4, 0x11, 0xc5, 0x84,
- 0x2f, 0x50, 0x00, 0x22, 0x50, 0x6e, 0xbd, 0x93,
- 0x07, 0x00, 0x20, 0x10, 0x84, 0xb2, 0x45, 0x10,
- 0x06, 0x44, 0x00, 0x00, 0x12, 0x02, 0x11, 0x00,
- // Entry 840 - 87F
- 0xf0, 0xfb, 0xfd, 0x7f, 0x05, 0x00, 0x16, 0x89,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x03,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x02, 0x28,
- 0x84, 0x00, 0x21, 0xc0, 0x23, 0x24, 0x00, 0x00,
- 0x00, 0xcb, 0xe4, 0x3a, 0x46, 0x88, 0x54, 0xf1,
- 0xef, 0xff, 0x7f, 0x12, 0x01, 0x01, 0x84, 0x50,
- 0x07, 0xfc, 0xff, 0xff, 0x0f, 0x01, 0x00, 0x40,
- 0x10, 0x38, 0x01, 0x01, 0x1c, 0x12, 0x40, 0xe1,
- // Entry 880 - 8BF
- 0x76, 0x16, 0x08, 0x03, 0x10, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x24,
- 0x0a, 0x00, 0x80, 0x00, 0x00,
-}
-
-// altLangISO3 holds an alphabetically sorted list of 3-letter language code alternatives
-// to 2-letter language codes that cannot be derived using the method described above.
-// Each 3-letter code is followed by its 1-byte langID.
-const altLangISO3 tag.Index = "---\x00cor\x00hbs\x01heb\x02kin\x03spa\x04yid\x05\xff\xff\xff\xff"
-
-// altLangIndex is used to convert indexes in altLangISO3 to langIDs.
-// Size: 12 bytes, 6 elements
-var altLangIndex = [6]uint16{
- 0x0281, 0x0407, 0x01fb, 0x03e5, 0x013e, 0x0208,
-}
-
-// AliasMap maps langIDs to their suggested replacements.
-// Size: 772 bytes, 193 elements
-var AliasMap = [193]FromTo{
- 0: {From: 0x82, To: 0x88},
- 1: {From: 0x187, To: 0x1ae},
- 2: {From: 0x1f3, To: 0x1e1},
- 3: {From: 0x1fb, To: 0x1bc},
- 4: {From: 0x208, To: 0x512},
- 5: {From: 0x20f, To: 0x20e},
- 6: {From: 0x310, To: 0x3dc},
- 7: {From: 0x347, To: 0x36f},
- 8: {From: 0x407, To: 0x432},
- 9: {From: 0x47a, To: 0x153},
- 10: {From: 0x490, To: 0x451},
- 11: {From: 0x4a2, To: 0x21},
- 12: {From: 0x53e, To: 0x544},
- 13: {From: 0x58f, To: 0x12d},
- 14: {From: 0x62b, To: 0x34},
- 15: {From: 0x62f, To: 0x14},
- 16: {From: 0x630, To: 0x1eb1},
- 17: {From: 0x651, To: 0x431},
- 18: {From: 0x662, To: 0x431},
- 19: {From: 0x6ed, To: 0x3a},
- 20: {From: 0x6f8, To: 0x1d7},
- 21: {From: 0x709, To: 0x3625},
- 22: {From: 0x73e, To: 0x21a1},
- 23: {From: 0x7b3, To: 0x56},
- 24: {From: 0x7b9, To: 0x299b},
- 25: {From: 0x7c5, To: 0x58},
- 26: {From: 0x7e6, To: 0x145},
- 27: {From: 0x80c, To: 0x5a},
- 28: {From: 0x815, To: 0x8d},
- 29: {From: 0x87e, To: 0x810},
- 30: {From: 0x8a8, To: 0x8b7},
- 31: {From: 0x8c3, To: 0xee3},
- 32: {From: 0x8fa, To: 0x1dc},
- 33: {From: 0x9ef, To: 0x331},
- 34: {From: 0xa36, To: 0x2c5},
- 35: {From: 0xa3d, To: 0xbf},
- 36: {From: 0xabe, To: 0x3322},
- 37: {From: 0xb38, To: 0x529},
- 38: {From: 0xb75, To: 0x265a},
- 39: {From: 0xb7e, To: 0xbc3},
- 40: {From: 0xb9b, To: 0x44e},
- 41: {From: 0xbbc, To: 0x4229},
- 42: {From: 0xbbf, To: 0x529},
- 43: {From: 0xbfe, To: 0x2da7},
- 44: {From: 0xc2e, To: 0x3181},
- 45: {From: 0xcb9, To: 0xf3},
- 46: {From: 0xd08, To: 0xfa},
- 47: {From: 0xdc8, To: 0x11a},
- 48: {From: 0xdd7, To: 0x32d},
- 49: {From: 0xdf8, To: 0xdfb},
- 50: {From: 0xdfe, To: 0x531},
- 51: {From: 0xe01, To: 0xdf3},
- 52: {From: 0xedf, To: 0x205a},
- 53: {From: 0xee9, To: 0x222e},
- 54: {From: 0xeee, To: 0x2e9a},
- 55: {From: 0xf39, To: 0x367},
- 56: {From: 0x10d0, To: 0x140},
- 57: {From: 0x1104, To: 0x2d0},
- 58: {From: 0x11a0, To: 0x1ec},
- 59: {From: 0x1279, To: 0x21},
- 60: {From: 0x1424, To: 0x15e},
- 61: {From: 0x1470, To: 0x14e},
- 62: {From: 0x151f, To: 0xd9b},
- 63: {From: 0x1523, To: 0x390},
- 64: {From: 0x1532, To: 0x19f},
- 65: {From: 0x1580, To: 0x210},
- 66: {From: 0x1583, To: 0x10d},
- 67: {From: 0x15a3, To: 0x3caf},
- 68: {From: 0x1630, To: 0x222e},
- 69: {From: 0x166a, To: 0x19b},
- 70: {From: 0x16c8, To: 0x136},
- 71: {From: 0x1700, To: 0x29f8},
- 72: {From: 0x1718, To: 0x194},
- 73: {From: 0x1727, To: 0xf3f},
- 74: {From: 0x177a, To: 0x178},
- 75: {From: 0x1809, To: 0x17b6},
- 76: {From: 0x1816, To: 0x18f3},
- 77: {From: 0x188a, To: 0x436},
- 78: {From: 0x1979, To: 0x1d01},
- 79: {From: 0x1a74, To: 0x2bb0},
- 80: {From: 0x1a8a, To: 0x1f8},
- 81: {From: 0x1b5a, To: 0x1fa},
- 82: {From: 0x1b86, To: 0x1515},
- 83: {From: 0x1d64, To: 0x2c9b},
- 84: {From: 0x2038, To: 0x37b1},
- 85: {From: 0x203d, To: 0x20dd},
- 86: {From: 0x2042, To: 0x2e00},
- 87: {From: 0x205a, To: 0x30b},
- 88: {From: 0x20e3, To: 0x274},
- 89: {From: 0x20ee, To: 0x263},
- 90: {From: 0x20f2, To: 0x22d},
- 91: {From: 0x20f9, To: 0x256},
- 92: {From: 0x210f, To: 0x21eb},
- 93: {From: 0x2135, To: 0x27d},
- 94: {From: 0x2160, To: 0x913},
- 95: {From: 0x2199, To: 0x121},
- 96: {From: 0x21ce, To: 0x1561},
- 97: {From: 0x21e6, To: 0x504},
- 98: {From: 0x21f4, To: 0x49f},
- 99: {From: 0x21fb, To: 0x269},
- 100: {From: 0x222d, To: 0x121},
- 101: {From: 0x2237, To: 0x121},
- 102: {From: 0x2248, To: 0x217d},
- 103: {From: 0x2262, To: 0x92a},
- 104: {From: 0x2316, To: 0x3226},
- 105: {From: 0x236a, To: 0x2835},
- 106: {From: 0x2382, To: 0x3365},
- 107: {From: 0x2472, To: 0x2c7},
- 108: {From: 0x24e4, To: 0x2ff},
- 109: {From: 0x24f0, To: 0x2fa},
- 110: {From: 0x24fa, To: 0x31f},
- 111: {From: 0x2550, To: 0xb5b},
- 112: {From: 0x25a9, To: 0xe2},
- 113: {From: 0x263e, To: 0x2d0},
- 114: {From: 0x26c9, To: 0x26b4},
- 115: {From: 0x26f9, To: 0x3c8},
- 116: {From: 0x2727, To: 0x3caf},
- 117: {From: 0x2755, To: 0x6a4},
- 118: {From: 0x2765, To: 0x26b4},
- 119: {From: 0x2789, To: 0x4358},
- 120: {From: 0x27c9, To: 0x2001},
- 121: {From: 0x28ea, To: 0x27b1},
- 122: {From: 0x28ef, To: 0x2837},
- 123: {From: 0x28fe, To: 0xaa5},
- 124: {From: 0x2914, To: 0x351},
- 125: {From: 0x2986, To: 0x2da7},
- 126: {From: 0x29f0, To: 0x96b},
- 127: {From: 0x2b1a, To: 0x38d},
- 128: {From: 0x2bfc, To: 0x395},
- 129: {From: 0x2c3f, To: 0x3caf},
- 130: {From: 0x2ce1, To: 0x2201},
- 131: {From: 0x2cfc, To: 0x3be},
- 132: {From: 0x2d13, To: 0x597},
- 133: {From: 0x2d47, To: 0x148},
- 134: {From: 0x2d48, To: 0x148},
- 135: {From: 0x2dff, To: 0x2f1},
- 136: {From: 0x2e08, To: 0x19cc},
- 137: {From: 0x2e10, To: 0xc45},
- 138: {From: 0x2e1a, To: 0x2d95},
- 139: {From: 0x2e21, To: 0x292},
- 140: {From: 0x2e54, To: 0x7d},
- 141: {From: 0x2e65, To: 0x2282},
- 142: {From: 0x2e97, To: 0x1a4},
- 143: {From: 0x2ea0, To: 0x2e9b},
- 144: {From: 0x2eef, To: 0x2ed7},
- 145: {From: 0x3193, To: 0x3c4},
- 146: {From: 0x3366, To: 0x338e},
- 147: {From: 0x342a, To: 0x3dc},
- 148: {From: 0x34ee, To: 0x18d0},
- 149: {From: 0x35c8, To: 0x2c9b},
- 150: {From: 0x35e6, To: 0x412},
- 151: {From: 0x35f5, To: 0x24b},
- 152: {From: 0x360d, To: 0x1dc},
- 153: {From: 0x3658, To: 0x246},
- 154: {From: 0x3676, To: 0x3f4},
- 155: {From: 0x36fd, To: 0x445},
- 156: {From: 0x3747, To: 0x3b42},
- 157: {From: 0x37c0, To: 0x121},
- 158: {From: 0x3816, To: 0x38f2},
- 159: {From: 0x382a, To: 0x2b48},
- 160: {From: 0x382b, To: 0x2c9b},
- 161: {From: 0x382f, To: 0xa9},
- 162: {From: 0x3832, To: 0x3228},
- 163: {From: 0x386c, To: 0x39a6},
- 164: {From: 0x3892, To: 0x3fc0},
- 165: {From: 0x38a0, To: 0x45f},
- 166: {From: 0x38a5, To: 0x39d7},
- 167: {From: 0x38b4, To: 0x1fa4},
- 168: {From: 0x38b5, To: 0x2e9a},
- 169: {From: 0x38fa, To: 0x38f1},
- 170: {From: 0x395c, To: 0x47e},
- 171: {From: 0x3b4e, To: 0xd91},
- 172: {From: 0x3b78, To: 0x137},
- 173: {From: 0x3c99, To: 0x4bc},
- 174: {From: 0x3fbd, To: 0x100},
- 175: {From: 0x4208, To: 0xa91},
- 176: {From: 0x42be, To: 0x573},
- 177: {From: 0x42f9, To: 0x3f60},
- 178: {From: 0x4378, To: 0x25a},
- 179: {From: 0x43b8, To: 0xe6c},
- 180: {From: 0x43cd, To: 0x10f},
- 181: {From: 0x43d4, To: 0x4848},
- 182: {From: 0x44af, To: 0x3322},
- 183: {From: 0x44e3, To: 0x512},
- 184: {From: 0x45ca, To: 0x2409},
- 185: {From: 0x45dd, To: 0x26dc},
- 186: {From: 0x4610, To: 0x48ae},
- 187: {From: 0x46ae, To: 0x46a0},
- 188: {From: 0x473e, To: 0x4745},
- 189: {From: 0x4817, To: 0x3503},
- 190: {From: 0x483b, To: 0x208b},
- 191: {From: 0x4916, To: 0x31f},
- 192: {From: 0x49a7, To: 0x523},
-}
-
-// Size: 193 bytes, 193 elements
-var AliasTypes = [193]AliasType{
- // Entry 0 - 3F
- 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 1, 0, 0, 0, 0,
- 1, 2, 1, 1, 2, 0, 0, 1, 0, 1, 2, 1, 1, 0, 0, 0,
- 0, 2, 1, 1, 0, 2, 0, 0, 1, 0, 1, 0, 0, 1, 2, 1,
- 1, 1, 1, 0, 0, 0, 0, 2, 1, 1, 1, 1, 2, 1, 0, 1,
- // Entry 40 - 7F
- 1, 2, 2, 0, 0, 1, 2, 0, 1, 0, 1, 1, 1, 1, 0, 0,
- 2, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 2, 2, 0,
- 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1,
- // Entry 80 - BF
- 1, 0, 0, 1, 0, 2, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0,
- 0, 1, 1, 2, 0, 0, 2, 0, 0, 1, 1, 1, 0, 0, 0, 0,
- 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 2, 0,
- 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1,
- // Entry C0 - FF
- 1,
-}
-
-const (
- _Latn = 91
- _Hani = 57
- _Hans = 59
- _Hant = 60
- _Qaaa = 149
- _Qaai = 157
- _Qabx = 198
- _Zinh = 255
- _Zyyy = 260
- _Zzzz = 261
-)
-
-// script is an alphabetically sorted list of ISO 15924 codes. The index
-// of the script in the string, divided by 4, is the internal scriptID.
-const script tag.Index = "" + // Size: 1052 bytes
- "----AdlmAfakAghbAhomArabAranArmiArmnAvstBaliBamuBassBatkBengBhksBlisBopo" +
- "BrahBraiBugiBuhdCakmCansCariChamCherChrsCirtCoptCpmnCprtCyrlCyrsDevaDiak" +
- "DogrDsrtDuplEgydEgyhEgypElbaElymEthiGeokGeorGlagGongGonmGothGranGrekGujr" +
- "GuruHanbHangHaniHanoHansHantHatrHebrHiraHluwHmngHmnpHrktHungIndsItalJamo" +
- "JavaJpanJurcKaliKanaKawiKharKhmrKhojKitlKitsKndaKoreKpelKthiLanaLaooLatf" +
- "LatgLatnLekeLepcLimbLinaLinbLisuLomaLyciLydiMahjMakaMandManiMarcMayaMedf" +
- "MendMercMeroMlymModiMongMoonMrooMteiMultMymrNagmNandNarbNbatNewaNkdbNkgb" +
- "NkooNshuOgamOlckOrkhOryaOsgeOsmaOugrPalmPaucPcunPelmPermPhagPhliPhlpPhlv" +
- "PhnxPiqdPlrdPrtiPsinQaaaQaabQaacQaadQaaeQaafQaagQaahQaaiQaajQaakQaalQaam" +
- "QaanQaaoQaapQaaqQaarQaasQaatQaauQaavQaawQaaxQaayQaazQabaQabbQabcQabdQabe" +
- "QabfQabgQabhQabiQabjQabkQablQabmQabnQaboQabpQabqQabrQabsQabtQabuQabvQabw" +
- "QabxRanjRjngRohgRoroRunrSamrSaraSarbSaurSgnwShawShrdShuiSiddSindSinhSogd" +
- "SogoSoraSoyoSundSunuSyloSyrcSyreSyrjSyrnTagbTakrTaleTaluTamlTangTavtTelu" +
- "TengTfngTglgThaaThaiTibtTirhTnsaTotoUgarVaiiVispVithWaraWchoWoleXpeoXsux" +
- "YeziYiiiZanbZinhZmthZsyeZsymZxxxZyyyZzzz\xff\xff\xff\xff"
-
-// suppressScript is an index from langID to the dominant script for that language,
-// if it exists. If a script is given, it should be suppressed from the language tag.
-// Size: 1330 bytes, 1330 elements
-var suppressScript = [1330]uint8{
- // Entry 0 - 3F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 40 - 7F
- 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
- // Entry 80 - BF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry C0 - FF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 100 - 13F
- 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xed, 0x00, 0x00, 0x00, 0x00, 0xef, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x5b, 0x00,
- // Entry 140 - 17F
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x5b, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 180 - 1BF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x5b, 0x35, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x22, 0x00,
- // Entry 1C0 - 1FF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x5b, 0x00, 0x5b, 0x5b, 0x00, 0x08,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x5b, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
- // Entry 200 - 23F
- 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 240 - 27F
- 0x00, 0x00, 0x20, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x53, 0x00, 0x00, 0x54, 0x00, 0x22, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 280 - 2BF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 2C0 - 2FF
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
- // Entry 300 - 33F
- 0x00, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5b,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00,
- // Entry 340 - 37F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x5b, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x5b, 0x00,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 380 - 3BF
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00,
- // Entry 3C0 - 3FF
- 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x20, 0x00, 0x00, 0x5b, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 400 - 43F
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00,
- // Entry 440 - 47F
- 0x00, 0x00, 0x00, 0x00, 0x5b, 0x5b, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0xe9, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x2c,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00,
- // Entry 480 - 4BF
- 0x5b, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5b, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 4C0 - 4FF
- 0x5b, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 500 - 53F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b,
- 0x00, 0x00,
-}
-
-const (
- _001 = 1
- _419 = 31
- _BR = 65
- _CA = 73
- _ES = 111
- _GB = 124
- _MD = 189
- _PT = 239
- _UK = 307
- _US = 310
- _ZZ = 358
- _XA = 324
- _XC = 326
- _XK = 334
-)
-
-// isoRegionOffset needs to be added to the index of regionISO to obtain the regionID
-// for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for
-// the UN.M49 codes used for groups.)
-const isoRegionOffset = 32
-
-// regionTypes defines the status of a region for various standards.
-// Size: 359 bytes, 359 elements
-var regionTypes = [359]uint8{
- // Entry 0 - 3F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- // Entry 40 - 7F
- 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x04, 0x06,
- 0x04, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x04, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x00,
- 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x00, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06,
- // Entry 80 - BF
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x00, 0x04, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- // Entry C0 - FF
- 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x00, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04,
- 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x00, 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05,
- 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
- // Entry 100 - 13F
- 0x05, 0x05, 0x05, 0x06, 0x00, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x02, 0x06, 0x04, 0x06, 0x06,
- 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06,
- // Entry 140 - 17F
- 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05,
- 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
- 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
- 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x06,
- 0x06, 0x04, 0x06, 0x06, 0x04, 0x06, 0x05,
-}
-
-// regionISO holds a list of alphabetically sorted 2-letter ISO region codes.
-// Each 2-letter codes is followed by two bytes with the following meaning:
-// - [A-Z}{2}: the first letter of the 2-letter code plus these two
-// letters form the 3-letter ISO code.
-// - 0, n: index into altRegionISO3.
-const regionISO tag.Index = "" + // Size: 1312 bytes
- "AAAAACSCADNDAEREAFFGAGTGAIIAALLBAMRMANNTAOGOAQTAARRGASSMATUTAUUSAWBWAXLA" +
- "AZZEBAIHBBRBBDGDBEELBFFABGGRBHHRBIDIBJENBLLMBMMUBNRNBOOLBQESBRRABSHSBTTN" +
- "BUURBVVTBWWABYLRBZLZCAANCCCKCDODCFAFCGOGCHHECIIVCKOKCLHLCMMRCNHNCOOLCPPT" +
- "CQ CRRICS\x00\x00CTTECUUBCVPVCWUWCXXRCYYPCZZEDDDRDEEUDGGADJJIDKNKDMMADO" +
- "OMDYHYDZZAEA ECCUEESTEGGYEHSHERRIESSPETTHEU\x00\x03EZ FIINFJJIFKLKFMSM" +
- "FOROFQ\x00\x18FRRAFXXXGAABGBBRGDRDGEEOGFUFGGGYGHHAGIIBGLRLGMMBGNINGPLPGQ" +
- "NQGRRCGS\x00\x06GTTMGUUMGWNBGYUYHKKGHMMDHNNDHRRVHTTIHUUNHVVOIC IDDNIERL" +
- "ILSRIMMNINNDIOOTIQRQIRRNISSLITTAJEEYJMAMJOORJPPNJTTNKEENKGGZKHHMKIIRKM" +
- "\x00\x09KNNAKP\x00\x0cKRORKWWTKY\x00\x0fKZAZLAAOLBBNLCCALIIELKKALRBRLSSO" +
- "LTTULUUXLVVALYBYMAARMCCOMDDAMENEMFAFMGDGMHHLMIIDMKKDMLLIMMMRMNNGMOACMPNP" +
- "MQTQMRRTMSSRMTLTMUUSMVDVMWWIMXEXMYYSMZOZNAAMNCCLNEERNFFKNGGANHHBNIICNLLD" +
- "NOORNPPLNQ\x00\x1eNRRUNTTZNUIUNZZLOMMNPAANPCCIPEERPFYFPGNGPHHLPKAKPLOLPM" +
- "\x00\x12PNCNPRRIPSSEPTRTPUUSPWLWPYRYPZCZQAATQMMMQNNNQOOOQPPPQQQQQRRRQSSS" +
- "QTTTQU\x00\x03QVVVQWWWQXXXQYYYQZZZREEURHHOROOURS\x00\x15RUUSRWWASAAUSBLB" +
- "SCYCSDDNSEWESGGPSHHNSIVNSJJMSKVKSLLESMMRSNENSOOMSRURSSSDSTTPSUUNSVLVSXXM" +
- "SYYRSZWZTAAATCCATDCDTF\x00\x18TGGOTHHATJJKTKKLTLLSTMKMTNUNTOONTPMPTRURTT" +
- "TOTVUVTWWNTZZAUAKRUGGAUK UMMIUN USSAUYRYUZZBVAATVCCTVDDRVEENVGGBVIIRVN" +
- "NMVUUTWFLFWKAKWSSMXAAAXBBBXCCCXDDDXEEEXFFFXGGGXHHHXIIIXJJJXKKKXLLLXMMMXN" +
- "NNXOOOXPPPXQQQXRRRXSSSXTTTXUUUXVVVXWWWXXXXXYYYXZZZYDMDYEEMYT\x00\x1bYUUG" +
- "ZAAFZMMBZRARZWWEZZZZ\xff\xff\xff\xff"
-
-// altRegionISO3 holds a list of 3-letter region codes that cannot be
-// mapped to 2-letter codes using the default algorithm. This is a short list.
-const altRegionISO3 string = "SCGQUUSGSCOMPRKCYMSPMSRBATFMYTATN"
-
-// altRegionIDs holds a list of regionIDs the positions of which match those
-// of the 3-letter ISO codes in altRegionISO3.
-// Size: 22 bytes, 11 elements
-var altRegionIDs = [11]uint16{
- 0x0058, 0x0071, 0x0089, 0x00a9, 0x00ab, 0x00ae, 0x00eb, 0x0106,
- 0x0122, 0x0160, 0x00dd,
-}
-
-// Size: 80 bytes, 20 elements
-var regionOldMap = [20]FromTo{
- 0: {From: 0x44, To: 0xc5},
- 1: {From: 0x59, To: 0xa8},
- 2: {From: 0x60, To: 0x61},
- 3: {From: 0x67, To: 0x3b},
- 4: {From: 0x7a, To: 0x79},
- 5: {From: 0x94, To: 0x37},
- 6: {From: 0xa4, To: 0x134},
- 7: {From: 0xc2, To: 0x134},
- 8: {From: 0xd8, To: 0x140},
- 9: {From: 0xdd, To: 0x2b},
- 10: {From: 0xf0, To: 0x134},
- 11: {From: 0xf3, To: 0xe3},
- 12: {From: 0xfd, To: 0x71},
- 13: {From: 0x104, To: 0x165},
- 14: {From: 0x12b, To: 0x127},
- 15: {From: 0x133, To: 0x7c},
- 16: {From: 0x13b, To: 0x13f},
- 17: {From: 0x142, To: 0x134},
- 18: {From: 0x15e, To: 0x15f},
- 19: {From: 0x164, To: 0x4b},
-}
-
-// m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are
-// codes indicating collections of regions.
-// Size: 718 bytes, 359 elements
-var m49 = [359]int16{
- // Entry 0 - 3F
- 0, 1, 2, 3, 5, 9, 11, 13,
- 14, 15, 17, 18, 19, 21, 29, 30,
- 34, 35, 39, 53, 54, 57, 61, 142,
- 143, 145, 150, 151, 154, 155, 202, 419,
- 958, 0, 20, 784, 4, 28, 660, 8,
- 51, 530, 24, 10, 32, 16, 40, 36,
- 533, 248, 31, 70, 52, 50, 56, 854,
- 100, 48, 108, 204, 652, 60, 96, 68,
- // Entry 40 - 7F
- 535, 76, 44, 64, 104, 74, 72, 112,
- 84, 124, 166, 180, 140, 178, 756, 384,
- 184, 152, 120, 156, 170, 0, 0, 188,
- 891, 296, 192, 132, 531, 162, 196, 203,
- 278, 276, 0, 262, 208, 212, 214, 204,
- 12, 0, 218, 233, 818, 732, 232, 724,
- 231, 967, 0, 246, 242, 238, 583, 234,
- 0, 250, 249, 266, 826, 308, 268, 254,
- // Entry 80 - BF
- 831, 288, 292, 304, 270, 324, 312, 226,
- 300, 239, 320, 316, 624, 328, 344, 334,
- 340, 191, 332, 348, 854, 0, 360, 372,
- 376, 833, 356, 86, 368, 364, 352, 380,
- 832, 388, 400, 392, 581, 404, 417, 116,
- 296, 174, 659, 408, 410, 414, 136, 398,
- 418, 422, 662, 438, 144, 430, 426, 440,
- 442, 428, 434, 504, 492, 498, 499, 663,
- // Entry C0 - FF
- 450, 584, 581, 807, 466, 104, 496, 446,
- 580, 474, 478, 500, 470, 480, 462, 454,
- 484, 458, 508, 516, 540, 562, 574, 566,
- 548, 558, 528, 578, 524, 10, 520, 536,
- 570, 554, 512, 591, 0, 604, 258, 598,
- 608, 586, 616, 666, 612, 630, 275, 620,
- 581, 585, 600, 591, 634, 959, 960, 961,
- 962, 963, 964, 965, 966, 967, 968, 969,
- // Entry 100 - 13F
- 970, 971, 972, 638, 716, 642, 688, 643,
- 646, 682, 90, 690, 729, 752, 702, 654,
- 705, 744, 703, 694, 674, 686, 706, 740,
- 728, 678, 810, 222, 534, 760, 748, 0,
- 796, 148, 260, 768, 764, 762, 772, 626,
- 795, 788, 776, 626, 792, 780, 798, 158,
- 834, 804, 800, 826, 581, 0, 840, 858,
- 860, 336, 670, 704, 862, 92, 850, 704,
- // Entry 140 - 17F
- 548, 876, 581, 882, 973, 974, 975, 976,
- 977, 978, 979, 980, 981, 982, 983, 984,
- 985, 986, 987, 988, 989, 990, 991, 992,
- 993, 994, 995, 996, 997, 998, 720, 887,
- 175, 891, 710, 894, 180, 716, 999,
-}
-
-// m49Index gives indexes into fromM49 based on the three most significant bits
-// of a 10-bit UN.M49 code. To search an UN.M49 code in fromM49, search in
-//
-// fromM49[m49Index[msb39(code)]:m49Index[msb3(code)+1]]
-//
-// for an entry where the first 7 bits match the 7 lsb of the UN.M49 code.
-// The region code is stored in the 9 lsb of the indexed value.
-// Size: 18 bytes, 9 elements
-var m49Index = [9]int16{
- 0, 59, 108, 143, 181, 220, 259, 291,
- 333,
-}
-
-// fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details.
-// Size: 666 bytes, 333 elements
-var fromM49 = [333]uint16{
- // Entry 0 - 3F
- 0x0201, 0x0402, 0x0603, 0x0824, 0x0a04, 0x1027, 0x1205, 0x142b,
- 0x1606, 0x1868, 0x1a07, 0x1c08, 0x1e09, 0x202d, 0x220a, 0x240b,
- 0x260c, 0x2822, 0x2a0d, 0x302a, 0x3825, 0x3a0e, 0x3c0f, 0x3e32,
- 0x402c, 0x4410, 0x4611, 0x482f, 0x4e12, 0x502e, 0x5842, 0x6039,
- 0x6435, 0x6628, 0x6834, 0x6a13, 0x6c14, 0x7036, 0x7215, 0x783d,
- 0x7a16, 0x8043, 0x883f, 0x8c33, 0x9046, 0x9445, 0x9841, 0xa848,
- 0xac9b, 0xb50a, 0xb93d, 0xc03e, 0xc838, 0xd0c5, 0xd83a, 0xe047,
- 0xe8a7, 0xf052, 0xf849, 0x085b, 0x10ae, 0x184c, 0x1c17, 0x1e18,
- // Entry 40 - 7F
- 0x20b4, 0x2219, 0x2921, 0x2c1a, 0x2e1b, 0x3051, 0x341c, 0x361d,
- 0x3853, 0x3d2f, 0x445d, 0x4c4a, 0x5454, 0x5ca9, 0x5f60, 0x644d,
- 0x684b, 0x7050, 0x7857, 0x7e91, 0x805a, 0x885e, 0x941e, 0x965f,
- 0x983b, 0xa064, 0xa865, 0xac66, 0xb46a, 0xbd1b, 0xc487, 0xcc70,
- 0xce70, 0xd06e, 0xd26b, 0xd477, 0xdc75, 0xde89, 0xe474, 0xec73,
- 0xf031, 0xf27a, 0xf479, 0xfc7f, 0x04e6, 0x0922, 0x0c63, 0x147b,
- 0x187e, 0x1c84, 0x26ee, 0x2861, 0x2c60, 0x3061, 0x4081, 0x4882,
- 0x50a8, 0x5888, 0x6083, 0x687d, 0x7086, 0x788b, 0x808a, 0x8885,
- // Entry 80 - BF
- 0x908d, 0x9892, 0x9c8f, 0xa139, 0xa890, 0xb08e, 0xb893, 0xc09e,
- 0xc89a, 0xd096, 0xd89d, 0xe09c, 0xe897, 0xf098, 0xf89f, 0x004f,
- 0x08a1, 0x10a3, 0x1caf, 0x20a2, 0x28a5, 0x30ab, 0x34ac, 0x3cad,
- 0x42a6, 0x44b0, 0x461f, 0x4cb1, 0x54b6, 0x58b9, 0x5cb5, 0x64ba,
- 0x6cb3, 0x70b7, 0x74b8, 0x7cc7, 0x84c0, 0x8ccf, 0x94d1, 0x9cce,
- 0xa4c4, 0xaccc, 0xb4c9, 0xbcca, 0xc0cd, 0xc8d0, 0xd8bc, 0xe0c6,
- 0xe4bd, 0xe6be, 0xe8cb, 0xf0bb, 0xf8d2, 0x00e2, 0x08d3, 0x10de,
- 0x18dc, 0x20da, 0x2429, 0x265c, 0x2a30, 0x2d1c, 0x2e40, 0x30df,
- // Entry C0 - FF
- 0x38d4, 0x4940, 0x54e1, 0x5cd9, 0x64d5, 0x6cd7, 0x74e0, 0x7cd6,
- 0x84db, 0x88c8, 0x8b34, 0x8e76, 0x90c1, 0x92f1, 0x94e9, 0x9ee3,
- 0xace7, 0xb0f2, 0xb8e5, 0xc0e8, 0xc8ec, 0xd0ea, 0xd8ef, 0xe08c,
- 0xe527, 0xeced, 0xf4f4, 0xfd03, 0x0505, 0x0707, 0x0d08, 0x183c,
- 0x1d0f, 0x26aa, 0x2826, 0x2cb2, 0x2ebf, 0x34eb, 0x3d3a, 0x4514,
- 0x4d19, 0x5509, 0x5d15, 0x6106, 0x650b, 0x6d13, 0x7d0e, 0x7f12,
- 0x813f, 0x8310, 0x8516, 0x8d62, 0x9965, 0xa15e, 0xa86f, 0xb118,
- 0xb30c, 0xb86d, 0xc10c, 0xc917, 0xd111, 0xd91e, 0xe10d, 0xe84e,
- // Entry 100 - 13F
- 0xf11d, 0xf525, 0xf924, 0x0123, 0x0926, 0x112a, 0x192d, 0x2023,
- 0x2929, 0x312c, 0x3728, 0x3920, 0x3d2e, 0x4132, 0x4931, 0x4ec3,
- 0x551a, 0x646c, 0x747c, 0x7e80, 0x80a0, 0x8299, 0x8530, 0x9136,
- 0xa53e, 0xac37, 0xb537, 0xb938, 0xbd3c, 0xd941, 0xe543, 0xed5f,
- 0xef5f, 0xf658, 0xfd63, 0x7c20, 0x7ef5, 0x80f6, 0x82f7, 0x84f8,
- 0x86f9, 0x88fa, 0x8afb, 0x8cfc, 0x8e71, 0x90fe, 0x92ff, 0x9500,
- 0x9701, 0x9902, 0x9b44, 0x9d45, 0x9f46, 0xa147, 0xa348, 0xa549,
- 0xa74a, 0xa94b, 0xab4c, 0xad4d, 0xaf4e, 0xb14f, 0xb350, 0xb551,
- // Entry 140 - 17F
- 0xb752, 0xb953, 0xbb54, 0xbd55, 0xbf56, 0xc157, 0xc358, 0xc559,
- 0xc75a, 0xc95b, 0xcb5c, 0xcd5d, 0xcf66,
-}
-
-// Size: 2128 bytes
-var variantIndex = map[string]uint8{
- "1606nict": 0x0,
- "1694acad": 0x1,
- "1901": 0x2,
- "1959acad": 0x3,
- "1994": 0x67,
- "1996": 0x4,
- "abl1943": 0x5,
- "akuapem": 0x6,
- "alalc97": 0x69,
- "aluku": 0x7,
- "ao1990": 0x8,
- "aranes": 0x9,
- "arevela": 0xa,
- "arevmda": 0xb,
- "arkaika": 0xc,
- "asante": 0xd,
- "auvern": 0xe,
- "baku1926": 0xf,
- "balanka": 0x10,
- "barla": 0x11,
- "basiceng": 0x12,
- "bauddha": 0x13,
- "bciav": 0x14,
- "bcizbl": 0x15,
- "biscayan": 0x16,
- "biske": 0x62,
- "bohoric": 0x17,
- "boont": 0x18,
- "bornholm": 0x19,
- "cisaup": 0x1a,
- "colb1945": 0x1b,
- "cornu": 0x1c,
- "creiss": 0x1d,
- "dajnko": 0x1e,
- "ekavsk": 0x1f,
- "emodeng": 0x20,
- "fonipa": 0x6a,
- "fonkirsh": 0x6b,
- "fonnapa": 0x6c,
- "fonupa": 0x6d,
- "fonxsamp": 0x6e,
- "gallo": 0x21,
- "gascon": 0x22,
- "grclass": 0x23,
- "grital": 0x24,
- "grmistr": 0x25,
- "hepburn": 0x26,
- "heploc": 0x68,
- "hognorsk": 0x27,
- "hsistemo": 0x28,
- "ijekavsk": 0x29,
- "itihasa": 0x2a,
- "ivanchov": 0x2b,
- "jauer": 0x2c,
- "jyutping": 0x2d,
- "kkcor": 0x2e,
- "kociewie": 0x2f,
- "kscor": 0x30,
- "laukika": 0x31,
- "lemosin": 0x32,
- "lengadoc": 0x33,
- "lipaw": 0x63,
- "ltg1929": 0x34,
- "ltg2007": 0x35,
- "luna1918": 0x36,
- "metelko": 0x37,
- "monoton": 0x38,
- "ndyuka": 0x39,
- "nedis": 0x3a,
- "newfound": 0x3b,
- "nicard": 0x3c,
- "njiva": 0x64,
- "nulik": 0x3d,
- "osojs": 0x65,
- "oxendict": 0x3e,
- "pahawh2": 0x3f,
- "pahawh3": 0x40,
- "pahawh4": 0x41,
- "pamaka": 0x42,
- "peano": 0x43,
- "petr1708": 0x44,
- "pinyin": 0x45,
- "polyton": 0x46,
- "provenc": 0x47,
- "puter": 0x48,
- "rigik": 0x49,
- "rozaj": 0x4a,
- "rumgr": 0x4b,
- "scotland": 0x4c,
- "scouse": 0x4d,
- "simple": 0x6f,
- "solba": 0x66,
- "sotav": 0x4e,
- "spanglis": 0x4f,
- "surmiran": 0x50,
- "sursilv": 0x51,
- "sutsilv": 0x52,
- "synnejyl": 0x53,
- "tarask": 0x54,
- "tongyong": 0x55,
- "tunumiit": 0x56,
- "uccor": 0x57,
- "ucrcor": 0x58,
- "ulster": 0x59,
- "unifon": 0x5a,
- "vaidika": 0x5b,
- "valencia": 0x5c,
- "vallader": 0x5d,
- "vecdruka": 0x5e,
- "vivaraup": 0x5f,
- "wadegile": 0x60,
- "xsistemo": 0x61,
-}
-
-// variantNumSpecialized is the number of specialized variants in variants.
-const variantNumSpecialized = 105
-
-// nRegionGroups is the number of region groups.
-const nRegionGroups = 33
-
-type likelyLangRegion struct {
- lang uint16
- region uint16
-}
-
-// likelyScript is a lookup table, indexed by scriptID, for the most likely
-// languages and regions given a script.
-// Size: 1052 bytes, 263 elements
-var likelyScript = [263]likelyLangRegion{
- 1: {lang: 0x14e, region: 0x85},
- 3: {lang: 0x2a2, region: 0x107},
- 4: {lang: 0x1f, region: 0x9a},
- 5: {lang: 0x3a, region: 0x6c},
- 7: {lang: 0x3b, region: 0x9d},
- 8: {lang: 0x1d7, region: 0x28},
- 9: {lang: 0x13, region: 0x9d},
- 10: {lang: 0x5b, region: 0x96},
- 11: {lang: 0x60, region: 0x52},
- 12: {lang: 0xb9, region: 0xb5},
- 13: {lang: 0x63, region: 0x96},
- 14: {lang: 0xa5, region: 0x35},
- 15: {lang: 0x3e9, region: 0x9a},
- 17: {lang: 0x529, region: 0x12f},
- 18: {lang: 0x3b1, region: 0x9a},
- 19: {lang: 0x15e, region: 0x79},
- 20: {lang: 0xc2, region: 0x96},
- 21: {lang: 0x9d, region: 0xe8},
- 22: {lang: 0xdb, region: 0x35},
- 23: {lang: 0xf3, region: 0x49},
- 24: {lang: 0x4f0, region: 0x12c},
- 25: {lang: 0xe7, region: 0x13f},
- 26: {lang: 0xe5, region: 0x136},
- 29: {lang: 0xf1, region: 0x6c},
- 31: {lang: 0x1a0, region: 0x5e},
- 32: {lang: 0x3e2, region: 0x107},
- 34: {lang: 0x1be, region: 0x9a},
- 38: {lang: 0x15e, region: 0x79},
- 41: {lang: 0x133, region: 0x6c},
- 42: {lang: 0x431, region: 0x27},
- 44: {lang: 0x27, region: 0x70},
- 46: {lang: 0x210, region: 0x7e},
- 47: {lang: 0xfe, region: 0x38},
- 49: {lang: 0x19b, region: 0x9a},
- 50: {lang: 0x19e, region: 0x131},
- 51: {lang: 0x3e9, region: 0x9a},
- 52: {lang: 0x136, region: 0x88},
- 53: {lang: 0x1a4, region: 0x9a},
- 54: {lang: 0x39d, region: 0x9a},
- 55: {lang: 0x529, region: 0x12f},
- 56: {lang: 0x254, region: 0xac},
- 57: {lang: 0x529, region: 0x53},
- 58: {lang: 0x1cb, region: 0xe8},
- 59: {lang: 0x529, region: 0x53},
- 60: {lang: 0x529, region: 0x12f},
- 61: {lang: 0x2fd, region: 0x9c},
- 62: {lang: 0x1bc, region: 0x98},
- 63: {lang: 0x200, region: 0xa3},
- 64: {lang: 0x1c5, region: 0x12c},
- 65: {lang: 0x1ca, region: 0xb0},
- 68: {lang: 0x1d5, region: 0x93},
- 70: {lang: 0x142, region: 0x9f},
- 71: {lang: 0x254, region: 0xac},
- 72: {lang: 0x20e, region: 0x96},
- 73: {lang: 0x200, region: 0xa3},
- 75: {lang: 0x135, region: 0xc5},
- 76: {lang: 0x200, region: 0xa3},
- 78: {lang: 0x3bb, region: 0xe9},
- 79: {lang: 0x24a, region: 0xa7},
- 80: {lang: 0x3fa, region: 0x9a},
- 83: {lang: 0x251, region: 0x9a},
- 84: {lang: 0x254, region: 0xac},
- 86: {lang: 0x88, region: 0x9a},
- 87: {lang: 0x370, region: 0x124},
- 88: {lang: 0x2b8, region: 0xb0},
- 93: {lang: 0x29f, region: 0x9a},
- 94: {lang: 0x2a8, region: 0x9a},
- 95: {lang: 0x28f, region: 0x88},
- 96: {lang: 0x1a0, region: 0x88},
- 97: {lang: 0x2ac, region: 0x53},
- 99: {lang: 0x4f4, region: 0x12c},
- 100: {lang: 0x4f5, region: 0x12c},
- 101: {lang: 0x1be, region: 0x9a},
- 103: {lang: 0x337, region: 0x9d},
- 104: {lang: 0x4f7, region: 0x53},
- 105: {lang: 0xa9, region: 0x53},
- 108: {lang: 0x2e8, region: 0x113},
- 109: {lang: 0x4f8, region: 0x10c},
- 110: {lang: 0x4f8, region: 0x10c},
- 111: {lang: 0x304, region: 0x9a},
- 112: {lang: 0x31b, region: 0x9a},
- 113: {lang: 0x30b, region: 0x53},
- 115: {lang: 0x31e, region: 0x35},
- 116: {lang: 0x30e, region: 0x9a},
- 117: {lang: 0x414, region: 0xe9},
- 118: {lang: 0x331, region: 0xc5},
- 121: {lang: 0x4f9, region: 0x109},
- 122: {lang: 0x3b, region: 0xa2},
- 123: {lang: 0x353, region: 0xdc},
- 126: {lang: 0x2d0, region: 0x85},
- 127: {lang: 0x52a, region: 0x53},
- 128: {lang: 0x403, region: 0x97},
- 129: {lang: 0x3ee, region: 0x9a},
- 130: {lang: 0x39b, region: 0xc6},
- 131: {lang: 0x395, region: 0x9a},
- 132: {lang: 0x399, region: 0x136},
- 133: {lang: 0x429, region: 0x116},
- 135: {lang: 0x3b, region: 0x11d},
- 136: {lang: 0xfd, region: 0xc5},
- 139: {lang: 0x27d, region: 0x107},
- 140: {lang: 0x2c9, region: 0x53},
- 141: {lang: 0x39f, region: 0x9d},
- 142: {lang: 0x39f, region: 0x53},
- 144: {lang: 0x3ad, region: 0xb1},
- 146: {lang: 0x1c6, region: 0x53},
- 147: {lang: 0x4fd, region: 0x9d},
- 200: {lang: 0x3cb, region: 0x96},
- 203: {lang: 0x372, region: 0x10d},
- 204: {lang: 0x420, region: 0x98},
- 206: {lang: 0x4ff, region: 0x15f},
- 207: {lang: 0x3f0, region: 0x9a},
- 208: {lang: 0x45, region: 0x136},
- 209: {lang: 0x139, region: 0x7c},
- 210: {lang: 0x3e9, region: 0x9a},
- 212: {lang: 0x3e9, region: 0x9a},
- 213: {lang: 0x3fa, region: 0x9a},
- 214: {lang: 0x40c, region: 0xb4},
- 217: {lang: 0x433, region: 0x9a},
- 218: {lang: 0xef, region: 0xc6},
- 219: {lang: 0x43e, region: 0x96},
- 221: {lang: 0x44d, region: 0x35},
- 222: {lang: 0x44e, region: 0x9c},
- 226: {lang: 0x45a, region: 0xe8},
- 227: {lang: 0x11a, region: 0x9a},
- 228: {lang: 0x45e, region: 0x53},
- 229: {lang: 0x232, region: 0x53},
- 230: {lang: 0x450, region: 0x9a},
- 231: {lang: 0x4a5, region: 0x53},
- 232: {lang: 0x9f, region: 0x13f},
- 233: {lang: 0x461, region: 0x9a},
- 235: {lang: 0x528, region: 0xbb},
- 236: {lang: 0x153, region: 0xe8},
- 237: {lang: 0x128, region: 0xce},
- 238: {lang: 0x46b, region: 0x124},
- 239: {lang: 0xa9, region: 0x53},
- 240: {lang: 0x2ce, region: 0x9a},
- 243: {lang: 0x4ad, region: 0x11d},
- 244: {lang: 0x4be, region: 0xb5},
- 247: {lang: 0x1ce, region: 0x9a},
- 250: {lang: 0x3a9, region: 0x9d},
- 251: {lang: 0x22, region: 0x9c},
- 253: {lang: 0x1ea, region: 0x53},
- 254: {lang: 0xef, region: 0xc6},
-}
-
-type likelyScriptRegion struct {
- region uint16
- script uint16
- flags uint8
-}
-
-// likelyLang is a lookup table, indexed by langID, for the most likely
-// scripts and regions given incomplete information. If more entries exist for a
-// given language, region and script are the index and size respectively
-// of the list in likelyLangList.
-// Size: 7980 bytes, 1330 elements
-var likelyLang = [1330]likelyScriptRegion{
- 0: {region: 0x136, script: 0x5b, flags: 0x0},
- 1: {region: 0x70, script: 0x5b, flags: 0x0},
- 2: {region: 0x166, script: 0x5b, flags: 0x0},
- 3: {region: 0x166, script: 0x5b, flags: 0x0},
- 4: {region: 0x166, script: 0x5b, flags: 0x0},
- 5: {region: 0x7e, script: 0x20, flags: 0x0},
- 6: {region: 0x166, script: 0x5b, flags: 0x0},
- 7: {region: 0x166, script: 0x20, flags: 0x0},
- 8: {region: 0x81, script: 0x5b, flags: 0x0},
- 9: {region: 0x166, script: 0x5b, flags: 0x0},
- 10: {region: 0x166, script: 0x5b, flags: 0x0},
- 11: {region: 0x166, script: 0x5b, flags: 0x0},
- 12: {region: 0x96, script: 0x5b, flags: 0x0},
- 13: {region: 0x132, script: 0x5b, flags: 0x0},
- 14: {region: 0x81, script: 0x5b, flags: 0x0},
- 15: {region: 0x166, script: 0x5b, flags: 0x0},
- 16: {region: 0x166, script: 0x5b, flags: 0x0},
- 17: {region: 0x107, script: 0x20, flags: 0x0},
- 18: {region: 0x166, script: 0x5b, flags: 0x0},
- 19: {region: 0x9d, script: 0x9, flags: 0x0},
- 20: {region: 0x129, script: 0x5, flags: 0x0},
- 21: {region: 0x166, script: 0x5b, flags: 0x0},
- 22: {region: 0x162, script: 0x5b, flags: 0x0},
- 23: {region: 0x166, script: 0x5b, flags: 0x0},
- 24: {region: 0x166, script: 0x5b, flags: 0x0},
- 25: {region: 0x166, script: 0x5b, flags: 0x0},
- 26: {region: 0x166, script: 0x5b, flags: 0x0},
- 27: {region: 0x166, script: 0x5b, flags: 0x0},
- 28: {region: 0x52, script: 0x5b, flags: 0x0},
- 29: {region: 0x166, script: 0x5b, flags: 0x0},
- 30: {region: 0x166, script: 0x5b, flags: 0x0},
- 31: {region: 0x9a, script: 0x4, flags: 0x0},
- 32: {region: 0x166, script: 0x5b, flags: 0x0},
- 33: {region: 0x81, script: 0x5b, flags: 0x0},
- 34: {region: 0x9c, script: 0xfb, flags: 0x0},
- 35: {region: 0x166, script: 0x5b, flags: 0x0},
- 36: {region: 0x166, script: 0x5b, flags: 0x0},
- 37: {region: 0x14e, script: 0x5b, flags: 0x0},
- 38: {region: 0x107, script: 0x20, flags: 0x0},
- 39: {region: 0x70, script: 0x2c, flags: 0x0},
- 40: {region: 0x166, script: 0x5b, flags: 0x0},
- 41: {region: 0x166, script: 0x5b, flags: 0x0},
- 42: {region: 0xd7, script: 0x5b, flags: 0x0},
- 43: {region: 0x166, script: 0x5b, flags: 0x0},
- 45: {region: 0x166, script: 0x5b, flags: 0x0},
- 46: {region: 0x166, script: 0x5b, flags: 0x0},
- 47: {region: 0x166, script: 0x5b, flags: 0x0},
- 48: {region: 0x166, script: 0x5b, flags: 0x0},
- 49: {region: 0x166, script: 0x5b, flags: 0x0},
- 50: {region: 0x166, script: 0x5b, flags: 0x0},
- 51: {region: 0x96, script: 0x5b, flags: 0x0},
- 52: {region: 0x166, script: 0x5, flags: 0x0},
- 53: {region: 0x123, script: 0x5, flags: 0x0},
- 54: {region: 0x166, script: 0x5b, flags: 0x0},
- 55: {region: 0x166, script: 0x5b, flags: 0x0},
- 56: {region: 0x166, script: 0x5b, flags: 0x0},
- 57: {region: 0x166, script: 0x5b, flags: 0x0},
- 58: {region: 0x6c, script: 0x5, flags: 0x0},
- 59: {region: 0x0, script: 0x3, flags: 0x1},
- 60: {region: 0x166, script: 0x5b, flags: 0x0},
- 61: {region: 0x51, script: 0x5b, flags: 0x0},
- 62: {region: 0x3f, script: 0x5b, flags: 0x0},
- 63: {region: 0x68, script: 0x5, flags: 0x0},
- 65: {region: 0xbb, script: 0x5, flags: 0x0},
- 66: {region: 0x6c, script: 0x5, flags: 0x0},
- 67: {region: 0x9a, script: 0xe, flags: 0x0},
- 68: {region: 0x130, script: 0x5b, flags: 0x0},
- 69: {region: 0x136, script: 0xd0, flags: 0x0},
- 70: {region: 0x166, script: 0x5b, flags: 0x0},
- 71: {region: 0x166, script: 0x5b, flags: 0x0},
- 72: {region: 0x6f, script: 0x5b, flags: 0x0},
- 73: {region: 0x166, script: 0x5b, flags: 0x0},
- 74: {region: 0x166, script: 0x5b, flags: 0x0},
- 75: {region: 0x49, script: 0x5b, flags: 0x0},
- 76: {region: 0x166, script: 0x5b, flags: 0x0},
- 77: {region: 0x107, script: 0x20, flags: 0x0},
- 78: {region: 0x166, script: 0x5, flags: 0x0},
- 79: {region: 0x166, script: 0x5b, flags: 0x0},
- 80: {region: 0x166, script: 0x5b, flags: 0x0},
- 81: {region: 0x166, script: 0x5b, flags: 0x0},
- 82: {region: 0x9a, script: 0x22, flags: 0x0},
- 83: {region: 0x166, script: 0x5b, flags: 0x0},
- 84: {region: 0x166, script: 0x5b, flags: 0x0},
- 85: {region: 0x166, script: 0x5b, flags: 0x0},
- 86: {region: 0x3f, script: 0x5b, flags: 0x0},
- 87: {region: 0x166, script: 0x5b, flags: 0x0},
- 88: {region: 0x3, script: 0x5, flags: 0x1},
- 89: {region: 0x107, script: 0x20, flags: 0x0},
- 90: {region: 0xe9, script: 0x5, flags: 0x0},
- 91: {region: 0x96, script: 0x5b, flags: 0x0},
- 92: {region: 0xdc, script: 0x22, flags: 0x0},
- 93: {region: 0x2e, script: 0x5b, flags: 0x0},
- 94: {region: 0x52, script: 0x5b, flags: 0x0},
- 95: {region: 0x166, script: 0x5b, flags: 0x0},
- 96: {region: 0x52, script: 0xb, flags: 0x0},
- 97: {region: 0x166, script: 0x5b, flags: 0x0},
- 98: {region: 0x166, script: 0x5b, flags: 0x0},
- 99: {region: 0x96, script: 0x5b, flags: 0x0},
- 100: {region: 0x166, script: 0x5b, flags: 0x0},
- 101: {region: 0x52, script: 0x5b, flags: 0x0},
- 102: {region: 0x166, script: 0x5b, flags: 0x0},
- 103: {region: 0x166, script: 0x5b, flags: 0x0},
- 104: {region: 0x166, script: 0x5b, flags: 0x0},
- 105: {region: 0x166, script: 0x5b, flags: 0x0},
- 106: {region: 0x4f, script: 0x5b, flags: 0x0},
- 107: {region: 0x166, script: 0x5b, flags: 0x0},
- 108: {region: 0x166, script: 0x5b, flags: 0x0},
- 109: {region: 0x166, script: 0x5b, flags: 0x0},
- 110: {region: 0x166, script: 0x2c, flags: 0x0},
- 111: {region: 0x166, script: 0x5b, flags: 0x0},
- 112: {region: 0x166, script: 0x5b, flags: 0x0},
- 113: {region: 0x47, script: 0x20, flags: 0x0},
- 114: {region: 0x166, script: 0x5b, flags: 0x0},
- 115: {region: 0x166, script: 0x5b, flags: 0x0},
- 116: {region: 0x10c, script: 0x5, flags: 0x0},
- 117: {region: 0x163, script: 0x5b, flags: 0x0},
- 118: {region: 0x166, script: 0x5b, flags: 0x0},
- 119: {region: 0x96, script: 0x5b, flags: 0x0},
- 120: {region: 0x166, script: 0x5b, flags: 0x0},
- 121: {region: 0x130, script: 0x5b, flags: 0x0},
- 122: {region: 0x52, script: 0x5b, flags: 0x0},
- 123: {region: 0x9a, script: 0xe6, flags: 0x0},
- 124: {region: 0xe9, script: 0x5, flags: 0x0},
- 125: {region: 0x9a, script: 0x22, flags: 0x0},
- 126: {region: 0x38, script: 0x20, flags: 0x0},
- 127: {region: 0x9a, script: 0x22, flags: 0x0},
- 128: {region: 0xe9, script: 0x5, flags: 0x0},
- 129: {region: 0x12c, script: 0x34, flags: 0x0},
- 131: {region: 0x9a, script: 0x22, flags: 0x0},
- 132: {region: 0x166, script: 0x5b, flags: 0x0},
- 133: {region: 0x9a, script: 0x22, flags: 0x0},
- 134: {region: 0xe8, script: 0x5b, flags: 0x0},
- 135: {region: 0x166, script: 0x5b, flags: 0x0},
- 136: {region: 0x9a, script: 0x22, flags: 0x0},
- 137: {region: 0x166, script: 0x5b, flags: 0x0},
- 138: {region: 0x140, script: 0x5b, flags: 0x0},
- 139: {region: 0x166, script: 0x5b, flags: 0x0},
- 140: {region: 0x166, script: 0x5b, flags: 0x0},
- 141: {region: 0xe8, script: 0x5b, flags: 0x0},
- 142: {region: 0x166, script: 0x5b, flags: 0x0},
- 143: {region: 0xd7, script: 0x5b, flags: 0x0},
- 144: {region: 0x166, script: 0x5b, flags: 0x0},
- 145: {region: 0x166, script: 0x5b, flags: 0x0},
- 146: {region: 0x166, script: 0x5b, flags: 0x0},
- 147: {region: 0x166, script: 0x2c, flags: 0x0},
- 148: {region: 0x9a, script: 0x22, flags: 0x0},
- 149: {region: 0x96, script: 0x5b, flags: 0x0},
- 150: {region: 0x166, script: 0x5b, flags: 0x0},
- 151: {region: 0x166, script: 0x5b, flags: 0x0},
- 152: {region: 0x115, script: 0x5b, flags: 0x0},
- 153: {region: 0x166, script: 0x5b, flags: 0x0},
- 154: {region: 0x166, script: 0x5b, flags: 0x0},
- 155: {region: 0x52, script: 0x5b, flags: 0x0},
- 156: {region: 0x166, script: 0x5b, flags: 0x0},
- 157: {region: 0xe8, script: 0x5b, flags: 0x0},
- 158: {region: 0x166, script: 0x5b, flags: 0x0},
- 159: {region: 0x13f, script: 0xe8, flags: 0x0},
- 160: {region: 0xc4, script: 0x5b, flags: 0x0},
- 161: {region: 0x166, script: 0x5b, flags: 0x0},
- 162: {region: 0x166, script: 0x5b, flags: 0x0},
- 163: {region: 0xc4, script: 0x5b, flags: 0x0},
- 164: {region: 0x166, script: 0x5b, flags: 0x0},
- 165: {region: 0x35, script: 0xe, flags: 0x0},
- 166: {region: 0x166, script: 0x5b, flags: 0x0},
- 167: {region: 0x166, script: 0x5b, flags: 0x0},
- 168: {region: 0x166, script: 0x5b, flags: 0x0},
- 169: {region: 0x53, script: 0xef, flags: 0x0},
- 170: {region: 0x166, script: 0x5b, flags: 0x0},
- 171: {region: 0x166, script: 0x5b, flags: 0x0},
- 172: {region: 0x166, script: 0x5b, flags: 0x0},
- 173: {region: 0x9a, script: 0xe, flags: 0x0},
- 174: {region: 0x166, script: 0x5b, flags: 0x0},
- 175: {region: 0x9d, script: 0x5, flags: 0x0},
- 176: {region: 0x166, script: 0x5b, flags: 0x0},
- 177: {region: 0x4f, script: 0x5b, flags: 0x0},
- 178: {region: 0x79, script: 0x5b, flags: 0x0},
- 179: {region: 0x9a, script: 0x22, flags: 0x0},
- 180: {region: 0xe9, script: 0x5, flags: 0x0},
- 181: {region: 0x9a, script: 0x22, flags: 0x0},
- 182: {region: 0x166, script: 0x5b, flags: 0x0},
- 183: {region: 0x33, script: 0x5b, flags: 0x0},
- 184: {region: 0x166, script: 0x5b, flags: 0x0},
- 185: {region: 0xb5, script: 0xc, flags: 0x0},
- 186: {region: 0x52, script: 0x5b, flags: 0x0},
- 187: {region: 0x166, script: 0x2c, flags: 0x0},
- 188: {region: 0xe8, script: 0x5b, flags: 0x0},
- 189: {region: 0x166, script: 0x5b, flags: 0x0},
- 190: {region: 0xe9, script: 0x22, flags: 0x0},
- 191: {region: 0x107, script: 0x20, flags: 0x0},
- 192: {region: 0x160, script: 0x5b, flags: 0x0},
- 193: {region: 0x166, script: 0x5b, flags: 0x0},
- 194: {region: 0x96, script: 0x5b, flags: 0x0},
- 195: {region: 0x166, script: 0x5b, flags: 0x0},
- 196: {region: 0x52, script: 0x5b, flags: 0x0},
- 197: {region: 0x166, script: 0x5b, flags: 0x0},
- 198: {region: 0x166, script: 0x5b, flags: 0x0},
- 199: {region: 0x166, script: 0x5b, flags: 0x0},
- 200: {region: 0x87, script: 0x5b, flags: 0x0},
- 201: {region: 0x166, script: 0x5b, flags: 0x0},
- 202: {region: 0x166, script: 0x5b, flags: 0x0},
- 203: {region: 0x166, script: 0x5b, flags: 0x0},
- 204: {region: 0x166, script: 0x5b, flags: 0x0},
- 205: {region: 0x6e, script: 0x2c, flags: 0x0},
- 206: {region: 0x166, script: 0x5b, flags: 0x0},
- 207: {region: 0x166, script: 0x5b, flags: 0x0},
- 208: {region: 0x52, script: 0x5b, flags: 0x0},
- 209: {region: 0x166, script: 0x5b, flags: 0x0},
- 210: {region: 0x166, script: 0x5b, flags: 0x0},
- 211: {region: 0xc4, script: 0x5b, flags: 0x0},
- 212: {region: 0x166, script: 0x5b, flags: 0x0},
- 213: {region: 0x166, script: 0x5b, flags: 0x0},
- 214: {region: 0x166, script: 0x5b, flags: 0x0},
- 215: {region: 0x6f, script: 0x5b, flags: 0x0},
- 216: {region: 0x166, script: 0x5b, flags: 0x0},
- 217: {region: 0x166, script: 0x5b, flags: 0x0},
- 218: {region: 0xd7, script: 0x5b, flags: 0x0},
- 219: {region: 0x35, script: 0x16, flags: 0x0},
- 220: {region: 0x107, script: 0x20, flags: 0x0},
- 221: {region: 0xe8, script: 0x5b, flags: 0x0},
- 222: {region: 0x166, script: 0x5b, flags: 0x0},
- 223: {region: 0x132, script: 0x5b, flags: 0x0},
- 224: {region: 0x8b, script: 0x5b, flags: 0x0},
- 225: {region: 0x76, script: 0x5b, flags: 0x0},
- 226: {region: 0x107, script: 0x20, flags: 0x0},
- 227: {region: 0x136, script: 0x5b, flags: 0x0},
- 228: {region: 0x49, script: 0x5b, flags: 0x0},
- 229: {region: 0x136, script: 0x1a, flags: 0x0},
- 230: {region: 0xa7, script: 0x5, flags: 0x0},
- 231: {region: 0x13f, script: 0x19, flags: 0x0},
- 232: {region: 0x166, script: 0x5b, flags: 0x0},
- 233: {region: 0x9c, script: 0x5, flags: 0x0},
- 234: {region: 0x166, script: 0x5b, flags: 0x0},
- 235: {region: 0x166, script: 0x5b, flags: 0x0},
- 236: {region: 0x166, script: 0x5b, flags: 0x0},
- 237: {region: 0x166, script: 0x5b, flags: 0x0},
- 238: {region: 0x166, script: 0x5b, flags: 0x0},
- 239: {region: 0xc6, script: 0xda, flags: 0x0},
- 240: {region: 0x79, script: 0x5b, flags: 0x0},
- 241: {region: 0x6c, script: 0x1d, flags: 0x0},
- 242: {region: 0xe8, script: 0x5b, flags: 0x0},
- 243: {region: 0x49, script: 0x17, flags: 0x0},
- 244: {region: 0x131, script: 0x20, flags: 0x0},
- 245: {region: 0x49, script: 0x17, flags: 0x0},
- 246: {region: 0x49, script: 0x17, flags: 0x0},
- 247: {region: 0x49, script: 0x17, flags: 0x0},
- 248: {region: 0x49, script: 0x17, flags: 0x0},
- 249: {region: 0x10b, script: 0x5b, flags: 0x0},
- 250: {region: 0x5f, script: 0x5b, flags: 0x0},
- 251: {region: 0xea, script: 0x5b, flags: 0x0},
- 252: {region: 0x49, script: 0x17, flags: 0x0},
- 253: {region: 0xc5, script: 0x88, flags: 0x0},
- 254: {region: 0x8, script: 0x2, flags: 0x1},
- 255: {region: 0x107, script: 0x20, flags: 0x0},
- 256: {region: 0x7c, script: 0x5b, flags: 0x0},
- 257: {region: 0x64, script: 0x5b, flags: 0x0},
- 258: {region: 0x166, script: 0x5b, flags: 0x0},
- 259: {region: 0x166, script: 0x5b, flags: 0x0},
- 260: {region: 0x166, script: 0x5b, flags: 0x0},
- 261: {region: 0x166, script: 0x5b, flags: 0x0},
- 262: {region: 0x136, script: 0x5b, flags: 0x0},
- 263: {region: 0x107, script: 0x20, flags: 0x0},
- 264: {region: 0xa5, script: 0x5b, flags: 0x0},
- 265: {region: 0x166, script: 0x5b, flags: 0x0},
- 266: {region: 0x166, script: 0x5b, flags: 0x0},
- 267: {region: 0x9a, script: 0x5, flags: 0x0},
- 268: {region: 0x166, script: 0x5b, flags: 0x0},
- 269: {region: 0x61, script: 0x5b, flags: 0x0},
- 270: {region: 0x166, script: 0x5b, flags: 0x0},
- 271: {region: 0x49, script: 0x5b, flags: 0x0},
- 272: {region: 0x166, script: 0x5b, flags: 0x0},
- 273: {region: 0x166, script: 0x5b, flags: 0x0},
- 274: {region: 0x166, script: 0x5b, flags: 0x0},
- 275: {region: 0x166, script: 0x5, flags: 0x0},
- 276: {region: 0x49, script: 0x5b, flags: 0x0},
- 277: {region: 0x166, script: 0x5b, flags: 0x0},
- 278: {region: 0x166, script: 0x5b, flags: 0x0},
- 279: {region: 0xd5, script: 0x5b, flags: 0x0},
- 280: {region: 0x4f, script: 0x5b, flags: 0x0},
- 281: {region: 0x166, script: 0x5b, flags: 0x0},
- 282: {region: 0x9a, script: 0x5, flags: 0x0},
- 283: {region: 0x166, script: 0x5b, flags: 0x0},
- 284: {region: 0x166, script: 0x5b, flags: 0x0},
- 285: {region: 0x166, script: 0x5b, flags: 0x0},
- 286: {region: 0x166, script: 0x2c, flags: 0x0},
- 287: {region: 0x61, script: 0x5b, flags: 0x0},
- 288: {region: 0xc4, script: 0x5b, flags: 0x0},
- 289: {region: 0xd1, script: 0x5b, flags: 0x0},
- 290: {region: 0x166, script: 0x5b, flags: 0x0},
- 291: {region: 0xdc, script: 0x22, flags: 0x0},
- 292: {region: 0x52, script: 0x5b, flags: 0x0},
- 293: {region: 0x166, script: 0x5b, flags: 0x0},
- 294: {region: 0x166, script: 0x5b, flags: 0x0},
- 295: {region: 0x166, script: 0x5b, flags: 0x0},
- 296: {region: 0xce, script: 0xed, flags: 0x0},
- 297: {region: 0x166, script: 0x5b, flags: 0x0},
- 298: {region: 0x166, script: 0x5b, flags: 0x0},
- 299: {region: 0x115, script: 0x5b, flags: 0x0},
- 300: {region: 0x37, script: 0x5b, flags: 0x0},
- 301: {region: 0x43, script: 0xef, flags: 0x0},
- 302: {region: 0x166, script: 0x5b, flags: 0x0},
- 303: {region: 0xa5, script: 0x5b, flags: 0x0},
- 304: {region: 0x81, script: 0x5b, flags: 0x0},
- 305: {region: 0xd7, script: 0x5b, flags: 0x0},
- 306: {region: 0x9f, script: 0x5b, flags: 0x0},
- 307: {region: 0x6c, script: 0x29, flags: 0x0},
- 308: {region: 0x166, script: 0x5b, flags: 0x0},
- 309: {region: 0xc5, script: 0x4b, flags: 0x0},
- 310: {region: 0x88, script: 0x34, flags: 0x0},
- 311: {region: 0x166, script: 0x5b, flags: 0x0},
- 312: {region: 0x166, script: 0x5b, flags: 0x0},
- 313: {region: 0xa, script: 0x2, flags: 0x1},
- 314: {region: 0x166, script: 0x5b, flags: 0x0},
- 315: {region: 0x166, script: 0x5b, flags: 0x0},
- 316: {region: 0x1, script: 0x5b, flags: 0x0},
- 317: {region: 0x166, script: 0x5b, flags: 0x0},
- 318: {region: 0x6f, script: 0x5b, flags: 0x0},
- 319: {region: 0x136, script: 0x5b, flags: 0x0},
- 320: {region: 0x6b, script: 0x5b, flags: 0x0},
- 321: {region: 0x166, script: 0x5b, flags: 0x0},
- 322: {region: 0x9f, script: 0x46, flags: 0x0},
- 323: {region: 0x166, script: 0x5b, flags: 0x0},
- 324: {region: 0x166, script: 0x5b, flags: 0x0},
- 325: {region: 0x6f, script: 0x5b, flags: 0x0},
- 326: {region: 0x52, script: 0x5b, flags: 0x0},
- 327: {region: 0x6f, script: 0x5b, flags: 0x0},
- 328: {region: 0x9d, script: 0x5, flags: 0x0},
- 329: {region: 0x166, script: 0x5b, flags: 0x0},
- 330: {region: 0x166, script: 0x5b, flags: 0x0},
- 331: {region: 0x166, script: 0x5b, flags: 0x0},
- 332: {region: 0x166, script: 0x5b, flags: 0x0},
- 333: {region: 0x87, script: 0x5b, flags: 0x0},
- 334: {region: 0xc, script: 0x2, flags: 0x1},
- 335: {region: 0x166, script: 0x5b, flags: 0x0},
- 336: {region: 0xc4, script: 0x5b, flags: 0x0},
- 337: {region: 0x73, script: 0x5b, flags: 0x0},
- 338: {region: 0x10c, script: 0x5, flags: 0x0},
- 339: {region: 0xe8, script: 0x5b, flags: 0x0},
- 340: {region: 0x10d, script: 0x5b, flags: 0x0},
- 341: {region: 0x74, script: 0x5b, flags: 0x0},
- 342: {region: 0x166, script: 0x5b, flags: 0x0},
- 343: {region: 0x166, script: 0x5b, flags: 0x0},
- 344: {region: 0x77, script: 0x5b, flags: 0x0},
- 345: {region: 0x166, script: 0x5b, flags: 0x0},
- 346: {region: 0x3b, script: 0x5b, flags: 0x0},
- 347: {region: 0x166, script: 0x5b, flags: 0x0},
- 348: {region: 0x166, script: 0x5b, flags: 0x0},
- 349: {region: 0x166, script: 0x5b, flags: 0x0},
- 350: {region: 0x79, script: 0x5b, flags: 0x0},
- 351: {region: 0x136, script: 0x5b, flags: 0x0},
- 352: {region: 0x79, script: 0x5b, flags: 0x0},
- 353: {region: 0x61, script: 0x5b, flags: 0x0},
- 354: {region: 0x61, script: 0x5b, flags: 0x0},
- 355: {region: 0x52, script: 0x5, flags: 0x0},
- 356: {region: 0x141, script: 0x5b, flags: 0x0},
- 357: {region: 0x166, script: 0x5b, flags: 0x0},
- 358: {region: 0x85, script: 0x5b, flags: 0x0},
- 359: {region: 0x166, script: 0x5b, flags: 0x0},
- 360: {region: 0xd5, script: 0x5b, flags: 0x0},
- 361: {region: 0x9f, script: 0x5b, flags: 0x0},
- 362: {region: 0xd7, script: 0x5b, flags: 0x0},
- 363: {region: 0x166, script: 0x5b, flags: 0x0},
- 364: {region: 0x10c, script: 0x5b, flags: 0x0},
- 365: {region: 0xda, script: 0x5b, flags: 0x0},
- 366: {region: 0x97, script: 0x5b, flags: 0x0},
- 367: {region: 0x81, script: 0x5b, flags: 0x0},
- 368: {region: 0x166, script: 0x5b, flags: 0x0},
- 369: {region: 0xbd, script: 0x5b, flags: 0x0},
- 370: {region: 0x166, script: 0x5b, flags: 0x0},
- 371: {region: 0x166, script: 0x5b, flags: 0x0},
- 372: {region: 0x166, script: 0x5b, flags: 0x0},
- 373: {region: 0x53, script: 0x3b, flags: 0x0},
- 374: {region: 0x166, script: 0x5b, flags: 0x0},
- 375: {region: 0x96, script: 0x5b, flags: 0x0},
- 376: {region: 0x166, script: 0x5b, flags: 0x0},
- 377: {region: 0x166, script: 0x5b, flags: 0x0},
- 378: {region: 0x9a, script: 0x22, flags: 0x0},
- 379: {region: 0x166, script: 0x5b, flags: 0x0},
- 380: {region: 0x9d, script: 0x5, flags: 0x0},
- 381: {region: 0x7f, script: 0x5b, flags: 0x0},
- 382: {region: 0x7c, script: 0x5b, flags: 0x0},
- 383: {region: 0x166, script: 0x5b, flags: 0x0},
- 384: {region: 0x166, script: 0x5b, flags: 0x0},
- 385: {region: 0x166, script: 0x5b, flags: 0x0},
- 386: {region: 0x166, script: 0x5b, flags: 0x0},
- 387: {region: 0x166, script: 0x5b, flags: 0x0},
- 388: {region: 0x166, script: 0x5b, flags: 0x0},
- 389: {region: 0x70, script: 0x2c, flags: 0x0},
- 390: {region: 0x166, script: 0x5b, flags: 0x0},
- 391: {region: 0xdc, script: 0x22, flags: 0x0},
- 392: {region: 0x166, script: 0x5b, flags: 0x0},
- 393: {region: 0xa8, script: 0x5b, flags: 0x0},
- 394: {region: 0x166, script: 0x5b, flags: 0x0},
- 395: {region: 0xe9, script: 0x5, flags: 0x0},
- 396: {region: 0x166, script: 0x5b, flags: 0x0},
- 397: {region: 0xe9, script: 0x5, flags: 0x0},
- 398: {region: 0x166, script: 0x5b, flags: 0x0},
- 399: {region: 0x166, script: 0x5b, flags: 0x0},
- 400: {region: 0x6f, script: 0x5b, flags: 0x0},
- 401: {region: 0x9d, script: 0x5, flags: 0x0},
- 402: {region: 0x166, script: 0x5b, flags: 0x0},
- 403: {region: 0x166, script: 0x2c, flags: 0x0},
- 404: {region: 0xf2, script: 0x5b, flags: 0x0},
- 405: {region: 0x166, script: 0x5b, flags: 0x0},
- 406: {region: 0x166, script: 0x5b, flags: 0x0},
- 407: {region: 0x166, script: 0x5b, flags: 0x0},
- 408: {region: 0x166, script: 0x2c, flags: 0x0},
- 409: {region: 0x166, script: 0x5b, flags: 0x0},
- 410: {region: 0x9a, script: 0x22, flags: 0x0},
- 411: {region: 0x9a, script: 0xe9, flags: 0x0},
- 412: {region: 0x96, script: 0x5b, flags: 0x0},
- 413: {region: 0xda, script: 0x5b, flags: 0x0},
- 414: {region: 0x131, script: 0x32, flags: 0x0},
- 415: {region: 0x166, script: 0x5b, flags: 0x0},
- 416: {region: 0xe, script: 0x2, flags: 0x1},
- 417: {region: 0x9a, script: 0xe, flags: 0x0},
- 418: {region: 0x166, script: 0x5b, flags: 0x0},
- 419: {region: 0x4e, script: 0x5b, flags: 0x0},
- 420: {region: 0x9a, script: 0x35, flags: 0x0},
- 421: {region: 0x41, script: 0x5b, flags: 0x0},
- 422: {region: 0x54, script: 0x5b, flags: 0x0},
- 423: {region: 0x166, script: 0x5b, flags: 0x0},
- 424: {region: 0x81, script: 0x5b, flags: 0x0},
- 425: {region: 0x166, script: 0x5b, flags: 0x0},
- 426: {region: 0x166, script: 0x5b, flags: 0x0},
- 427: {region: 0xa5, script: 0x5b, flags: 0x0},
- 428: {region: 0x99, script: 0x5b, flags: 0x0},
- 429: {region: 0x166, script: 0x5b, flags: 0x0},
- 430: {region: 0xdc, script: 0x22, flags: 0x0},
- 431: {region: 0x166, script: 0x5b, flags: 0x0},
- 432: {region: 0x166, script: 0x5, flags: 0x0},
- 433: {region: 0x49, script: 0x5b, flags: 0x0},
- 434: {region: 0x166, script: 0x5, flags: 0x0},
- 435: {region: 0x166, script: 0x5b, flags: 0x0},
- 436: {region: 0x10, script: 0x3, flags: 0x1},
- 437: {region: 0x166, script: 0x5b, flags: 0x0},
- 438: {region: 0x53, script: 0x3b, flags: 0x0},
- 439: {region: 0x166, script: 0x5b, flags: 0x0},
- 440: {region: 0x136, script: 0x5b, flags: 0x0},
- 441: {region: 0x24, script: 0x5, flags: 0x0},
- 442: {region: 0x166, script: 0x5b, flags: 0x0},
- 443: {region: 0x166, script: 0x2c, flags: 0x0},
- 444: {region: 0x98, script: 0x3e, flags: 0x0},
- 445: {region: 0x166, script: 0x5b, flags: 0x0},
- 446: {region: 0x9a, script: 0x22, flags: 0x0},
- 447: {region: 0x166, script: 0x5b, flags: 0x0},
- 448: {region: 0x74, script: 0x5b, flags: 0x0},
- 449: {region: 0x166, script: 0x5b, flags: 0x0},
- 450: {region: 0x166, script: 0x5b, flags: 0x0},
- 451: {region: 0xe8, script: 0x5b, flags: 0x0},
- 452: {region: 0x166, script: 0x5b, flags: 0x0},
- 453: {region: 0x12c, script: 0x40, flags: 0x0},
- 454: {region: 0x53, script: 0x92, flags: 0x0},
- 455: {region: 0x166, script: 0x5b, flags: 0x0},
- 456: {region: 0xe9, script: 0x5, flags: 0x0},
- 457: {region: 0x9a, script: 0x22, flags: 0x0},
- 458: {region: 0xb0, script: 0x41, flags: 0x0},
- 459: {region: 0xe8, script: 0x5b, flags: 0x0},
- 460: {region: 0xe9, script: 0x5, flags: 0x0},
- 461: {region: 0xe7, script: 0x5b, flags: 0x0},
- 462: {region: 0x9a, script: 0x22, flags: 0x0},
- 463: {region: 0x9a, script: 0x22, flags: 0x0},
- 464: {region: 0x166, script: 0x5b, flags: 0x0},
- 465: {region: 0x91, script: 0x5b, flags: 0x0},
- 466: {region: 0x61, script: 0x5b, flags: 0x0},
- 467: {region: 0x53, script: 0x3b, flags: 0x0},
- 468: {region: 0x92, script: 0x5b, flags: 0x0},
- 469: {region: 0x93, script: 0x5b, flags: 0x0},
- 470: {region: 0x166, script: 0x5b, flags: 0x0},
- 471: {region: 0x28, script: 0x8, flags: 0x0},
- 472: {region: 0xd3, script: 0x5b, flags: 0x0},
- 473: {region: 0x79, script: 0x5b, flags: 0x0},
- 474: {region: 0x166, script: 0x5b, flags: 0x0},
- 475: {region: 0x166, script: 0x5b, flags: 0x0},
- 476: {region: 0xd1, script: 0x5b, flags: 0x0},
- 477: {region: 0xd7, script: 0x5b, flags: 0x0},
- 478: {region: 0x166, script: 0x5b, flags: 0x0},
- 479: {region: 0x166, script: 0x5b, flags: 0x0},
- 480: {region: 0x166, script: 0x5b, flags: 0x0},
- 481: {region: 0x96, script: 0x5b, flags: 0x0},
- 482: {region: 0x166, script: 0x5b, flags: 0x0},
- 483: {region: 0x166, script: 0x5b, flags: 0x0},
- 484: {region: 0x166, script: 0x5b, flags: 0x0},
- 486: {region: 0x123, script: 0x5b, flags: 0x0},
- 487: {region: 0xd7, script: 0x5b, flags: 0x0},
- 488: {region: 0x166, script: 0x5b, flags: 0x0},
- 489: {region: 0x166, script: 0x5b, flags: 0x0},
- 490: {region: 0x53, script: 0xfd, flags: 0x0},
- 491: {region: 0x166, script: 0x5b, flags: 0x0},
- 492: {region: 0x136, script: 0x5b, flags: 0x0},
- 493: {region: 0x166, script: 0x5b, flags: 0x0},
- 494: {region: 0x49, script: 0x5b, flags: 0x0},
- 495: {region: 0x166, script: 0x5b, flags: 0x0},
- 496: {region: 0x166, script: 0x5b, flags: 0x0},
- 497: {region: 0xe8, script: 0x5b, flags: 0x0},
- 498: {region: 0x166, script: 0x5b, flags: 0x0},
- 499: {region: 0x96, script: 0x5b, flags: 0x0},
- 500: {region: 0x107, script: 0x20, flags: 0x0},
- 501: {region: 0x1, script: 0x5b, flags: 0x0},
- 502: {region: 0x166, script: 0x5b, flags: 0x0},
- 503: {region: 0x166, script: 0x5b, flags: 0x0},
- 504: {region: 0x9e, script: 0x5b, flags: 0x0},
- 505: {region: 0x9f, script: 0x5b, flags: 0x0},
- 506: {region: 0x49, script: 0x17, flags: 0x0},
- 507: {region: 0x98, script: 0x3e, flags: 0x0},
- 508: {region: 0x166, script: 0x5b, flags: 0x0},
- 509: {region: 0x166, script: 0x5b, flags: 0x0},
- 510: {region: 0x107, script: 0x5b, flags: 0x0},
- 511: {region: 0x166, script: 0x5b, flags: 0x0},
- 512: {region: 0xa3, script: 0x49, flags: 0x0},
- 513: {region: 0x166, script: 0x5b, flags: 0x0},
- 514: {region: 0xa1, script: 0x5b, flags: 0x0},
- 515: {region: 0x1, script: 0x5b, flags: 0x0},
- 516: {region: 0x166, script: 0x5b, flags: 0x0},
- 517: {region: 0x166, script: 0x5b, flags: 0x0},
- 518: {region: 0x166, script: 0x5b, flags: 0x0},
- 519: {region: 0x52, script: 0x5b, flags: 0x0},
- 520: {region: 0x131, script: 0x3e, flags: 0x0},
- 521: {region: 0x166, script: 0x5b, flags: 0x0},
- 522: {region: 0x130, script: 0x5b, flags: 0x0},
- 523: {region: 0xdc, script: 0x22, flags: 0x0},
- 524: {region: 0x166, script: 0x5b, flags: 0x0},
- 525: {region: 0x64, script: 0x5b, flags: 0x0},
- 526: {region: 0x96, script: 0x5b, flags: 0x0},
- 527: {region: 0x96, script: 0x5b, flags: 0x0},
- 528: {region: 0x7e, script: 0x2e, flags: 0x0},
- 529: {region: 0x138, script: 0x20, flags: 0x0},
- 530: {region: 0x68, script: 0x5b, flags: 0x0},
- 531: {region: 0xc5, script: 0x5b, flags: 0x0},
- 532: {region: 0x166, script: 0x5b, flags: 0x0},
- 533: {region: 0x166, script: 0x5b, flags: 0x0},
- 534: {region: 0xd7, script: 0x5b, flags: 0x0},
- 535: {region: 0xa5, script: 0x5b, flags: 0x0},
- 536: {region: 0xc4, script: 0x5b, flags: 0x0},
- 537: {region: 0x107, script: 0x20, flags: 0x0},
- 538: {region: 0x166, script: 0x5b, flags: 0x0},
- 539: {region: 0x166, script: 0x5b, flags: 0x0},
- 540: {region: 0x166, script: 0x5b, flags: 0x0},
- 541: {region: 0x166, script: 0x5b, flags: 0x0},
- 542: {region: 0xd5, script: 0x5, flags: 0x0},
- 543: {region: 0xd7, script: 0x5b, flags: 0x0},
- 544: {region: 0x165, script: 0x5b, flags: 0x0},
- 545: {region: 0x166, script: 0x5b, flags: 0x0},
- 546: {region: 0x166, script: 0x5b, flags: 0x0},
- 547: {region: 0x130, script: 0x5b, flags: 0x0},
- 548: {region: 0x123, script: 0x5, flags: 0x0},
- 549: {region: 0x166, script: 0x5b, flags: 0x0},
- 550: {region: 0x124, script: 0xee, flags: 0x0},
- 551: {region: 0x5b, script: 0x5b, flags: 0x0},
- 552: {region: 0x52, script: 0x5b, flags: 0x0},
- 553: {region: 0x166, script: 0x5b, flags: 0x0},
- 554: {region: 0x4f, script: 0x5b, flags: 0x0},
- 555: {region: 0x9a, script: 0x22, flags: 0x0},
- 556: {region: 0x9a, script: 0x22, flags: 0x0},
- 557: {region: 0x4b, script: 0x5b, flags: 0x0},
- 558: {region: 0x96, script: 0x5b, flags: 0x0},
- 559: {region: 0x166, script: 0x5b, flags: 0x0},
- 560: {region: 0x41, script: 0x5b, flags: 0x0},
- 561: {region: 0x9a, script: 0x5b, flags: 0x0},
- 562: {region: 0x53, script: 0xe5, flags: 0x0},
- 563: {region: 0x9a, script: 0x22, flags: 0x0},
- 564: {region: 0xc4, script: 0x5b, flags: 0x0},
- 565: {region: 0x166, script: 0x5b, flags: 0x0},
- 566: {region: 0x9a, script: 0x76, flags: 0x0},
- 567: {region: 0xe9, script: 0x5, flags: 0x0},
- 568: {region: 0x166, script: 0x5b, flags: 0x0},
- 569: {region: 0xa5, script: 0x5b, flags: 0x0},
- 570: {region: 0x166, script: 0x5b, flags: 0x0},
- 571: {region: 0x12c, script: 0x5b, flags: 0x0},
- 572: {region: 0x166, script: 0x5b, flags: 0x0},
- 573: {region: 0xd3, script: 0x5b, flags: 0x0},
- 574: {region: 0x166, script: 0x5b, flags: 0x0},
- 575: {region: 0xb0, script: 0x58, flags: 0x0},
- 576: {region: 0x166, script: 0x5b, flags: 0x0},
- 577: {region: 0x166, script: 0x5b, flags: 0x0},
- 578: {region: 0x13, script: 0x6, flags: 0x1},
- 579: {region: 0x166, script: 0x5b, flags: 0x0},
- 580: {region: 0x52, script: 0x5b, flags: 0x0},
- 581: {region: 0x83, script: 0x5b, flags: 0x0},
- 582: {region: 0xa5, script: 0x5b, flags: 0x0},
- 583: {region: 0x166, script: 0x5b, flags: 0x0},
- 584: {region: 0x166, script: 0x5b, flags: 0x0},
- 585: {region: 0x166, script: 0x5b, flags: 0x0},
- 586: {region: 0xa7, script: 0x4f, flags: 0x0},
- 587: {region: 0x2a, script: 0x5b, flags: 0x0},
- 588: {region: 0x166, script: 0x5b, flags: 0x0},
- 589: {region: 0x166, script: 0x5b, flags: 0x0},
- 590: {region: 0x166, script: 0x5b, flags: 0x0},
- 591: {region: 0x166, script: 0x5b, flags: 0x0},
- 592: {region: 0x166, script: 0x5b, flags: 0x0},
- 593: {region: 0x9a, script: 0x53, flags: 0x0},
- 594: {region: 0x8c, script: 0x5b, flags: 0x0},
- 595: {region: 0x166, script: 0x5b, flags: 0x0},
- 596: {region: 0xac, script: 0x54, flags: 0x0},
- 597: {region: 0x107, script: 0x20, flags: 0x0},
- 598: {region: 0x9a, script: 0x22, flags: 0x0},
- 599: {region: 0x166, script: 0x5b, flags: 0x0},
- 600: {region: 0x76, script: 0x5b, flags: 0x0},
- 601: {region: 0x166, script: 0x5b, flags: 0x0},
- 602: {region: 0xb5, script: 0x5b, flags: 0x0},
- 603: {region: 0x166, script: 0x5b, flags: 0x0},
- 604: {region: 0x166, script: 0x5b, flags: 0x0},
- 605: {region: 0x166, script: 0x5b, flags: 0x0},
- 606: {region: 0x166, script: 0x5b, flags: 0x0},
- 607: {region: 0x166, script: 0x5b, flags: 0x0},
- 608: {region: 0x166, script: 0x5b, flags: 0x0},
- 609: {region: 0x166, script: 0x5b, flags: 0x0},
- 610: {region: 0x166, script: 0x2c, flags: 0x0},
- 611: {region: 0x166, script: 0x5b, flags: 0x0},
- 612: {region: 0x107, script: 0x20, flags: 0x0},
- 613: {region: 0x113, script: 0x5b, flags: 0x0},
- 614: {region: 0xe8, script: 0x5b, flags: 0x0},
- 615: {region: 0x107, script: 0x5b, flags: 0x0},
- 616: {region: 0x166, script: 0x5b, flags: 0x0},
- 617: {region: 0x9a, script: 0x22, flags: 0x0},
- 618: {region: 0x9a, script: 0x5, flags: 0x0},
- 619: {region: 0x130, script: 0x5b, flags: 0x0},
- 620: {region: 0x166, script: 0x5b, flags: 0x0},
- 621: {region: 0x52, script: 0x5b, flags: 0x0},
- 622: {region: 0x61, script: 0x5b, flags: 0x0},
- 623: {region: 0x166, script: 0x5b, flags: 0x0},
- 624: {region: 0x166, script: 0x5b, flags: 0x0},
- 625: {region: 0x166, script: 0x2c, flags: 0x0},
- 626: {region: 0x166, script: 0x5b, flags: 0x0},
- 627: {region: 0x166, script: 0x5b, flags: 0x0},
- 628: {region: 0x19, script: 0x3, flags: 0x1},
- 629: {region: 0x166, script: 0x5b, flags: 0x0},
- 630: {region: 0x166, script: 0x5b, flags: 0x0},
- 631: {region: 0x166, script: 0x5b, flags: 0x0},
- 632: {region: 0x166, script: 0x5b, flags: 0x0},
- 633: {region: 0x107, script: 0x20, flags: 0x0},
- 634: {region: 0x166, script: 0x5b, flags: 0x0},
- 635: {region: 0x166, script: 0x5b, flags: 0x0},
- 636: {region: 0x166, script: 0x5b, flags: 0x0},
- 637: {region: 0x107, script: 0x20, flags: 0x0},
- 638: {region: 0x166, script: 0x5b, flags: 0x0},
- 639: {region: 0x96, script: 0x5b, flags: 0x0},
- 640: {region: 0xe9, script: 0x5, flags: 0x0},
- 641: {region: 0x7c, script: 0x5b, flags: 0x0},
- 642: {region: 0x166, script: 0x5b, flags: 0x0},
- 643: {region: 0x166, script: 0x5b, flags: 0x0},
- 644: {region: 0x166, script: 0x5b, flags: 0x0},
- 645: {region: 0x166, script: 0x2c, flags: 0x0},
- 646: {region: 0x124, script: 0xee, flags: 0x0},
- 647: {region: 0xe9, script: 0x5, flags: 0x0},
- 648: {region: 0x166, script: 0x5b, flags: 0x0},
- 649: {region: 0x166, script: 0x5b, flags: 0x0},
- 650: {region: 0x1c, script: 0x5, flags: 0x1},
- 651: {region: 0x166, script: 0x5b, flags: 0x0},
- 652: {region: 0x166, script: 0x5b, flags: 0x0},
- 653: {region: 0x166, script: 0x5b, flags: 0x0},
- 654: {region: 0x139, script: 0x5b, flags: 0x0},
- 655: {region: 0x88, script: 0x5f, flags: 0x0},
- 656: {region: 0x98, script: 0x3e, flags: 0x0},
- 657: {region: 0x130, script: 0x5b, flags: 0x0},
- 658: {region: 0xe9, script: 0x5, flags: 0x0},
- 659: {region: 0x132, script: 0x5b, flags: 0x0},
- 660: {region: 0x166, script: 0x5b, flags: 0x0},
- 661: {region: 0xb8, script: 0x5b, flags: 0x0},
- 662: {region: 0x107, script: 0x20, flags: 0x0},
- 663: {region: 0x166, script: 0x5b, flags: 0x0},
- 664: {region: 0x96, script: 0x5b, flags: 0x0},
- 665: {region: 0x166, script: 0x5b, flags: 0x0},
- 666: {region: 0x53, script: 0xee, flags: 0x0},
- 667: {region: 0x166, script: 0x5b, flags: 0x0},
- 668: {region: 0x166, script: 0x5b, flags: 0x0},
- 669: {region: 0x166, script: 0x5b, flags: 0x0},
- 670: {region: 0x166, script: 0x5b, flags: 0x0},
- 671: {region: 0x9a, script: 0x5d, flags: 0x0},
- 672: {region: 0x166, script: 0x5b, flags: 0x0},
- 673: {region: 0x166, script: 0x5b, flags: 0x0},
- 674: {region: 0x107, script: 0x20, flags: 0x0},
- 675: {region: 0x132, script: 0x5b, flags: 0x0},
- 676: {region: 0x166, script: 0x5b, flags: 0x0},
- 677: {region: 0xda, script: 0x5b, flags: 0x0},
- 678: {region: 0x166, script: 0x5b, flags: 0x0},
- 679: {region: 0x166, script: 0x5b, flags: 0x0},
- 680: {region: 0x21, script: 0x2, flags: 0x1},
- 681: {region: 0x166, script: 0x5b, flags: 0x0},
- 682: {region: 0x166, script: 0x5b, flags: 0x0},
- 683: {region: 0x9f, script: 0x5b, flags: 0x0},
- 684: {region: 0x53, script: 0x61, flags: 0x0},
- 685: {region: 0x96, script: 0x5b, flags: 0x0},
- 686: {region: 0x9d, script: 0x5, flags: 0x0},
- 687: {region: 0x136, script: 0x5b, flags: 0x0},
- 688: {region: 0x166, script: 0x5b, flags: 0x0},
- 689: {region: 0x166, script: 0x5b, flags: 0x0},
- 690: {region: 0x9a, script: 0xe9, flags: 0x0},
- 691: {region: 0x9f, script: 0x5b, flags: 0x0},
- 692: {region: 0x166, script: 0x5b, flags: 0x0},
- 693: {region: 0x4b, script: 0x5b, flags: 0x0},
- 694: {region: 0x166, script: 0x5b, flags: 0x0},
- 695: {region: 0x166, script: 0x5b, flags: 0x0},
- 696: {region: 0xb0, script: 0x58, flags: 0x0},
- 697: {region: 0x166, script: 0x5b, flags: 0x0},
- 698: {region: 0x166, script: 0x5b, flags: 0x0},
- 699: {region: 0x4b, script: 0x5b, flags: 0x0},
- 700: {region: 0x166, script: 0x5b, flags: 0x0},
- 701: {region: 0x166, script: 0x5b, flags: 0x0},
- 702: {region: 0x163, script: 0x5b, flags: 0x0},
- 703: {region: 0x9d, script: 0x5, flags: 0x0},
- 704: {region: 0xb7, script: 0x5b, flags: 0x0},
- 705: {region: 0xb9, script: 0x5b, flags: 0x0},
- 706: {region: 0x4b, script: 0x5b, flags: 0x0},
- 707: {region: 0x4b, script: 0x5b, flags: 0x0},
- 708: {region: 0xa5, script: 0x5b, flags: 0x0},
- 709: {region: 0xa5, script: 0x5b, flags: 0x0},
- 710: {region: 0x9d, script: 0x5, flags: 0x0},
- 711: {region: 0xb9, script: 0x5b, flags: 0x0},
- 712: {region: 0x124, script: 0xee, flags: 0x0},
- 713: {region: 0x53, script: 0x3b, flags: 0x0},
- 714: {region: 0x12c, script: 0x5b, flags: 0x0},
- 715: {region: 0x96, script: 0x5b, flags: 0x0},
- 716: {region: 0x52, script: 0x5b, flags: 0x0},
- 717: {region: 0x9a, script: 0x22, flags: 0x0},
- 718: {region: 0x9a, script: 0x22, flags: 0x0},
- 719: {region: 0x96, script: 0x5b, flags: 0x0},
- 720: {region: 0x23, script: 0x3, flags: 0x1},
- 721: {region: 0xa5, script: 0x5b, flags: 0x0},
- 722: {region: 0x166, script: 0x5b, flags: 0x0},
- 723: {region: 0xd0, script: 0x5b, flags: 0x0},
- 724: {region: 0x166, script: 0x5b, flags: 0x0},
- 725: {region: 0x166, script: 0x5b, flags: 0x0},
- 726: {region: 0x166, script: 0x5b, flags: 0x0},
- 727: {region: 0x166, script: 0x5b, flags: 0x0},
- 728: {region: 0x166, script: 0x5b, flags: 0x0},
- 729: {region: 0x166, script: 0x5b, flags: 0x0},
- 730: {region: 0x166, script: 0x5b, flags: 0x0},
- 731: {region: 0x166, script: 0x5b, flags: 0x0},
- 732: {region: 0x166, script: 0x5b, flags: 0x0},
- 733: {region: 0x166, script: 0x5b, flags: 0x0},
- 734: {region: 0x166, script: 0x5b, flags: 0x0},
- 735: {region: 0x166, script: 0x5, flags: 0x0},
- 736: {region: 0x107, script: 0x20, flags: 0x0},
- 737: {region: 0xe8, script: 0x5b, flags: 0x0},
- 738: {region: 0x166, script: 0x5b, flags: 0x0},
- 739: {region: 0x96, script: 0x5b, flags: 0x0},
- 740: {region: 0x166, script: 0x2c, flags: 0x0},
- 741: {region: 0x166, script: 0x5b, flags: 0x0},
- 742: {region: 0x166, script: 0x5b, flags: 0x0},
- 743: {region: 0x166, script: 0x5b, flags: 0x0},
- 744: {region: 0x113, script: 0x5b, flags: 0x0},
- 745: {region: 0xa5, script: 0x5b, flags: 0x0},
- 746: {region: 0x166, script: 0x5b, flags: 0x0},
- 747: {region: 0x166, script: 0x5b, flags: 0x0},
- 748: {region: 0x124, script: 0x5, flags: 0x0},
- 749: {region: 0xcd, script: 0x5b, flags: 0x0},
- 750: {region: 0x166, script: 0x5b, flags: 0x0},
- 751: {region: 0x166, script: 0x5b, flags: 0x0},
- 752: {region: 0x166, script: 0x5b, flags: 0x0},
- 753: {region: 0xc0, script: 0x5b, flags: 0x0},
- 754: {region: 0xd2, script: 0x5b, flags: 0x0},
- 755: {region: 0x166, script: 0x5b, flags: 0x0},
- 756: {region: 0x52, script: 0x5b, flags: 0x0},
- 757: {region: 0xdc, script: 0x22, flags: 0x0},
- 758: {region: 0x130, script: 0x5b, flags: 0x0},
- 759: {region: 0xc1, script: 0x5b, flags: 0x0},
- 760: {region: 0x166, script: 0x5b, flags: 0x0},
- 761: {region: 0x166, script: 0x5b, flags: 0x0},
- 762: {region: 0xe1, script: 0x5b, flags: 0x0},
- 763: {region: 0x166, script: 0x5b, flags: 0x0},
- 764: {region: 0x96, script: 0x5b, flags: 0x0},
- 765: {region: 0x9c, script: 0x3d, flags: 0x0},
- 766: {region: 0x166, script: 0x5b, flags: 0x0},
- 767: {region: 0xc3, script: 0x20, flags: 0x0},
- 768: {region: 0x166, script: 0x5, flags: 0x0},
- 769: {region: 0x166, script: 0x5b, flags: 0x0},
- 770: {region: 0x166, script: 0x5b, flags: 0x0},
- 771: {region: 0x166, script: 0x5b, flags: 0x0},
- 772: {region: 0x9a, script: 0x6f, flags: 0x0},
- 773: {region: 0x166, script: 0x5b, flags: 0x0},
- 774: {region: 0x166, script: 0x5b, flags: 0x0},
- 775: {region: 0x10c, script: 0x5b, flags: 0x0},
- 776: {region: 0x166, script: 0x5b, flags: 0x0},
- 777: {region: 0x166, script: 0x5b, flags: 0x0},
- 778: {region: 0x166, script: 0x5b, flags: 0x0},
- 779: {region: 0x26, script: 0x3, flags: 0x1},
- 780: {region: 0x166, script: 0x5b, flags: 0x0},
- 781: {region: 0x166, script: 0x5b, flags: 0x0},
- 782: {region: 0x9a, script: 0xe, flags: 0x0},
- 783: {region: 0xc5, script: 0x76, flags: 0x0},
- 785: {region: 0x166, script: 0x5b, flags: 0x0},
- 786: {region: 0x49, script: 0x5b, flags: 0x0},
- 787: {region: 0x49, script: 0x5b, flags: 0x0},
- 788: {region: 0x37, script: 0x5b, flags: 0x0},
- 789: {region: 0x166, script: 0x5b, flags: 0x0},
- 790: {region: 0x166, script: 0x5b, flags: 0x0},
- 791: {region: 0x166, script: 0x5b, flags: 0x0},
- 792: {region: 0x166, script: 0x5b, flags: 0x0},
- 793: {region: 0x166, script: 0x5b, flags: 0x0},
- 794: {region: 0x166, script: 0x5b, flags: 0x0},
- 795: {region: 0x9a, script: 0x22, flags: 0x0},
- 796: {region: 0xdc, script: 0x22, flags: 0x0},
- 797: {region: 0x107, script: 0x20, flags: 0x0},
- 798: {region: 0x35, script: 0x73, flags: 0x0},
- 799: {region: 0x29, script: 0x3, flags: 0x1},
- 800: {region: 0xcc, script: 0x5b, flags: 0x0},
- 801: {region: 0x166, script: 0x5b, flags: 0x0},
- 802: {region: 0x166, script: 0x5b, flags: 0x0},
- 803: {region: 0x166, script: 0x5b, flags: 0x0},
- 804: {region: 0x9a, script: 0x22, flags: 0x0},
- 805: {region: 0x52, script: 0x5b, flags: 0x0},
- 807: {region: 0x166, script: 0x5b, flags: 0x0},
- 808: {region: 0x136, script: 0x5b, flags: 0x0},
- 809: {region: 0x166, script: 0x5b, flags: 0x0},
- 810: {region: 0x166, script: 0x5b, flags: 0x0},
- 811: {region: 0xe9, script: 0x5, flags: 0x0},
- 812: {region: 0xc4, script: 0x5b, flags: 0x0},
- 813: {region: 0x9a, script: 0x22, flags: 0x0},
- 814: {region: 0x96, script: 0x5b, flags: 0x0},
- 815: {region: 0x165, script: 0x5b, flags: 0x0},
- 816: {region: 0x166, script: 0x5b, flags: 0x0},
- 817: {region: 0xc5, script: 0x76, flags: 0x0},
- 818: {region: 0x166, script: 0x5b, flags: 0x0},
- 819: {region: 0x166, script: 0x2c, flags: 0x0},
- 820: {region: 0x107, script: 0x20, flags: 0x0},
- 821: {region: 0x166, script: 0x5b, flags: 0x0},
- 822: {region: 0x132, script: 0x5b, flags: 0x0},
- 823: {region: 0x9d, script: 0x67, flags: 0x0},
- 824: {region: 0x166, script: 0x5b, flags: 0x0},
- 825: {region: 0x166, script: 0x5b, flags: 0x0},
- 826: {region: 0x9d, script: 0x5, flags: 0x0},
- 827: {region: 0x166, script: 0x5b, flags: 0x0},
- 828: {region: 0x166, script: 0x5b, flags: 0x0},
- 829: {region: 0x166, script: 0x5b, flags: 0x0},
- 830: {region: 0xde, script: 0x5b, flags: 0x0},
- 831: {region: 0x166, script: 0x5b, flags: 0x0},
- 832: {region: 0x166, script: 0x5b, flags: 0x0},
- 834: {region: 0x166, script: 0x5b, flags: 0x0},
- 835: {region: 0x53, script: 0x3b, flags: 0x0},
- 836: {region: 0x9f, script: 0x5b, flags: 0x0},
- 837: {region: 0xd3, script: 0x5b, flags: 0x0},
- 838: {region: 0x166, script: 0x5b, flags: 0x0},
- 839: {region: 0xdb, script: 0x5b, flags: 0x0},
- 840: {region: 0x166, script: 0x5b, flags: 0x0},
- 841: {region: 0x166, script: 0x5b, flags: 0x0},
- 842: {region: 0x166, script: 0x5b, flags: 0x0},
- 843: {region: 0xd0, script: 0x5b, flags: 0x0},
- 844: {region: 0x166, script: 0x5b, flags: 0x0},
- 845: {region: 0x166, script: 0x5b, flags: 0x0},
- 846: {region: 0x165, script: 0x5b, flags: 0x0},
- 847: {region: 0xd2, script: 0x5b, flags: 0x0},
- 848: {region: 0x61, script: 0x5b, flags: 0x0},
- 849: {region: 0xdc, script: 0x22, flags: 0x0},
- 850: {region: 0x166, script: 0x5b, flags: 0x0},
- 851: {region: 0xdc, script: 0x22, flags: 0x0},
- 852: {region: 0x166, script: 0x5b, flags: 0x0},
- 853: {region: 0x166, script: 0x5b, flags: 0x0},
- 854: {region: 0xd3, script: 0x5b, flags: 0x0},
- 855: {region: 0x166, script: 0x5b, flags: 0x0},
- 856: {region: 0x166, script: 0x5b, flags: 0x0},
- 857: {region: 0xd2, script: 0x5b, flags: 0x0},
- 858: {region: 0x166, script: 0x5b, flags: 0x0},
- 859: {region: 0xd0, script: 0x5b, flags: 0x0},
- 860: {region: 0xd0, script: 0x5b, flags: 0x0},
- 861: {region: 0x166, script: 0x5b, flags: 0x0},
- 862: {region: 0x166, script: 0x5b, flags: 0x0},
- 863: {region: 0x96, script: 0x5b, flags: 0x0},
- 864: {region: 0x166, script: 0x5b, flags: 0x0},
- 865: {region: 0xe0, script: 0x5b, flags: 0x0},
- 866: {region: 0x166, script: 0x5b, flags: 0x0},
- 867: {region: 0x166, script: 0x5b, flags: 0x0},
- 868: {region: 0x9a, script: 0x5b, flags: 0x0},
- 869: {region: 0x166, script: 0x5b, flags: 0x0},
- 870: {region: 0x166, script: 0x5b, flags: 0x0},
- 871: {region: 0xda, script: 0x5b, flags: 0x0},
- 872: {region: 0x52, script: 0x5b, flags: 0x0},
- 873: {region: 0x166, script: 0x5b, flags: 0x0},
- 874: {region: 0xdb, script: 0x5b, flags: 0x0},
- 875: {region: 0x166, script: 0x5b, flags: 0x0},
- 876: {region: 0x52, script: 0x5b, flags: 0x0},
- 877: {region: 0x166, script: 0x5b, flags: 0x0},
- 878: {region: 0x166, script: 0x5b, flags: 0x0},
- 879: {region: 0xdb, script: 0x5b, flags: 0x0},
- 880: {region: 0x124, script: 0x57, flags: 0x0},
- 881: {region: 0x9a, script: 0x22, flags: 0x0},
- 882: {region: 0x10d, script: 0xcb, flags: 0x0},
- 883: {region: 0x166, script: 0x5b, flags: 0x0},
- 884: {region: 0x166, script: 0x5b, flags: 0x0},
- 885: {region: 0x85, script: 0x7e, flags: 0x0},
- 886: {region: 0x162, script: 0x5b, flags: 0x0},
- 887: {region: 0x166, script: 0x5b, flags: 0x0},
- 888: {region: 0x49, script: 0x17, flags: 0x0},
- 889: {region: 0x166, script: 0x5b, flags: 0x0},
- 890: {region: 0x162, script: 0x5b, flags: 0x0},
- 891: {region: 0x166, script: 0x5b, flags: 0x0},
- 892: {region: 0x166, script: 0x5b, flags: 0x0},
- 893: {region: 0x166, script: 0x5b, flags: 0x0},
- 894: {region: 0x166, script: 0x5b, flags: 0x0},
- 895: {region: 0x166, script: 0x5b, flags: 0x0},
- 896: {region: 0x118, script: 0x5b, flags: 0x0},
- 897: {region: 0x166, script: 0x5b, flags: 0x0},
- 898: {region: 0x166, script: 0x5b, flags: 0x0},
- 899: {region: 0x136, script: 0x5b, flags: 0x0},
- 900: {region: 0x166, script: 0x5b, flags: 0x0},
- 901: {region: 0x53, script: 0x5b, flags: 0x0},
- 902: {region: 0x166, script: 0x5b, flags: 0x0},
- 903: {region: 0xcf, script: 0x5b, flags: 0x0},
- 904: {region: 0x130, script: 0x5b, flags: 0x0},
- 905: {region: 0x132, script: 0x5b, flags: 0x0},
- 906: {region: 0x81, script: 0x5b, flags: 0x0},
- 907: {region: 0x79, script: 0x5b, flags: 0x0},
- 908: {region: 0x166, script: 0x5b, flags: 0x0},
- 910: {region: 0x166, script: 0x5b, flags: 0x0},
- 911: {region: 0x166, script: 0x5b, flags: 0x0},
- 912: {region: 0x70, script: 0x5b, flags: 0x0},
- 913: {region: 0x166, script: 0x5b, flags: 0x0},
- 914: {region: 0x166, script: 0x5b, flags: 0x0},
- 915: {region: 0x166, script: 0x5b, flags: 0x0},
- 916: {region: 0x166, script: 0x5b, flags: 0x0},
- 917: {region: 0x9a, script: 0x83, flags: 0x0},
- 918: {region: 0x166, script: 0x5b, flags: 0x0},
- 919: {region: 0x166, script: 0x5, flags: 0x0},
- 920: {region: 0x7e, script: 0x20, flags: 0x0},
- 921: {region: 0x136, script: 0x84, flags: 0x0},
- 922: {region: 0x166, script: 0x5, flags: 0x0},
- 923: {region: 0xc6, script: 0x82, flags: 0x0},
- 924: {region: 0x166, script: 0x5b, flags: 0x0},
- 925: {region: 0x2c, script: 0x3, flags: 0x1},
- 926: {region: 0xe8, script: 0x5b, flags: 0x0},
- 927: {region: 0x2f, script: 0x2, flags: 0x1},
- 928: {region: 0xe8, script: 0x5b, flags: 0x0},
- 929: {region: 0x30, script: 0x5b, flags: 0x0},
- 930: {region: 0xf1, script: 0x5b, flags: 0x0},
- 931: {region: 0x166, script: 0x5b, flags: 0x0},
- 932: {region: 0x79, script: 0x5b, flags: 0x0},
- 933: {region: 0xd7, script: 0x5b, flags: 0x0},
- 934: {region: 0x136, script: 0x5b, flags: 0x0},
- 935: {region: 0x49, script: 0x5b, flags: 0x0},
- 936: {region: 0x166, script: 0x5b, flags: 0x0},
- 937: {region: 0x9d, script: 0xfa, flags: 0x0},
- 938: {region: 0x166, script: 0x5b, flags: 0x0},
- 939: {region: 0x61, script: 0x5b, flags: 0x0},
- 940: {region: 0x166, script: 0x5, flags: 0x0},
- 941: {region: 0xb1, script: 0x90, flags: 0x0},
- 943: {region: 0x166, script: 0x5b, flags: 0x0},
- 944: {region: 0x166, script: 0x5b, flags: 0x0},
- 945: {region: 0x9a, script: 0x12, flags: 0x0},
- 946: {region: 0xa5, script: 0x5b, flags: 0x0},
- 947: {region: 0xea, script: 0x5b, flags: 0x0},
- 948: {region: 0x166, script: 0x5b, flags: 0x0},
- 949: {region: 0x9f, script: 0x5b, flags: 0x0},
- 950: {region: 0x166, script: 0x5b, flags: 0x0},
- 951: {region: 0x166, script: 0x5b, flags: 0x0},
- 952: {region: 0x88, script: 0x34, flags: 0x0},
- 953: {region: 0x76, script: 0x5b, flags: 0x0},
- 954: {region: 0x166, script: 0x5b, flags: 0x0},
- 955: {region: 0xe9, script: 0x4e, flags: 0x0},
- 956: {region: 0x9d, script: 0x5, flags: 0x0},
- 957: {region: 0x1, script: 0x5b, flags: 0x0},
- 958: {region: 0x24, script: 0x5, flags: 0x0},
- 959: {region: 0x166, script: 0x5b, flags: 0x0},
- 960: {region: 0x41, script: 0x5b, flags: 0x0},
- 961: {region: 0x166, script: 0x5b, flags: 0x0},
- 962: {region: 0x7b, script: 0x5b, flags: 0x0},
- 963: {region: 0x166, script: 0x5b, flags: 0x0},
- 964: {region: 0xe5, script: 0x5b, flags: 0x0},
- 965: {region: 0x8a, script: 0x5b, flags: 0x0},
- 966: {region: 0x6a, script: 0x5b, flags: 0x0},
- 967: {region: 0x166, script: 0x5b, flags: 0x0},
- 968: {region: 0x9a, script: 0x22, flags: 0x0},
- 969: {region: 0x166, script: 0x5b, flags: 0x0},
- 970: {region: 0x103, script: 0x5b, flags: 0x0},
- 971: {region: 0x96, script: 0x5b, flags: 0x0},
- 972: {region: 0x166, script: 0x5b, flags: 0x0},
- 973: {region: 0x166, script: 0x5b, flags: 0x0},
- 974: {region: 0x9f, script: 0x5b, flags: 0x0},
- 975: {region: 0x166, script: 0x5, flags: 0x0},
- 976: {region: 0x9a, script: 0x5b, flags: 0x0},
- 977: {region: 0x31, script: 0x2, flags: 0x1},
- 978: {region: 0xdc, script: 0x22, flags: 0x0},
- 979: {region: 0x35, script: 0xe, flags: 0x0},
- 980: {region: 0x4e, script: 0x5b, flags: 0x0},
- 981: {region: 0x73, script: 0x5b, flags: 0x0},
- 982: {region: 0x4e, script: 0x5b, flags: 0x0},
- 983: {region: 0x9d, script: 0x5, flags: 0x0},
- 984: {region: 0x10d, script: 0x5b, flags: 0x0},
- 985: {region: 0x3a, script: 0x5b, flags: 0x0},
- 986: {region: 0x166, script: 0x5b, flags: 0x0},
- 987: {region: 0xd2, script: 0x5b, flags: 0x0},
- 988: {region: 0x105, script: 0x5b, flags: 0x0},
- 989: {region: 0x96, script: 0x5b, flags: 0x0},
- 990: {region: 0x130, script: 0x5b, flags: 0x0},
- 991: {region: 0x166, script: 0x5b, flags: 0x0},
- 992: {region: 0x166, script: 0x5b, flags: 0x0},
- 993: {region: 0x74, script: 0x5b, flags: 0x0},
- 994: {region: 0x107, script: 0x20, flags: 0x0},
- 995: {region: 0x131, script: 0x20, flags: 0x0},
- 996: {region: 0x10a, script: 0x5b, flags: 0x0},
- 997: {region: 0x108, script: 0x5b, flags: 0x0},
- 998: {region: 0x130, script: 0x5b, flags: 0x0},
- 999: {region: 0x166, script: 0x5b, flags: 0x0},
- 1000: {region: 0xa3, script: 0x4c, flags: 0x0},
- 1001: {region: 0x9a, script: 0x22, flags: 0x0},
- 1002: {region: 0x81, script: 0x5b, flags: 0x0},
- 1003: {region: 0x107, script: 0x20, flags: 0x0},
- 1004: {region: 0xa5, script: 0x5b, flags: 0x0},
- 1005: {region: 0x96, script: 0x5b, flags: 0x0},
- 1006: {region: 0x9a, script: 0x5b, flags: 0x0},
- 1007: {region: 0x115, script: 0x5b, flags: 0x0},
- 1008: {region: 0x9a, script: 0xcf, flags: 0x0},
- 1009: {region: 0x166, script: 0x5b, flags: 0x0},
- 1010: {region: 0x166, script: 0x5b, flags: 0x0},
- 1011: {region: 0x130, script: 0x5b, flags: 0x0},
- 1012: {region: 0x9f, script: 0x5b, flags: 0x0},
- 1013: {region: 0x9a, script: 0x22, flags: 0x0},
- 1014: {region: 0x166, script: 0x5, flags: 0x0},
- 1015: {region: 0x9f, script: 0x5b, flags: 0x0},
- 1016: {region: 0x7c, script: 0x5b, flags: 0x0},
- 1017: {region: 0x49, script: 0x5b, flags: 0x0},
- 1018: {region: 0x33, script: 0x4, flags: 0x1},
- 1019: {region: 0x9f, script: 0x5b, flags: 0x0},
- 1020: {region: 0x9d, script: 0x5, flags: 0x0},
- 1021: {region: 0xdb, script: 0x5b, flags: 0x0},
- 1022: {region: 0x4f, script: 0x5b, flags: 0x0},
- 1023: {region: 0xd2, script: 0x5b, flags: 0x0},
- 1024: {region: 0xd0, script: 0x5b, flags: 0x0},
- 1025: {region: 0xc4, script: 0x5b, flags: 0x0},
- 1026: {region: 0x4c, script: 0x5b, flags: 0x0},
- 1027: {region: 0x97, script: 0x80, flags: 0x0},
- 1028: {region: 0xb7, script: 0x5b, flags: 0x0},
- 1029: {region: 0x166, script: 0x2c, flags: 0x0},
- 1030: {region: 0x166, script: 0x5b, flags: 0x0},
- 1032: {region: 0xbb, script: 0xeb, flags: 0x0},
- 1033: {region: 0x166, script: 0x5b, flags: 0x0},
- 1034: {region: 0xc5, script: 0x76, flags: 0x0},
- 1035: {region: 0x166, script: 0x5, flags: 0x0},
- 1036: {region: 0xb4, script: 0xd6, flags: 0x0},
- 1037: {region: 0x70, script: 0x5b, flags: 0x0},
- 1038: {region: 0x166, script: 0x5b, flags: 0x0},
- 1039: {region: 0x166, script: 0x5b, flags: 0x0},
- 1040: {region: 0x166, script: 0x5b, flags: 0x0},
- 1041: {region: 0x166, script: 0x5b, flags: 0x0},
- 1042: {region: 0x112, script: 0x5b, flags: 0x0},
- 1043: {region: 0x166, script: 0x5b, flags: 0x0},
- 1044: {region: 0xe9, script: 0x5, flags: 0x0},
- 1045: {region: 0x166, script: 0x5b, flags: 0x0},
- 1046: {region: 0x110, script: 0x5b, flags: 0x0},
- 1047: {region: 0x166, script: 0x5b, flags: 0x0},
- 1048: {region: 0xea, script: 0x5b, flags: 0x0},
- 1049: {region: 0x166, script: 0x5b, flags: 0x0},
- 1050: {region: 0x96, script: 0x5b, flags: 0x0},
- 1051: {region: 0x143, script: 0x5b, flags: 0x0},
- 1052: {region: 0x10d, script: 0x5b, flags: 0x0},
- 1054: {region: 0x10d, script: 0x5b, flags: 0x0},
- 1055: {region: 0x73, script: 0x5b, flags: 0x0},
- 1056: {region: 0x98, script: 0xcc, flags: 0x0},
- 1057: {region: 0x166, script: 0x5b, flags: 0x0},
- 1058: {region: 0x73, script: 0x5b, flags: 0x0},
- 1059: {region: 0x165, script: 0x5b, flags: 0x0},
- 1060: {region: 0x166, script: 0x5b, flags: 0x0},
- 1061: {region: 0xc4, script: 0x5b, flags: 0x0},
- 1062: {region: 0x166, script: 0x5b, flags: 0x0},
- 1063: {region: 0x166, script: 0x5b, flags: 0x0},
- 1064: {region: 0x166, script: 0x5b, flags: 0x0},
- 1065: {region: 0x116, script: 0x5b, flags: 0x0},
- 1066: {region: 0x166, script: 0x5b, flags: 0x0},
- 1067: {region: 0x166, script: 0x5b, flags: 0x0},
- 1068: {region: 0x124, script: 0xee, flags: 0x0},
- 1069: {region: 0x166, script: 0x5b, flags: 0x0},
- 1070: {region: 0x166, script: 0x5b, flags: 0x0},
- 1071: {region: 0x166, script: 0x5b, flags: 0x0},
- 1072: {region: 0x166, script: 0x5b, flags: 0x0},
- 1073: {region: 0x27, script: 0x5b, flags: 0x0},
- 1074: {region: 0x37, script: 0x5, flags: 0x1},
- 1075: {region: 0x9a, script: 0xd9, flags: 0x0},
- 1076: {region: 0x117, script: 0x5b, flags: 0x0},
- 1077: {region: 0x115, script: 0x5b, flags: 0x0},
- 1078: {region: 0x9a, script: 0x22, flags: 0x0},
- 1079: {region: 0x162, script: 0x5b, flags: 0x0},
- 1080: {region: 0x166, script: 0x5b, flags: 0x0},
- 1081: {region: 0x166, script: 0x5b, flags: 0x0},
- 1082: {region: 0x6e, script: 0x5b, flags: 0x0},
- 1083: {region: 0x162, script: 0x5b, flags: 0x0},
- 1084: {region: 0x166, script: 0x5b, flags: 0x0},
- 1085: {region: 0x61, script: 0x5b, flags: 0x0},
- 1086: {region: 0x96, script: 0x5b, flags: 0x0},
- 1087: {region: 0x166, script: 0x5b, flags: 0x0},
- 1088: {region: 0x166, script: 0x5b, flags: 0x0},
- 1089: {region: 0x130, script: 0x5b, flags: 0x0},
- 1090: {region: 0x166, script: 0x5b, flags: 0x0},
- 1091: {region: 0x85, script: 0x5b, flags: 0x0},
- 1092: {region: 0x10d, script: 0x5b, flags: 0x0},
- 1093: {region: 0x130, script: 0x5b, flags: 0x0},
- 1094: {region: 0x160, script: 0x5, flags: 0x0},
- 1095: {region: 0x4b, script: 0x5b, flags: 0x0},
- 1096: {region: 0x61, script: 0x5b, flags: 0x0},
- 1097: {region: 0x166, script: 0x5b, flags: 0x0},
- 1098: {region: 0x9a, script: 0x22, flags: 0x0},
- 1099: {region: 0x96, script: 0x5b, flags: 0x0},
- 1100: {region: 0x166, script: 0x5b, flags: 0x0},
- 1101: {region: 0x35, script: 0xe, flags: 0x0},
- 1102: {region: 0x9c, script: 0xde, flags: 0x0},
- 1103: {region: 0xea, script: 0x5b, flags: 0x0},
- 1104: {region: 0x9a, script: 0xe6, flags: 0x0},
- 1105: {region: 0xdc, script: 0x22, flags: 0x0},
- 1106: {region: 0x166, script: 0x5b, flags: 0x0},
- 1107: {region: 0x166, script: 0x5b, flags: 0x0},
- 1108: {region: 0x166, script: 0x5b, flags: 0x0},
- 1109: {region: 0x166, script: 0x5b, flags: 0x0},
- 1110: {region: 0x166, script: 0x5b, flags: 0x0},
- 1111: {region: 0x166, script: 0x5b, flags: 0x0},
- 1112: {region: 0x166, script: 0x5b, flags: 0x0},
- 1113: {region: 0x166, script: 0x5b, flags: 0x0},
- 1114: {region: 0xe8, script: 0x5b, flags: 0x0},
- 1115: {region: 0x166, script: 0x5b, flags: 0x0},
- 1116: {region: 0x166, script: 0x5b, flags: 0x0},
- 1117: {region: 0x9a, script: 0x53, flags: 0x0},
- 1118: {region: 0x53, script: 0xe4, flags: 0x0},
- 1119: {region: 0xdc, script: 0x22, flags: 0x0},
- 1120: {region: 0xdc, script: 0x22, flags: 0x0},
- 1121: {region: 0x9a, script: 0xe9, flags: 0x0},
- 1122: {region: 0x166, script: 0x5b, flags: 0x0},
- 1123: {region: 0x113, script: 0x5b, flags: 0x0},
- 1124: {region: 0x132, script: 0x5b, flags: 0x0},
- 1125: {region: 0x127, script: 0x5b, flags: 0x0},
- 1126: {region: 0x166, script: 0x5b, flags: 0x0},
- 1127: {region: 0x3c, script: 0x3, flags: 0x1},
- 1128: {region: 0x166, script: 0x5b, flags: 0x0},
- 1129: {region: 0x166, script: 0x5b, flags: 0x0},
- 1130: {region: 0x166, script: 0x5b, flags: 0x0},
- 1131: {region: 0x124, script: 0xee, flags: 0x0},
- 1132: {region: 0xdc, script: 0x22, flags: 0x0},
- 1133: {region: 0xdc, script: 0x22, flags: 0x0},
- 1134: {region: 0xdc, script: 0x22, flags: 0x0},
- 1135: {region: 0x70, script: 0x2c, flags: 0x0},
- 1136: {region: 0x166, script: 0x5b, flags: 0x0},
- 1137: {region: 0x6e, script: 0x2c, flags: 0x0},
- 1138: {region: 0x166, script: 0x5b, flags: 0x0},
- 1139: {region: 0x166, script: 0x5b, flags: 0x0},
- 1140: {region: 0x166, script: 0x5b, flags: 0x0},
- 1141: {region: 0xd7, script: 0x5b, flags: 0x0},
- 1142: {region: 0x128, script: 0x5b, flags: 0x0},
- 1143: {region: 0x126, script: 0x5b, flags: 0x0},
- 1144: {region: 0x32, script: 0x5b, flags: 0x0},
- 1145: {region: 0xdc, script: 0x22, flags: 0x0},
- 1146: {region: 0xe8, script: 0x5b, flags: 0x0},
- 1147: {region: 0x166, script: 0x5b, flags: 0x0},
- 1148: {region: 0x166, script: 0x5b, flags: 0x0},
- 1149: {region: 0x32, script: 0x5b, flags: 0x0},
- 1150: {region: 0xd5, script: 0x5b, flags: 0x0},
- 1151: {region: 0x166, script: 0x5b, flags: 0x0},
- 1152: {region: 0x162, script: 0x5b, flags: 0x0},
- 1153: {region: 0x166, script: 0x5b, flags: 0x0},
- 1154: {region: 0x12a, script: 0x5b, flags: 0x0},
- 1155: {region: 0x166, script: 0x5b, flags: 0x0},
- 1156: {region: 0xcf, script: 0x5b, flags: 0x0},
- 1157: {region: 0x166, script: 0x5b, flags: 0x0},
- 1158: {region: 0xe7, script: 0x5b, flags: 0x0},
- 1159: {region: 0x166, script: 0x5b, flags: 0x0},
- 1160: {region: 0x166, script: 0x5b, flags: 0x0},
- 1161: {region: 0x166, script: 0x5b, flags: 0x0},
- 1162: {region: 0x12c, script: 0x5b, flags: 0x0},
- 1163: {region: 0x12c, script: 0x5b, flags: 0x0},
- 1164: {region: 0x12f, script: 0x5b, flags: 0x0},
- 1165: {region: 0x166, script: 0x5, flags: 0x0},
- 1166: {region: 0x162, script: 0x5b, flags: 0x0},
- 1167: {region: 0x88, script: 0x34, flags: 0x0},
- 1168: {region: 0xdc, script: 0x22, flags: 0x0},
- 1169: {region: 0xe8, script: 0x5b, flags: 0x0},
- 1170: {region: 0x43, script: 0xef, flags: 0x0},
- 1171: {region: 0x166, script: 0x5b, flags: 0x0},
- 1172: {region: 0x107, script: 0x20, flags: 0x0},
- 1173: {region: 0x166, script: 0x5b, flags: 0x0},
- 1174: {region: 0x166, script: 0x5b, flags: 0x0},
- 1175: {region: 0x132, script: 0x5b, flags: 0x0},
- 1176: {region: 0x166, script: 0x5b, flags: 0x0},
- 1177: {region: 0x124, script: 0xee, flags: 0x0},
- 1178: {region: 0x32, script: 0x5b, flags: 0x0},
- 1179: {region: 0x166, script: 0x5b, flags: 0x0},
- 1180: {region: 0x166, script: 0x5b, flags: 0x0},
- 1181: {region: 0xcf, script: 0x5b, flags: 0x0},
- 1182: {region: 0x166, script: 0x5b, flags: 0x0},
- 1183: {region: 0x166, script: 0x5b, flags: 0x0},
- 1184: {region: 0x12e, script: 0x5b, flags: 0x0},
- 1185: {region: 0x166, script: 0x5b, flags: 0x0},
- 1187: {region: 0x166, script: 0x5b, flags: 0x0},
- 1188: {region: 0xd5, script: 0x5b, flags: 0x0},
- 1189: {region: 0x53, script: 0xe7, flags: 0x0},
- 1190: {region: 0xe6, script: 0x5b, flags: 0x0},
- 1191: {region: 0x166, script: 0x5b, flags: 0x0},
- 1192: {region: 0x107, script: 0x20, flags: 0x0},
- 1193: {region: 0xbb, script: 0x5b, flags: 0x0},
- 1194: {region: 0x166, script: 0x5b, flags: 0x0},
- 1195: {region: 0x107, script: 0x20, flags: 0x0},
- 1196: {region: 0x3f, script: 0x4, flags: 0x1},
- 1197: {region: 0x11d, script: 0xf3, flags: 0x0},
- 1198: {region: 0x131, script: 0x20, flags: 0x0},
- 1199: {region: 0x76, script: 0x5b, flags: 0x0},
- 1200: {region: 0x2a, script: 0x5b, flags: 0x0},
- 1202: {region: 0x43, script: 0x3, flags: 0x1},
- 1203: {region: 0x9a, script: 0xe, flags: 0x0},
- 1204: {region: 0xe9, script: 0x5, flags: 0x0},
- 1205: {region: 0x166, script: 0x5b, flags: 0x0},
- 1206: {region: 0x166, script: 0x5b, flags: 0x0},
- 1207: {region: 0x166, script: 0x5b, flags: 0x0},
- 1208: {region: 0x166, script: 0x5b, flags: 0x0},
- 1209: {region: 0x166, script: 0x5b, flags: 0x0},
- 1210: {region: 0x166, script: 0x5b, flags: 0x0},
- 1211: {region: 0x166, script: 0x5b, flags: 0x0},
- 1212: {region: 0x46, script: 0x4, flags: 0x1},
- 1213: {region: 0x166, script: 0x5b, flags: 0x0},
- 1214: {region: 0xb5, script: 0xf4, flags: 0x0},
- 1215: {region: 0x166, script: 0x5b, flags: 0x0},
- 1216: {region: 0x162, script: 0x5b, flags: 0x0},
- 1217: {region: 0x9f, script: 0x5b, flags: 0x0},
- 1218: {region: 0x107, script: 0x5b, flags: 0x0},
- 1219: {region: 0x13f, script: 0x5b, flags: 0x0},
- 1220: {region: 0x11c, script: 0x5b, flags: 0x0},
- 1221: {region: 0x166, script: 0x5b, flags: 0x0},
- 1222: {region: 0x36, script: 0x5b, flags: 0x0},
- 1223: {region: 0x61, script: 0x5b, flags: 0x0},
- 1224: {region: 0xd2, script: 0x5b, flags: 0x0},
- 1225: {region: 0x1, script: 0x5b, flags: 0x0},
- 1226: {region: 0x107, script: 0x5b, flags: 0x0},
- 1227: {region: 0x6b, script: 0x5b, flags: 0x0},
- 1228: {region: 0x130, script: 0x5b, flags: 0x0},
- 1229: {region: 0x166, script: 0x5b, flags: 0x0},
- 1230: {region: 0x36, script: 0x5b, flags: 0x0},
- 1231: {region: 0x4e, script: 0x5b, flags: 0x0},
- 1232: {region: 0x166, script: 0x5b, flags: 0x0},
- 1233: {region: 0x70, script: 0x2c, flags: 0x0},
- 1234: {region: 0x166, script: 0x5b, flags: 0x0},
- 1235: {region: 0xe8, script: 0x5b, flags: 0x0},
- 1236: {region: 0x2f, script: 0x5b, flags: 0x0},
- 1237: {region: 0x9a, script: 0xe9, flags: 0x0},
- 1238: {region: 0x9a, script: 0x22, flags: 0x0},
- 1239: {region: 0x166, script: 0x5b, flags: 0x0},
- 1240: {region: 0x166, script: 0x5b, flags: 0x0},
- 1241: {region: 0x166, script: 0x5b, flags: 0x0},
- 1242: {region: 0x166, script: 0x5b, flags: 0x0},
- 1243: {region: 0x166, script: 0x5b, flags: 0x0},
- 1244: {region: 0x166, script: 0x5b, flags: 0x0},
- 1245: {region: 0x166, script: 0x5b, flags: 0x0},
- 1246: {region: 0x166, script: 0x5b, flags: 0x0},
- 1247: {region: 0x166, script: 0x5b, flags: 0x0},
- 1248: {region: 0x141, script: 0x5b, flags: 0x0},
- 1249: {region: 0x166, script: 0x5b, flags: 0x0},
- 1250: {region: 0x166, script: 0x5b, flags: 0x0},
- 1251: {region: 0xa9, script: 0x5, flags: 0x0},
- 1252: {region: 0x166, script: 0x5b, flags: 0x0},
- 1253: {region: 0x115, script: 0x5b, flags: 0x0},
- 1254: {region: 0x166, script: 0x5b, flags: 0x0},
- 1255: {region: 0x166, script: 0x5b, flags: 0x0},
- 1256: {region: 0x166, script: 0x5b, flags: 0x0},
- 1257: {region: 0x166, script: 0x5b, flags: 0x0},
- 1258: {region: 0x9a, script: 0x22, flags: 0x0},
- 1259: {region: 0x53, script: 0x3b, flags: 0x0},
- 1260: {region: 0x166, script: 0x5b, flags: 0x0},
- 1261: {region: 0x166, script: 0x5b, flags: 0x0},
- 1262: {region: 0x41, script: 0x5b, flags: 0x0},
- 1263: {region: 0x166, script: 0x5b, flags: 0x0},
- 1264: {region: 0x12c, script: 0x18, flags: 0x0},
- 1265: {region: 0x166, script: 0x5b, flags: 0x0},
- 1266: {region: 0x162, script: 0x5b, flags: 0x0},
- 1267: {region: 0x166, script: 0x5b, flags: 0x0},
- 1268: {region: 0x12c, script: 0x63, flags: 0x0},
- 1269: {region: 0x12c, script: 0x64, flags: 0x0},
- 1270: {region: 0x7e, script: 0x2e, flags: 0x0},
- 1271: {region: 0x53, script: 0x68, flags: 0x0},
- 1272: {region: 0x10c, script: 0x6d, flags: 0x0},
- 1273: {region: 0x109, script: 0x79, flags: 0x0},
- 1274: {region: 0x9a, script: 0x22, flags: 0x0},
- 1275: {region: 0x132, script: 0x5b, flags: 0x0},
- 1276: {region: 0x166, script: 0x5b, flags: 0x0},
- 1277: {region: 0x9d, script: 0x93, flags: 0x0},
- 1278: {region: 0x166, script: 0x5b, flags: 0x0},
- 1279: {region: 0x15f, script: 0xce, flags: 0x0},
- 1280: {region: 0x166, script: 0x5b, flags: 0x0},
- 1281: {region: 0x166, script: 0x5b, flags: 0x0},
- 1282: {region: 0xdc, script: 0x22, flags: 0x0},
- 1283: {region: 0x166, script: 0x5b, flags: 0x0},
- 1284: {region: 0x166, script: 0x5b, flags: 0x0},
- 1285: {region: 0xd2, script: 0x5b, flags: 0x0},
- 1286: {region: 0x76, script: 0x5b, flags: 0x0},
- 1287: {region: 0x166, script: 0x5b, flags: 0x0},
- 1288: {region: 0x166, script: 0x5b, flags: 0x0},
- 1289: {region: 0x52, script: 0x5b, flags: 0x0},
- 1290: {region: 0x166, script: 0x5b, flags: 0x0},
- 1291: {region: 0x166, script: 0x5b, flags: 0x0},
- 1292: {region: 0x166, script: 0x5b, flags: 0x0},
- 1293: {region: 0x52, script: 0x5b, flags: 0x0},
- 1294: {region: 0x166, script: 0x5b, flags: 0x0},
- 1295: {region: 0x166, script: 0x5b, flags: 0x0},
- 1296: {region: 0x166, script: 0x5b, flags: 0x0},
- 1297: {region: 0x166, script: 0x5b, flags: 0x0},
- 1298: {region: 0x1, script: 0x3e, flags: 0x0},
- 1299: {region: 0x166, script: 0x5b, flags: 0x0},
- 1300: {region: 0x166, script: 0x5b, flags: 0x0},
- 1301: {region: 0x166, script: 0x5b, flags: 0x0},
- 1302: {region: 0x166, script: 0x5b, flags: 0x0},
- 1303: {region: 0x166, script: 0x5b, flags: 0x0},
- 1304: {region: 0xd7, script: 0x5b, flags: 0x0},
- 1305: {region: 0x166, script: 0x5b, flags: 0x0},
- 1306: {region: 0x166, script: 0x5b, flags: 0x0},
- 1307: {region: 0x166, script: 0x5b, flags: 0x0},
- 1308: {region: 0x41, script: 0x5b, flags: 0x0},
- 1309: {region: 0x166, script: 0x5b, flags: 0x0},
- 1310: {region: 0xd0, script: 0x5b, flags: 0x0},
- 1311: {region: 0x4a, script: 0x3, flags: 0x1},
- 1312: {region: 0x166, script: 0x5b, flags: 0x0},
- 1313: {region: 0x166, script: 0x5b, flags: 0x0},
- 1314: {region: 0x166, script: 0x5b, flags: 0x0},
- 1315: {region: 0x53, script: 0x5b, flags: 0x0},
- 1316: {region: 0x10c, script: 0x5b, flags: 0x0},
- 1318: {region: 0xa9, script: 0x5, flags: 0x0},
- 1319: {region: 0xda, script: 0x5b, flags: 0x0},
- 1320: {region: 0xbb, script: 0xeb, flags: 0x0},
- 1321: {region: 0x4d, script: 0x14, flags: 0x1},
- 1322: {region: 0x53, script: 0x7f, flags: 0x0},
- 1323: {region: 0x166, script: 0x5b, flags: 0x0},
- 1324: {region: 0x123, script: 0x5b, flags: 0x0},
- 1325: {region: 0xd1, script: 0x5b, flags: 0x0},
- 1326: {region: 0x166, script: 0x5b, flags: 0x0},
- 1327: {region: 0x162, script: 0x5b, flags: 0x0},
- 1329: {region: 0x12c, script: 0x5b, flags: 0x0},
-}
-
-// likelyLangList holds lists info associated with likelyLang.
-// Size: 582 bytes, 97 elements
-var likelyLangList = [97]likelyScriptRegion{
- 0: {region: 0x9d, script: 0x7, flags: 0x0},
- 1: {region: 0xa2, script: 0x7a, flags: 0x2},
- 2: {region: 0x11d, script: 0x87, flags: 0x2},
- 3: {region: 0x32, script: 0x5b, flags: 0x0},
- 4: {region: 0x9c, script: 0x5, flags: 0x4},
- 5: {region: 0x9d, script: 0x5, flags: 0x4},
- 6: {region: 0x107, script: 0x20, flags: 0x4},
- 7: {region: 0x9d, script: 0x5, flags: 0x2},
- 8: {region: 0x107, script: 0x20, flags: 0x0},
- 9: {region: 0x38, script: 0x2f, flags: 0x2},
- 10: {region: 0x136, script: 0x5b, flags: 0x0},
- 11: {region: 0x7c, script: 0xd1, flags: 0x2},
- 12: {region: 0x115, script: 0x5b, flags: 0x0},
- 13: {region: 0x85, script: 0x1, flags: 0x2},
- 14: {region: 0x5e, script: 0x1f, flags: 0x0},
- 15: {region: 0x88, script: 0x60, flags: 0x2},
- 16: {region: 0xd7, script: 0x5b, flags: 0x0},
- 17: {region: 0x52, script: 0x5, flags: 0x4},
- 18: {region: 0x10c, script: 0x5, flags: 0x4},
- 19: {region: 0xaf, script: 0x20, flags: 0x0},
- 20: {region: 0x24, script: 0x5, flags: 0x4},
- 21: {region: 0x53, script: 0x5, flags: 0x4},
- 22: {region: 0x9d, script: 0x5, flags: 0x4},
- 23: {region: 0xc6, script: 0x5, flags: 0x4},
- 24: {region: 0x53, script: 0x5, flags: 0x2},
- 25: {region: 0x12c, script: 0x5b, flags: 0x0},
- 26: {region: 0xb1, script: 0x5, flags: 0x4},
- 27: {region: 0x9c, script: 0x5, flags: 0x2},
- 28: {region: 0xa6, script: 0x20, flags: 0x0},
- 29: {region: 0x53, script: 0x5, flags: 0x4},
- 30: {region: 0x12c, script: 0x5b, flags: 0x4},
- 31: {region: 0x53, script: 0x5, flags: 0x2},
- 32: {region: 0x12c, script: 0x5b, flags: 0x2},
- 33: {region: 0xdc, script: 0x22, flags: 0x0},
- 34: {region: 0x9a, script: 0x5e, flags: 0x2},
- 35: {region: 0x84, script: 0x5b, flags: 0x0},
- 36: {region: 0x85, script: 0x7e, flags: 0x4},
- 37: {region: 0x85, script: 0x7e, flags: 0x2},
- 38: {region: 0xc6, script: 0x20, flags: 0x0},
- 39: {region: 0x53, script: 0x71, flags: 0x4},
- 40: {region: 0x53, script: 0x71, flags: 0x2},
- 41: {region: 0xd1, script: 0x5b, flags: 0x0},
- 42: {region: 0x4a, script: 0x5, flags: 0x4},
- 43: {region: 0x96, script: 0x5, flags: 0x4},
- 44: {region: 0x9a, script: 0x36, flags: 0x0},
- 45: {region: 0xe9, script: 0x5, flags: 0x4},
- 46: {region: 0xe9, script: 0x5, flags: 0x2},
- 47: {region: 0x9d, script: 0x8d, flags: 0x0},
- 48: {region: 0x53, script: 0x8e, flags: 0x2},
- 49: {region: 0xbb, script: 0xeb, flags: 0x0},
- 50: {region: 0xda, script: 0x5b, flags: 0x4},
- 51: {region: 0xe9, script: 0x5, flags: 0x0},
- 52: {region: 0x9a, script: 0x22, flags: 0x2},
- 53: {region: 0x9a, script: 0x50, flags: 0x2},
- 54: {region: 0x9a, script: 0xd5, flags: 0x2},
- 55: {region: 0x106, script: 0x20, flags: 0x0},
- 56: {region: 0xbe, script: 0x5b, flags: 0x4},
- 57: {region: 0x105, script: 0x5b, flags: 0x4},
- 58: {region: 0x107, script: 0x5b, flags: 0x4},
- 59: {region: 0x12c, script: 0x5b, flags: 0x4},
- 60: {region: 0x125, script: 0x20, flags: 0x0},
- 61: {region: 0xe9, script: 0x5, flags: 0x4},
- 62: {region: 0xe9, script: 0x5, flags: 0x2},
- 63: {region: 0x53, script: 0x5, flags: 0x0},
- 64: {region: 0xaf, script: 0x20, flags: 0x4},
- 65: {region: 0xc6, script: 0x20, flags: 0x4},
- 66: {region: 0xaf, script: 0x20, flags: 0x2},
- 67: {region: 0x9a, script: 0xe, flags: 0x0},
- 68: {region: 0xdc, script: 0x22, flags: 0x4},
- 69: {region: 0xdc, script: 0x22, flags: 0x2},
- 70: {region: 0x138, script: 0x5b, flags: 0x0},
- 71: {region: 0x24, script: 0x5, flags: 0x4},
- 72: {region: 0x53, script: 0x20, flags: 0x4},
- 73: {region: 0x24, script: 0x5, flags: 0x2},
- 74: {region: 0x8e, script: 0x3c, flags: 0x0},
- 75: {region: 0x53, script: 0x3b, flags: 0x4},
- 76: {region: 0x53, script: 0x3b, flags: 0x2},
- 77: {region: 0x53, script: 0x3b, flags: 0x0},
- 78: {region: 0x2f, script: 0x3c, flags: 0x4},
- 79: {region: 0x3e, script: 0x3c, flags: 0x4},
- 80: {region: 0x7c, script: 0x3c, flags: 0x4},
- 81: {region: 0x7f, script: 0x3c, flags: 0x4},
- 82: {region: 0x8e, script: 0x3c, flags: 0x4},
- 83: {region: 0x96, script: 0x3c, flags: 0x4},
- 84: {region: 0xc7, script: 0x3c, flags: 0x4},
- 85: {region: 0xd1, script: 0x3c, flags: 0x4},
- 86: {region: 0xe3, script: 0x3c, flags: 0x4},
- 87: {region: 0xe6, script: 0x3c, flags: 0x4},
- 88: {region: 0xe8, script: 0x3c, flags: 0x4},
- 89: {region: 0x117, script: 0x3c, flags: 0x4},
- 90: {region: 0x124, script: 0x3c, flags: 0x4},
- 91: {region: 0x12f, script: 0x3c, flags: 0x4},
- 92: {region: 0x136, script: 0x3c, flags: 0x4},
- 93: {region: 0x13f, script: 0x3c, flags: 0x4},
- 94: {region: 0x12f, script: 0x11, flags: 0x2},
- 95: {region: 0x12f, script: 0x37, flags: 0x2},
- 96: {region: 0x12f, script: 0x3c, flags: 0x2},
-}
-
-type likelyLangScript struct {
- lang uint16
- script uint16
- flags uint8
-}
-
-// likelyRegion is a lookup table, indexed by regionID, for the most likely
-// languages and scripts given incomplete information. If more entries exist
-// for a given regionID, lang and script are the index and size respectively
-// of the list in likelyRegionList.
-// TODO: exclude containers and user-definable regions from the list.
-// Size: 2154 bytes, 359 elements
-var likelyRegion = [359]likelyLangScript{
- 34: {lang: 0xd7, script: 0x5b, flags: 0x0},
- 35: {lang: 0x3a, script: 0x5, flags: 0x0},
- 36: {lang: 0x0, script: 0x2, flags: 0x1},
- 39: {lang: 0x2, script: 0x2, flags: 0x1},
- 40: {lang: 0x4, script: 0x2, flags: 0x1},
- 42: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 43: {lang: 0x0, script: 0x5b, flags: 0x0},
- 44: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 45: {lang: 0x41b, script: 0x5b, flags: 0x0},
- 46: {lang: 0x10d, script: 0x5b, flags: 0x0},
- 48: {lang: 0x367, script: 0x5b, flags: 0x0},
- 49: {lang: 0x444, script: 0x5b, flags: 0x0},
- 50: {lang: 0x58, script: 0x5b, flags: 0x0},
- 51: {lang: 0x6, script: 0x2, flags: 0x1},
- 53: {lang: 0xa5, script: 0xe, flags: 0x0},
- 54: {lang: 0x367, script: 0x5b, flags: 0x0},
- 55: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 56: {lang: 0x7e, script: 0x20, flags: 0x0},
- 57: {lang: 0x3a, script: 0x5, flags: 0x0},
- 58: {lang: 0x3d9, script: 0x5b, flags: 0x0},
- 59: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 60: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 62: {lang: 0x31f, script: 0x5b, flags: 0x0},
- 63: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 64: {lang: 0x3a1, script: 0x5b, flags: 0x0},
- 65: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 67: {lang: 0x8, script: 0x2, flags: 0x1},
- 69: {lang: 0x0, script: 0x5b, flags: 0x0},
- 71: {lang: 0x71, script: 0x20, flags: 0x0},
- 73: {lang: 0x512, script: 0x3e, flags: 0x2},
- 74: {lang: 0x31f, script: 0x5, flags: 0x2},
- 75: {lang: 0x445, script: 0x5b, flags: 0x0},
- 76: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 77: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 78: {lang: 0x10d, script: 0x5b, flags: 0x0},
- 79: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 81: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 82: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 83: {lang: 0xa, script: 0x4, flags: 0x1},
- 84: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 85: {lang: 0x0, script: 0x5b, flags: 0x0},
- 87: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 90: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 91: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 92: {lang: 0x3a1, script: 0x5b, flags: 0x0},
- 94: {lang: 0xe, script: 0x2, flags: 0x1},
- 95: {lang: 0xfa, script: 0x5b, flags: 0x0},
- 97: {lang: 0x10d, script: 0x5b, flags: 0x0},
- 99: {lang: 0x1, script: 0x5b, flags: 0x0},
- 100: {lang: 0x101, script: 0x5b, flags: 0x0},
- 102: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 104: {lang: 0x10, script: 0x2, flags: 0x1},
- 105: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 106: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 107: {lang: 0x140, script: 0x5b, flags: 0x0},
- 108: {lang: 0x3a, script: 0x5, flags: 0x0},
- 109: {lang: 0x3a, script: 0x5, flags: 0x0},
- 110: {lang: 0x46f, script: 0x2c, flags: 0x0},
- 111: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 112: {lang: 0x12, script: 0x2, flags: 0x1},
- 114: {lang: 0x10d, script: 0x5b, flags: 0x0},
- 115: {lang: 0x151, script: 0x5b, flags: 0x0},
- 116: {lang: 0x1c0, script: 0x22, flags: 0x2},
- 119: {lang: 0x158, script: 0x5b, flags: 0x0},
- 121: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 123: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 124: {lang: 0x14, script: 0x2, flags: 0x1},
- 126: {lang: 0x16, script: 0x3, flags: 0x1},
- 127: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 129: {lang: 0x21, script: 0x5b, flags: 0x0},
- 131: {lang: 0x245, script: 0x5b, flags: 0x0},
- 133: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 134: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 135: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 136: {lang: 0x19, script: 0x2, flags: 0x1},
- 137: {lang: 0x0, script: 0x5b, flags: 0x0},
- 138: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 140: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 142: {lang: 0x529, script: 0x3c, flags: 0x0},
- 143: {lang: 0x0, script: 0x5b, flags: 0x0},
- 144: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 145: {lang: 0x1d1, script: 0x5b, flags: 0x0},
- 146: {lang: 0x1d4, script: 0x5b, flags: 0x0},
- 147: {lang: 0x1d5, script: 0x5b, flags: 0x0},
- 149: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 150: {lang: 0x1b, script: 0x2, flags: 0x1},
- 152: {lang: 0x1bc, script: 0x3e, flags: 0x0},
- 154: {lang: 0x1d, script: 0x3, flags: 0x1},
- 156: {lang: 0x3a, script: 0x5, flags: 0x0},
- 157: {lang: 0x20, script: 0x2, flags: 0x1},
- 158: {lang: 0x1f8, script: 0x5b, flags: 0x0},
- 159: {lang: 0x1f9, script: 0x5b, flags: 0x0},
- 162: {lang: 0x3a, script: 0x5, flags: 0x0},
- 163: {lang: 0x200, script: 0x49, flags: 0x0},
- 165: {lang: 0x445, script: 0x5b, flags: 0x0},
- 166: {lang: 0x28a, script: 0x20, flags: 0x0},
- 167: {lang: 0x22, script: 0x3, flags: 0x1},
- 169: {lang: 0x25, script: 0x2, flags: 0x1},
- 171: {lang: 0x254, script: 0x54, flags: 0x0},
- 172: {lang: 0x254, script: 0x54, flags: 0x0},
- 173: {lang: 0x3a, script: 0x5, flags: 0x0},
- 175: {lang: 0x3e2, script: 0x20, flags: 0x0},
- 176: {lang: 0x27, script: 0x2, flags: 0x1},
- 177: {lang: 0x3a, script: 0x5, flags: 0x0},
- 179: {lang: 0x10d, script: 0x5b, flags: 0x0},
- 180: {lang: 0x40c, script: 0xd6, flags: 0x0},
- 182: {lang: 0x43b, script: 0x5b, flags: 0x0},
- 183: {lang: 0x2c0, script: 0x5b, flags: 0x0},
- 184: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 185: {lang: 0x2c7, script: 0x5b, flags: 0x0},
- 186: {lang: 0x3a, script: 0x5, flags: 0x0},
- 187: {lang: 0x29, script: 0x2, flags: 0x1},
- 188: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 189: {lang: 0x2b, script: 0x2, flags: 0x1},
- 190: {lang: 0x432, script: 0x5b, flags: 0x0},
- 191: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 192: {lang: 0x2f1, script: 0x5b, flags: 0x0},
- 195: {lang: 0x2d, script: 0x2, flags: 0x1},
- 196: {lang: 0xa0, script: 0x5b, flags: 0x0},
- 197: {lang: 0x2f, script: 0x2, flags: 0x1},
- 198: {lang: 0x31, script: 0x2, flags: 0x1},
- 199: {lang: 0x33, script: 0x2, flags: 0x1},
- 201: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 202: {lang: 0x35, script: 0x2, flags: 0x1},
- 204: {lang: 0x320, script: 0x5b, flags: 0x0},
- 205: {lang: 0x37, script: 0x3, flags: 0x1},
- 206: {lang: 0x128, script: 0xed, flags: 0x0},
- 208: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 209: {lang: 0x31f, script: 0x5b, flags: 0x0},
- 210: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 211: {lang: 0x16, script: 0x5b, flags: 0x0},
- 212: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 213: {lang: 0x1b4, script: 0x5b, flags: 0x0},
- 215: {lang: 0x1b4, script: 0x5, flags: 0x2},
- 217: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 218: {lang: 0x367, script: 0x5b, flags: 0x0},
- 219: {lang: 0x347, script: 0x5b, flags: 0x0},
- 220: {lang: 0x351, script: 0x22, flags: 0x0},
- 226: {lang: 0x3a, script: 0x5, flags: 0x0},
- 227: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 229: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 230: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 231: {lang: 0x486, script: 0x5b, flags: 0x0},
- 232: {lang: 0x153, script: 0x5b, flags: 0x0},
- 233: {lang: 0x3a, script: 0x3, flags: 0x1},
- 234: {lang: 0x3b3, script: 0x5b, flags: 0x0},
- 235: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 237: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 238: {lang: 0x3a, script: 0x5, flags: 0x0},
- 239: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 241: {lang: 0x3a2, script: 0x5b, flags: 0x0},
- 242: {lang: 0x194, script: 0x5b, flags: 0x0},
- 244: {lang: 0x3a, script: 0x5, flags: 0x0},
- 259: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 261: {lang: 0x3d, script: 0x2, flags: 0x1},
- 262: {lang: 0x432, script: 0x20, flags: 0x0},
- 263: {lang: 0x3f, script: 0x2, flags: 0x1},
- 264: {lang: 0x3e5, script: 0x5b, flags: 0x0},
- 265: {lang: 0x3a, script: 0x5, flags: 0x0},
- 267: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 268: {lang: 0x3a, script: 0x5, flags: 0x0},
- 269: {lang: 0x41, script: 0x2, flags: 0x1},
- 272: {lang: 0x416, script: 0x5b, flags: 0x0},
- 273: {lang: 0x347, script: 0x5b, flags: 0x0},
- 274: {lang: 0x43, script: 0x2, flags: 0x1},
- 276: {lang: 0x1f9, script: 0x5b, flags: 0x0},
- 277: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 278: {lang: 0x429, script: 0x5b, flags: 0x0},
- 279: {lang: 0x367, script: 0x5b, flags: 0x0},
- 281: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 283: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 285: {lang: 0x45, script: 0x2, flags: 0x1},
- 289: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 290: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 291: {lang: 0x47, script: 0x2, flags: 0x1},
- 292: {lang: 0x49, script: 0x3, flags: 0x1},
- 293: {lang: 0x4c, script: 0x2, flags: 0x1},
- 294: {lang: 0x477, script: 0x5b, flags: 0x0},
- 295: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 296: {lang: 0x476, script: 0x5b, flags: 0x0},
- 297: {lang: 0x4e, script: 0x2, flags: 0x1},
- 298: {lang: 0x482, script: 0x5b, flags: 0x0},
- 300: {lang: 0x50, script: 0x4, flags: 0x1},
- 302: {lang: 0x4a0, script: 0x5b, flags: 0x0},
- 303: {lang: 0x54, script: 0x2, flags: 0x1},
- 304: {lang: 0x445, script: 0x5b, flags: 0x0},
- 305: {lang: 0x56, script: 0x3, flags: 0x1},
- 306: {lang: 0x445, script: 0x5b, flags: 0x0},
- 310: {lang: 0x512, script: 0x3e, flags: 0x2},
- 311: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 312: {lang: 0x4bc, script: 0x5b, flags: 0x0},
- 313: {lang: 0x1f9, script: 0x5b, flags: 0x0},
- 316: {lang: 0x13e, script: 0x5b, flags: 0x0},
- 319: {lang: 0x4c3, script: 0x5b, flags: 0x0},
- 320: {lang: 0x8a, script: 0x5b, flags: 0x0},
- 321: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 323: {lang: 0x41b, script: 0x5b, flags: 0x0},
- 334: {lang: 0x59, script: 0x2, flags: 0x1},
- 351: {lang: 0x3a, script: 0x5, flags: 0x0},
- 352: {lang: 0x5b, script: 0x2, flags: 0x1},
- 357: {lang: 0x423, script: 0x5b, flags: 0x0},
-}
-
-// likelyRegionList holds lists info associated with likelyRegion.
-// Size: 558 bytes, 93 elements
-var likelyRegionList = [93]likelyLangScript{
- 0: {lang: 0x148, script: 0x5, flags: 0x0},
- 1: {lang: 0x476, script: 0x5b, flags: 0x0},
- 2: {lang: 0x431, script: 0x5b, flags: 0x0},
- 3: {lang: 0x2ff, script: 0x20, flags: 0x0},
- 4: {lang: 0x1d7, script: 0x8, flags: 0x0},
- 5: {lang: 0x274, script: 0x5b, flags: 0x0},
- 6: {lang: 0xb7, script: 0x5b, flags: 0x0},
- 7: {lang: 0x432, script: 0x20, flags: 0x0},
- 8: {lang: 0x12d, script: 0xef, flags: 0x0},
- 9: {lang: 0x351, script: 0x22, flags: 0x0},
- 10: {lang: 0x529, script: 0x3b, flags: 0x0},
- 11: {lang: 0x4ac, script: 0x5, flags: 0x0},
- 12: {lang: 0x523, script: 0x5b, flags: 0x0},
- 13: {lang: 0x29a, script: 0xee, flags: 0x0},
- 14: {lang: 0x136, script: 0x34, flags: 0x0},
- 15: {lang: 0x48a, script: 0x5b, flags: 0x0},
- 16: {lang: 0x3a, script: 0x5, flags: 0x0},
- 17: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 18: {lang: 0x27, script: 0x2c, flags: 0x0},
- 19: {lang: 0x139, script: 0x5b, flags: 0x0},
- 20: {lang: 0x26a, script: 0x5, flags: 0x2},
- 21: {lang: 0x512, script: 0x3e, flags: 0x2},
- 22: {lang: 0x210, script: 0x2e, flags: 0x0},
- 23: {lang: 0x5, script: 0x20, flags: 0x0},
- 24: {lang: 0x274, script: 0x5b, flags: 0x0},
- 25: {lang: 0x136, script: 0x34, flags: 0x0},
- 26: {lang: 0x2ff, script: 0x20, flags: 0x0},
- 27: {lang: 0x1e1, script: 0x5b, flags: 0x0},
- 28: {lang: 0x31f, script: 0x5, flags: 0x0},
- 29: {lang: 0x1be, script: 0x22, flags: 0x0},
- 30: {lang: 0x4b4, script: 0x5, flags: 0x0},
- 31: {lang: 0x236, script: 0x76, flags: 0x0},
- 32: {lang: 0x148, script: 0x5, flags: 0x0},
- 33: {lang: 0x476, script: 0x5b, flags: 0x0},
- 34: {lang: 0x24a, script: 0x4f, flags: 0x0},
- 35: {lang: 0xe6, script: 0x5, flags: 0x0},
- 36: {lang: 0x226, script: 0xee, flags: 0x0},
- 37: {lang: 0x3a, script: 0x5, flags: 0x0},
- 38: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 39: {lang: 0x2b8, script: 0x58, flags: 0x0},
- 40: {lang: 0x226, script: 0xee, flags: 0x0},
- 41: {lang: 0x3a, script: 0x5, flags: 0x0},
- 42: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 43: {lang: 0x3dc, script: 0x5b, flags: 0x0},
- 44: {lang: 0x4ae, script: 0x20, flags: 0x0},
- 45: {lang: 0x2ff, script: 0x20, flags: 0x0},
- 46: {lang: 0x431, script: 0x5b, flags: 0x0},
- 47: {lang: 0x331, script: 0x76, flags: 0x0},
- 48: {lang: 0x213, script: 0x5b, flags: 0x0},
- 49: {lang: 0x30b, script: 0x20, flags: 0x0},
- 50: {lang: 0x242, script: 0x5, flags: 0x0},
- 51: {lang: 0x529, script: 0x3c, flags: 0x0},
- 52: {lang: 0x3c0, script: 0x5b, flags: 0x0},
- 53: {lang: 0x3a, script: 0x5, flags: 0x0},
- 54: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 55: {lang: 0x2ed, script: 0x5b, flags: 0x0},
- 56: {lang: 0x4b4, script: 0x5, flags: 0x0},
- 57: {lang: 0x88, script: 0x22, flags: 0x0},
- 58: {lang: 0x4b4, script: 0x5, flags: 0x0},
- 59: {lang: 0x4b4, script: 0x5, flags: 0x0},
- 60: {lang: 0xbe, script: 0x22, flags: 0x0},
- 61: {lang: 0x3dc, script: 0x5b, flags: 0x0},
- 62: {lang: 0x7e, script: 0x20, flags: 0x0},
- 63: {lang: 0x3e2, script: 0x20, flags: 0x0},
- 64: {lang: 0x267, script: 0x5b, flags: 0x0},
- 65: {lang: 0x444, script: 0x5b, flags: 0x0},
- 66: {lang: 0x512, script: 0x3e, flags: 0x0},
- 67: {lang: 0x412, script: 0x5b, flags: 0x0},
- 68: {lang: 0x4ae, script: 0x20, flags: 0x0},
- 69: {lang: 0x3a, script: 0x5, flags: 0x0},
- 70: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 71: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 72: {lang: 0x35, script: 0x5, flags: 0x0},
- 73: {lang: 0x46b, script: 0xee, flags: 0x0},
- 74: {lang: 0x2ec, script: 0x5, flags: 0x0},
- 75: {lang: 0x30f, script: 0x76, flags: 0x0},
- 76: {lang: 0x467, script: 0x20, flags: 0x0},
- 77: {lang: 0x148, script: 0x5, flags: 0x0},
- 78: {lang: 0x3a, script: 0x5, flags: 0x0},
- 79: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 80: {lang: 0x48a, script: 0x5b, flags: 0x0},
- 81: {lang: 0x58, script: 0x5, flags: 0x0},
- 82: {lang: 0x219, script: 0x20, flags: 0x0},
- 83: {lang: 0x81, script: 0x34, flags: 0x0},
- 84: {lang: 0x529, script: 0x3c, flags: 0x0},
- 85: {lang: 0x48c, script: 0x5b, flags: 0x0},
- 86: {lang: 0x4ae, script: 0x20, flags: 0x0},
- 87: {lang: 0x512, script: 0x3e, flags: 0x0},
- 88: {lang: 0x3b3, script: 0x5b, flags: 0x0},
- 89: {lang: 0x431, script: 0x5b, flags: 0x0},
- 90: {lang: 0x432, script: 0x20, flags: 0x0},
- 91: {lang: 0x15e, script: 0x5b, flags: 0x0},
- 92: {lang: 0x446, script: 0x5, flags: 0x0},
-}
-
-type likelyTag struct {
- lang uint16
- region uint16
- script uint16
-}
-
-// Size: 198 bytes, 33 elements
-var likelyRegionGroup = [33]likelyTag{
- 1: {lang: 0x139, region: 0xd7, script: 0x5b},
- 2: {lang: 0x139, region: 0x136, script: 0x5b},
- 3: {lang: 0x3c0, region: 0x41, script: 0x5b},
- 4: {lang: 0x139, region: 0x2f, script: 0x5b},
- 5: {lang: 0x139, region: 0xd7, script: 0x5b},
- 6: {lang: 0x13e, region: 0xd0, script: 0x5b},
- 7: {lang: 0x445, region: 0x130, script: 0x5b},
- 8: {lang: 0x3a, region: 0x6c, script: 0x5},
- 9: {lang: 0x445, region: 0x4b, script: 0x5b},
- 10: {lang: 0x139, region: 0x162, script: 0x5b},
- 11: {lang: 0x139, region: 0x136, script: 0x5b},
- 12: {lang: 0x139, region: 0x136, script: 0x5b},
- 13: {lang: 0x13e, region: 0x5a, script: 0x5b},
- 14: {lang: 0x529, region: 0x53, script: 0x3b},
- 15: {lang: 0x1be, region: 0x9a, script: 0x22},
- 16: {lang: 0x1e1, region: 0x96, script: 0x5b},
- 17: {lang: 0x1f9, region: 0x9f, script: 0x5b},
- 18: {lang: 0x139, region: 0x2f, script: 0x5b},
- 19: {lang: 0x139, region: 0xe7, script: 0x5b},
- 20: {lang: 0x139, region: 0x8b, script: 0x5b},
- 21: {lang: 0x41b, region: 0x143, script: 0x5b},
- 22: {lang: 0x529, region: 0x53, script: 0x3b},
- 23: {lang: 0x4bc, region: 0x138, script: 0x5b},
- 24: {lang: 0x3a, region: 0x109, script: 0x5},
- 25: {lang: 0x3e2, region: 0x107, script: 0x20},
- 26: {lang: 0x3e2, region: 0x107, script: 0x20},
- 27: {lang: 0x139, region: 0x7c, script: 0x5b},
- 28: {lang: 0x10d, region: 0x61, script: 0x5b},
- 29: {lang: 0x139, region: 0xd7, script: 0x5b},
- 30: {lang: 0x13e, region: 0x1f, script: 0x5b},
- 31: {lang: 0x139, region: 0x9b, script: 0x5b},
- 32: {lang: 0x139, region: 0x7c, script: 0x5b},
-}
-
-// Size: 264 bytes, 33 elements
-var regionContainment = [33]uint64{
- // Entry 0 - 1F
- 0x00000001ffffffff, 0x00000000200007a2, 0x0000000000003044, 0x0000000000000008,
- 0x00000000803c0010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080,
- 0x0000000000000100, 0x0000000000000200, 0x0000000000000400, 0x000000004000384c,
- 0x0000000000001000, 0x0000000000002000, 0x0000000000004000, 0x0000000000008000,
- 0x0000000000010000, 0x0000000000020000, 0x0000000000040000, 0x0000000000080000,
- 0x0000000000100000, 0x0000000000200000, 0x0000000001c1c000, 0x0000000000800000,
- 0x0000000001000000, 0x000000001e020000, 0x0000000004000000, 0x0000000008000000,
- 0x0000000010000000, 0x00000000200006a0, 0x0000000040002048, 0x0000000080000000,
- // Entry 20 - 3F
- 0x0000000100000000,
-}
-
-// regionInclusion maps region identifiers to sets of regions in regionInclusionBits,
-// where each set holds all groupings that are directly connected in a region
-// containment graph.
-// Size: 359 bytes, 359 elements
-var regionInclusion = [359]uint8{
- // Entry 0 - 3F
- 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
- 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
- 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
- 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e,
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x26, 0x23,
- 0x24, 0x26, 0x27, 0x22, 0x28, 0x29, 0x2a, 0x2b,
- 0x26, 0x2c, 0x24, 0x23, 0x26, 0x25, 0x2a, 0x2d,
- 0x2e, 0x24, 0x2f, 0x2d, 0x26, 0x30, 0x31, 0x28,
- // Entry 40 - 7F
- 0x26, 0x28, 0x26, 0x25, 0x31, 0x22, 0x32, 0x33,
- 0x34, 0x30, 0x22, 0x27, 0x27, 0x27, 0x35, 0x2d,
- 0x29, 0x28, 0x27, 0x36, 0x28, 0x22, 0x21, 0x34,
- 0x23, 0x21, 0x26, 0x2d, 0x26, 0x22, 0x37, 0x2e,
- 0x35, 0x2a, 0x22, 0x2f, 0x38, 0x26, 0x26, 0x21,
- 0x39, 0x39, 0x28, 0x38, 0x39, 0x39, 0x2f, 0x3a,
- 0x2f, 0x20, 0x21, 0x38, 0x3b, 0x28, 0x3c, 0x2c,
- 0x21, 0x2a, 0x35, 0x27, 0x38, 0x26, 0x24, 0x28,
- // Entry 80 - BF
- 0x2c, 0x2d, 0x23, 0x30, 0x2d, 0x2d, 0x26, 0x27,
- 0x3a, 0x22, 0x34, 0x3c, 0x2d, 0x28, 0x36, 0x22,
- 0x34, 0x3a, 0x26, 0x2e, 0x21, 0x39, 0x31, 0x38,
- 0x24, 0x2c, 0x25, 0x22, 0x24, 0x25, 0x2c, 0x3a,
- 0x2c, 0x26, 0x24, 0x36, 0x21, 0x2f, 0x3d, 0x31,
- 0x3c, 0x2f, 0x26, 0x36, 0x36, 0x24, 0x26, 0x3d,
- 0x31, 0x24, 0x26, 0x35, 0x25, 0x2d, 0x32, 0x38,
- 0x2a, 0x38, 0x39, 0x39, 0x35, 0x33, 0x23, 0x26,
- // Entry C0 - FF
- 0x2f, 0x3c, 0x21, 0x23, 0x2d, 0x31, 0x36, 0x36,
- 0x3c, 0x26, 0x2d, 0x26, 0x3a, 0x2f, 0x25, 0x2f,
- 0x34, 0x31, 0x2f, 0x32, 0x3b, 0x2d, 0x2b, 0x2d,
- 0x21, 0x34, 0x2a, 0x2c, 0x25, 0x21, 0x3c, 0x24,
- 0x29, 0x2b, 0x24, 0x34, 0x21, 0x28, 0x29, 0x3b,
- 0x31, 0x25, 0x2e, 0x30, 0x29, 0x26, 0x24, 0x3a,
- 0x21, 0x3c, 0x28, 0x21, 0x24, 0x21, 0x21, 0x1f,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
- // Entry 100 - 13F
- 0x21, 0x21, 0x21, 0x2f, 0x21, 0x2e, 0x23, 0x33,
- 0x2f, 0x24, 0x3b, 0x2f, 0x39, 0x38, 0x31, 0x2d,
- 0x3a, 0x2c, 0x2e, 0x2d, 0x23, 0x2d, 0x2f, 0x28,
- 0x2f, 0x27, 0x33, 0x34, 0x26, 0x24, 0x32, 0x22,
- 0x26, 0x27, 0x22, 0x2d, 0x31, 0x3d, 0x29, 0x31,
- 0x3d, 0x39, 0x29, 0x31, 0x24, 0x26, 0x29, 0x36,
- 0x2f, 0x33, 0x2f, 0x21, 0x22, 0x21, 0x30, 0x28,
- 0x3d, 0x23, 0x26, 0x21, 0x28, 0x26, 0x26, 0x31,
- // Entry 140 - 17F
- 0x3b, 0x29, 0x21, 0x29, 0x21, 0x21, 0x21, 0x21,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x23, 0x21,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
- 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x24, 0x24,
- 0x2f, 0x23, 0x32, 0x2f, 0x27, 0x2f, 0x21,
-}
-
-// regionInclusionBits is an array of bit vectors where every vector represents
-// a set of region groupings. These sets are used to compute the distance
-// between two regions for the purpose of language matching.
-// Size: 584 bytes, 73 elements
-var regionInclusionBits = [73]uint64{
- // Entry 0 - 1F
- 0x0000000102400813, 0x00000000200007a3, 0x0000000000003844, 0x0000000040000808,
- 0x00000000803c0011, 0x0000000020000022, 0x0000000040000844, 0x0000000020000082,
- 0x0000000000000102, 0x0000000020000202, 0x0000000020000402, 0x000000004000384d,
- 0x0000000000001804, 0x0000000040002804, 0x0000000000404000, 0x0000000000408000,
- 0x0000000000410000, 0x0000000002020000, 0x0000000000040010, 0x0000000000080010,
- 0x0000000000100010, 0x0000000000200010, 0x0000000001c1c001, 0x0000000000c00000,
- 0x0000000001400000, 0x000000001e020001, 0x0000000006000000, 0x000000000a000000,
- 0x0000000012000000, 0x00000000200006a2, 0x0000000040002848, 0x0000000080000010,
- // Entry 20 - 3F
- 0x0000000100000001, 0x0000000000000001, 0x0000000080000000, 0x0000000000020000,
- 0x0000000001000000, 0x0000000000008000, 0x0000000000002000, 0x0000000000000200,
- 0x0000000000000008, 0x0000000000200000, 0x0000000110000000, 0x0000000000040000,
- 0x0000000008000000, 0x0000000000000020, 0x0000000104000000, 0x0000000000000080,
- 0x0000000000001000, 0x0000000000010000, 0x0000000000000400, 0x0000000004000000,
- 0x0000000000000040, 0x0000000010000000, 0x0000000000004000, 0x0000000101000000,
- 0x0000000108000000, 0x0000000000000100, 0x0000000100020000, 0x0000000000080000,
- 0x0000000000100000, 0x0000000000800000, 0x00000001ffffffff, 0x0000000122400fb3,
- // Entry 40 - 5F
- 0x00000001827c0813, 0x000000014240385f, 0x0000000103c1c813, 0x000000011e420813,
- 0x0000000112000001, 0x0000000106000001, 0x0000000101400001, 0x000000010a000001,
- 0x0000000102020001,
-}
-
-// regionInclusionNext marks, for each entry in regionInclusionBits, the set of
-// all groups that are reachable from the groups set in the respective entry.
-// Size: 73 bytes, 73 elements
-var regionInclusionNext = [73]uint8{
- // Entry 0 - 3F
- 0x3e, 0x3f, 0x0b, 0x0b, 0x40, 0x01, 0x0b, 0x01,
- 0x01, 0x01, 0x01, 0x41, 0x0b, 0x0b, 0x16, 0x16,
- 0x16, 0x19, 0x04, 0x04, 0x04, 0x04, 0x42, 0x16,
- 0x16, 0x43, 0x19, 0x19, 0x19, 0x01, 0x0b, 0x04,
- 0x00, 0x00, 0x1f, 0x11, 0x18, 0x0f, 0x0d, 0x09,
- 0x03, 0x15, 0x44, 0x12, 0x1b, 0x05, 0x45, 0x07,
- 0x0c, 0x10, 0x0a, 0x1a, 0x06, 0x1c, 0x0e, 0x46,
- 0x47, 0x08, 0x48, 0x13, 0x14, 0x17, 0x3e, 0x3e,
- // Entry 40 - 7F
- 0x3e, 0x3e, 0x3e, 0x3e, 0x43, 0x43, 0x42, 0x43,
- 0x43,
-}
-
-type parentRel struct {
- lang uint16
- script uint16
- maxScript uint16
- toRegion uint16
- fromRegion []uint16
-}
-
-// Size: 414 bytes, 5 elements
-var parents = [5]parentRel{
- 0: {lang: 0x139, script: 0x0, maxScript: 0x5b, toRegion: 0x1, fromRegion: []uint16{0x1a, 0x25, 0x26, 0x2f, 0x34, 0x36, 0x3d, 0x42, 0x46, 0x48, 0x49, 0x4a, 0x50, 0x52, 0x5d, 0x5e, 0x62, 0x65, 0x6e, 0x74, 0x75, 0x76, 0x7c, 0x7d, 0x80, 0x81, 0x82, 0x84, 0x8d, 0x8e, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0xa0, 0xa1, 0xa5, 0xa8, 0xaa, 0xae, 0xb2, 0xb5, 0xb6, 0xc0, 0xc7, 0xcb, 0xcc, 0xcd, 0xcf, 0xd1, 0xd3, 0xd6, 0xd7, 0xde, 0xe0, 0xe1, 0xe7, 0xe8, 0xe9, 0xec, 0xf1, 0x108, 0x10a, 0x10b, 0x10c, 0x10e, 0x10f, 0x113, 0x118, 0x11c, 0x11e, 0x120, 0x126, 0x12a, 0x12d, 0x12e, 0x130, 0x132, 0x13a, 0x13d, 0x140, 0x143, 0x162, 0x163, 0x165}},
- 1: {lang: 0x139, script: 0x0, maxScript: 0x5b, toRegion: 0x1a, fromRegion: []uint16{0x2e, 0x4e, 0x61, 0x64, 0x73, 0xda, 0x10d, 0x110}},
- 2: {lang: 0x13e, script: 0x0, maxScript: 0x5b, toRegion: 0x1f, fromRegion: []uint16{0x2c, 0x3f, 0x41, 0x48, 0x51, 0x54, 0x57, 0x5a, 0x66, 0x6a, 0x8a, 0x90, 0xd0, 0xd9, 0xe3, 0xe5, 0xed, 0xf2, 0x11b, 0x136, 0x137, 0x13c}},
- 3: {lang: 0x3c0, script: 0x0, maxScript: 0x5b, toRegion: 0xef, fromRegion: []uint16{0x2a, 0x4e, 0x5b, 0x87, 0x8c, 0xb8, 0xc7, 0xd2, 0x119, 0x127}},
- 4: {lang: 0x529, script: 0x3c, maxScript: 0x3c, toRegion: 0x8e, fromRegion: []uint16{0xc7}},
-}
-
-// Total table size 30466 bytes (29KiB); checksum: 7544152B
diff --git a/vendor/golang.org/x/text/internal/language/tags.go b/vendor/golang.org/x/text/internal/language/tags.go
deleted file mode 100644
index e7afd31..0000000
--- a/vendor/golang.org/x/text/internal/language/tags.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
-// It simplifies safe initialization of Tag values.
-func MustParse(s string) Tag {
- t, err := Parse(s)
- if err != nil {
- panic(err)
- }
- return t
-}
-
-// MustParseBase is like ParseBase, but panics if the given base cannot be parsed.
-// It simplifies safe initialization of Base values.
-func MustParseBase(s string) Language {
- b, err := ParseBase(s)
- if err != nil {
- panic(err)
- }
- return b
-}
-
-// MustParseScript is like ParseScript, but panics if the given script cannot be
-// parsed. It simplifies safe initialization of Script values.
-func MustParseScript(s string) Script {
- scr, err := ParseScript(s)
- if err != nil {
- panic(err)
- }
- return scr
-}
-
-// MustParseRegion is like ParseRegion, but panics if the given region cannot be
-// parsed. It simplifies safe initialization of Region values.
-func MustParseRegion(s string) Region {
- r, err := ParseRegion(s)
- if err != nil {
- panic(err)
- }
- return r
-}
-
-// Und is the root language.
-var Und Tag
diff --git a/vendor/golang.org/x/text/internal/match.go b/vendor/golang.org/x/text/internal/match.go
deleted file mode 100644
index 1cc004a..0000000
--- a/vendor/golang.org/x/text/internal/match.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package internal
-
-// This file contains matchers that implement CLDR inheritance.
-//
-// See https://unicode.org/reports/tr35/#Locale_Inheritance.
-//
-// Some of the inheritance described in this document is already handled by
-// the cldr package.
-
-import (
- "golang.org/x/text/language"
-)
-
-// TODO: consider if (some of the) matching algorithm needs to be public after
-// getting some feel about what is generic and what is specific.
-
-// NewInheritanceMatcher returns a matcher that matches based on the inheritance
-// chain.
-//
-// The matcher uses canonicalization and the parent relationship to find a
-// match. The resulting match will always be either Und or a language with the
-// same language and script as the requested language. It will not match
-// languages for which there is understood to be mutual or one-directional
-// intelligibility.
-//
-// A Match will indicate an Exact match if the language matches after
-// canonicalization and High if the matched tag is a parent.
-func NewInheritanceMatcher(t []language.Tag) *InheritanceMatcher {
- tags := &InheritanceMatcher{make(map[language.Tag]int)}
- for i, tag := range t {
- ct, err := language.All.Canonicalize(tag)
- if err != nil {
- ct = tag
- }
- tags.index[ct] = i
- }
- return tags
-}
-
-type InheritanceMatcher struct {
- index map[language.Tag]int
-}
-
-func (m InheritanceMatcher) Match(want ...language.Tag) (language.Tag, int, language.Confidence) {
- for _, t := range want {
- ct, err := language.All.Canonicalize(t)
- if err != nil {
- ct = t
- }
- conf := language.Exact
- for {
- if index, ok := m.index[ct]; ok {
- return ct, index, conf
- }
- if ct == language.Und {
- break
- }
- ct = ct.Parent()
- conf = language.High
- }
- }
- return language.Und, 0, language.No
-}
diff --git a/vendor/golang.org/x/text/internal/number/common.go b/vendor/golang.org/x/text/internal/number/common.go
deleted file mode 100644
index a6e9c8e..0000000
--- a/vendor/golang.org/x/text/internal/number/common.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package number
-
-import (
- "unicode/utf8"
-
- "golang.org/x/text/internal/language/compact"
-)
-
-// A system identifies a CLDR numbering system.
-type system byte
-
-type systemData struct {
- id system
- digitSize byte // number of UTF-8 bytes per digit
- zero [utf8.UTFMax]byte // UTF-8 sequence of zero digit.
-}
-
-// A SymbolType identifies a symbol of a specific kind.
-type SymbolType int
-
-const (
- SymDecimal SymbolType = iota
- SymGroup
- SymList
- SymPercentSign
- SymPlusSign
- SymMinusSign
- SymExponential
- SymSuperscriptingExponent
- SymPerMille
- SymInfinity
- SymNan
- SymTimeSeparator
-
- NumSymbolTypes
-)
-
-const hasNonLatnMask = 0x8000
-
-// symOffset is an offset into altSymData if the bit indicated by hasNonLatnMask
-// is not 0 (with this bit masked out), and an offset into symIndex otherwise.
-//
-// TODO: this type can be a byte again if we use an indirection into altsymData
-// and introduce an alt -> offset slice (the length of this will be number of
-// alternatives plus 1). This also allows getting rid of the compactTag field
-// in altSymData. In total this will save about 1K.
-type symOffset uint16
-
-type altSymData struct {
- compactTag compact.ID
- symIndex symOffset
- system system
-}
diff --git a/vendor/golang.org/x/text/internal/number/decimal.go b/vendor/golang.org/x/text/internal/number/decimal.go
deleted file mode 100644
index e128cf3..0000000
--- a/vendor/golang.org/x/text/internal/number/decimal.go
+++ /dev/null
@@ -1,500 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:generate stringer -type RoundingMode
-
-package number
-
-import (
- "math"
- "strconv"
-)
-
-// RoundingMode determines how a number is rounded to the desired precision.
-type RoundingMode byte
-
-const (
- ToNearestEven RoundingMode = iota // towards the nearest integer, or towards an even number if equidistant.
- ToNearestZero // towards the nearest integer, or towards zero if equidistant.
- ToNearestAway // towards the nearest integer, or away from zero if equidistant.
- ToPositiveInf // towards infinity
- ToNegativeInf // towards negative infinity
- ToZero // towards zero
- AwayFromZero // away from zero
- numModes
-)
-
-const maxIntDigits = 20
-
-// A Decimal represents a floating point number in decimal format.
-// Digits represents a number [0, 1.0), and the absolute value represented by
-// Decimal is Digits * 10^Exp. Leading and trailing zeros may be omitted and Exp
-// may point outside a valid position in Digits.
-//
-// Examples:
-//
-// Number Decimal
-// 12345 Digits: [1, 2, 3, 4, 5], Exp: 5
-// 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2
-// 12000 Digits: [1, 2], Exp: 5
-// 12000.00 Digits: [1, 2], Exp: 5
-// 0.00123 Digits: [1, 2, 3], Exp: -2
-// 0 Digits: [], Exp: 0
-type Decimal struct {
- digits
-
- buf [maxIntDigits]byte
-}
-
-type digits struct {
- Digits []byte // mantissa digits, big-endian
- Exp int32 // exponent
- Neg bool
- Inf bool // Takes precedence over Digits and Exp.
- NaN bool // Takes precedence over Inf.
-}
-
-// Digits represents a floating point number represented in digits of the
-// base in which a number is to be displayed. It is similar to Decimal, but
-// keeps track of trailing fraction zeros and the comma placement for
-// engineering notation. Digits must have at least one digit.
-//
-// Examples:
-//
-// Number Decimal
-// decimal
-// 12345 Digits: [1, 2, 3, 4, 5], Exp: 5 End: 5
-// 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2 End: 5
-// 12000 Digits: [1, 2], Exp: 5 End: 5
-// 12000.00 Digits: [1, 2], Exp: 5 End: 7
-// 0.00123 Digits: [1, 2, 3], Exp: -2 End: 3
-// 0 Digits: [], Exp: 0 End: 1
-// scientific (actual exp is Exp - Comma)
-// 0e0 Digits: [0], Exp: 1, End: 1, Comma: 1
-// .0e0 Digits: [0], Exp: 0, End: 1, Comma: 0
-// 0.0e0 Digits: [0], Exp: 1, End: 2, Comma: 1
-// 1.23e4 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 1
-// .123e5 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 0
-// engineering
-// 12.3e3 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 2
-type Digits struct {
- digits
- // End indicates the end position of the number.
- End int32 // For decimals Exp <= End. For scientific len(Digits) <= End.
- // Comma is used for the comma position for scientific (always 0 or 1) and
- // engineering notation (always 0, 1, 2, or 3).
- Comma uint8
- // IsScientific indicates whether this number is to be rendered as a
- // scientific number.
- IsScientific bool
-}
-
-func (d *Digits) NumFracDigits() int {
- if d.Exp >= d.End {
- return 0
- }
- return int(d.End - d.Exp)
-}
-
-// normalize returns a new Decimal with leading and trailing zeros removed.
-func (d *Decimal) normalize() (n Decimal) {
- n = *d
- b := n.Digits
- // Strip leading zeros. Resulting number of digits is significant digits.
- for len(b) > 0 && b[0] == 0 {
- b = b[1:]
- n.Exp--
- }
- // Strip trailing zeros
- for len(b) > 0 && b[len(b)-1] == 0 {
- b = b[:len(b)-1]
- }
- if len(b) == 0 {
- n.Exp = 0
- }
- n.Digits = b
- return n
-}
-
-func (d *Decimal) clear() {
- b := d.Digits
- if b == nil {
- b = d.buf[:0]
- }
- *d = Decimal{}
- d.Digits = b[:0]
-}
-
-func (x *Decimal) String() string {
- if x.NaN {
- return "NaN"
- }
- var buf []byte
- if x.Neg {
- buf = append(buf, '-')
- }
- if x.Inf {
- buf = append(buf, "Inf"...)
- return string(buf)
- }
- switch {
- case len(x.Digits) == 0:
- buf = append(buf, '0')
- case x.Exp <= 0:
- // 0.00ddd
- buf = append(buf, "0."...)
- buf = appendZeros(buf, -int(x.Exp))
- buf = appendDigits(buf, x.Digits)
-
- case /* 0 < */ int(x.Exp) < len(x.Digits):
- // dd.ddd
- buf = appendDigits(buf, x.Digits[:x.Exp])
- buf = append(buf, '.')
- buf = appendDigits(buf, x.Digits[x.Exp:])
-
- default: // len(x.Digits) <= x.Exp
- // ddd00
- buf = appendDigits(buf, x.Digits)
- buf = appendZeros(buf, int(x.Exp)-len(x.Digits))
- }
- return string(buf)
-}
-
-func appendDigits(buf []byte, digits []byte) []byte {
- for _, c := range digits {
- buf = append(buf, c+'0')
- }
- return buf
-}
-
-// appendZeros appends n 0 digits to buf and returns buf.
-func appendZeros(buf []byte, n int) []byte {
- for ; n > 0; n-- {
- buf = append(buf, '0')
- }
- return buf
-}
-
-func (d *digits) round(mode RoundingMode, n int) {
- if n >= len(d.Digits) {
- return
- }
- // Make rounding decision: The result mantissa is truncated ("rounded down")
- // by default. Decide if we need to increment, or "round up", the (unsigned)
- // mantissa.
- inc := false
- switch mode {
- case ToNegativeInf:
- inc = d.Neg
- case ToPositiveInf:
- inc = !d.Neg
- case ToZero:
- // nothing to do
- case AwayFromZero:
- inc = true
- case ToNearestEven:
- inc = d.Digits[n] > 5 || d.Digits[n] == 5 &&
- (len(d.Digits) > n+1 || n == 0 || d.Digits[n-1]&1 != 0)
- case ToNearestAway:
- inc = d.Digits[n] >= 5
- case ToNearestZero:
- inc = d.Digits[n] > 5 || d.Digits[n] == 5 && len(d.Digits) > n+1
- default:
- panic("unreachable")
- }
- if inc {
- d.roundUp(n)
- } else {
- d.roundDown(n)
- }
-}
-
-// roundFloat rounds a floating point number.
-func (r RoundingMode) roundFloat(x float64) float64 {
- // Make rounding decision: The result mantissa is truncated ("rounded down")
- // by default. Decide if we need to increment, or "round up", the (unsigned)
- // mantissa.
- abs := x
- if x < 0 {
- abs = -x
- }
- i, f := math.Modf(abs)
- if f == 0.0 {
- return x
- }
- inc := false
- switch r {
- case ToNegativeInf:
- inc = x < 0
- case ToPositiveInf:
- inc = x >= 0
- case ToZero:
- // nothing to do
- case AwayFromZero:
- inc = true
- case ToNearestEven:
- // TODO: check overflow
- inc = f > 0.5 || f == 0.5 && int64(i)&1 != 0
- case ToNearestAway:
- inc = f >= 0.5
- case ToNearestZero:
- inc = f > 0.5
- default:
- panic("unreachable")
- }
- if inc {
- i += 1
- }
- if abs != x {
- i = -i
- }
- return i
-}
-
-func (x *digits) roundUp(n int) {
- if n < 0 || n >= len(x.Digits) {
- return // nothing to do
- }
- // find first digit < 9
- for n > 0 && x.Digits[n-1] >= 9 {
- n--
- }
-
- if n == 0 {
- // all digits are 9s => round up to 1 and update exponent
- x.Digits[0] = 1 // ok since len(x.Digits) > n
- x.Digits = x.Digits[:1]
- x.Exp++
- return
- }
- x.Digits[n-1]++
- x.Digits = x.Digits[:n]
- // x already trimmed
-}
-
-func (x *digits) roundDown(n int) {
- if n < 0 || n >= len(x.Digits) {
- return // nothing to do
- }
- x.Digits = x.Digits[:n]
- trim(x)
-}
-
-// trim cuts off any trailing zeros from x's mantissa;
-// they are meaningless for the value of x.
-func trim(x *digits) {
- i := len(x.Digits)
- for i > 0 && x.Digits[i-1] == 0 {
- i--
- }
- x.Digits = x.Digits[:i]
- if i == 0 {
- x.Exp = 0
- }
-}
-
-// A Converter converts a number into decimals according to the given rounding
-// criteria.
-type Converter interface {
- Convert(d *Decimal, r RoundingContext)
-}
-
-const (
- signed = true
- unsigned = false
-)
-
-// Convert converts the given number to the decimal representation using the
-// supplied RoundingContext.
-func (d *Decimal) Convert(r RoundingContext, number interface{}) {
- switch f := number.(type) {
- case Converter:
- d.clear()
- f.Convert(d, r)
- case float32:
- d.ConvertFloat(r, float64(f), 32)
- case float64:
- d.ConvertFloat(r, f, 64)
- case int:
- d.ConvertInt(r, signed, uint64(f))
- case int8:
- d.ConvertInt(r, signed, uint64(f))
- case int16:
- d.ConvertInt(r, signed, uint64(f))
- case int32:
- d.ConvertInt(r, signed, uint64(f))
- case int64:
- d.ConvertInt(r, signed, uint64(f))
- case uint:
- d.ConvertInt(r, unsigned, uint64(f))
- case uint8:
- d.ConvertInt(r, unsigned, uint64(f))
- case uint16:
- d.ConvertInt(r, unsigned, uint64(f))
- case uint32:
- d.ConvertInt(r, unsigned, uint64(f))
- case uint64:
- d.ConvertInt(r, unsigned, f)
-
- default:
- d.NaN = true
- // TODO:
- // case string: if produced by strconv, allows for easy arbitrary pos.
- // case reflect.Value:
- // case big.Float
- // case big.Int
- // case big.Rat?
- // catch underlyings using reflect or will this already be done by the
- // message package?
- }
-}
-
-// ConvertInt converts an integer to decimals.
-func (d *Decimal) ConvertInt(r RoundingContext, signed bool, x uint64) {
- if r.Increment > 0 {
- // TODO: if uint64 is too large, fall back to float64
- if signed {
- d.ConvertFloat(r, float64(int64(x)), 64)
- } else {
- d.ConvertFloat(r, float64(x), 64)
- }
- return
- }
- d.clear()
- if signed && int64(x) < 0 {
- x = uint64(-int64(x))
- d.Neg = true
- }
- d.fillIntDigits(x)
- d.Exp = int32(len(d.Digits))
-}
-
-// ConvertFloat converts a floating point number to decimals.
-func (d *Decimal) ConvertFloat(r RoundingContext, x float64, size int) {
- d.clear()
- if math.IsNaN(x) {
- d.NaN = true
- return
- }
- // Simple case: decimal notation
- if r.Increment > 0 {
- scale := int(r.IncrementScale)
- mult := 1.0
- if scale >= len(scales) {
- mult = math.Pow(10, float64(scale))
- } else {
- mult = scales[scale]
- }
- // We multiply x instead of dividing inc as it gives less rounding
- // issues.
- x *= mult
- x /= float64(r.Increment)
- x = r.Mode.roundFloat(x)
- x *= float64(r.Increment)
- x /= mult
- }
-
- abs := x
- if x < 0 {
- d.Neg = true
- abs = -x
- }
- if math.IsInf(abs, 1) {
- d.Inf = true
- return
- }
-
- // By default we get the exact decimal representation.
- verb := byte('g')
- prec := -1
- // As the strconv API does not return the rounding accuracy, we can only
- // round using ToNearestEven.
- if r.Mode == ToNearestEven {
- if n := r.RoundSignificantDigits(); n >= 0 {
- prec = n
- } else if n = r.RoundFractionDigits(); n >= 0 {
- prec = n
- verb = 'f'
- }
- } else {
- // TODO: At this point strconv's rounding is imprecise to the point that
- // it is not usable for this purpose.
- // See https://github.com/golang/go/issues/21714
- // If rounding is requested, we ask for a large number of digits and
- // round from there to simulate rounding only once.
- // Ideally we would have strconv export an AppendDigits that would take
- // a rounding mode and/or return an accuracy. Something like this would
- // work:
- // AppendDigits(dst []byte, x float64, base, size, prec int) (digits []byte, exp, accuracy int)
- hasPrec := r.RoundSignificantDigits() >= 0
- hasScale := r.RoundFractionDigits() >= 0
- if hasPrec || hasScale {
- // prec is the number of mantissa bits plus some extra for safety.
- // We need at least the number of mantissa bits as decimals to
- // accurately represent the floating point without rounding, as each
- // bit requires one more decimal to represent: 0.5, 0.25, 0.125, ...
- prec = 60
- }
- }
-
- b := strconv.AppendFloat(d.Digits[:0], abs, verb, prec, size)
- i := 0
- k := 0
- beforeDot := 1
- for i < len(b) {
- if c := b[i]; '0' <= c && c <= '9' {
- b[k] = c - '0'
- k++
- d.Exp += int32(beforeDot)
- } else if c == '.' {
- beforeDot = 0
- d.Exp = int32(k)
- } else {
- break
- }
- i++
- }
- d.Digits = b[:k]
- if i != len(b) {
- i += len("e")
- pSign := i
- exp := 0
- for i++; i < len(b); i++ {
- exp *= 10
- exp += int(b[i] - '0')
- }
- if b[pSign] == '-' {
- exp = -exp
- }
- d.Exp = int32(exp) + 1
- }
-}
-
-func (d *Decimal) fillIntDigits(x uint64) {
- if cap(d.Digits) < maxIntDigits {
- d.Digits = d.buf[:]
- } else {
- d.Digits = d.buf[:maxIntDigits]
- }
- i := 0
- for ; x > 0; x /= 10 {
- d.Digits[i] = byte(x % 10)
- i++
- }
- d.Digits = d.Digits[:i]
- for p := 0; p < i; p++ {
- i--
- d.Digits[p], d.Digits[i] = d.Digits[i], d.Digits[p]
- }
-}
-
-var scales [70]float64
-
-func init() {
- x := 1.0
- for i := range scales {
- scales[i] = x
- x *= 10
- }
-}
diff --git a/vendor/golang.org/x/text/internal/number/format.go b/vendor/golang.org/x/text/internal/number/format.go
deleted file mode 100644
index cd94c5d..0000000
--- a/vendor/golang.org/x/text/internal/number/format.go
+++ /dev/null
@@ -1,535 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package number
-
-import (
- "strconv"
- "unicode/utf8"
-
- "golang.org/x/text/language"
-)
-
-// TODO:
-// - grouping of fractions
-// - allow user-defined superscript notation (such as 4)
-// - same for non-breaking spaces, like
-
-// A VisibleDigits computes digits, comma placement and trailing zeros as they
-// will be shown to the user.
-type VisibleDigits interface {
- Digits(buf []byte, t language.Tag, scale int) Digits
- // TODO: Do we also need to add the verb or pass a format.State?
-}
-
-// Formatting proceeds along the following lines:
-// 0) Compose rounding information from format and context.
-// 1) Convert a number into a Decimal.
-// 2) Sanitize Decimal by adding trailing zeros, removing leading digits, and
-// (non-increment) rounding. The Decimal that results from this is suitable
-// for determining the plural form.
-// 3) Render the Decimal in the localized form.
-
-// Formatter contains all the information needed to render a number.
-type Formatter struct {
- Pattern
- Info
-}
-
-func (f *Formatter) init(t language.Tag, index []uint8) {
- f.Info = InfoFromTag(t)
- f.Pattern = formats[index[tagToID(t)]]
-}
-
-// InitPattern initializes a Formatter for the given Pattern.
-func (f *Formatter) InitPattern(t language.Tag, pat *Pattern) {
- f.Info = InfoFromTag(t)
- f.Pattern = *pat
-}
-
-// InitDecimal initializes a Formatter using the default Pattern for the given
-// language.
-func (f *Formatter) InitDecimal(t language.Tag) {
- f.init(t, tagToDecimal)
-}
-
-// InitScientific initializes a Formatter using the default Pattern for the
-// given language.
-func (f *Formatter) InitScientific(t language.Tag) {
- f.init(t, tagToScientific)
- f.Pattern.MinFractionDigits = 0
- f.Pattern.MaxFractionDigits = -1
-}
-
-// InitEngineering initializes a Formatter using the default Pattern for the
-// given language.
-func (f *Formatter) InitEngineering(t language.Tag) {
- f.init(t, tagToScientific)
- f.Pattern.MinFractionDigits = 0
- f.Pattern.MaxFractionDigits = -1
- f.Pattern.MaxIntegerDigits = 3
- f.Pattern.MinIntegerDigits = 1
-}
-
-// InitPercent initializes a Formatter using the default Pattern for the given
-// language.
-func (f *Formatter) InitPercent(t language.Tag) {
- f.init(t, tagToPercent)
-}
-
-// InitPerMille initializes a Formatter using the default Pattern for the given
-// language.
-func (f *Formatter) InitPerMille(t language.Tag) {
- f.init(t, tagToPercent)
- f.Pattern.DigitShift = 3
-}
-
-func (f *Formatter) Append(dst []byte, x interface{}) []byte {
- var d Decimal
- r := f.RoundingContext
- d.Convert(r, x)
- return f.Render(dst, FormatDigits(&d, r))
-}
-
-func FormatDigits(d *Decimal, r RoundingContext) Digits {
- if r.isScientific() {
- return scientificVisibleDigits(r, d)
- }
- return decimalVisibleDigits(r, d)
-}
-
-func (f *Formatter) Format(dst []byte, d *Decimal) []byte {
- return f.Render(dst, FormatDigits(d, f.RoundingContext))
-}
-
-func (f *Formatter) Render(dst []byte, d Digits) []byte {
- var result []byte
- var postPrefix, preSuffix int
- if d.IsScientific {
- result, postPrefix, preSuffix = appendScientific(dst, f, &d)
- } else {
- result, postPrefix, preSuffix = appendDecimal(dst, f, &d)
- }
- if f.PadRune == 0 {
- return result
- }
- width := int(f.FormatWidth)
- if count := utf8.RuneCount(result); count < width {
- insertPos := 0
- switch f.Flags & PadMask {
- case PadAfterPrefix:
- insertPos = postPrefix
- case PadBeforeSuffix:
- insertPos = preSuffix
- case PadAfterSuffix:
- insertPos = len(result)
- }
- num := width - count
- pad := [utf8.UTFMax]byte{' '}
- sz := 1
- if r := f.PadRune; r != 0 {
- sz = utf8.EncodeRune(pad[:], r)
- }
- extra := sz * num
- if n := len(result) + extra; n < cap(result) {
- result = result[:n]
- copy(result[insertPos+extra:], result[insertPos:])
- } else {
- buf := make([]byte, n)
- copy(buf, result[:insertPos])
- copy(buf[insertPos+extra:], result[insertPos:])
- result = buf
- }
- for ; num > 0; num-- {
- insertPos += copy(result[insertPos:], pad[:sz])
- }
- }
- return result
-}
-
-// decimalVisibleDigits converts d according to the RoundingContext. Note that
-// the exponent may change as a result of this operation.
-func decimalVisibleDigits(r RoundingContext, d *Decimal) Digits {
- if d.NaN || d.Inf {
- return Digits{digits: digits{Neg: d.Neg, NaN: d.NaN, Inf: d.Inf}}
- }
- n := Digits{digits: d.normalize().digits}
-
- exp := n.Exp
- exp += int32(r.DigitShift)
-
- // Cap integer digits. Remove *most-significant* digits.
- if r.MaxIntegerDigits > 0 {
- if p := int(exp) - int(r.MaxIntegerDigits); p > 0 {
- if p > len(n.Digits) {
- p = len(n.Digits)
- }
- if n.Digits = n.Digits[p:]; len(n.Digits) == 0 {
- exp = 0
- } else {
- exp -= int32(p)
- }
- // Strip leading zeros.
- for len(n.Digits) > 0 && n.Digits[0] == 0 {
- n.Digits = n.Digits[1:]
- exp--
- }
- }
- }
-
- // Rounding if not already done by Convert.
- p := len(n.Digits)
- if maxSig := int(r.MaxSignificantDigits); maxSig > 0 {
- p = maxSig
- }
- if maxFrac := int(r.MaxFractionDigits); maxFrac >= 0 {
- if cap := int(exp) + maxFrac; cap < p {
- p = int(exp) + maxFrac
- }
- if p < 0 {
- p = 0
- }
- }
- n.round(r.Mode, p)
-
- // set End (trailing zeros)
- n.End = int32(len(n.Digits))
- if n.End == 0 {
- exp = 0
- if r.MinFractionDigits > 0 {
- n.End = int32(r.MinFractionDigits)
- }
- if p := int32(r.MinSignificantDigits) - 1; p > n.End {
- n.End = p
- }
- } else {
- if end := exp + int32(r.MinFractionDigits); end > n.End {
- n.End = end
- }
- if n.End < int32(r.MinSignificantDigits) {
- n.End = int32(r.MinSignificantDigits)
- }
- }
- n.Exp = exp
- return n
-}
-
-// appendDecimal appends a formatted number to dst. It returns two possible
-// insertion points for padding.
-func appendDecimal(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, preSuf int) {
- if dst, ok := f.renderSpecial(dst, n); ok {
- return dst, 0, len(dst)
- }
- digits := n.Digits
- exp := n.Exp
-
- // Split in integer and fraction part.
- var intDigits, fracDigits []byte
- numInt := 0
- numFrac := int(n.End - n.Exp)
- if exp > 0 {
- numInt = int(exp)
- if int(exp) >= len(digits) { // ddddd | ddddd00
- intDigits = digits
- } else { // ddd.dd
- intDigits = digits[:exp]
- fracDigits = digits[exp:]
- }
- } else {
- fracDigits = digits
- }
-
- neg := n.Neg
- affix, suffix := f.getAffixes(neg)
- dst = appendAffix(dst, f, affix, neg)
- savedLen := len(dst)
-
- minInt := int(f.MinIntegerDigits)
- if minInt == 0 && f.MinSignificantDigits > 0 {
- minInt = 1
- }
- // add leading zeros
- for i := minInt; i > numInt; i-- {
- dst = f.AppendDigit(dst, 0)
- if f.needsSep(i) {
- dst = append(dst, f.Symbol(SymGroup)...)
- }
- }
- i := 0
- for ; i < len(intDigits); i++ {
- dst = f.AppendDigit(dst, intDigits[i])
- if f.needsSep(numInt - i) {
- dst = append(dst, f.Symbol(SymGroup)...)
- }
- }
- for ; i < numInt; i++ {
- dst = f.AppendDigit(dst, 0)
- if f.needsSep(numInt - i) {
- dst = append(dst, f.Symbol(SymGroup)...)
- }
- }
-
- if numFrac > 0 || f.Flags&AlwaysDecimalSeparator != 0 {
- dst = append(dst, f.Symbol(SymDecimal)...)
- }
- // Add trailing zeros
- i = 0
- for n := -int(n.Exp); i < n; i++ {
- dst = f.AppendDigit(dst, 0)
- }
- for _, d := range fracDigits {
- i++
- dst = f.AppendDigit(dst, d)
- }
- for ; i < numFrac; i++ {
- dst = f.AppendDigit(dst, 0)
- }
- return appendAffix(dst, f, suffix, neg), savedLen, len(dst)
-}
-
-func scientificVisibleDigits(r RoundingContext, d *Decimal) Digits {
- if d.NaN || d.Inf {
- return Digits{digits: digits{Neg: d.Neg, NaN: d.NaN, Inf: d.Inf}}
- }
- n := Digits{digits: d.normalize().digits, IsScientific: true}
-
- // Normalize to have at least one digit. This simplifies engineering
- // notation.
- if len(n.Digits) == 0 {
- n.Digits = append(n.Digits, 0)
- n.Exp = 1
- }
-
- // Significant digits are transformed by the parser for scientific notation
- // and do not need to be handled here.
- maxInt, numInt := int(r.MaxIntegerDigits), int(r.MinIntegerDigits)
- if numInt == 0 {
- numInt = 1
- }
-
- // If a maximum number of integers is specified, the minimum must be 1
- // and the exponent is grouped by this number (e.g. for engineering)
- if maxInt > numInt {
- // Correct the exponent to reflect a single integer digit.
- numInt = 1
- // engineering
- // 0.01234 ([12345]e-1) -> 1.2345e-2 12.345e-3
- // 12345 ([12345]e+5) -> 1.2345e4 12.345e3
- d := int(n.Exp-1) % maxInt
- if d < 0 {
- d += maxInt
- }
- numInt += d
- }
-
- p := len(n.Digits)
- if maxSig := int(r.MaxSignificantDigits); maxSig > 0 {
- p = maxSig
- }
- if maxFrac := int(r.MaxFractionDigits); maxFrac >= 0 && numInt+maxFrac < p {
- p = numInt + maxFrac
- }
- n.round(r.Mode, p)
-
- n.Comma = uint8(numInt)
- n.End = int32(len(n.Digits))
- if minSig := int32(r.MinFractionDigits) + int32(numInt); n.End < minSig {
- n.End = minSig
- }
- return n
-}
-
-// appendScientific appends a formatted number to dst. It returns two possible
-// insertion points for padding.
-func appendScientific(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, preSuf int) {
- if dst, ok := f.renderSpecial(dst, n); ok {
- return dst, 0, 0
- }
- digits := n.Digits
- numInt := int(n.Comma)
- numFrac := int(n.End) - int(n.Comma)
-
- var intDigits, fracDigits []byte
- if numInt <= len(digits) {
- intDigits = digits[:numInt]
- fracDigits = digits[numInt:]
- } else {
- intDigits = digits
- }
- neg := n.Neg
- affix, suffix := f.getAffixes(neg)
- dst = appendAffix(dst, f, affix, neg)
- savedLen := len(dst)
-
- i := 0
- for ; i < len(intDigits); i++ {
- dst = f.AppendDigit(dst, intDigits[i])
- if f.needsSep(numInt - i) {
- dst = append(dst, f.Symbol(SymGroup)...)
- }
- }
- for ; i < numInt; i++ {
- dst = f.AppendDigit(dst, 0)
- if f.needsSep(numInt - i) {
- dst = append(dst, f.Symbol(SymGroup)...)
- }
- }
-
- if numFrac > 0 || f.Flags&AlwaysDecimalSeparator != 0 {
- dst = append(dst, f.Symbol(SymDecimal)...)
- }
- i = 0
- for ; i < len(fracDigits); i++ {
- dst = f.AppendDigit(dst, fracDigits[i])
- }
- for ; i < numFrac; i++ {
- dst = f.AppendDigit(dst, 0)
- }
-
- // exp
- buf := [12]byte{}
- // TODO: use exponential if superscripting is not available (no Latin
- // numbers or no tags) and use exponential in all other cases.
- exp := n.Exp - int32(n.Comma)
- exponential := f.Symbol(SymExponential)
- if exponential == "E" {
- dst = append(dst, "\u202f"...) // NARROW NO-BREAK SPACE
- dst = append(dst, f.Symbol(SymSuperscriptingExponent)...)
- dst = append(dst, "\u202f"...) // NARROW NO-BREAK SPACE
- dst = f.AppendDigit(dst, 1)
- dst = f.AppendDigit(dst, 0)
- switch {
- case exp < 0:
- dst = append(dst, superMinus...)
- exp = -exp
- case f.Flags&AlwaysExpSign != 0:
- dst = append(dst, superPlus...)
- }
- b = strconv.AppendUint(buf[:0], uint64(exp), 10)
- for i := len(b); i < int(f.MinExponentDigits); i++ {
- dst = append(dst, superDigits[0]...)
- }
- for _, c := range b {
- dst = append(dst, superDigits[c-'0']...)
- }
- } else {
- dst = append(dst, exponential...)
- switch {
- case exp < 0:
- dst = append(dst, f.Symbol(SymMinusSign)...)
- exp = -exp
- case f.Flags&AlwaysExpSign != 0:
- dst = append(dst, f.Symbol(SymPlusSign)...)
- }
- b = strconv.AppendUint(buf[:0], uint64(exp), 10)
- for i := len(b); i < int(f.MinExponentDigits); i++ {
- dst = f.AppendDigit(dst, 0)
- }
- for _, c := range b {
- dst = f.AppendDigit(dst, c-'0')
- }
- }
- return appendAffix(dst, f, suffix, neg), savedLen, len(dst)
-}
-
-const (
- superMinus = "\u207B" // SUPERSCRIPT HYPHEN-MINUS
- superPlus = "\u207A" // SUPERSCRIPT PLUS SIGN
-)
-
-var (
- // Note: the digits are not sequential!!!
- superDigits = []string{
- "\u2070", // SUPERSCRIPT DIGIT ZERO
- "\u00B9", // SUPERSCRIPT DIGIT ONE
- "\u00B2", // SUPERSCRIPT DIGIT TWO
- "\u00B3", // SUPERSCRIPT DIGIT THREE
- "\u2074", // SUPERSCRIPT DIGIT FOUR
- "\u2075", // SUPERSCRIPT DIGIT FIVE
- "\u2076", // SUPERSCRIPT DIGIT SIX
- "\u2077", // SUPERSCRIPT DIGIT SEVEN
- "\u2078", // SUPERSCRIPT DIGIT EIGHT
- "\u2079", // SUPERSCRIPT DIGIT NINE
- }
-)
-
-func (f *Formatter) getAffixes(neg bool) (affix, suffix string) {
- str := f.Affix
- if str != "" {
- if f.NegOffset > 0 {
- if neg {
- str = str[f.NegOffset:]
- } else {
- str = str[:f.NegOffset]
- }
- }
- sufStart := 1 + str[0]
- affix = str[1:sufStart]
- suffix = str[sufStart+1:]
- }
- // TODO: introduce a NeedNeg sign to indicate if the left pattern already
- // has a sign marked?
- if f.NegOffset == 0 && (neg || f.Flags&AlwaysSign != 0) {
- affix = "-" + affix
- }
- return affix, suffix
-}
-
-func (f *Formatter) renderSpecial(dst []byte, d *Digits) (b []byte, ok bool) {
- if d.NaN {
- return fmtNaN(dst, f), true
- }
- if d.Inf {
- return fmtInfinite(dst, f, d), true
- }
- return dst, false
-}
-
-func fmtNaN(dst []byte, f *Formatter) []byte {
- return append(dst, f.Symbol(SymNan)...)
-}
-
-func fmtInfinite(dst []byte, f *Formatter, d *Digits) []byte {
- affix, suffix := f.getAffixes(d.Neg)
- dst = appendAffix(dst, f, affix, d.Neg)
- dst = append(dst, f.Symbol(SymInfinity)...)
- dst = appendAffix(dst, f, suffix, d.Neg)
- return dst
-}
-
-func appendAffix(dst []byte, f *Formatter, affix string, neg bool) []byte {
- quoting := false
- escaping := false
- for _, r := range affix {
- switch {
- case escaping:
- // escaping occurs both inside and outside of quotes
- dst = append(dst, string(r)...)
- escaping = false
- case r == '\\':
- escaping = true
- case r == '\'':
- quoting = !quoting
- case quoting:
- dst = append(dst, string(r)...)
- case r == '%':
- if f.DigitShift == 3 {
- dst = append(dst, f.Symbol(SymPerMille)...)
- } else {
- dst = append(dst, f.Symbol(SymPercentSign)...)
- }
- case r == '-' || r == '+':
- if neg {
- dst = append(dst, f.Symbol(SymMinusSign)...)
- } else if f.Flags&ElideSign == 0 {
- dst = append(dst, f.Symbol(SymPlusSign)...)
- } else {
- dst = append(dst, ' ')
- }
- default:
- dst = append(dst, string(r)...)
- }
- }
- return dst
-}
diff --git a/vendor/golang.org/x/text/internal/number/number.go b/vendor/golang.org/x/text/internal/number/number.go
deleted file mode 100644
index e1d933c..0000000
--- a/vendor/golang.org/x/text/internal/number/number.go
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:generate go run gen.go gen_common.go
-
-// Package number contains tools and data for formatting numbers.
-package number
-
-import (
- "unicode/utf8"
-
- "golang.org/x/text/internal/language/compact"
- "golang.org/x/text/language"
-)
-
-// Info holds number formatting configuration data.
-type Info struct {
- system systemData // numbering system information
- symIndex symOffset // index to symbols
-}
-
-// InfoFromLangID returns a Info for the given compact language identifier and
-// numbering system identifier. If system is the empty string, the default
-// numbering system will be taken for that language.
-func InfoFromLangID(compactIndex compact.ID, numberSystem string) Info {
- p := langToDefaults[compactIndex]
- // Lookup the entry for the language.
- pSymIndex := symOffset(0) // Default: Latin, default symbols
- system, ok := systemMap[numberSystem]
- if !ok {
- // Take the value for the default numbering system. This is by far the
- // most common case as an alternative numbering system is hardly used.
- if p&hasNonLatnMask == 0 { // Latn digits.
- pSymIndex = p
- } else { // Non-Latn or multiple numbering systems.
- // Take the first entry from the alternatives list.
- data := langToAlt[p&^hasNonLatnMask]
- pSymIndex = data.symIndex
- system = data.system
- }
- } else {
- langIndex := compactIndex
- ns := system
- outerLoop:
- for ; ; p = langToDefaults[langIndex] {
- if p&hasNonLatnMask == 0 {
- if ns == 0 {
- // The index directly points to the symbol data.
- pSymIndex = p
- break
- }
- // Move to the parent and retry.
- langIndex = langIndex.Parent()
- } else {
- // The index points to a list of symbol data indexes.
- for _, e := range langToAlt[p&^hasNonLatnMask:] {
- if e.compactTag != langIndex {
- if langIndex == 0 {
- // The CLDR root defines full symbol information for
- // all numbering systems (even though mostly by
- // means of aliases). Fall back to the default entry
- // for Latn if there is no data for the numbering
- // system of this language.
- if ns == 0 {
- break
- }
- // Fall back to Latin and start from the original
- // language. See
- // https://unicode.org/reports/tr35/#Locale_Inheritance.
- ns = numLatn
- langIndex = compactIndex
- continue outerLoop
- }
- // Fall back to parent.
- langIndex = langIndex.Parent()
- } else if e.system == ns {
- pSymIndex = e.symIndex
- break outerLoop
- }
- }
- }
- }
- }
- if int(system) >= len(numSysData) { // algorithmic
- // Will generate ASCII digits in case the user inadvertently calls
- // WriteDigit or Digit on it.
- d := numSysData[0]
- d.id = system
- return Info{
- system: d,
- symIndex: pSymIndex,
- }
- }
- return Info{
- system: numSysData[system],
- symIndex: pSymIndex,
- }
-}
-
-// InfoFromTag returns a Info for the given language tag.
-func InfoFromTag(t language.Tag) Info {
- return InfoFromLangID(tagToID(t), t.TypeForKey("nu"))
-}
-
-// IsDecimal reports if the numbering system can convert decimal to native
-// symbols one-to-one.
-func (n Info) IsDecimal() bool {
- return int(n.system.id) < len(numSysData)
-}
-
-// WriteDigit writes the UTF-8 sequence for n corresponding to the given ASCII
-// digit to dst and reports the number of bytes written. dst must be large
-// enough to hold the rune (can be up to utf8.UTFMax bytes).
-func (n Info) WriteDigit(dst []byte, asciiDigit rune) int {
- copy(dst, n.system.zero[:n.system.digitSize])
- dst[n.system.digitSize-1] += byte(asciiDigit - '0')
- return int(n.system.digitSize)
-}
-
-// AppendDigit appends the UTF-8 sequence for n corresponding to the given digit
-// to dst and reports the number of bytes written. dst must be large enough to
-// hold the rune (can be up to utf8.UTFMax bytes).
-func (n Info) AppendDigit(dst []byte, digit byte) []byte {
- dst = append(dst, n.system.zero[:n.system.digitSize]...)
- dst[len(dst)-1] += digit
- return dst
-}
-
-// Digit returns the digit for the numbering system for the corresponding ASCII
-// value. For example, ni.Digit('3') could return '三'. Note that the argument
-// is the rune constant '3', which equals 51, not the integer constant 3.
-func (n Info) Digit(asciiDigit rune) rune {
- var x [utf8.UTFMax]byte
- n.WriteDigit(x[:], asciiDigit)
- r, _ := utf8.DecodeRune(x[:])
- return r
-}
-
-// Symbol returns the string for the given symbol type.
-func (n Info) Symbol(t SymbolType) string {
- return symData.Elem(int(symIndex[n.symIndex][t]))
-}
-
-func formatForLang(t language.Tag, index []byte) *Pattern {
- return &formats[index[tagToID(t)]]
-}
-
-func tagToID(t language.Tag) compact.ID {
- id, _ := compact.RegionalID(compact.Tag(t))
- return id
-}
diff --git a/vendor/golang.org/x/text/internal/number/pattern.go b/vendor/golang.org/x/text/internal/number/pattern.go
deleted file mode 100644
index 06e5955..0000000
--- a/vendor/golang.org/x/text/internal/number/pattern.go
+++ /dev/null
@@ -1,485 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package number
-
-import (
- "errors"
- "unicode/utf8"
-)
-
-// This file contains a parser for the CLDR number patterns as described in
-// https://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns.
-//
-// The following BNF is derived from this standard.
-//
-// pattern := subpattern (';' subpattern)?
-// subpattern := affix? number exponent? affix?
-// number := decimal | sigDigits
-// decimal := '#'* '0'* ('.' fraction)? | '#' | '0'
-// fraction := '0'* '#'*
-// sigDigits := '#'* '@' '@'* '#'*
-// exponent := 'E' '+'? '0'* '0'
-// padSpec := '*' \L
-//
-// Notes:
-// - An affix pattern may contain any runes, but runes with special meaning
-// should be escaped.
-// - Sequences of digits, '#', and '@' in decimal and sigDigits may have
-// interstitial commas.
-
-// TODO: replace special characters in affixes (-, +, ¤) with control codes.
-
-// Pattern holds information for formatting numbers. It is designed to hold
-// information from CLDR number patterns.
-//
-// This pattern is precompiled for all patterns for all languages. Even though
-// the number of patterns is not very large, we want to keep this small.
-//
-// This type is only intended for internal use.
-type Pattern struct {
- RoundingContext
-
- Affix string // includes prefix and suffix. First byte is prefix length.
- Offset uint16 // Offset into Affix for prefix and suffix
- NegOffset uint16 // Offset into Affix for negative prefix and suffix or 0.
- PadRune rune
- FormatWidth uint16
-
- GroupingSize [2]uint8
- Flags PatternFlag
-}
-
-// A RoundingContext indicates how a number should be converted to digits.
-// It contains all information needed to determine the "visible digits" as
-// required by the pluralization rules.
-type RoundingContext struct {
- // TODO: unify these two fields so that there is a more unambiguous meaning
- // of how precision is handled.
- MaxSignificantDigits int16 // -1 is unlimited
- MaxFractionDigits int16 // -1 is unlimited
-
- Increment uint32
- IncrementScale uint8 // May differ from printed scale.
-
- Mode RoundingMode
-
- DigitShift uint8 // Number of decimals to shift. Used for % and ‰.
-
- // Number of digits.
- MinIntegerDigits uint8
-
- MaxIntegerDigits uint8
- MinFractionDigits uint8
- MinSignificantDigits uint8
-
- MinExponentDigits uint8
-}
-
-// RoundSignificantDigits returns the number of significant digits an
-// implementation of Convert may round to or n < 0 if there is no maximum or
-// a maximum is not recommended.
-func (r *RoundingContext) RoundSignificantDigits() (n int) {
- if r.MaxFractionDigits == 0 && r.MaxSignificantDigits > 0 {
- return int(r.MaxSignificantDigits)
- } else if r.isScientific() && r.MaxIntegerDigits == 1 {
- if r.MaxSignificantDigits == 0 ||
- int(r.MaxFractionDigits+1) == int(r.MaxSignificantDigits) {
- // Note: don't add DigitShift: it is only used for decimals.
- return int(r.MaxFractionDigits) + 1
- }
- }
- return -1
-}
-
-// RoundFractionDigits returns the number of fraction digits an implementation
-// of Convert may round to or n < 0 if there is no maximum or a maximum is not
-// recommended.
-func (r *RoundingContext) RoundFractionDigits() (n int) {
- if r.MinExponentDigits == 0 &&
- r.MaxSignificantDigits == 0 &&
- r.MaxFractionDigits >= 0 {
- return int(r.MaxFractionDigits) + int(r.DigitShift)
- }
- return -1
-}
-
-// SetScale fixes the RoundingContext to a fixed number of fraction digits.
-func (r *RoundingContext) SetScale(scale int) {
- r.MinFractionDigits = uint8(scale)
- r.MaxFractionDigits = int16(scale)
-}
-
-func (r *RoundingContext) SetPrecision(prec int) {
- r.MaxSignificantDigits = int16(prec)
-}
-
-func (r *RoundingContext) isScientific() bool {
- return r.MinExponentDigits > 0
-}
-
-func (f *Pattern) needsSep(pos int) bool {
- p := pos - 1
- size := int(f.GroupingSize[0])
- if size == 0 || p == 0 {
- return false
- }
- if p == size {
- return true
- }
- if p -= size; p < 0 {
- return false
- }
- // TODO: make second groupingsize the same as first if 0 so that we can
- // avoid this check.
- if x := int(f.GroupingSize[1]); x != 0 {
- size = x
- }
- return p%size == 0
-}
-
-// A PatternFlag is a bit mask for the flag field of a Pattern.
-type PatternFlag uint8
-
-const (
- AlwaysSign PatternFlag = 1 << iota
- ElideSign // Use space instead of plus sign. AlwaysSign must be true.
- AlwaysExpSign
- AlwaysDecimalSeparator
- ParenthesisForNegative // Common pattern. Saves space.
-
- PadAfterNumber
- PadAfterAffix
-
- PadBeforePrefix = 0 // Default
- PadAfterPrefix = PadAfterAffix
- PadBeforeSuffix = PadAfterNumber
- PadAfterSuffix = PadAfterNumber | PadAfterAffix
- PadMask = PadAfterNumber | PadAfterAffix
-)
-
-type parser struct {
- *Pattern
-
- leadingSharps int
-
- pos int
- err error
- doNotTerminate bool
- groupingCount uint
- hasGroup bool
- buf []byte
-}
-
-func (p *parser) setError(err error) {
- if p.err == nil {
- p.err = err
- }
-}
-
-func (p *parser) updateGrouping() {
- if p.hasGroup &&
- 0 < p.groupingCount && p.groupingCount < 255 {
- p.GroupingSize[1] = p.GroupingSize[0]
- p.GroupingSize[0] = uint8(p.groupingCount)
- }
- p.groupingCount = 0
- p.hasGroup = true
-}
-
-var (
- // TODO: more sensible and localizeable error messages.
- errMultiplePadSpecifiers = errors.New("format: pattern has multiple pad specifiers")
- errInvalidPadSpecifier = errors.New("format: invalid pad specifier")
- errInvalidQuote = errors.New("format: invalid quote")
- errAffixTooLarge = errors.New("format: prefix or suffix exceeds maximum UTF-8 length of 256 bytes")
- errDuplicatePercentSign = errors.New("format: duplicate percent sign")
- errDuplicatePermilleSign = errors.New("format: duplicate permille sign")
- errUnexpectedEnd = errors.New("format: unexpected end of pattern")
-)
-
-// ParsePattern extracts formatting information from a CLDR number pattern.
-//
-// See https://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns.
-func ParsePattern(s string) (f *Pattern, err error) {
- p := parser{Pattern: &Pattern{}}
-
- s = p.parseSubPattern(s)
-
- if s != "" {
- // Parse negative sub pattern.
- if s[0] != ';' {
- p.setError(errors.New("format: error parsing first sub pattern"))
- return nil, p.err
- }
- neg := parser{Pattern: &Pattern{}} // just for extracting the affixes.
- s = neg.parseSubPattern(s[len(";"):])
- p.NegOffset = uint16(len(p.buf))
- p.buf = append(p.buf, neg.buf...)
- }
- if s != "" {
- p.setError(errors.New("format: spurious characters at end of pattern"))
- }
- if p.err != nil {
- return nil, p.err
- }
- if affix := string(p.buf); affix == "\x00\x00" || affix == "\x00\x00\x00\x00" {
- // No prefix or suffixes.
- p.NegOffset = 0
- } else {
- p.Affix = affix
- }
- if p.Increment == 0 {
- p.IncrementScale = 0
- }
- return p.Pattern, nil
-}
-
-func (p *parser) parseSubPattern(s string) string {
- s = p.parsePad(s, PadBeforePrefix)
- s = p.parseAffix(s)
- s = p.parsePad(s, PadAfterPrefix)
-
- s = p.parse(p.number, s)
- p.updateGrouping()
-
- s = p.parsePad(s, PadBeforeSuffix)
- s = p.parseAffix(s)
- s = p.parsePad(s, PadAfterSuffix)
- return s
-}
-
-func (p *parser) parsePad(s string, f PatternFlag) (tail string) {
- if len(s) >= 2 && s[0] == '*' {
- r, sz := utf8.DecodeRuneInString(s[1:])
- if p.PadRune != 0 {
- p.err = errMultiplePadSpecifiers
- } else {
- p.Flags |= f
- p.PadRune = r
- }
- return s[1+sz:]
- }
- return s
-}
-
-func (p *parser) parseAffix(s string) string {
- x := len(p.buf)
- p.buf = append(p.buf, 0) // placeholder for affix length
-
- s = p.parse(p.affix, s)
-
- n := len(p.buf) - x - 1
- if n > 0xFF {
- p.setError(errAffixTooLarge)
- }
- p.buf[x] = uint8(n)
- return s
-}
-
-// state implements a state transition. It returns the new state. A state
-// function may set an error on the parser or may simply return on an incorrect
-// token and let the next phase fail.
-type state func(r rune) state
-
-// parse repeatedly applies a state function on the given string until a
-// termination condition is reached.
-func (p *parser) parse(fn state, s string) (tail string) {
- for i, r := range s {
- p.doNotTerminate = false
- if fn = fn(r); fn == nil || p.err != nil {
- return s[i:]
- }
- p.FormatWidth++
- }
- if p.doNotTerminate {
- p.setError(errUnexpectedEnd)
- }
- return ""
-}
-
-func (p *parser) affix(r rune) state {
- switch r {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- '#', '@', '.', '*', ',', ';':
- return nil
- case '\'':
- p.FormatWidth--
- return p.escapeFirst
- case '%':
- if p.DigitShift != 0 {
- p.setError(errDuplicatePercentSign)
- }
- p.DigitShift = 2
- case '\u2030': // ‰ Per mille
- if p.DigitShift != 0 {
- p.setError(errDuplicatePermilleSign)
- }
- p.DigitShift = 3
- // TODO: handle currency somehow: ¤, ¤¤, ¤¤¤, ¤¤¤¤
- }
- p.buf = append(p.buf, string(r)...)
- return p.affix
-}
-
-func (p *parser) escapeFirst(r rune) state {
- switch r {
- case '\'':
- p.buf = append(p.buf, "\\'"...)
- return p.affix
- default:
- p.buf = append(p.buf, '\'')
- p.buf = append(p.buf, string(r)...)
- }
- return p.escape
-}
-
-func (p *parser) escape(r rune) state {
- switch r {
- case '\'':
- p.FormatWidth--
- p.buf = append(p.buf, '\'')
- return p.affix
- default:
- p.buf = append(p.buf, string(r)...)
- }
- return p.escape
-}
-
-// number parses a number. The BNF says the integer part should always have
-// a '0', but that does not appear to be the case according to the rest of the
-// documentation. We will allow having only '#' numbers.
-func (p *parser) number(r rune) state {
- switch r {
- case '#':
- p.groupingCount++
- p.leadingSharps++
- case '@':
- p.groupingCount++
- p.leadingSharps = 0
- p.MaxFractionDigits = -1
- return p.sigDigits(r)
- case ',':
- if p.leadingSharps == 0 { // no leading commas
- return nil
- }
- p.updateGrouping()
- case 'E':
- p.MaxIntegerDigits = uint8(p.leadingSharps)
- return p.exponent
- case '.': // allow ".##" etc.
- p.updateGrouping()
- return p.fraction
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- return p.integer(r)
- default:
- return nil
- }
- return p.number
-}
-
-func (p *parser) integer(r rune) state {
- if !('0' <= r && r <= '9') {
- var next state
- switch r {
- case 'E':
- if p.leadingSharps > 0 {
- p.MaxIntegerDigits = uint8(p.leadingSharps) + p.MinIntegerDigits
- }
- next = p.exponent
- case '.':
- next = p.fraction
- case ',':
- next = p.integer
- }
- p.updateGrouping()
- return next
- }
- p.Increment = p.Increment*10 + uint32(r-'0')
- p.groupingCount++
- p.MinIntegerDigits++
- return p.integer
-}
-
-func (p *parser) sigDigits(r rune) state {
- switch r {
- case '@':
- p.groupingCount++
- p.MaxSignificantDigits++
- p.MinSignificantDigits++
- case '#':
- return p.sigDigitsFinal(r)
- case 'E':
- p.updateGrouping()
- return p.normalizeSigDigitsWithExponent()
- default:
- p.updateGrouping()
- return nil
- }
- return p.sigDigits
-}
-
-func (p *parser) sigDigitsFinal(r rune) state {
- switch r {
- case '#':
- p.groupingCount++
- p.MaxSignificantDigits++
- case 'E':
- p.updateGrouping()
- return p.normalizeSigDigitsWithExponent()
- default:
- p.updateGrouping()
- return nil
- }
- return p.sigDigitsFinal
-}
-
-func (p *parser) normalizeSigDigitsWithExponent() state {
- p.MinIntegerDigits, p.MaxIntegerDigits = 1, 1
- p.MinFractionDigits = p.MinSignificantDigits - 1
- p.MaxFractionDigits = p.MaxSignificantDigits - 1
- p.MinSignificantDigits, p.MaxSignificantDigits = 0, 0
- return p.exponent
-}
-
-func (p *parser) fraction(r rune) state {
- switch r {
- case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
- p.Increment = p.Increment*10 + uint32(r-'0')
- p.IncrementScale++
- p.MinFractionDigits++
- p.MaxFractionDigits++
- case '#':
- p.MaxFractionDigits++
- case 'E':
- if p.leadingSharps > 0 {
- p.MaxIntegerDigits = uint8(p.leadingSharps) + p.MinIntegerDigits
- }
- return p.exponent
- default:
- return nil
- }
- return p.fraction
-}
-
-func (p *parser) exponent(r rune) state {
- switch r {
- case '+':
- // Set mode and check it wasn't already set.
- if p.Flags&AlwaysExpSign != 0 || p.MinExponentDigits > 0 {
- break
- }
- p.Flags |= AlwaysExpSign
- p.doNotTerminate = true
- return p.exponent
- case '0':
- p.MinExponentDigits++
- return p.exponent
- }
- // termination condition
- if p.MinExponentDigits == 0 {
- p.setError(errors.New("format: need at least one digit"))
- }
- return nil
-}
diff --git a/vendor/golang.org/x/text/internal/number/roundingmode_string.go b/vendor/golang.org/x/text/internal/number/roundingmode_string.go
deleted file mode 100644
index bcc2247..0000000
--- a/vendor/golang.org/x/text/internal/number/roundingmode_string.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Code generated by "stringer -type RoundingMode"; DO NOT EDIT.
-
-package number
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[ToNearestEven-0]
- _ = x[ToNearestZero-1]
- _ = x[ToNearestAway-2]
- _ = x[ToPositiveInf-3]
- _ = x[ToNegativeInf-4]
- _ = x[ToZero-5]
- _ = x[AwayFromZero-6]
- _ = x[numModes-7]
-}
-
-const _RoundingMode_name = "ToNearestEvenToNearestZeroToNearestAwayToPositiveInfToNegativeInfToZeroAwayFromZeronumModes"
-
-var _RoundingMode_index = [...]uint8{0, 13, 26, 39, 52, 65, 71, 83, 91}
-
-func (i RoundingMode) String() string {
- if i >= RoundingMode(len(_RoundingMode_index)-1) {
- return "RoundingMode(" + strconv.FormatInt(int64(i), 10) + ")"
- }
- return _RoundingMode_name[_RoundingMode_index[i]:_RoundingMode_index[i+1]]
-}
diff --git a/vendor/golang.org/x/text/internal/number/tables.go b/vendor/golang.org/x/text/internal/number/tables.go
deleted file mode 100644
index 8efce81..0000000
--- a/vendor/golang.org/x/text/internal/number/tables.go
+++ /dev/null
@@ -1,1219 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package number
-
-import "golang.org/x/text/internal/stringset"
-
-// CLDRVersion is the CLDR version from which the tables in this package are derived.
-const CLDRVersion = "32"
-
-var numSysData = []systemData{ // 59 elements
- 0: {id: 0x0, digitSize: 0x1, zero: [4]uint8{0x30, 0x0, 0x0, 0x0}},
- 1: {id: 0x1, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9e, 0xa5, 0x90}},
- 2: {id: 0x2, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x9c, 0xb0}},
- 3: {id: 0x3, digitSize: 0x2, zero: [4]uint8{0xd9, 0xa0, 0x0, 0x0}},
- 4: {id: 0x4, digitSize: 0x2, zero: [4]uint8{0xdb, 0xb0, 0x0, 0x0}},
- 5: {id: 0x5, digitSize: 0x3, zero: [4]uint8{0xe1, 0xad, 0x90, 0x0}},
- 6: {id: 0x6, digitSize: 0x3, zero: [4]uint8{0xe0, 0xa7, 0xa6, 0x0}},
- 7: {id: 0x7, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0xb1, 0x90}},
- 8: {id: 0x8, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x81, 0xa6}},
- 9: {id: 0x9, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x84, 0xb6}},
- 10: {id: 0xa, digitSize: 0x3, zero: [4]uint8{0xea, 0xa9, 0x90, 0x0}},
- 11: {id: 0xb, digitSize: 0x3, zero: [4]uint8{0xe0, 0xa5, 0xa6, 0x0}},
- 12: {id: 0xc, digitSize: 0x3, zero: [4]uint8{0xef, 0xbc, 0x90, 0x0}},
- 13: {id: 0xd, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0xb5, 0x90}},
- 14: {id: 0xe, digitSize: 0x3, zero: [4]uint8{0xe0, 0xab, 0xa6, 0x0}},
- 15: {id: 0xf, digitSize: 0x3, zero: [4]uint8{0xe0, 0xa9, 0xa6, 0x0}},
- 16: {id: 0x10, digitSize: 0x4, zero: [4]uint8{0xf0, 0x96, 0xad, 0x90}},
- 17: {id: 0x11, digitSize: 0x3, zero: [4]uint8{0xea, 0xa7, 0x90, 0x0}},
- 18: {id: 0x12, digitSize: 0x3, zero: [4]uint8{0xea, 0xa4, 0x80, 0x0}},
- 19: {id: 0x13, digitSize: 0x3, zero: [4]uint8{0xe1, 0x9f, 0xa0, 0x0}},
- 20: {id: 0x14, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb3, 0xa6, 0x0}},
- 21: {id: 0x15, digitSize: 0x3, zero: [4]uint8{0xe1, 0xaa, 0x80, 0x0}},
- 22: {id: 0x16, digitSize: 0x3, zero: [4]uint8{0xe1, 0xaa, 0x90, 0x0}},
- 23: {id: 0x17, digitSize: 0x3, zero: [4]uint8{0xe0, 0xbb, 0x90, 0x0}},
- 24: {id: 0x18, digitSize: 0x3, zero: [4]uint8{0xe1, 0xb1, 0x80, 0x0}},
- 25: {id: 0x19, digitSize: 0x3, zero: [4]uint8{0xe1, 0xa5, 0x86, 0x0}},
- 26: {id: 0x1a, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0x8e}},
- 27: {id: 0x1b, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0x98}},
- 28: {id: 0x1c, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0xb6}},
- 29: {id: 0x1d, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0xac}},
- 30: {id: 0x1e, digitSize: 0x4, zero: [4]uint8{0xf0, 0x9d, 0x9f, 0xa2}},
- 31: {id: 0x1f, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb5, 0xa6, 0x0}},
- 32: {id: 0x20, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x99, 0x90}},
- 33: {id: 0x21, digitSize: 0x3, zero: [4]uint8{0xe1, 0xa0, 0x90, 0x0}},
- 34: {id: 0x22, digitSize: 0x4, zero: [4]uint8{0xf0, 0x96, 0xa9, 0xa0}},
- 35: {id: 0x23, digitSize: 0x3, zero: [4]uint8{0xea, 0xaf, 0xb0, 0x0}},
- 36: {id: 0x24, digitSize: 0x3, zero: [4]uint8{0xe1, 0x81, 0x80, 0x0}},
- 37: {id: 0x25, digitSize: 0x3, zero: [4]uint8{0xe1, 0x82, 0x90, 0x0}},
- 38: {id: 0x26, digitSize: 0x3, zero: [4]uint8{0xea, 0xa7, 0xb0, 0x0}},
- 39: {id: 0x27, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x91, 0x90}},
- 40: {id: 0x28, digitSize: 0x2, zero: [4]uint8{0xdf, 0x80, 0x0, 0x0}},
- 41: {id: 0x29, digitSize: 0x3, zero: [4]uint8{0xe1, 0xb1, 0x90, 0x0}},
- 42: {id: 0x2a, digitSize: 0x3, zero: [4]uint8{0xe0, 0xad, 0xa6, 0x0}},
- 43: {id: 0x2b, digitSize: 0x4, zero: [4]uint8{0xf0, 0x90, 0x92, 0xa0}},
- 44: {id: 0x2c, digitSize: 0x3, zero: [4]uint8{0xea, 0xa3, 0x90, 0x0}},
- 45: {id: 0x2d, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x87, 0x90}},
- 46: {id: 0x2e, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x8b, 0xb0}},
- 47: {id: 0x2f, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb7, 0xa6, 0x0}},
- 48: {id: 0x30, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x83, 0xb0}},
- 49: {id: 0x31, digitSize: 0x3, zero: [4]uint8{0xe1, 0xae, 0xb0, 0x0}},
- 50: {id: 0x32, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x9b, 0x80}},
- 51: {id: 0x33, digitSize: 0x3, zero: [4]uint8{0xe1, 0xa7, 0x90, 0x0}},
- 52: {id: 0x34, digitSize: 0x3, zero: [4]uint8{0xe0, 0xaf, 0xa6, 0x0}},
- 53: {id: 0x35, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb1, 0xa6, 0x0}},
- 54: {id: 0x36, digitSize: 0x3, zero: [4]uint8{0xe0, 0xb9, 0x90, 0x0}},
- 55: {id: 0x37, digitSize: 0x3, zero: [4]uint8{0xe0, 0xbc, 0xa0, 0x0}},
- 56: {id: 0x38, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0x93, 0x90}},
- 57: {id: 0x39, digitSize: 0x3, zero: [4]uint8{0xea, 0x98, 0xa0, 0x0}},
- 58: {id: 0x3a, digitSize: 0x4, zero: [4]uint8{0xf0, 0x91, 0xa3, 0xa0}},
-} // Size: 378 bytes
-
-const (
- numAdlm = 0x1
- numAhom = 0x2
- numArab = 0x3
- numArabext = 0x4
- numArmn = 0x3b
- numArmnlow = 0x3c
- numBali = 0x5
- numBeng = 0x6
- numBhks = 0x7
- numBrah = 0x8
- numCakm = 0x9
- numCham = 0xa
- numCyrl = 0x3d
- numDeva = 0xb
- numEthi = 0x3e
- numFullwide = 0xc
- numGeor = 0x3f
- numGonm = 0xd
- numGrek = 0x40
- numGreklow = 0x41
- numGujr = 0xe
- numGuru = 0xf
- numHanidays = 0x42
- numHanidec = 0x43
- numHans = 0x44
- numHansfin = 0x45
- numHant = 0x46
- numHantfin = 0x47
- numHebr = 0x48
- numHmng = 0x10
- numJava = 0x11
- numJpan = 0x49
- numJpanfin = 0x4a
- numKali = 0x12
- numKhmr = 0x13
- numKnda = 0x14
- numLana = 0x15
- numLanatham = 0x16
- numLaoo = 0x17
- numLatn = 0x0
- numLepc = 0x18
- numLimb = 0x19
- numMathbold = 0x1a
- numMathdbl = 0x1b
- numMathmono = 0x1c
- numMathsanb = 0x1d
- numMathsans = 0x1e
- numMlym = 0x1f
- numModi = 0x20
- numMong = 0x21
- numMroo = 0x22
- numMtei = 0x23
- numMymr = 0x24
- numMymrshan = 0x25
- numMymrtlng = 0x26
- numNewa = 0x27
- numNkoo = 0x28
- numOlck = 0x29
- numOrya = 0x2a
- numOsma = 0x2b
- numRoman = 0x4b
- numRomanlow = 0x4c
- numSaur = 0x2c
- numShrd = 0x2d
- numSind = 0x2e
- numSinh = 0x2f
- numSora = 0x30
- numSund = 0x31
- numTakr = 0x32
- numTalu = 0x33
- numTaml = 0x4d
- numTamldec = 0x34
- numTelu = 0x35
- numThai = 0x36
- numTibt = 0x37
- numTirh = 0x38
- numVaii = 0x39
- numWara = 0x3a
- numNumberSystems
-)
-
-var systemMap = map[string]system{
- "adlm": numAdlm,
- "ahom": numAhom,
- "arab": numArab,
- "arabext": numArabext,
- "armn": numArmn,
- "armnlow": numArmnlow,
- "bali": numBali,
- "beng": numBeng,
- "bhks": numBhks,
- "brah": numBrah,
- "cakm": numCakm,
- "cham": numCham,
- "cyrl": numCyrl,
- "deva": numDeva,
- "ethi": numEthi,
- "fullwide": numFullwide,
- "geor": numGeor,
- "gonm": numGonm,
- "grek": numGrek,
- "greklow": numGreklow,
- "gujr": numGujr,
- "guru": numGuru,
- "hanidays": numHanidays,
- "hanidec": numHanidec,
- "hans": numHans,
- "hansfin": numHansfin,
- "hant": numHant,
- "hantfin": numHantfin,
- "hebr": numHebr,
- "hmng": numHmng,
- "java": numJava,
- "jpan": numJpan,
- "jpanfin": numJpanfin,
- "kali": numKali,
- "khmr": numKhmr,
- "knda": numKnda,
- "lana": numLana,
- "lanatham": numLanatham,
- "laoo": numLaoo,
- "latn": numLatn,
- "lepc": numLepc,
- "limb": numLimb,
- "mathbold": numMathbold,
- "mathdbl": numMathdbl,
- "mathmono": numMathmono,
- "mathsanb": numMathsanb,
- "mathsans": numMathsans,
- "mlym": numMlym,
- "modi": numModi,
- "mong": numMong,
- "mroo": numMroo,
- "mtei": numMtei,
- "mymr": numMymr,
- "mymrshan": numMymrshan,
- "mymrtlng": numMymrtlng,
- "newa": numNewa,
- "nkoo": numNkoo,
- "olck": numOlck,
- "orya": numOrya,
- "osma": numOsma,
- "roman": numRoman,
- "romanlow": numRomanlow,
- "saur": numSaur,
- "shrd": numShrd,
- "sind": numSind,
- "sinh": numSinh,
- "sora": numSora,
- "sund": numSund,
- "takr": numTakr,
- "talu": numTalu,
- "taml": numTaml,
- "tamldec": numTamldec,
- "telu": numTelu,
- "thai": numThai,
- "tibt": numTibt,
- "tirh": numTirh,
- "vaii": numVaii,
- "wara": numWara,
-}
-
-var symIndex = [][12]uint8{ // 81 elements
- 0: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 1: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 2: [12]uint8{0x0, 0x1, 0x2, 0xd, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0x10, 0xb},
- 3: [12]uint8{0x1, 0x0, 0x2, 0xd, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0x10, 0xb},
- 4: [12]uint8{0x0, 0x1, 0x2, 0x11, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0x10, 0xb},
- 5: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x12, 0xb},
- 6: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 7: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x13, 0xb},
- 8: [12]uint8{0x0, 0x1, 0x2, 0x3, 0xe, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 9: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x0},
- 10: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x14, 0x8, 0x9, 0xa, 0xb},
- 11: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x14, 0x8, 0x9, 0xa, 0xb},
- 12: [12]uint8{0x0, 0x15, 0x2, 0x3, 0x4, 0x5, 0x6, 0x14, 0x8, 0x9, 0xa, 0xb},
- 13: [12]uint8{0x0, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 14: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x16, 0xb},
- 15: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb},
- 16: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0x0},
- 17: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb},
- 18: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x0},
- 19: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x18, 0x7, 0x8, 0x9, 0xa, 0xb},
- 20: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x19, 0x1a, 0xa, 0xb},
- 21: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 22: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x18, 0x7, 0x8, 0x9, 0xa, 0xb},
- 23: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 24: [12]uint8{0x0, 0x1, 0x2, 0x3, 0xe, 0x1c, 0x6, 0x7, 0x8, 0x9, 0x1d, 0xb},
- 25: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0x1e, 0x0},
- 26: [12]uint8{0x0, 0x15, 0x2, 0x3, 0x4, 0x1b, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 27: [12]uint8{0x0, 0x1, 0x2, 0x3, 0xe, 0xf, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 28: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x1f, 0xb},
- 29: [12]uint8{0x0, 0x15, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 30: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x20, 0xb},
- 31: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x21, 0x7, 0x8, 0x9, 0x22, 0xb},
- 32: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x23, 0xb},
- 33: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x1b, 0x18, 0x14, 0x8, 0x9, 0x24, 0xb},
- 34: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x18, 0x7, 0x8, 0x9, 0x24, 0xb},
- 35: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x25, 0xb},
- 36: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x26, 0xb},
- 37: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x27, 0xb},
- 38: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x28, 0xb},
- 39: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x29, 0xb},
- 40: [12]uint8{0x1, 0x0, 0x2, 0x3, 0xe, 0x1c, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 41: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2a, 0xb},
- 42: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2b, 0xb},
- 43: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x1b, 0x2c, 0x14, 0x8, 0x9, 0x24, 0xb},
- 44: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x0},
- 45: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb},
- 46: [12]uint8{0x1, 0x0, 0x2, 0x3, 0x4, 0x1b, 0x17, 0x7, 0x8, 0x9, 0xa, 0xb},
- 47: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2d, 0x0},
- 48: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2e, 0xb},
- 49: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x2f, 0xb},
- 50: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x30, 0x7, 0x8, 0x9, 0xa, 0xb},
- 51: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x31, 0xb},
- 52: [12]uint8{0x1, 0xc, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x32, 0xb},
- 53: [12]uint8{0x1, 0x15, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb},
- 54: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x33, 0xb},
- 55: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x34, 0xb},
- 56: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb},
- 57: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x7, 0x3c, 0x9, 0x3d, 0xb},
- 58: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x3e, 0x3f, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb},
- 59: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x39, 0x3a, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb},
- 60: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x39, 0x40, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb},
- 61: [12]uint8{0x35, 0x36, 0x37, 0x41, 0x3e, 0x3f, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb},
- 62: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x3e, 0x3f, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0xb},
- 63: [12]uint8{0x35, 0xc, 0x37, 0x38, 0x39, 0x42, 0x3b, 0x7, 0x3c, 0x9, 0xa, 0x0},
- 64: [12]uint8{0x35, 0xc, 0x37, 0x38, 0x39, 0x42, 0x43, 0x7, 0x44, 0x9, 0x24, 0xb},
- 65: [12]uint8{0x35, 0x36, 0x37, 0x38, 0x39, 0x5, 0x3b, 0x7, 0x3c, 0x9, 0x33, 0xb},
- 66: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x45, 0x46, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35},
- 67: [12]uint8{0x35, 0x36, 0x37, 0x11, 0xe, 0x1c, 0x43, 0x7, 0x3c, 0x9, 0x1d, 0xb},
- 68: [12]uint8{0x35, 0x36, 0x37, 0x11, 0xe, 0x1c, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35},
- 69: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x45, 0x5, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35},
- 70: [12]uint8{0x1, 0xc, 0x37, 0x11, 0x45, 0x47, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x0},
- 71: [12]uint8{0x35, 0x1, 0x37, 0x11, 0x4, 0x5, 0x43, 0x7, 0x3c, 0x9, 0xa, 0x35},
- 72: [12]uint8{0x1, 0xc, 0x37, 0x11, 0x45, 0x47, 0x43, 0x7, 0x3c, 0x9, 0x24, 0xb},
- 73: [12]uint8{0x35, 0x36, 0x2, 0x3, 0x45, 0x46, 0x43, 0x7, 0x8, 0x9, 0xa, 0x35},
- 74: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x4, 0x5, 0x43, 0x7, 0x3c, 0x9, 0x31, 0x35},
- 75: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x4, 0x5, 0x43, 0x7, 0x3c, 0x9, 0x32, 0x35},
- 76: [12]uint8{0x35, 0x36, 0x37, 0x11, 0x48, 0x46, 0x43, 0x7, 0x3c, 0x9, 0x33, 0x35},
- 77: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0x49},
- 78: [12]uint8{0x0, 0x1, 0x4a, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x28, 0xb},
- 79: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x4b, 0xb},
- 80: [12]uint8{0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x4c, 0x4d, 0xb},
-} // Size: 996 bytes
-
-var symData = stringset.Set{
- Data: "" + // Size: 599 bytes
- ".,;%+-E׉∞NaN:\u00a0\u200e%\u200e\u200e+\u200e-ليس\u00a0رقمًا٪NDТерхьаш" +
- "\u00a0дац·’mnne×10^0/00INF−\u200e−ناعددepälukuՈչԹარ\u00a0არის\u00a0რიცხვ" +
- "იZMdMсан\u00a0емес¤¤¤сан\u00a0эмесບໍ່\u200bແມ່ນ\u200bໂຕ\u200bເລກNSဂဏန်" +
- "းမဟုတ်သောННне\u00a0числочыыһыла\u00a0буотах·10^epilohosan\u00a0dälTFЕs" +
- "on\u00a0emasҳақиқий\u00a0сон\u00a0эмас非數值非数值٫٬؛٪\u061c\u061c+\u061c-اس؉ل" +
- "يس\u00a0رقم\u200f+\u200f-\u200f−٪\u200f\u061c−×۱۰^؉\u200f\u200e+\u200e" +
- "\u200e-\u200e\u200e−\u200e+\u200e:၊ཨང་མེན་གྲངས་མེདཨང་མད",
- Index: []uint16{ // 79 elements
- // Entry 0 - 3F
- 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0009, 0x000c, 0x000f, 0x0012, 0x0013, 0x0015, 0x001c, 0x0020,
- 0x0024, 0x0036, 0x0038, 0x003a, 0x0050, 0x0052, 0x0055, 0x0058,
- 0x0059, 0x005e, 0x0062, 0x0065, 0x0068, 0x006e, 0x0078, 0x0080,
- 0x0086, 0x00ae, 0x00af, 0x00b2, 0x00c2, 0x00c8, 0x00d8, 0x0105,
- 0x0107, 0x012e, 0x0132, 0x0142, 0x015e, 0x0163, 0x016a, 0x0173,
- 0x0175, 0x0177, 0x0180, 0x01a0, 0x01a9, 0x01b2, 0x01b4, 0x01b6,
- 0x01b8, 0x01bc, 0x01bf, 0x01c2, 0x01c6, 0x01c8, 0x01d6, 0x01da,
- // Entry 40 - 7F
- 0x01de, 0x01e4, 0x01e9, 0x01ee, 0x01f5, 0x01fa, 0x0201, 0x0208,
- 0x0211, 0x0215, 0x0218, 0x021b, 0x0230, 0x0248, 0x0257,
- },
-} // Size: 797 bytes
-
-// langToDefaults maps a compact language index to the default numbering system
-// and default symbol set
-var langToDefaults = [775]symOffset{
- // Entry 0 - 3F
- 0x8000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x8003, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003,
- 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002,
- 0x0003, 0x0003, 0x0003, 0x0003, 0x0002, 0x0002, 0x0002, 0x0004,
- 0x0002, 0x0004, 0x0002, 0x0002, 0x0002, 0x0003, 0x0002, 0x0000,
- 0x8005, 0x0000, 0x0000, 0x0000, 0x8006, 0x0005, 0x0006, 0x0006,
- 0x0006, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000,
- // Entry 40 - 7F
- 0x8009, 0x0000, 0x0000, 0x800a, 0x0000, 0x0000, 0x800c, 0x0001,
- 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006,
- 0x0006, 0x0006, 0x0006, 0x0006, 0x800e, 0x0000, 0x0000, 0x0007,
- 0x0007, 0x0000, 0x0000, 0x0000, 0x0000, 0x800f, 0x0008, 0x0008,
- 0x8011, 0x0001, 0x0001, 0x0001, 0x803c, 0x0000, 0x0009, 0x0009,
- 0x0009, 0x0000, 0x0000, 0x000a, 0x000b, 0x000a, 0x000c, 0x000a,
- 0x000a, 0x000c, 0x000a, 0x000d, 0x000d, 0x000a, 0x000a, 0x0001,
- 0x0001, 0x0000, 0x0001, 0x0001, 0x803f, 0x0000, 0x0000, 0x0000,
- // Entry 80 - BF
- 0x000e, 0x000e, 0x000e, 0x000f, 0x000f, 0x000f, 0x0000, 0x0000,
- 0x0006, 0x0000, 0x0000, 0x0000, 0x000a, 0x0010, 0x0000, 0x0006,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0011, 0x0000, 0x000a,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x000a, 0x0000, 0x0009, 0x0000,
- 0x0000, 0x0012, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- // Entry C0 - FF
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0013, 0x0000,
- 0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0015,
- 0x0015, 0x0006, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000, 0x0006,
- 0x0006, 0x0001, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006,
- // Entry 100 - 13F
- 0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006,
- 0x0000, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x0016, 0x0016,
- 0x0017, 0x0017, 0x0001, 0x0001, 0x8041, 0x0018, 0x0018, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0019, 0x0019, 0x0000, 0x0000,
- 0x0017, 0x0017, 0x0017, 0x8044, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001,
- // Entry 140 - 17F
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x0001, 0x0001, 0x0006, 0x0006, 0x0006, 0x0006, 0x0000, 0x0000,
- 0x8047, 0x0000, 0x0006, 0x0006, 0x001a, 0x001a, 0x001a, 0x001a,
- 0x804a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x804c, 0x001b, 0x0000,
- 0x0000, 0x0006, 0x0006, 0x0006, 0x000a, 0x000a, 0x0001, 0x0001,
- 0x001c, 0x001c, 0x0009, 0x0009, 0x804f, 0x0000, 0x0000, 0x0000,
- // Entry 180 - 1BF
- 0x0000, 0x0000, 0x8052, 0x0006, 0x0006, 0x001d, 0x0006, 0x0006,
- 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x001e, 0x001e, 0x001f,
- 0x001f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001,
- 0x0001, 0x000d, 0x000d, 0x0000, 0x0000, 0x0020, 0x0020, 0x0006,
- 0x0006, 0x0021, 0x0021, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000,
- 0x0000, 0x8054, 0x0000, 0x0000, 0x0000, 0x0000, 0x8056, 0x001b,
- 0x0000, 0x0000, 0x0001, 0x0001, 0x0022, 0x0022, 0x0000, 0x0000,
- // Entry 1C0 - 1FF
- 0x0000, 0x0023, 0x0023, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006,
- 0x0024, 0x0024, 0x8058, 0x0000, 0x0000, 0x0016, 0x0016, 0x0006,
- 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0025, 0x0025, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x000d, 0x000d, 0x0000, 0x0000,
- 0x0006, 0x0006, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x805a, 0x0000, 0x0000, 0x0006, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x805b, 0x0026, 0x805d,
- // Entry 200 - 23F
- 0x0000, 0x0000, 0x0000, 0x0000, 0x805e, 0x0015, 0x0015, 0x0000,
- 0x0000, 0x0006, 0x0006, 0x0006, 0x8061, 0x0000, 0x0000, 0x8062,
- 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0001,
- 0x0001, 0x0015, 0x0015, 0x0006, 0x0006, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0027, 0x0027, 0x0027, 0x8065, 0x8067,
- 0x001b, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x8069, 0x0028, 0x0006, 0x0001, 0x0006, 0x0001, 0x0001, 0x0001,
- // Entry 240 - 27F
- 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000,
- 0x0006, 0x0000, 0x0000, 0x001a, 0x001a, 0x0006, 0x0006, 0x0006,
- 0x0006, 0x0006, 0x0000, 0x0000, 0x0029, 0x0029, 0x0029, 0x0029,
- 0x0029, 0x0029, 0x0029, 0x0006, 0x0006, 0x0000, 0x0000, 0x002a,
- 0x002a, 0x0000, 0x0000, 0x0000, 0x0000, 0x806b, 0x0000, 0x0000,
- 0x002b, 0x002b, 0x002b, 0x002b, 0x0006, 0x0006, 0x000d, 0x000d,
- 0x0006, 0x0006, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001,
- 0x002c, 0x002c, 0x002d, 0x002d, 0x002e, 0x002e, 0x0000, 0x0000,
- // Entry 280 - 2BF
- 0x0000, 0x002f, 0x002f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0006,
- 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006, 0x0006,
- 0x0006, 0x0006, 0x0000, 0x0000, 0x0000, 0x806d, 0x0022, 0x0022,
- 0x0022, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0030, 0x0030, 0x0000, 0x0000, 0x8071, 0x0031, 0x0006,
- // Entry 2C0 - 2FF
- 0x0006, 0x0006, 0x0000, 0x0001, 0x0001, 0x000d, 0x000d, 0x0001,
- 0x0001, 0x0000, 0x0000, 0x0032, 0x0032, 0x8074, 0x8076, 0x001b,
- 0x8077, 0x8079, 0x0028, 0x807b, 0x0034, 0x0033, 0x0033, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0006, 0x0006, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0035, 0x0035, 0x0006, 0x0006,
- 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0036, 0x0037, 0x0037, 0x0036, 0x0036, 0x0001,
- 0x0001, 0x807d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8080,
- // Entry 300 - 33F
- 0x0036, 0x0036, 0x0036, 0x0000, 0x0000, 0x0006, 0x0014,
-} // Size: 1550 bytes
-
-// langToAlt is a list of numbering system and symbol set pairs, sorted and
-// marked by compact language index.
-var langToAlt = []altSymData{ // 131 elements
- 1: {compactTag: 0x0, symIndex: 0x38, system: 0x3},
- 2: {compactTag: 0x0, symIndex: 0x42, system: 0x4},
- 3: {compactTag: 0xa, symIndex: 0x39, system: 0x3},
- 4: {compactTag: 0xa, symIndex: 0x2, system: 0x0},
- 5: {compactTag: 0x28, symIndex: 0x0, system: 0x6},
- 6: {compactTag: 0x2c, symIndex: 0x5, system: 0x0},
- 7: {compactTag: 0x2c, symIndex: 0x3a, system: 0x3},
- 8: {compactTag: 0x2c, symIndex: 0x42, system: 0x4},
- 9: {compactTag: 0x40, symIndex: 0x0, system: 0x6},
- 10: {compactTag: 0x43, symIndex: 0x0, system: 0x0},
- 11: {compactTag: 0x43, symIndex: 0x4f, system: 0x37},
- 12: {compactTag: 0x46, symIndex: 0x1, system: 0x0},
- 13: {compactTag: 0x46, symIndex: 0x38, system: 0x3},
- 14: {compactTag: 0x54, symIndex: 0x0, system: 0x9},
- 15: {compactTag: 0x5d, symIndex: 0x3a, system: 0x3},
- 16: {compactTag: 0x5d, symIndex: 0x8, system: 0x0},
- 17: {compactTag: 0x60, symIndex: 0x1, system: 0x0},
- 18: {compactTag: 0x60, symIndex: 0x38, system: 0x3},
- 19: {compactTag: 0x60, symIndex: 0x42, system: 0x4},
- 20: {compactTag: 0x60, symIndex: 0x0, system: 0x5},
- 21: {compactTag: 0x60, symIndex: 0x0, system: 0x6},
- 22: {compactTag: 0x60, symIndex: 0x0, system: 0x8},
- 23: {compactTag: 0x60, symIndex: 0x0, system: 0x9},
- 24: {compactTag: 0x60, symIndex: 0x0, system: 0xa},
- 25: {compactTag: 0x60, symIndex: 0x0, system: 0xb},
- 26: {compactTag: 0x60, symIndex: 0x0, system: 0xc},
- 27: {compactTag: 0x60, symIndex: 0x0, system: 0xd},
- 28: {compactTag: 0x60, symIndex: 0x0, system: 0xe},
- 29: {compactTag: 0x60, symIndex: 0x0, system: 0xf},
- 30: {compactTag: 0x60, symIndex: 0x0, system: 0x11},
- 31: {compactTag: 0x60, symIndex: 0x0, system: 0x12},
- 32: {compactTag: 0x60, symIndex: 0x0, system: 0x13},
- 33: {compactTag: 0x60, symIndex: 0x0, system: 0x14},
- 34: {compactTag: 0x60, symIndex: 0x0, system: 0x15},
- 35: {compactTag: 0x60, symIndex: 0x0, system: 0x16},
- 36: {compactTag: 0x60, symIndex: 0x0, system: 0x17},
- 37: {compactTag: 0x60, symIndex: 0x0, system: 0x18},
- 38: {compactTag: 0x60, symIndex: 0x0, system: 0x19},
- 39: {compactTag: 0x60, symIndex: 0x0, system: 0x1f},
- 40: {compactTag: 0x60, symIndex: 0x0, system: 0x21},
- 41: {compactTag: 0x60, symIndex: 0x0, system: 0x23},
- 42: {compactTag: 0x60, symIndex: 0x0, system: 0x24},
- 43: {compactTag: 0x60, symIndex: 0x0, system: 0x25},
- 44: {compactTag: 0x60, symIndex: 0x0, system: 0x28},
- 45: {compactTag: 0x60, symIndex: 0x0, system: 0x29},
- 46: {compactTag: 0x60, symIndex: 0x0, system: 0x2a},
- 47: {compactTag: 0x60, symIndex: 0x0, system: 0x2b},
- 48: {compactTag: 0x60, symIndex: 0x0, system: 0x2c},
- 49: {compactTag: 0x60, symIndex: 0x0, system: 0x2d},
- 50: {compactTag: 0x60, symIndex: 0x0, system: 0x30},
- 51: {compactTag: 0x60, symIndex: 0x0, system: 0x31},
- 52: {compactTag: 0x60, symIndex: 0x0, system: 0x32},
- 53: {compactTag: 0x60, symIndex: 0x0, system: 0x33},
- 54: {compactTag: 0x60, symIndex: 0x0, system: 0x34},
- 55: {compactTag: 0x60, symIndex: 0x0, system: 0x35},
- 56: {compactTag: 0x60, symIndex: 0x0, system: 0x36},
- 57: {compactTag: 0x60, symIndex: 0x0, system: 0x37},
- 58: {compactTag: 0x60, symIndex: 0x0, system: 0x39},
- 59: {compactTag: 0x60, symIndex: 0x0, system: 0x43},
- 60: {compactTag: 0x64, symIndex: 0x0, system: 0x0},
- 61: {compactTag: 0x64, symIndex: 0x38, system: 0x3},
- 62: {compactTag: 0x64, symIndex: 0x42, system: 0x4},
- 63: {compactTag: 0x7c, symIndex: 0x50, system: 0x37},
- 64: {compactTag: 0x7c, symIndex: 0x0, system: 0x0},
- 65: {compactTag: 0x114, symIndex: 0x43, system: 0x4},
- 66: {compactTag: 0x114, symIndex: 0x18, system: 0x0},
- 67: {compactTag: 0x114, symIndex: 0x3b, system: 0x3},
- 68: {compactTag: 0x123, symIndex: 0x1, system: 0x0},
- 69: {compactTag: 0x123, symIndex: 0x3c, system: 0x3},
- 70: {compactTag: 0x123, symIndex: 0x44, system: 0x4},
- 71: {compactTag: 0x158, symIndex: 0x0, system: 0x0},
- 72: {compactTag: 0x158, symIndex: 0x3b, system: 0x3},
- 73: {compactTag: 0x158, symIndex: 0x45, system: 0x4},
- 74: {compactTag: 0x160, symIndex: 0x0, system: 0x0},
- 75: {compactTag: 0x160, symIndex: 0x38, system: 0x3},
- 76: {compactTag: 0x16d, symIndex: 0x1b, system: 0x0},
- 77: {compactTag: 0x16d, symIndex: 0x0, system: 0x9},
- 78: {compactTag: 0x16d, symIndex: 0x0, system: 0xa},
- 79: {compactTag: 0x17c, symIndex: 0x0, system: 0x0},
- 80: {compactTag: 0x17c, symIndex: 0x3d, system: 0x3},
- 81: {compactTag: 0x17c, symIndex: 0x42, system: 0x4},
- 82: {compactTag: 0x182, symIndex: 0x6, system: 0x0},
- 83: {compactTag: 0x182, symIndex: 0x38, system: 0x3},
- 84: {compactTag: 0x1b1, symIndex: 0x0, system: 0x0},
- 85: {compactTag: 0x1b1, symIndex: 0x3e, system: 0x3},
- 86: {compactTag: 0x1b6, symIndex: 0x42, system: 0x4},
- 87: {compactTag: 0x1b6, symIndex: 0x1b, system: 0x0},
- 88: {compactTag: 0x1d2, symIndex: 0x42, system: 0x4},
- 89: {compactTag: 0x1d2, symIndex: 0x0, system: 0x0},
- 90: {compactTag: 0x1f3, symIndex: 0x0, system: 0xb},
- 91: {compactTag: 0x1fd, symIndex: 0x4e, system: 0x24},
- 92: {compactTag: 0x1fd, symIndex: 0x26, system: 0x0},
- 93: {compactTag: 0x1ff, symIndex: 0x42, system: 0x4},
- 94: {compactTag: 0x204, symIndex: 0x15, system: 0x0},
- 95: {compactTag: 0x204, symIndex: 0x3f, system: 0x3},
- 96: {compactTag: 0x204, symIndex: 0x46, system: 0x4},
- 97: {compactTag: 0x20c, symIndex: 0x0, system: 0xb},
- 98: {compactTag: 0x20f, symIndex: 0x6, system: 0x0},
- 99: {compactTag: 0x20f, symIndex: 0x38, system: 0x3},
- 100: {compactTag: 0x20f, symIndex: 0x42, system: 0x4},
- 101: {compactTag: 0x22e, symIndex: 0x0, system: 0x0},
- 102: {compactTag: 0x22e, symIndex: 0x47, system: 0x4},
- 103: {compactTag: 0x22f, symIndex: 0x42, system: 0x4},
- 104: {compactTag: 0x22f, symIndex: 0x1b, system: 0x0},
- 105: {compactTag: 0x238, symIndex: 0x42, system: 0x4},
- 106: {compactTag: 0x238, symIndex: 0x28, system: 0x0},
- 107: {compactTag: 0x265, symIndex: 0x38, system: 0x3},
- 108: {compactTag: 0x265, symIndex: 0x0, system: 0x0},
- 109: {compactTag: 0x29d, symIndex: 0x22, system: 0x0},
- 110: {compactTag: 0x29d, symIndex: 0x40, system: 0x3},
- 111: {compactTag: 0x29d, symIndex: 0x48, system: 0x4},
- 112: {compactTag: 0x29d, symIndex: 0x4d, system: 0xc},
- 113: {compactTag: 0x2bd, symIndex: 0x31, system: 0x0},
- 114: {compactTag: 0x2bd, symIndex: 0x3e, system: 0x3},
- 115: {compactTag: 0x2bd, symIndex: 0x42, system: 0x4},
- 116: {compactTag: 0x2cd, symIndex: 0x1b, system: 0x0},
- 117: {compactTag: 0x2cd, symIndex: 0x49, system: 0x4},
- 118: {compactTag: 0x2ce, symIndex: 0x49, system: 0x4},
- 119: {compactTag: 0x2d0, symIndex: 0x33, system: 0x0},
- 120: {compactTag: 0x2d0, symIndex: 0x4a, system: 0x4},
- 121: {compactTag: 0x2d1, symIndex: 0x42, system: 0x4},
- 122: {compactTag: 0x2d1, symIndex: 0x28, system: 0x0},
- 123: {compactTag: 0x2d3, symIndex: 0x34, system: 0x0},
- 124: {compactTag: 0x2d3, symIndex: 0x4b, system: 0x4},
- 125: {compactTag: 0x2f9, symIndex: 0x0, system: 0x0},
- 126: {compactTag: 0x2f9, symIndex: 0x38, system: 0x3},
- 127: {compactTag: 0x2f9, symIndex: 0x42, system: 0x4},
- 128: {compactTag: 0x2ff, symIndex: 0x36, system: 0x0},
- 129: {compactTag: 0x2ff, symIndex: 0x41, system: 0x3},
- 130: {compactTag: 0x2ff, symIndex: 0x4c, system: 0x4},
-} // Size: 810 bytes
-
-var tagToDecimal = []uint8{ // 775 elements
- // Entry 0 - 3F
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 40 - 7F
- 0x05, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x05, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01,
- // Entry 80 - BF
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry C0 - FF
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 100 - 13F
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 140 - 17F
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05,
- 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 180 - 1BF
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x05, 0x05, 0x05, 0x05,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 1C0 - 1FF
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, 0x05,
- 0x01, 0x01, 0x01, 0x05, 0x05, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 200 - 23F
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x05, 0x01,
- 0x01, 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 240 - 27F
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 280 - 2BF
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05,
- 0x05, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 2C0 - 2FF
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
- // Entry 300 - 33F
- 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08,
-} // Size: 799 bytes
-
-var tagToScientific = []uint8{ // 775 elements
- // Entry 0 - 3F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 40 - 7F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 80 - BF
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry C0 - FF
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 100 - 13F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 140 - 17F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x0c, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c,
- 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 180 - 1BF
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 1C0 - 1FF
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x0d, 0x0d, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x0c, 0x0c, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 200 - 23F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c, 0x02,
- 0x02, 0x0c, 0x0c, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 240 - 27F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x0d, 0x0d, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 280 - 2BF
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 2C0 - 2FF
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
- // Entry 300 - 33F
- 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x09,
-} // Size: 799 bytes
-
-var tagToPercent = []uint8{ // 775 elements
- // Entry 0 - 3F
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry 40 - 7F
- 0x06, 0x06, 0x06, 0x04, 0x04, 0x04, 0x03, 0x03,
- 0x06, 0x06, 0x03, 0x04, 0x04, 0x03, 0x03, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x06, 0x03,
- 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03,
- 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04, 0x03,
- 0x03, 0x04, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03,
- 0x03, 0x04, 0x04, 0x04, 0x07, 0x07, 0x04, 0x04,
- // Entry 80 - BF
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x03, 0x04,
- 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry C0 - FF
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- // Entry 100 - 13F
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04,
- 0x0b, 0x0b, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- // Entry 140 - 17F
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06,
- 0x06, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry 180 - 1BF
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06,
- 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04, 0x04,
- // Entry 1C0 - 1FF
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry 200 - 23F
- 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x06, 0x06, 0x04, 0x04, 0x04, 0x06, 0x04,
- 0x04, 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry 240 - 27F
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03,
- 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03,
- 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04,
- // Entry 280 - 2BF
- 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03,
- 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06,
- 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x0e,
- // Entry 2C0 - 2FF
- 0x0e, 0x0e, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03,
- 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
- // Entry 300 - 33F
- 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0a,
-} // Size: 799 bytes
-
-var formats = []Pattern{Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x0,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x0,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 3,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x9,
- GroupingSize: [2]uint8{0x3,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x0,
- MaxIntegerDigits: 0x1,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x1},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x3,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x00\x03\u00a0%",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x7,
- GroupingSize: [2]uint8{0x3,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x00\x01%",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x6,
- GroupingSize: [2]uint8{0x3,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 3,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0xc,
- GroupingSize: [2]uint8{0x3,
- 0x2},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x00\x01%",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x9,
- GroupingSize: [2]uint8{0x3,
- 0x2},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x00\x03\u00a0%",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0xa,
- GroupingSize: [2]uint8{0x3,
- 0x2},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 6,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x8,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 6,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x6,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x3},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0xd,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x4},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x00\x01%",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x2,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x03%\u00a0\x00",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x7,
- GroupingSize: [2]uint8{0x3,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x0,
- MaxIntegerDigits: 0x1,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x1},
- Affix: "\x01[\x01]",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x5,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x0,
- MinIntegerDigits: 0x0,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x1,
- GroupingSize: [2]uint8{0x0,
- 0x0},
- Flags: 0x0},
- Pattern{RoundingContext: RoundingContext{MaxSignificantDigits: 0,
- MaxFractionDigits: 0,
- Increment: 0x0,
- IncrementScale: 0x0,
- Mode: 0x0,
- DigitShift: 0x2,
- MinIntegerDigits: 0x1,
- MaxIntegerDigits: 0x0,
- MinFractionDigits: 0x0,
- MinSignificantDigits: 0x0,
- MinExponentDigits: 0x0},
- Affix: "\x01%\x00",
- Offset: 0x0,
- NegOffset: 0x0,
- PadRune: 0,
- FormatWidth: 0x6,
- GroupingSize: [2]uint8{0x3,
- 0x0},
- Flags: 0x0}}
-
-// Total table size 8634 bytes (8KiB); checksum: 8F23386D
diff --git a/vendor/golang.org/x/text/internal/stringset/set.go b/vendor/golang.org/x/text/internal/stringset/set.go
deleted file mode 100644
index bb2fffb..0000000
--- a/vendor/golang.org/x/text/internal/stringset/set.go
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package stringset provides a way to represent a collection of strings
-// compactly.
-package stringset
-
-import "sort"
-
-// A Set holds a collection of strings that can be looked up by an index number.
-type Set struct {
- // These fields are exported to allow for code generation.
-
- Data string
- Index []uint16
-}
-
-// Elem returns the string with index i. It panics if i is out of range.
-func (s *Set) Elem(i int) string {
- return s.Data[s.Index[i]:s.Index[i+1]]
-}
-
-// Len returns the number of strings in the set.
-func (s *Set) Len() int {
- return len(s.Index) - 1
-}
-
-// Search returns the index of the given string or -1 if it is not in the set.
-// The Set must have been created with strings in sorted order.
-func Search(s *Set, str string) int {
- // TODO: optimize this if it gets used a lot.
- n := len(s.Index) - 1
- p := sort.Search(n, func(i int) bool {
- return s.Elem(i) >= str
- })
- if p == n || str != s.Elem(p) {
- return -1
- }
- return p
-}
-
-// A Builder constructs Sets.
-type Builder struct {
- set Set
- index map[string]int
-}
-
-// NewBuilder returns a new and initialized Builder.
-func NewBuilder() *Builder {
- return &Builder{
- set: Set{
- Index: []uint16{0},
- },
- index: map[string]int{},
- }
-}
-
-// Set creates the set created so far.
-func (b *Builder) Set() Set {
- return b.set
-}
-
-// Index returns the index for the given string, which must have been added
-// before.
-func (b *Builder) Index(s string) int {
- return b.index[s]
-}
-
-// Add adds a string to the index. Strings that are added by a single Add will
-// be stored together, unless they match an existing string.
-func (b *Builder) Add(ss ...string) {
- // First check if the string already exists.
- for _, s := range ss {
- if _, ok := b.index[s]; ok {
- continue
- }
- b.index[s] = len(b.set.Index) - 1
- b.set.Data += s
- x := len(b.set.Data)
- if x > 0xFFFF {
- panic("Index too > 0xFFFF")
- }
- b.set.Index = append(b.set.Index, uint16(x))
- }
-}
diff --git a/vendor/golang.org/x/text/internal/tag/tag.go b/vendor/golang.org/x/text/internal/tag/tag.go
deleted file mode 100644
index b5d3488..0000000
--- a/vendor/golang.org/x/text/internal/tag/tag.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package tag contains functionality handling tags and related data.
-package tag // import "golang.org/x/text/internal/tag"
-
-import "sort"
-
-// An Index converts tags to a compact numeric value.
-//
-// All elements are of size 4. Tags may be up to 4 bytes long. Excess bytes can
-// be used to store additional information about the tag.
-type Index string
-
-// Elem returns the element data at the given index.
-func (s Index) Elem(x int) string {
- return string(s[x*4 : x*4+4])
-}
-
-// Index reports the index of the given key or -1 if it could not be found.
-// Only the first len(key) bytes from the start of the 4-byte entries will be
-// considered for the search and the first match in Index will be returned.
-func (s Index) Index(key []byte) int {
- n := len(key)
- // search the index of the first entry with an equal or higher value than
- // key in s.
- index := sort.Search(len(s)/4, func(i int) bool {
- return cmp(s[i*4:i*4+n], key) != -1
- })
- i := index * 4
- if cmp(s[i:i+len(key)], key) != 0 {
- return -1
- }
- return index
-}
-
-// Next finds the next occurrence of key after index x, which must have been
-// obtained from a call to Index using the same key. It returns x+1 or -1.
-func (s Index) Next(key []byte, x int) int {
- if x++; x*4 < len(s) && cmp(s[x*4:x*4+len(key)], key) == 0 {
- return x
- }
- return -1
-}
-
-// cmp returns an integer comparing a and b lexicographically.
-func cmp(a Index, b []byte) int {
- n := len(a)
- if len(b) < n {
- n = len(b)
- }
- for i, c := range b[:n] {
- switch {
- case a[i] > c:
- return 1
- case a[i] < c:
- return -1
- }
- }
- switch {
- case len(a) < len(b):
- return -1
- case len(a) > len(b):
- return 1
- }
- return 0
-}
-
-// Compare returns an integer comparing a and b lexicographically.
-func Compare(a string, b []byte) int {
- return cmp(Index(a), b)
-}
-
-// FixCase reformats b to the same pattern of cases as form.
-// If returns false if string b is malformed.
-func FixCase(form string, b []byte) bool {
- if len(form) != len(b) {
- return false
- }
- for i, c := range b {
- if form[i] <= 'Z' {
- if c >= 'a' {
- c -= 'z' - 'Z'
- }
- if c < 'A' || 'Z' < c {
- return false
- }
- } else {
- if c <= 'Z' {
- c += 'z' - 'Z'
- }
- if c < 'a' || 'z' < c {
- return false
- }
- }
- b[i] = c
- }
- return true
-}
diff --git a/vendor/golang.org/x/text/language/coverage.go b/vendor/golang.org/x/text/language/coverage.go
deleted file mode 100644
index a24fd1a..0000000
--- a/vendor/golang.org/x/text/language/coverage.go
+++ /dev/null
@@ -1,187 +0,0 @@
-// Copyright 2014 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import (
- "fmt"
- "sort"
-
- "golang.org/x/text/internal/language"
-)
-
-// The Coverage interface is used to define the level of coverage of an
-// internationalization service. Note that not all types are supported by all
-// services. As lists may be generated on the fly, it is recommended that users
-// of a Coverage cache the results.
-type Coverage interface {
- // Tags returns the list of supported tags.
- Tags() []Tag
-
- // BaseLanguages returns the list of supported base languages.
- BaseLanguages() []Base
-
- // Scripts returns the list of supported scripts.
- Scripts() []Script
-
- // Regions returns the list of supported regions.
- Regions() []Region
-}
-
-var (
- // Supported defines a Coverage that lists all supported subtags. Tags
- // always returns nil.
- Supported Coverage = allSubtags{}
-)
-
-// TODO:
-// - Support Variants, numbering systems.
-// - CLDR coverage levels.
-// - Set of common tags defined in this package.
-
-type allSubtags struct{}
-
-// Regions returns the list of supported regions. As all regions are in a
-// consecutive range, it simply returns a slice of numbers in increasing order.
-// The "undefined" region is not returned.
-func (s allSubtags) Regions() []Region {
- reg := make([]Region, language.NumRegions)
- for i := range reg {
- reg[i] = Region{language.Region(i + 1)}
- }
- return reg
-}
-
-// Scripts returns the list of supported scripts. As all scripts are in a
-// consecutive range, it simply returns a slice of numbers in increasing order.
-// The "undefined" script is not returned.
-func (s allSubtags) Scripts() []Script {
- scr := make([]Script, language.NumScripts)
- for i := range scr {
- scr[i] = Script{language.Script(i + 1)}
- }
- return scr
-}
-
-// BaseLanguages returns the list of all supported base languages. It generates
-// the list by traversing the internal structures.
-func (s allSubtags) BaseLanguages() []Base {
- bs := language.BaseLanguages()
- base := make([]Base, len(bs))
- for i, b := range bs {
- base[i] = Base{b}
- }
- return base
-}
-
-// Tags always returns nil.
-func (s allSubtags) Tags() []Tag {
- return nil
-}
-
-// coverage is used by NewCoverage which is used as a convenient way for
-// creating Coverage implementations for partially defined data. Very often a
-// package will only need to define a subset of slices. coverage provides a
-// convenient way to do this. Moreover, packages using NewCoverage, instead of
-// their own implementation, will not break if later new slice types are added.
-type coverage struct {
- tags func() []Tag
- bases func() []Base
- scripts func() []Script
- regions func() []Region
-}
-
-func (s *coverage) Tags() []Tag {
- if s.tags == nil {
- return nil
- }
- return s.tags()
-}
-
-// bases implements sort.Interface and is used to sort base languages.
-type bases []Base
-
-func (b bases) Len() int {
- return len(b)
-}
-
-func (b bases) Swap(i, j int) {
- b[i], b[j] = b[j], b[i]
-}
-
-func (b bases) Less(i, j int) bool {
- return b[i].langID < b[j].langID
-}
-
-// BaseLanguages returns the result from calling s.bases if it is specified or
-// otherwise derives the set of supported base languages from tags.
-func (s *coverage) BaseLanguages() []Base {
- if s.bases == nil {
- tags := s.Tags()
- if len(tags) == 0 {
- return nil
- }
- a := make([]Base, len(tags))
- for i, t := range tags {
- a[i] = Base{language.Language(t.lang())}
- }
- sort.Sort(bases(a))
- k := 0
- for i := 1; i < len(a); i++ {
- if a[k] != a[i] {
- k++
- a[k] = a[i]
- }
- }
- return a[:k+1]
- }
- return s.bases()
-}
-
-func (s *coverage) Scripts() []Script {
- if s.scripts == nil {
- return nil
- }
- return s.scripts()
-}
-
-func (s *coverage) Regions() []Region {
- if s.regions == nil {
- return nil
- }
- return s.regions()
-}
-
-// NewCoverage returns a Coverage for the given lists. It is typically used by
-// packages providing internationalization services to define their level of
-// coverage. A list may be of type []T or func() []T, where T is either Tag,
-// Base, Script or Region. The returned Coverage derives the value for Bases
-// from Tags if no func or slice for []Base is specified. For other unspecified
-// types the returned Coverage will return nil for the respective methods.
-func NewCoverage(list ...interface{}) Coverage {
- s := &coverage{}
- for _, x := range list {
- switch v := x.(type) {
- case func() []Base:
- s.bases = v
- case func() []Script:
- s.scripts = v
- case func() []Region:
- s.regions = v
- case func() []Tag:
- s.tags = v
- case []Base:
- s.bases = func() []Base { return v }
- case []Script:
- s.scripts = func() []Script { return v }
- case []Region:
- s.regions = func() []Region { return v }
- case []Tag:
- s.tags = func() []Tag { return v }
- default:
- panic(fmt.Sprintf("language: unsupported set type %T", v))
- }
- }
- return s
-}
diff --git a/vendor/golang.org/x/text/language/doc.go b/vendor/golang.org/x/text/language/doc.go
deleted file mode 100644
index 212b77c..0000000
--- a/vendor/golang.org/x/text/language/doc.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package language implements BCP 47 language tags and related functionality.
-//
-// The most important function of package language is to match a list of
-// user-preferred languages to a list of supported languages.
-// It alleviates the developer of dealing with the complexity of this process
-// and provides the user with the best experience
-// (see https://blog.golang.org/matchlang).
-//
-// # Matching preferred against supported languages
-//
-// A Matcher for an application that supports English, Australian English,
-// Danish, and standard Mandarin can be created as follows:
-//
-// var matcher = language.NewMatcher([]language.Tag{
-// language.English, // The first language is used as fallback.
-// language.MustParse("en-AU"),
-// language.Danish,
-// language.Chinese,
-// })
-//
-// This list of supported languages is typically implied by the languages for
-// which there exists translations of the user interface.
-//
-// User-preferred languages usually come as a comma-separated list of BCP 47
-// language tags.
-// The MatchString finds best matches for such strings:
-//
-// handler(w http.ResponseWriter, r *http.Request) {
-// lang, _ := r.Cookie("lang")
-// accept := r.Header.Get("Accept-Language")
-// tag, _ := language.MatchStrings(matcher, lang.String(), accept)
-//
-// // tag should now be used for the initialization of any
-// // locale-specific service.
-// }
-//
-// The Matcher's Match method can be used to match Tags directly.
-//
-// Matchers are aware of the intricacies of equivalence between languages, such
-// as deprecated subtags, legacy tags, macro languages, mutual
-// intelligibility between scripts and languages, and transparently passing
-// BCP 47 user configuration.
-// For instance, it will know that a reader of Bokmål Danish can read Norwegian
-// and will know that Cantonese ("yue") is a good match for "zh-HK".
-//
-// # Using match results
-//
-// To guarantee a consistent user experience to the user it is important to
-// use the same language tag for the selection of any locale-specific services.
-// For example, it is utterly confusing to substitute spelled-out numbers
-// or dates in one language in text of another language.
-// More subtly confusing is using the wrong sorting order or casing
-// algorithm for a certain language.
-//
-// All the packages in x/text that provide locale-specific services
-// (e.g. collate, cases) should be initialized with the tag that was
-// obtained at the start of an interaction with the user.
-//
-// Note that Tag that is returned by Match and MatchString may differ from any
-// of the supported languages, as it may contain carried over settings from
-// the user tags.
-// This may be inconvenient when your application has some additional
-// locale-specific data for your supported languages.
-// Match and MatchString both return the index of the matched supported tag
-// to simplify associating such data with the matched tag.
-//
-// # Canonicalization
-//
-// If one uses the Matcher to compare languages one does not need to
-// worry about canonicalization.
-//
-// The meaning of a Tag varies per application. The language package
-// therefore delays canonicalization and preserves information as much
-// as possible. The Matcher, however, will always take into account that
-// two different tags may represent the same language.
-//
-// By default, only legacy and deprecated tags are converted into their
-// canonical equivalent. All other information is preserved. This approach makes
-// the confidence scores more accurate and allows matchers to distinguish
-// between variants that are otherwise lost.
-//
-// As a consequence, two tags that should be treated as identical according to
-// BCP 47 or CLDR, like "en-Latn" and "en", will be represented differently. The
-// Matcher handles such distinctions, though, and is aware of the
-// equivalence relations. The CanonType type can be used to alter the
-// canonicalization form.
-//
-// # References
-//
-// BCP 47 - Tags for Identifying Languages http://tools.ietf.org/html/bcp47
-package language // import "golang.org/x/text/language"
-
-// TODO: explanation on how to match languages for your own locale-specific
-// service.
diff --git a/vendor/golang.org/x/text/language/language.go b/vendor/golang.org/x/text/language/language.go
deleted file mode 100644
index 4d9c661..0000000
--- a/vendor/golang.org/x/text/language/language.go
+++ /dev/null
@@ -1,605 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:generate go run gen.go -output tables.go
-
-package language
-
-// TODO: Remove above NOTE after:
-// - verifying that tables are dropped correctly (most notably matcher tables).
-
-import (
- "strings"
-
- "golang.org/x/text/internal/language"
- "golang.org/x/text/internal/language/compact"
-)
-
-// Tag represents a BCP 47 language tag. It is used to specify an instance of a
-// specific language or locale. All language tag values are guaranteed to be
-// well-formed.
-type Tag compact.Tag
-
-func makeTag(t language.Tag) (tag Tag) {
- return Tag(compact.Make(t))
-}
-
-func (t *Tag) tag() language.Tag {
- return (*compact.Tag)(t).Tag()
-}
-
-func (t *Tag) isCompact() bool {
- return (*compact.Tag)(t).IsCompact()
-}
-
-// TODO: improve performance.
-func (t *Tag) lang() language.Language { return t.tag().LangID }
-func (t *Tag) region() language.Region { return t.tag().RegionID }
-func (t *Tag) script() language.Script { return t.tag().ScriptID }
-
-// Make is a convenience wrapper for Parse that omits the error.
-// In case of an error, a sensible default is returned.
-func Make(s string) Tag {
- return Default.Make(s)
-}
-
-// Make is a convenience wrapper for c.Parse that omits the error.
-// In case of an error, a sensible default is returned.
-func (c CanonType) Make(s string) Tag {
- t, _ := c.Parse(s)
- return t
-}
-
-// Raw returns the raw base language, script and region, without making an
-// attempt to infer their values.
-func (t Tag) Raw() (b Base, s Script, r Region) {
- tt := t.tag()
- return Base{tt.LangID}, Script{tt.ScriptID}, Region{tt.RegionID}
-}
-
-// IsRoot returns true if t is equal to language "und".
-func (t Tag) IsRoot() bool {
- return compact.Tag(t).IsRoot()
-}
-
-// CanonType can be used to enable or disable various types of canonicalization.
-type CanonType int
-
-const (
- // Replace deprecated base languages with their preferred replacements.
- DeprecatedBase CanonType = 1 << iota
- // Replace deprecated scripts with their preferred replacements.
- DeprecatedScript
- // Replace deprecated regions with their preferred replacements.
- DeprecatedRegion
- // Remove redundant scripts.
- SuppressScript
- // Normalize legacy encodings. This includes legacy languages defined in
- // CLDR as well as bibliographic codes defined in ISO-639.
- Legacy
- // Map the dominant language of a macro language group to the macro language
- // subtag. For example cmn -> zh.
- Macro
- // The CLDR flag should be used if full compatibility with CLDR is required.
- // There are a few cases where language.Tag may differ from CLDR. To follow all
- // of CLDR's suggestions, use All|CLDR.
- CLDR
-
- // Raw can be used to Compose or Parse without Canonicalization.
- Raw CanonType = 0
-
- // Replace all deprecated tags with their preferred replacements.
- Deprecated = DeprecatedBase | DeprecatedScript | DeprecatedRegion
-
- // All canonicalizations recommended by BCP 47.
- BCP47 = Deprecated | SuppressScript
-
- // All canonicalizations.
- All = BCP47 | Legacy | Macro
-
- // Default is the canonicalization used by Parse, Make and Compose. To
- // preserve as much information as possible, canonicalizations that remove
- // potentially valuable information are not included. The Matcher is
- // designed to recognize similar tags that would be the same if
- // they were canonicalized using All.
- Default = Deprecated | Legacy
-
- canonLang = DeprecatedBase | Legacy | Macro
-
- // TODO: LikelyScript, LikelyRegion: suppress similar to ICU.
-)
-
-// canonicalize returns the canonicalized equivalent of the tag and
-// whether there was any change.
-func canonicalize(c CanonType, t language.Tag) (language.Tag, bool) {
- if c == Raw {
- return t, false
- }
- changed := false
- if c&SuppressScript != 0 {
- if t.LangID.SuppressScript() == t.ScriptID {
- t.ScriptID = 0
- changed = true
- }
- }
- if c&canonLang != 0 {
- for {
- if l, aliasType := t.LangID.Canonicalize(); l != t.LangID {
- switch aliasType {
- case language.Legacy:
- if c&Legacy != 0 {
- if t.LangID == _sh && t.ScriptID == 0 {
- t.ScriptID = _Latn
- }
- t.LangID = l
- changed = true
- }
- case language.Macro:
- if c&Macro != 0 {
- // We deviate here from CLDR. The mapping "nb" -> "no"
- // qualifies as a typical Macro language mapping. However,
- // for legacy reasons, CLDR maps "no", the macro language
- // code for Norwegian, to the dominant variant "nb". This
- // change is currently under consideration for CLDR as well.
- // See https://unicode.org/cldr/trac/ticket/2698 and also
- // https://unicode.org/cldr/trac/ticket/1790 for some of the
- // practical implications. TODO: this check could be removed
- // if CLDR adopts this change.
- if c&CLDR == 0 || t.LangID != _nb {
- changed = true
- t.LangID = l
- }
- }
- case language.Deprecated:
- if c&DeprecatedBase != 0 {
- if t.LangID == _mo && t.RegionID == 0 {
- t.RegionID = _MD
- }
- t.LangID = l
- changed = true
- // Other canonicalization types may still apply.
- continue
- }
- }
- } else if c&Legacy != 0 && t.LangID == _no && c&CLDR != 0 {
- t.LangID = _nb
- changed = true
- }
- break
- }
- }
- if c&DeprecatedScript != 0 {
- if t.ScriptID == _Qaai {
- changed = true
- t.ScriptID = _Zinh
- }
- }
- if c&DeprecatedRegion != 0 {
- if r := t.RegionID.Canonicalize(); r != t.RegionID {
- changed = true
- t.RegionID = r
- }
- }
- return t, changed
-}
-
-// Canonicalize returns the canonicalized equivalent of the tag.
-func (c CanonType) Canonicalize(t Tag) (Tag, error) {
- // First try fast path.
- if t.isCompact() {
- if _, changed := canonicalize(c, compact.Tag(t).Tag()); !changed {
- return t, nil
- }
- }
- // It is unlikely that one will canonicalize a tag after matching. So do
- // a slow but simple approach here.
- if tag, changed := canonicalize(c, t.tag()); changed {
- tag.RemakeString()
- return makeTag(tag), nil
- }
- return t, nil
-
-}
-
-// Confidence indicates the level of certainty for a given return value.
-// For example, Serbian may be written in Cyrillic or Latin script.
-// The confidence level indicates whether a value was explicitly specified,
-// whether it is typically the only possible value, or whether there is
-// an ambiguity.
-type Confidence int
-
-const (
- No Confidence = iota // full confidence that there was no match
- Low // most likely value picked out of a set of alternatives
- High // value is generally assumed to be the correct match
- Exact // exact match or explicitly specified value
-)
-
-var confName = []string{"No", "Low", "High", "Exact"}
-
-func (c Confidence) String() string {
- return confName[c]
-}
-
-// String returns the canonical string representation of the language tag.
-func (t Tag) String() string {
- return t.tag().String()
-}
-
-// MarshalText implements encoding.TextMarshaler.
-func (t Tag) MarshalText() (text []byte, err error) {
- return t.tag().MarshalText()
-}
-
-// UnmarshalText implements encoding.TextUnmarshaler.
-func (t *Tag) UnmarshalText(text []byte) error {
- var tag language.Tag
- err := tag.UnmarshalText(text)
- *t = makeTag(tag)
- return err
-}
-
-// Base returns the base language of the language tag. If the base language is
-// unspecified, an attempt will be made to infer it from the context.
-// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change.
-func (t Tag) Base() (Base, Confidence) {
- if b := t.lang(); b != 0 {
- return Base{b}, Exact
- }
- tt := t.tag()
- c := High
- if tt.ScriptID == 0 && !tt.RegionID.IsCountry() {
- c = Low
- }
- if tag, err := tt.Maximize(); err == nil && tag.LangID != 0 {
- return Base{tag.LangID}, c
- }
- return Base{0}, No
-}
-
-// Script infers the script for the language tag. If it was not explicitly given, it will infer
-// a most likely candidate.
-// If more than one script is commonly used for a language, the most likely one
-// is returned with a low confidence indication. For example, it returns (Cyrl, Low)
-// for Serbian.
-// If a script cannot be inferred (Zzzz, No) is returned. We do not use Zyyy (undetermined)
-// as one would suspect from the IANA registry for BCP 47. In a Unicode context Zyyy marks
-// common characters (like 1, 2, 3, '.', etc.) and is therefore more like multiple scripts.
-// See https://www.unicode.org/reports/tr24/#Values for more details. Zzzz is also used for
-// unknown value in CLDR. (Zzzz, Exact) is returned if Zzzz was explicitly specified.
-// Note that an inferred script is never guaranteed to be the correct one. Latin is
-// almost exclusively used for Afrikaans, but Arabic has been used for some texts
-// in the past. Also, the script that is commonly used may change over time.
-// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change.
-func (t Tag) Script() (Script, Confidence) {
- if scr := t.script(); scr != 0 {
- return Script{scr}, Exact
- }
- tt := t.tag()
- sc, c := language.Script(_Zzzz), No
- if scr := tt.LangID.SuppressScript(); scr != 0 {
- // Note: it is not always the case that a language with a suppress
- // script value is only written in one script (e.g. kk, ms, pa).
- if tt.RegionID == 0 {
- return Script{scr}, High
- }
- sc, c = scr, High
- }
- if tag, err := tt.Maximize(); err == nil {
- if tag.ScriptID != sc {
- sc, c = tag.ScriptID, Low
- }
- } else {
- tt, _ = canonicalize(Deprecated|Macro, tt)
- if tag, err := tt.Maximize(); err == nil && tag.ScriptID != sc {
- sc, c = tag.ScriptID, Low
- }
- }
- return Script{sc}, c
-}
-
-// Region returns the region for the language tag. If it was not explicitly given, it will
-// infer a most likely candidate from the context.
-// It uses a variant of CLDR's Add Likely Subtags algorithm. This is subject to change.
-func (t Tag) Region() (Region, Confidence) {
- if r := t.region(); r != 0 {
- return Region{r}, Exact
- }
- tt := t.tag()
- if tt, err := tt.Maximize(); err == nil {
- return Region{tt.RegionID}, Low // TODO: differentiate between high and low.
- }
- tt, _ = canonicalize(Deprecated|Macro, tt)
- if tag, err := tt.Maximize(); err == nil {
- return Region{tag.RegionID}, Low
- }
- return Region{_ZZ}, No // TODO: return world instead of undetermined?
-}
-
-// Variants returns the variants specified explicitly for this language tag.
-// or nil if no variant was specified.
-func (t Tag) Variants() []Variant {
- if !compact.Tag(t).MayHaveVariants() {
- return nil
- }
- v := []Variant{}
- x, str := "", t.tag().Variants()
- for str != "" {
- x, str = nextToken(str)
- v = append(v, Variant{x})
- }
- return v
-}
-
-// Parent returns the CLDR parent of t. In CLDR, missing fields in data for a
-// specific language are substituted with fields from the parent language.
-// The parent for a language may change for newer versions of CLDR.
-//
-// Parent returns a tag for a less specific language that is mutually
-// intelligible or Und if there is no such language. This may not be the same as
-// simply stripping the last BCP 47 subtag. For instance, the parent of "zh-TW"
-// is "zh-Hant", and the parent of "zh-Hant" is "und".
-func (t Tag) Parent() Tag {
- return Tag(compact.Tag(t).Parent())
-}
-
-// nextToken returns token t and the rest of the string.
-func nextToken(s string) (t, tail string) {
- p := strings.Index(s[1:], "-")
- if p == -1 {
- return s[1:], ""
- }
- p++
- return s[1:p], s[p:]
-}
-
-// Extension is a single BCP 47 extension.
-type Extension struct {
- s string
-}
-
-// String returns the string representation of the extension, including the
-// type tag.
-func (e Extension) String() string {
- return e.s
-}
-
-// ParseExtension parses s as an extension and returns it on success.
-func ParseExtension(s string) (e Extension, err error) {
- ext, err := language.ParseExtension(s)
- return Extension{ext}, err
-}
-
-// Type returns the one-byte extension type of e. It returns 0 for the zero
-// exception.
-func (e Extension) Type() byte {
- if e.s == "" {
- return 0
- }
- return e.s[0]
-}
-
-// Tokens returns the list of tokens of e.
-func (e Extension) Tokens() []string {
- return strings.Split(e.s, "-")
-}
-
-// Extension returns the extension of type x for tag t. It will return
-// false for ok if t does not have the requested extension. The returned
-// extension will be invalid in this case.
-func (t Tag) Extension(x byte) (ext Extension, ok bool) {
- if !compact.Tag(t).MayHaveExtensions() {
- return Extension{}, false
- }
- e, ok := t.tag().Extension(x)
- return Extension{e}, ok
-}
-
-// Extensions returns all extensions of t.
-func (t Tag) Extensions() []Extension {
- if !compact.Tag(t).MayHaveExtensions() {
- return nil
- }
- e := []Extension{}
- for _, ext := range t.tag().Extensions() {
- e = append(e, Extension{ext})
- }
- return e
-}
-
-// TypeForKey returns the type associated with the given key, where key and type
-// are of the allowed values defined for the Unicode locale extension ('u') in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-// TypeForKey will traverse the inheritance chain to get the correct value.
-//
-// If there are multiple types associated with a key, only the first will be
-// returned. If there is no type associated with a key, it returns the empty
-// string.
-func (t Tag) TypeForKey(key string) string {
- if !compact.Tag(t).MayHaveExtensions() {
- if key != "rg" && key != "va" {
- return ""
- }
- }
- return t.tag().TypeForKey(key)
-}
-
-// SetTypeForKey returns a new Tag with the key set to type, where key and type
-// are of the allowed values defined for the Unicode locale extension ('u') in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-// An empty value removes an existing pair with the same key.
-func (t Tag) SetTypeForKey(key, value string) (Tag, error) {
- tt, err := t.tag().SetTypeForKey(key, value)
- return makeTag(tt), err
-}
-
-// NumCompactTags is the number of compact tags. The maximum tag is
-// NumCompactTags-1.
-const NumCompactTags = compact.NumCompactTags
-
-// CompactIndex returns an index, where 0 <= index < NumCompactTags, for tags
-// for which data exists in the text repository.The index will change over time
-// and should not be stored in persistent storage. If t does not match a compact
-// index, exact will be false and the compact index will be returned for the
-// first match after repeatedly taking the Parent of t.
-func CompactIndex(t Tag) (index int, exact bool) {
- id, exact := compact.LanguageID(compact.Tag(t))
- return int(id), exact
-}
-
-var root = language.Tag{}
-
-// Base is an ISO 639 language code, used for encoding the base language
-// of a language tag.
-type Base struct {
- langID language.Language
-}
-
-// ParseBase parses a 2- or 3-letter ISO 639 code.
-// It returns a ValueError if s is a well-formed but unknown language identifier
-// or another error if another error occurred.
-func ParseBase(s string) (Base, error) {
- l, err := language.ParseBase(s)
- return Base{l}, err
-}
-
-// String returns the BCP 47 representation of the base language.
-func (b Base) String() string {
- return b.langID.String()
-}
-
-// ISO3 returns the ISO 639-3 language code.
-func (b Base) ISO3() string {
- return b.langID.ISO3()
-}
-
-// IsPrivateUse reports whether this language code is reserved for private use.
-func (b Base) IsPrivateUse() bool {
- return b.langID.IsPrivateUse()
-}
-
-// Script is a 4-letter ISO 15924 code for representing scripts.
-// It is idiomatically represented in title case.
-type Script struct {
- scriptID language.Script
-}
-
-// ParseScript parses a 4-letter ISO 15924 code.
-// It returns a ValueError if s is a well-formed but unknown script identifier
-// or another error if another error occurred.
-func ParseScript(s string) (Script, error) {
- sc, err := language.ParseScript(s)
- return Script{sc}, err
-}
-
-// String returns the script code in title case.
-// It returns "Zzzz" for an unspecified script.
-func (s Script) String() string {
- return s.scriptID.String()
-}
-
-// IsPrivateUse reports whether this script code is reserved for private use.
-func (s Script) IsPrivateUse() bool {
- return s.scriptID.IsPrivateUse()
-}
-
-// Region is an ISO 3166-1 or UN M.49 code for representing countries and regions.
-type Region struct {
- regionID language.Region
-}
-
-// EncodeM49 returns the Region for the given UN M.49 code.
-// It returns an error if r is not a valid code.
-func EncodeM49(r int) (Region, error) {
- rid, err := language.EncodeM49(r)
- return Region{rid}, err
-}
-
-// ParseRegion parses a 2- or 3-letter ISO 3166-1 or a UN M.49 code.
-// It returns a ValueError if s is a well-formed but unknown region identifier
-// or another error if another error occurred.
-func ParseRegion(s string) (Region, error) {
- r, err := language.ParseRegion(s)
- return Region{r}, err
-}
-
-// String returns the BCP 47 representation for the region.
-// It returns "ZZ" for an unspecified region.
-func (r Region) String() string {
- return r.regionID.String()
-}
-
-// ISO3 returns the 3-letter ISO code of r.
-// Note that not all regions have a 3-letter ISO code.
-// In such cases this method returns "ZZZ".
-func (r Region) ISO3() string {
- return r.regionID.ISO3()
-}
-
-// M49 returns the UN M.49 encoding of r, or 0 if this encoding
-// is not defined for r.
-func (r Region) M49() int {
- return r.regionID.M49()
-}
-
-// IsPrivateUse reports whether r has the ISO 3166 User-assigned status. This
-// may include private-use tags that are assigned by CLDR and used in this
-// implementation. So IsPrivateUse and IsCountry can be simultaneously true.
-func (r Region) IsPrivateUse() bool {
- return r.regionID.IsPrivateUse()
-}
-
-// IsCountry returns whether this region is a country or autonomous area. This
-// includes non-standard definitions from CLDR.
-func (r Region) IsCountry() bool {
- return r.regionID.IsCountry()
-}
-
-// IsGroup returns whether this region defines a collection of regions. This
-// includes non-standard definitions from CLDR.
-func (r Region) IsGroup() bool {
- return r.regionID.IsGroup()
-}
-
-// Contains returns whether Region c is contained by Region r. It returns true
-// if c == r.
-func (r Region) Contains(c Region) bool {
- return r.regionID.Contains(c.regionID)
-}
-
-// TLD returns the country code top-level domain (ccTLD). UK is returned for GB.
-// In all other cases it returns either the region itself or an error.
-//
-// This method may return an error for a region for which there exists a
-// canonical form with a ccTLD. To get that ccTLD canonicalize r first. The
-// region will already be canonicalized it was obtained from a Tag that was
-// obtained using any of the default methods.
-func (r Region) TLD() (Region, error) {
- tld, err := r.regionID.TLD()
- return Region{tld}, err
-}
-
-// Canonicalize returns the region or a possible replacement if the region is
-// deprecated. It will not return a replacement for deprecated regions that
-// are split into multiple regions.
-func (r Region) Canonicalize() Region {
- return Region{r.regionID.Canonicalize()}
-}
-
-// Variant represents a registered variant of a language as defined by BCP 47.
-type Variant struct {
- variant string
-}
-
-// ParseVariant parses and returns a Variant. An error is returned if s is not
-// a valid variant.
-func ParseVariant(s string) (Variant, error) {
- v, err := language.ParseVariant(s)
- return Variant{v.String()}, err
-}
-
-// String returns the string representation of the variant.
-func (v Variant) String() string {
- return v.variant
-}
diff --git a/vendor/golang.org/x/text/language/match.go b/vendor/golang.org/x/text/language/match.go
deleted file mode 100644
index 1153baf..0000000
--- a/vendor/golang.org/x/text/language/match.go
+++ /dev/null
@@ -1,735 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import (
- "errors"
- "strings"
-
- "golang.org/x/text/internal/language"
-)
-
-// A MatchOption configures a Matcher.
-type MatchOption func(*matcher)
-
-// PreferSameScript will, in the absence of a match, result in the first
-// preferred tag with the same script as a supported tag to match this supported
-// tag. The default is currently true, but this may change in the future.
-func PreferSameScript(preferSame bool) MatchOption {
- return func(m *matcher) { m.preferSameScript = preferSame }
-}
-
-// TODO(v1.0.0): consider making Matcher a concrete type, instead of interface.
-// There doesn't seem to be too much need for multiple types.
-// Making it a concrete type allows MatchStrings to be a method, which will
-// improve its discoverability.
-
-// MatchStrings parses and matches the given strings until one of them matches
-// the language in the Matcher. A string may be an Accept-Language header as
-// handled by ParseAcceptLanguage. The default language is returned if no
-// other language matched.
-func MatchStrings(m Matcher, lang ...string) (tag Tag, index int) {
- for _, accept := range lang {
- desired, _, err := ParseAcceptLanguage(accept)
- if err != nil {
- continue
- }
- if tag, index, conf := m.Match(desired...); conf != No {
- return tag, index
- }
- }
- tag, index, _ = m.Match()
- return
-}
-
-// Matcher is the interface that wraps the Match method.
-//
-// Match returns the best match for any of the given tags, along with
-// a unique index associated with the returned tag and a confidence
-// score.
-type Matcher interface {
- Match(t ...Tag) (tag Tag, index int, c Confidence)
-}
-
-// Comprehends reports the confidence score for a speaker of a given language
-// to being able to comprehend the written form of an alternative language.
-func Comprehends(speaker, alternative Tag) Confidence {
- _, _, c := NewMatcher([]Tag{alternative}).Match(speaker)
- return c
-}
-
-// NewMatcher returns a Matcher that matches an ordered list of preferred tags
-// against a list of supported tags based on written intelligibility, closeness
-// of dialect, equivalence of subtags and various other rules. It is initialized
-// with the list of supported tags. The first element is used as the default
-// value in case no match is found.
-//
-// Its Match method matches the first of the given Tags to reach a certain
-// confidence threshold. The tags passed to Match should therefore be specified
-// in order of preference. Extensions are ignored for matching.
-//
-// The index returned by the Match method corresponds to the index of the
-// matched tag in t, but is augmented with the Unicode extension ('u')of the
-// corresponding preferred tag. This allows user locale options to be passed
-// transparently.
-func NewMatcher(t []Tag, options ...MatchOption) Matcher {
- return newMatcher(t, options)
-}
-
-func (m *matcher) Match(want ...Tag) (t Tag, index int, c Confidence) {
- var tt language.Tag
- match, w, c := m.getBest(want...)
- if match != nil {
- tt, index = match.tag, match.index
- } else {
- // TODO: this should be an option
- tt = m.default_.tag
- if m.preferSameScript {
- outer:
- for _, w := range want {
- script, _ := w.Script()
- if script.scriptID == 0 {
- // Don't do anything if there is no script, such as with
- // private subtags.
- continue
- }
- for i, h := range m.supported {
- if script.scriptID == h.maxScript {
- tt, index = h.tag, i
- break outer
- }
- }
- }
- }
- // TODO: select first language tag based on script.
- }
- if w.RegionID != tt.RegionID && w.RegionID != 0 {
- if w.RegionID != 0 && tt.RegionID != 0 && tt.RegionID.Contains(w.RegionID) {
- tt.RegionID = w.RegionID
- tt.RemakeString()
- } else if r := w.RegionID.String(); len(r) == 2 {
- // TODO: also filter macro and deprecated.
- tt, _ = tt.SetTypeForKey("rg", strings.ToLower(r)+"zzzz")
- }
- }
- // Copy options from the user-provided tag into the result tag. This is hard
- // to do after the fact, so we do it here.
- // TODO: add in alternative variants to -u-va-.
- // TODO: add preferred region to -u-rg-.
- if e := w.Extensions(); len(e) > 0 {
- b := language.Builder{}
- b.SetTag(tt)
- for _, e := range e {
- b.AddExt(e)
- }
- tt = b.Make()
- }
- return makeTag(tt), index, c
-}
-
-// ErrMissingLikelyTagsData indicates no information was available
-// to compute likely values of missing tags.
-var ErrMissingLikelyTagsData = errors.New("missing likely tags data")
-
-// func (t *Tag) setTagsFrom(id Tag) {
-// t.LangID = id.LangID
-// t.ScriptID = id.ScriptID
-// t.RegionID = id.RegionID
-// }
-
-// Tag Matching
-// CLDR defines an algorithm for finding the best match between two sets of language
-// tags. The basic algorithm defines how to score a possible match and then find
-// the match with the best score
-// (see https://www.unicode.org/reports/tr35/#LanguageMatching).
-// Using scoring has several disadvantages. The scoring obfuscates the importance of
-// the various factors considered, making the algorithm harder to understand. Using
-// scoring also requires the full score to be computed for each pair of tags.
-//
-// We will use a different algorithm which aims to have the following properties:
-// - clarity on the precedence of the various selection factors, and
-// - improved performance by allowing early termination of a comparison.
-//
-// Matching algorithm (overview)
-// Input:
-// - supported: a set of supported tags
-// - default: the default tag to return in case there is no match
-// - desired: list of desired tags, ordered by preference, starting with
-// the most-preferred.
-//
-// Algorithm:
-// 1) Set the best match to the lowest confidence level
-// 2) For each tag in "desired":
-// a) For each tag in "supported":
-// 1) compute the match between the two tags.
-// 2) if the match is better than the previous best match, replace it
-// with the new match. (see next section)
-// b) if the current best match is Exact and pin is true the result will be
-// frozen to the language found thusfar, although better matches may
-// still be found for the same language.
-// 3) If the best match so far is below a certain threshold, return "default".
-//
-// Ranking:
-// We use two phases to determine whether one pair of tags are a better match
-// than another pair of tags. First, we determine a rough confidence level. If the
-// levels are different, the one with the highest confidence wins.
-// Second, if the rough confidence levels are identical, we use a set of tie-breaker
-// rules.
-//
-// The confidence level of matching a pair of tags is determined by finding the
-// lowest confidence level of any matches of the corresponding subtags (the
-// result is deemed as good as its weakest link).
-// We define the following levels:
-// Exact - An exact match of a subtag, before adding likely subtags.
-// MaxExact - An exact match of a subtag, after adding likely subtags.
-// [See Note 2].
-// High - High level of mutual intelligibility between different subtag
-// variants.
-// Low - Low level of mutual intelligibility between different subtag
-// variants.
-// No - No mutual intelligibility.
-//
-// The following levels can occur for each type of subtag:
-// Base: Exact, MaxExact, High, Low, No
-// Script: Exact, MaxExact [see Note 3], Low, No
-// Region: Exact, MaxExact, High
-// Variant: Exact, High
-// Private: Exact, No
-//
-// Any result with a confidence level of Low or higher is deemed a possible match.
-// Once a desired tag matches any of the supported tags with a level of MaxExact
-// or higher, the next desired tag is not considered (see Step 2.b).
-// Note that CLDR provides languageMatching data that defines close equivalence
-// classes for base languages, scripts and regions.
-//
-// Tie-breaking
-// If we get the same confidence level for two matches, we apply a sequence of
-// tie-breaking rules. The first that succeeds defines the result. The rules are
-// applied in the following order.
-// 1) Original language was defined and was identical.
-// 2) Original region was defined and was identical.
-// 3) Distance between two maximized regions was the smallest.
-// 4) Original script was defined and was identical.
-// 5) Distance from want tag to have tag using the parent relation [see Note 5.]
-// If there is still no winner after these rules are applied, the first match
-// found wins.
-//
-// Notes:
-// [2] In practice, as matching of Exact is done in a separate phase from
-// matching the other levels, we reuse the Exact level to mean MaxExact in
-// the second phase. As a consequence, we only need the levels defined by
-// the Confidence type. The MaxExact confidence level is mapped to High in
-// the public API.
-// [3] We do not differentiate between maximized script values that were derived
-// from suppressScript versus most likely tag data. We determined that in
-// ranking the two, one ranks just after the other. Moreover, the two cannot
-// occur concurrently. As a consequence, they are identical for practical
-// purposes.
-// [4] In case of deprecated, macro-equivalents and legacy mappings, we assign
-// the MaxExact level to allow iw vs he to still be a closer match than
-// en-AU vs en-US, for example.
-// [5] In CLDR a locale inherits fields that are unspecified for this locale
-// from its parent. Therefore, if a locale is a parent of another locale,
-// it is a strong measure for closeness, especially when no other tie
-// breaker rule applies. One could also argue it is inconsistent, for
-// example, when pt-AO matches pt (which CLDR equates with pt-BR), even
-// though its parent is pt-PT according to the inheritance rules.
-//
-// Implementation Details:
-// There are several performance considerations worth pointing out. Most notably,
-// we preprocess as much as possible (within reason) at the time of creation of a
-// matcher. This includes:
-// - creating a per-language map, which includes data for the raw base language
-// and its canonicalized variant (if applicable),
-// - expanding entries for the equivalence classes defined in CLDR's
-// languageMatch data.
-// The per-language map ensures that typically only a very small number of tags
-// need to be considered. The pre-expansion of canonicalized subtags and
-// equivalence classes reduces the amount of map lookups that need to be done at
-// runtime.
-
-// matcher keeps a set of supported language tags, indexed by language.
-type matcher struct {
- default_ *haveTag
- supported []*haveTag
- index map[language.Language]*matchHeader
- passSettings bool
- preferSameScript bool
-}
-
-// matchHeader has the lists of tags for exact matches and matches based on
-// maximized and canonicalized tags for a given language.
-type matchHeader struct {
- haveTags []*haveTag
- original bool
-}
-
-// haveTag holds a supported Tag and its maximized script and region. The maximized
-// or canonicalized language is not stored as it is not needed during matching.
-type haveTag struct {
- tag language.Tag
-
- // index of this tag in the original list of supported tags.
- index int
-
- // conf is the maximum confidence that can result from matching this haveTag.
- // When conf < Exact this means it was inserted after applying a CLDR equivalence rule.
- conf Confidence
-
- // Maximized region and script.
- maxRegion language.Region
- maxScript language.Script
-
- // altScript may be checked as an alternative match to maxScript. If altScript
- // matches, the confidence level for this match is Low. Theoretically there
- // could be multiple alternative scripts. This does not occur in practice.
- altScript language.Script
-
- // nextMax is the index of the next haveTag with the same maximized tags.
- nextMax uint16
-}
-
-func makeHaveTag(tag language.Tag, index int) (haveTag, language.Language) {
- max := tag
- if tag.LangID != 0 || tag.RegionID != 0 || tag.ScriptID != 0 {
- max, _ = canonicalize(All, max)
- max, _ = max.Maximize()
- max.RemakeString()
- }
- return haveTag{tag, index, Exact, max.RegionID, max.ScriptID, altScript(max.LangID, max.ScriptID), 0}, max.LangID
-}
-
-// altScript returns an alternative script that may match the given script with
-// a low confidence. At the moment, the langMatch data allows for at most one
-// script to map to another and we rely on this to keep the code simple.
-func altScript(l language.Language, s language.Script) language.Script {
- for _, alt := range matchScript {
- // TODO: also match cases where language is not the same.
- if (language.Language(alt.wantLang) == l || language.Language(alt.haveLang) == l) &&
- language.Script(alt.haveScript) == s {
- return language.Script(alt.wantScript)
- }
- }
- return 0
-}
-
-// addIfNew adds a haveTag to the list of tags only if it is a unique tag.
-// Tags that have the same maximized values are linked by index.
-func (h *matchHeader) addIfNew(n haveTag, exact bool) {
- h.original = h.original || exact
- // Don't add new exact matches.
- for _, v := range h.haveTags {
- if equalsRest(v.tag, n.tag) {
- return
- }
- }
- // Allow duplicate maximized tags, but create a linked list to allow quickly
- // comparing the equivalents and bail out.
- for i, v := range h.haveTags {
- if v.maxScript == n.maxScript &&
- v.maxRegion == n.maxRegion &&
- v.tag.VariantOrPrivateUseTags() == n.tag.VariantOrPrivateUseTags() {
- for h.haveTags[i].nextMax != 0 {
- i = int(h.haveTags[i].nextMax)
- }
- h.haveTags[i].nextMax = uint16(len(h.haveTags))
- break
- }
- }
- h.haveTags = append(h.haveTags, &n)
-}
-
-// header returns the matchHeader for the given language. It creates one if
-// it doesn't already exist.
-func (m *matcher) header(l language.Language) *matchHeader {
- if h := m.index[l]; h != nil {
- return h
- }
- h := &matchHeader{}
- m.index[l] = h
- return h
-}
-
-func toConf(d uint8) Confidence {
- if d <= 10 {
- return High
- }
- if d < 30 {
- return Low
- }
- return No
-}
-
-// newMatcher builds an index for the given supported tags and returns it as
-// a matcher. It also expands the index by considering various equivalence classes
-// for a given tag.
-func newMatcher(supported []Tag, options []MatchOption) *matcher {
- m := &matcher{
- index: make(map[language.Language]*matchHeader),
- preferSameScript: true,
- }
- for _, o := range options {
- o(m)
- }
- if len(supported) == 0 {
- m.default_ = &haveTag{}
- return m
- }
- // Add supported languages to the index. Add exact matches first to give
- // them precedence.
- for i, tag := range supported {
- tt := tag.tag()
- pair, _ := makeHaveTag(tt, i)
- m.header(tt.LangID).addIfNew(pair, true)
- m.supported = append(m.supported, &pair)
- }
- m.default_ = m.header(supported[0].lang()).haveTags[0]
- // Keep these in two different loops to support the case that two equivalent
- // languages are distinguished, such as iw and he.
- for i, tag := range supported {
- tt := tag.tag()
- pair, max := makeHaveTag(tt, i)
- if max != tt.LangID {
- m.header(max).addIfNew(pair, true)
- }
- }
-
- // update is used to add indexes in the map for equivalent languages.
- // update will only add entries to original indexes, thus not computing any
- // transitive relations.
- update := func(want, have uint16, conf Confidence) {
- if hh := m.index[language.Language(have)]; hh != nil {
- if !hh.original {
- return
- }
- hw := m.header(language.Language(want))
- for _, ht := range hh.haveTags {
- v := *ht
- if conf < v.conf {
- v.conf = conf
- }
- v.nextMax = 0 // this value needs to be recomputed
- if v.altScript != 0 {
- v.altScript = altScript(language.Language(want), v.maxScript)
- }
- hw.addIfNew(v, conf == Exact && hh.original)
- }
- }
- }
-
- // Add entries for languages with mutual intelligibility as defined by CLDR's
- // languageMatch data.
- for _, ml := range matchLang {
- update(ml.want, ml.have, toConf(ml.distance))
- if !ml.oneway {
- update(ml.have, ml.want, toConf(ml.distance))
- }
- }
-
- // Add entries for possible canonicalizations. This is an optimization to
- // ensure that only one map lookup needs to be done at runtime per desired tag.
- // First we match deprecated equivalents. If they are perfect equivalents
- // (their canonicalization simply substitutes a different language code, but
- // nothing else), the match confidence is Exact, otherwise it is High.
- for i, lm := range language.AliasMap {
- // If deprecated codes match and there is no fiddling with the script
- // or region, we consider it an exact match.
- conf := Exact
- if language.AliasTypes[i] != language.Macro {
- if !isExactEquivalent(language.Language(lm.From)) {
- conf = High
- }
- update(lm.To, lm.From, conf)
- }
- update(lm.From, lm.To, conf)
- }
- return m
-}
-
-// getBest gets the best matching tag in m for any of the given tags, taking into
-// account the order of preference of the given tags.
-func (m *matcher) getBest(want ...Tag) (got *haveTag, orig language.Tag, c Confidence) {
- best := bestMatch{}
- for i, ww := range want {
- w := ww.tag()
- var max language.Tag
- // Check for exact match first.
- h := m.index[w.LangID]
- if w.LangID != 0 {
- if h == nil {
- continue
- }
- // Base language is defined.
- max, _ = canonicalize(Legacy|Deprecated|Macro, w)
- // A region that is added through canonicalization is stronger than
- // a maximized region: set it in the original (e.g. mo -> ro-MD).
- if w.RegionID != max.RegionID {
- w.RegionID = max.RegionID
- }
- // TODO: should we do the same for scripts?
- // See test case: en, sr, nl ; sh ; sr
- max, _ = max.Maximize()
- } else {
- // Base language is not defined.
- if h != nil {
- for i := range h.haveTags {
- have := h.haveTags[i]
- if equalsRest(have.tag, w) {
- return have, w, Exact
- }
- }
- }
- if w.ScriptID == 0 && w.RegionID == 0 {
- // We skip all tags matching und for approximate matching, including
- // private tags.
- continue
- }
- max, _ = w.Maximize()
- if h = m.index[max.LangID]; h == nil {
- continue
- }
- }
- pin := true
- for _, t := range want[i+1:] {
- if w.LangID == t.lang() {
- pin = false
- break
- }
- }
- // Check for match based on maximized tag.
- for i := range h.haveTags {
- have := h.haveTags[i]
- best.update(have, w, max.ScriptID, max.RegionID, pin)
- if best.conf == Exact {
- for have.nextMax != 0 {
- have = h.haveTags[have.nextMax]
- best.update(have, w, max.ScriptID, max.RegionID, pin)
- }
- return best.have, best.want, best.conf
- }
- }
- }
- if best.conf <= No {
- if len(want) != 0 {
- return nil, want[0].tag(), No
- }
- return nil, language.Tag{}, No
- }
- return best.have, best.want, best.conf
-}
-
-// bestMatch accumulates the best match so far.
-type bestMatch struct {
- have *haveTag
- want language.Tag
- conf Confidence
- pinnedRegion language.Region
- pinLanguage bool
- sameRegionGroup bool
- // Cached results from applying tie-breaking rules.
- origLang bool
- origReg bool
- paradigmReg bool
- regGroupDist uint8
- origScript bool
-}
-
-// update updates the existing best match if the new pair is considered to be a
-// better match. To determine if the given pair is a better match, it first
-// computes the rough confidence level. If this surpasses the current match, it
-// will replace it and update the tie-breaker rule cache. If there is a tie, it
-// proceeds with applying a series of tie-breaker rules. If there is no
-// conclusive winner after applying the tie-breaker rules, it leaves the current
-// match as the preferred match.
-//
-// If pin is true and have and tag are a strong match, it will henceforth only
-// consider matches for this language. This corresponds to the idea that most
-// users have a strong preference for the first defined language. A user can
-// still prefer a second language over a dialect of the preferred language by
-// explicitly specifying dialects, e.g. "en, nl, en-GB". In this case pin should
-// be false.
-func (m *bestMatch) update(have *haveTag, tag language.Tag, maxScript language.Script, maxRegion language.Region, pin bool) {
- // Bail if the maximum attainable confidence is below that of the current best match.
- c := have.conf
- if c < m.conf {
- return
- }
- // Don't change the language once we already have found an exact match.
- if m.pinLanguage && tag.LangID != m.want.LangID {
- return
- }
- // Pin the region group if we are comparing tags for the same language.
- if tag.LangID == m.want.LangID && m.sameRegionGroup {
- _, sameGroup := regionGroupDist(m.pinnedRegion, have.maxRegion, have.maxScript, m.want.LangID)
- if !sameGroup {
- return
- }
- }
- if c == Exact && have.maxScript == maxScript {
- // If there is another language and then another entry of this language,
- // don't pin anything, otherwise pin the language.
- m.pinLanguage = pin
- }
- if equalsRest(have.tag, tag) {
- } else if have.maxScript != maxScript {
- // There is usually very little comprehension between different scripts.
- // In a few cases there may still be Low comprehension. This possibility
- // is pre-computed and stored in have.altScript.
- if Low < m.conf || have.altScript != maxScript {
- return
- }
- c = Low
- } else if have.maxRegion != maxRegion {
- if High < c {
- // There is usually a small difference between languages across regions.
- c = High
- }
- }
-
- // We store the results of the computations of the tie-breaker rules along
- // with the best match. There is no need to do the checks once we determine
- // we have a winner, but we do still need to do the tie-breaker computations.
- // We use "beaten" to keep track if we still need to do the checks.
- beaten := false // true if the new pair defeats the current one.
- if c != m.conf {
- if c < m.conf {
- return
- }
- beaten = true
- }
-
- // Tie-breaker rules:
- // We prefer if the pre-maximized language was specified and identical.
- origLang := have.tag.LangID == tag.LangID && tag.LangID != 0
- if !beaten && m.origLang != origLang {
- if m.origLang {
- return
- }
- beaten = true
- }
-
- // We prefer if the pre-maximized region was specified and identical.
- origReg := have.tag.RegionID == tag.RegionID && tag.RegionID != 0
- if !beaten && m.origReg != origReg {
- if m.origReg {
- return
- }
- beaten = true
- }
-
- regGroupDist, sameGroup := regionGroupDist(have.maxRegion, maxRegion, maxScript, tag.LangID)
- if !beaten && m.regGroupDist != regGroupDist {
- if regGroupDist > m.regGroupDist {
- return
- }
- beaten = true
- }
-
- paradigmReg := isParadigmLocale(tag.LangID, have.maxRegion)
- if !beaten && m.paradigmReg != paradigmReg {
- if !paradigmReg {
- return
- }
- beaten = true
- }
-
- // Next we prefer if the pre-maximized script was specified and identical.
- origScript := have.tag.ScriptID == tag.ScriptID && tag.ScriptID != 0
- if !beaten && m.origScript != origScript {
- if m.origScript {
- return
- }
- beaten = true
- }
-
- // Update m to the newly found best match.
- if beaten {
- m.have = have
- m.want = tag
- m.conf = c
- m.pinnedRegion = maxRegion
- m.sameRegionGroup = sameGroup
- m.origLang = origLang
- m.origReg = origReg
- m.paradigmReg = paradigmReg
- m.origScript = origScript
- m.regGroupDist = regGroupDist
- }
-}
-
-func isParadigmLocale(lang language.Language, r language.Region) bool {
- for _, e := range paradigmLocales {
- if language.Language(e[0]) == lang && (r == language.Region(e[1]) || r == language.Region(e[2])) {
- return true
- }
- }
- return false
-}
-
-// regionGroupDist computes the distance between two regions based on their
-// CLDR grouping.
-func regionGroupDist(a, b language.Region, script language.Script, lang language.Language) (dist uint8, same bool) {
- const defaultDistance = 4
-
- aGroup := uint(regionToGroups[a]) << 1
- bGroup := uint(regionToGroups[b]) << 1
- for _, ri := range matchRegion {
- if language.Language(ri.lang) == lang && (ri.script == 0 || language.Script(ri.script) == script) {
- group := uint(1 << (ri.group &^ 0x80))
- if 0x80&ri.group == 0 {
- if aGroup&bGroup&group != 0 { // Both regions are in the group.
- return ri.distance, ri.distance == defaultDistance
- }
- } else {
- if (aGroup|bGroup)&group == 0 { // Both regions are not in the group.
- return ri.distance, ri.distance == defaultDistance
- }
- }
- }
- }
- return defaultDistance, true
-}
-
-// equalsRest compares everything except the language.
-func equalsRest(a, b language.Tag) bool {
- // TODO: don't include extensions in this comparison. To do this efficiently,
- // though, we should handle private tags separately.
- return a.ScriptID == b.ScriptID && a.RegionID == b.RegionID && a.VariantOrPrivateUseTags() == b.VariantOrPrivateUseTags()
-}
-
-// isExactEquivalent returns true if canonicalizing the language will not alter
-// the script or region of a tag.
-func isExactEquivalent(l language.Language) bool {
- for _, o := range notEquivalent {
- if o == l {
- return false
- }
- }
- return true
-}
-
-var notEquivalent []language.Language
-
-func init() {
- // Create a list of all languages for which canonicalization may alter the
- // script or region.
- for _, lm := range language.AliasMap {
- tag := language.Tag{LangID: language.Language(lm.From)}
- if tag, _ = canonicalize(All, tag); tag.ScriptID != 0 || tag.RegionID != 0 {
- notEquivalent = append(notEquivalent, language.Language(lm.From))
- }
- }
- // Maximize undefined regions of paradigm locales.
- for i, v := range paradigmLocales {
- t := language.Tag{LangID: language.Language(v[0])}
- max, _ := t.Maximize()
- if v[1] == 0 {
- paradigmLocales[i][1] = uint16(max.RegionID)
- }
- if v[2] == 0 {
- paradigmLocales[i][2] = uint16(max.RegionID)
- }
- }
-}
diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go
deleted file mode 100644
index 4d57222..0000000
--- a/vendor/golang.org/x/text/language/parse.go
+++ /dev/null
@@ -1,256 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import (
- "errors"
- "sort"
- "strconv"
- "strings"
-
- "golang.org/x/text/internal/language"
-)
-
-// ValueError is returned by any of the parsing functions when the
-// input is well-formed but the respective subtag is not recognized
-// as a valid value.
-type ValueError interface {
- error
-
- // Subtag returns the subtag for which the error occurred.
- Subtag() string
-}
-
-// Parse parses the given BCP 47 string and returns a valid Tag. If parsing
-// failed it returns an error and any part of the tag that could be parsed.
-// If parsing succeeded but an unknown value was found, it returns
-// ValueError. The Tag returned in this case is just stripped of the unknown
-// value. All other values are preserved. It accepts tags in the BCP 47 format
-// and extensions to this standard defined in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-// The resulting tag is canonicalized using the default canonicalization type.
-func Parse(s string) (t Tag, err error) {
- return Default.Parse(s)
-}
-
-// Parse parses the given BCP 47 string and returns a valid Tag. If parsing
-// failed it returns an error and any part of the tag that could be parsed.
-// If parsing succeeded but an unknown value was found, it returns
-// ValueError. The Tag returned in this case is just stripped of the unknown
-// value. All other values are preserved. It accepts tags in the BCP 47 format
-// and extensions to this standard defined in
-// https://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers.
-// The resulting tag is canonicalized using the canonicalization type c.
-func (c CanonType) Parse(s string) (t Tag, err error) {
- defer func() {
- if recover() != nil {
- t = Tag{}
- err = language.ErrSyntax
- }
- }()
-
- tt, err := language.Parse(s)
- if err != nil {
- return makeTag(tt), err
- }
- tt, changed := canonicalize(c, tt)
- if changed {
- tt.RemakeString()
- }
- return makeTag(tt), err
-}
-
-// Compose creates a Tag from individual parts, which may be of type Tag, Base,
-// Script, Region, Variant, []Variant, Extension, []Extension or error. If a
-// Base, Script or Region or slice of type Variant or Extension is passed more
-// than once, the latter will overwrite the former. Variants and Extensions are
-// accumulated, but if two extensions of the same type are passed, the latter
-// will replace the former. For -u extensions, though, the key-type pairs are
-// added, where later values overwrite older ones. A Tag overwrites all former
-// values and typically only makes sense as the first argument. The resulting
-// tag is returned after canonicalizing using the Default CanonType. If one or
-// more errors are encountered, one of the errors is returned.
-func Compose(part ...interface{}) (t Tag, err error) {
- return Default.Compose(part...)
-}
-
-// Compose creates a Tag from individual parts, which may be of type Tag, Base,
-// Script, Region, Variant, []Variant, Extension, []Extension or error. If a
-// Base, Script or Region or slice of type Variant or Extension is passed more
-// than once, the latter will overwrite the former. Variants and Extensions are
-// accumulated, but if two extensions of the same type are passed, the latter
-// will replace the former. For -u extensions, though, the key-type pairs are
-// added, where later values overwrite older ones. A Tag overwrites all former
-// values and typically only makes sense as the first argument. The resulting
-// tag is returned after canonicalizing using CanonType c. If one or more errors
-// are encountered, one of the errors is returned.
-func (c CanonType) Compose(part ...interface{}) (t Tag, err error) {
- defer func() {
- if recover() != nil {
- t = Tag{}
- err = language.ErrSyntax
- }
- }()
-
- var b language.Builder
- if err = update(&b, part...); err != nil {
- return und, err
- }
- b.Tag, _ = canonicalize(c, b.Tag)
- return makeTag(b.Make()), err
-}
-
-var errInvalidArgument = errors.New("invalid Extension or Variant")
-
-func update(b *language.Builder, part ...interface{}) (err error) {
- for _, x := range part {
- switch v := x.(type) {
- case Tag:
- b.SetTag(v.tag())
- case Base:
- b.Tag.LangID = v.langID
- case Script:
- b.Tag.ScriptID = v.scriptID
- case Region:
- b.Tag.RegionID = v.regionID
- case Variant:
- if v.variant == "" {
- err = errInvalidArgument
- break
- }
- b.AddVariant(v.variant)
- case Extension:
- if v.s == "" {
- err = errInvalidArgument
- break
- }
- b.SetExt(v.s)
- case []Variant:
- b.ClearVariants()
- for _, v := range v {
- b.AddVariant(v.variant)
- }
- case []Extension:
- b.ClearExtensions()
- for _, e := range v {
- b.SetExt(e.s)
- }
- // TODO: support parsing of raw strings based on morphology or just extensions?
- case error:
- if v != nil {
- err = v
- }
- }
- }
- return
-}
-
-var errInvalidWeight = errors.New("ParseAcceptLanguage: invalid weight")
-var errTagListTooLarge = errors.New("tag list exceeds max length")
-
-// ParseAcceptLanguage parses the contents of an Accept-Language header as
-// defined in http://www.ietf.org/rfc/rfc2616.txt and returns a list of Tags and
-// a list of corresponding quality weights. It is more permissive than RFC 2616
-// and may return non-nil slices even if the input is not valid.
-// The Tags will be sorted by highest weight first and then by first occurrence.
-// Tags with a weight of zero will be dropped. An error will be returned if the
-// input could not be parsed.
-func ParseAcceptLanguage(s string) (tag []Tag, q []float32, err error) {
- defer func() {
- if recover() != nil {
- tag = nil
- q = nil
- err = language.ErrSyntax
- }
- }()
-
- if strings.Count(s, "-") > 1000 {
- return nil, nil, errTagListTooLarge
- }
-
- var entry string
- for s != "" {
- if entry, s = split(s, ','); entry == "" {
- continue
- }
-
- entry, weight := split(entry, ';')
-
- // Scan the language.
- t, err := Parse(entry)
- if err != nil {
- id, ok := acceptFallback[entry]
- if !ok {
- return nil, nil, err
- }
- t = makeTag(language.Tag{LangID: id})
- }
-
- // Scan the optional weight.
- w := 1.0
- if weight != "" {
- weight = consume(weight, 'q')
- weight = consume(weight, '=')
- // consume returns the empty string when a token could not be
- // consumed, resulting in an error for ParseFloat.
- if w, err = strconv.ParseFloat(weight, 32); err != nil {
- return nil, nil, errInvalidWeight
- }
- // Drop tags with a quality weight of 0.
- if w <= 0 {
- continue
- }
- }
-
- tag = append(tag, t)
- q = append(q, float32(w))
- }
- sort.Stable(&tagSort{tag, q})
- return tag, q, nil
-}
-
-// consume removes a leading token c from s and returns the result or the empty
-// string if there is no such token.
-func consume(s string, c byte) string {
- if s == "" || s[0] != c {
- return ""
- }
- return strings.TrimSpace(s[1:])
-}
-
-func split(s string, c byte) (head, tail string) {
- if i := strings.IndexByte(s, c); i >= 0 {
- return strings.TrimSpace(s[:i]), strings.TrimSpace(s[i+1:])
- }
- return strings.TrimSpace(s), ""
-}
-
-// Add hack mapping to deal with a small number of cases that occur
-// in Accept-Language (with reasonable frequency).
-var acceptFallback = map[string]language.Language{
- "english": _en,
- "deutsch": _de,
- "italian": _it,
- "french": _fr,
- "*": _mul, // defined in the spec to match all languages.
-}
-
-type tagSort struct {
- tag []Tag
- q []float32
-}
-
-func (s *tagSort) Len() int {
- return len(s.q)
-}
-
-func (s *tagSort) Less(i, j int) bool {
- return s.q[i] > s.q[j]
-}
-
-func (s *tagSort) Swap(i, j int) {
- s.tag[i], s.tag[j] = s.tag[j], s.tag[i]
- s.q[i], s.q[j] = s.q[j], s.q[i]
-}
diff --git a/vendor/golang.org/x/text/language/tables.go b/vendor/golang.org/x/text/language/tables.go
deleted file mode 100644
index a6573dc..0000000
--- a/vendor/golang.org/x/text/language/tables.go
+++ /dev/null
@@ -1,298 +0,0 @@
-// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
-
-package language
-
-// CLDRVersion is the CLDR version from which the tables in this package are derived.
-const CLDRVersion = "32"
-
-const (
- _de = 269
- _en = 313
- _fr = 350
- _it = 505
- _mo = 784
- _no = 879
- _nb = 839
- _pt = 960
- _sh = 1031
- _mul = 806
- _und = 0
-)
-const (
- _001 = 1
- _419 = 31
- _BR = 65
- _CA = 73
- _ES = 111
- _GB = 124
- _MD = 189
- _PT = 239
- _UK = 307
- _US = 310
- _ZZ = 358
- _XA = 324
- _XC = 326
- _XK = 334
-)
-const (
- _Latn = 91
- _Hani = 57
- _Hans = 59
- _Hant = 60
- _Qaaa = 149
- _Qaai = 157
- _Qabx = 198
- _Zinh = 255
- _Zyyy = 260
- _Zzzz = 261
-)
-
-var regionToGroups = []uint8{ // 359 elements
- // Entry 0 - 3F
- 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x04,
- // Entry 40 - 7F
- 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00,
- 0x08, 0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04,
- // Entry 80 - BF
- 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00,
- 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04,
- // Entry C0 - FF
- 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- 0x01, 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00,
- 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- // Entry 100 - 13F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
- 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04,
- 0x00, 0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00,
- // Entry 140 - 17F
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-} // Size: 383 bytes
-
-var paradigmLocales = [][3]uint16{ // 3 elements
- 0: [3]uint16{0x139, 0x0, 0x7c},
- 1: [3]uint16{0x13e, 0x0, 0x1f},
- 2: [3]uint16{0x3c0, 0x41, 0xef},
-} // Size: 42 bytes
-
-type mutualIntelligibility struct {
- want uint16
- have uint16
- distance uint8
- oneway bool
-}
-type scriptIntelligibility struct {
- wantLang uint16
- haveLang uint16
- wantScript uint8
- haveScript uint8
- distance uint8
-}
-type regionIntelligibility struct {
- lang uint16
- script uint8
- group uint8
- distance uint8
-}
-
-// matchLang holds pairs of langIDs of base languages that are typically
-// mutually intelligible. Each pair is associated with a confidence and
-// whether the intelligibility goes one or both ways.
-var matchLang = []mutualIntelligibility{ // 113 elements
- 0: {want: 0x1d1, have: 0xb7, distance: 0x4, oneway: false},
- 1: {want: 0x407, have: 0xb7, distance: 0x4, oneway: false},
- 2: {want: 0x407, have: 0x1d1, distance: 0x4, oneway: false},
- 3: {want: 0x407, have: 0x432, distance: 0x4, oneway: false},
- 4: {want: 0x43a, have: 0x1, distance: 0x4, oneway: false},
- 5: {want: 0x1a3, have: 0x10d, distance: 0x4, oneway: true},
- 6: {want: 0x295, have: 0x10d, distance: 0x4, oneway: true},
- 7: {want: 0x101, have: 0x36f, distance: 0x8, oneway: false},
- 8: {want: 0x101, have: 0x347, distance: 0x8, oneway: false},
- 9: {want: 0x5, have: 0x3e2, distance: 0xa, oneway: true},
- 10: {want: 0xd, have: 0x139, distance: 0xa, oneway: true},
- 11: {want: 0x16, have: 0x367, distance: 0xa, oneway: true},
- 12: {want: 0x21, have: 0x139, distance: 0xa, oneway: true},
- 13: {want: 0x56, have: 0x13e, distance: 0xa, oneway: true},
- 14: {want: 0x58, have: 0x3e2, distance: 0xa, oneway: true},
- 15: {want: 0x71, have: 0x3e2, distance: 0xa, oneway: true},
- 16: {want: 0x75, have: 0x139, distance: 0xa, oneway: true},
- 17: {want: 0x82, have: 0x1be, distance: 0xa, oneway: true},
- 18: {want: 0xa5, have: 0x139, distance: 0xa, oneway: true},
- 19: {want: 0xb2, have: 0x15e, distance: 0xa, oneway: true},
- 20: {want: 0xdd, have: 0x153, distance: 0xa, oneway: true},
- 21: {want: 0xe5, have: 0x139, distance: 0xa, oneway: true},
- 22: {want: 0xe9, have: 0x3a, distance: 0xa, oneway: true},
- 23: {want: 0xf0, have: 0x15e, distance: 0xa, oneway: true},
- 24: {want: 0xf9, have: 0x15e, distance: 0xa, oneway: true},
- 25: {want: 0x100, have: 0x139, distance: 0xa, oneway: true},
- 26: {want: 0x130, have: 0x139, distance: 0xa, oneway: true},
- 27: {want: 0x13c, have: 0x139, distance: 0xa, oneway: true},
- 28: {want: 0x140, have: 0x151, distance: 0xa, oneway: true},
- 29: {want: 0x145, have: 0x13e, distance: 0xa, oneway: true},
- 30: {want: 0x158, have: 0x101, distance: 0xa, oneway: true},
- 31: {want: 0x16d, have: 0x367, distance: 0xa, oneway: true},
- 32: {want: 0x16e, have: 0x139, distance: 0xa, oneway: true},
- 33: {want: 0x16f, have: 0x139, distance: 0xa, oneway: true},
- 34: {want: 0x17e, have: 0x139, distance: 0xa, oneway: true},
- 35: {want: 0x190, have: 0x13e, distance: 0xa, oneway: true},
- 36: {want: 0x194, have: 0x13e, distance: 0xa, oneway: true},
- 37: {want: 0x1a4, have: 0x1be, distance: 0xa, oneway: true},
- 38: {want: 0x1b4, have: 0x139, distance: 0xa, oneway: true},
- 39: {want: 0x1b8, have: 0x139, distance: 0xa, oneway: true},
- 40: {want: 0x1d4, have: 0x15e, distance: 0xa, oneway: true},
- 41: {want: 0x1d7, have: 0x3e2, distance: 0xa, oneway: true},
- 42: {want: 0x1d9, have: 0x139, distance: 0xa, oneway: true},
- 43: {want: 0x1e7, have: 0x139, distance: 0xa, oneway: true},
- 44: {want: 0x1f8, have: 0x139, distance: 0xa, oneway: true},
- 45: {want: 0x20e, have: 0x1e1, distance: 0xa, oneway: true},
- 46: {want: 0x210, have: 0x139, distance: 0xa, oneway: true},
- 47: {want: 0x22d, have: 0x15e, distance: 0xa, oneway: true},
- 48: {want: 0x242, have: 0x3e2, distance: 0xa, oneway: true},
- 49: {want: 0x24a, have: 0x139, distance: 0xa, oneway: true},
- 50: {want: 0x251, have: 0x139, distance: 0xa, oneway: true},
- 51: {want: 0x265, have: 0x139, distance: 0xa, oneway: true},
- 52: {want: 0x274, have: 0x48a, distance: 0xa, oneway: true},
- 53: {want: 0x28a, have: 0x3e2, distance: 0xa, oneway: true},
- 54: {want: 0x28e, have: 0x1f9, distance: 0xa, oneway: true},
- 55: {want: 0x2a3, have: 0x139, distance: 0xa, oneway: true},
- 56: {want: 0x2b5, have: 0x15e, distance: 0xa, oneway: true},
- 57: {want: 0x2b8, have: 0x139, distance: 0xa, oneway: true},
- 58: {want: 0x2be, have: 0x139, distance: 0xa, oneway: true},
- 59: {want: 0x2c3, have: 0x15e, distance: 0xa, oneway: true},
- 60: {want: 0x2ed, have: 0x139, distance: 0xa, oneway: true},
- 61: {want: 0x2f1, have: 0x15e, distance: 0xa, oneway: true},
- 62: {want: 0x2fa, have: 0x139, distance: 0xa, oneway: true},
- 63: {want: 0x2ff, have: 0x7e, distance: 0xa, oneway: true},
- 64: {want: 0x304, have: 0x139, distance: 0xa, oneway: true},
- 65: {want: 0x30b, have: 0x3e2, distance: 0xa, oneway: true},
- 66: {want: 0x31b, have: 0x1be, distance: 0xa, oneway: true},
- 67: {want: 0x31f, have: 0x1e1, distance: 0xa, oneway: true},
- 68: {want: 0x320, have: 0x139, distance: 0xa, oneway: true},
- 69: {want: 0x331, have: 0x139, distance: 0xa, oneway: true},
- 70: {want: 0x351, have: 0x139, distance: 0xa, oneway: true},
- 71: {want: 0x36a, have: 0x347, distance: 0xa, oneway: false},
- 72: {want: 0x36a, have: 0x36f, distance: 0xa, oneway: true},
- 73: {want: 0x37a, have: 0x139, distance: 0xa, oneway: true},
- 74: {want: 0x387, have: 0x139, distance: 0xa, oneway: true},
- 75: {want: 0x389, have: 0x139, distance: 0xa, oneway: true},
- 76: {want: 0x38b, have: 0x15e, distance: 0xa, oneway: true},
- 77: {want: 0x390, have: 0x139, distance: 0xa, oneway: true},
- 78: {want: 0x395, have: 0x139, distance: 0xa, oneway: true},
- 79: {want: 0x39d, have: 0x139, distance: 0xa, oneway: true},
- 80: {want: 0x3a5, have: 0x139, distance: 0xa, oneway: true},
- 81: {want: 0x3be, have: 0x139, distance: 0xa, oneway: true},
- 82: {want: 0x3c4, have: 0x13e, distance: 0xa, oneway: true},
- 83: {want: 0x3d4, have: 0x10d, distance: 0xa, oneway: true},
- 84: {want: 0x3d9, have: 0x139, distance: 0xa, oneway: true},
- 85: {want: 0x3e5, have: 0x15e, distance: 0xa, oneway: true},
- 86: {want: 0x3e9, have: 0x1be, distance: 0xa, oneway: true},
- 87: {want: 0x3fa, have: 0x139, distance: 0xa, oneway: true},
- 88: {want: 0x40c, have: 0x139, distance: 0xa, oneway: true},
- 89: {want: 0x423, have: 0x139, distance: 0xa, oneway: true},
- 90: {want: 0x429, have: 0x139, distance: 0xa, oneway: true},
- 91: {want: 0x431, have: 0x139, distance: 0xa, oneway: true},
- 92: {want: 0x43b, have: 0x139, distance: 0xa, oneway: true},
- 93: {want: 0x43e, have: 0x1e1, distance: 0xa, oneway: true},
- 94: {want: 0x445, have: 0x139, distance: 0xa, oneway: true},
- 95: {want: 0x450, have: 0x139, distance: 0xa, oneway: true},
- 96: {want: 0x461, have: 0x139, distance: 0xa, oneway: true},
- 97: {want: 0x467, have: 0x3e2, distance: 0xa, oneway: true},
- 98: {want: 0x46f, have: 0x139, distance: 0xa, oneway: true},
- 99: {want: 0x476, have: 0x3e2, distance: 0xa, oneway: true},
- 100: {want: 0x3883, have: 0x139, distance: 0xa, oneway: true},
- 101: {want: 0x480, have: 0x139, distance: 0xa, oneway: true},
- 102: {want: 0x482, have: 0x139, distance: 0xa, oneway: true},
- 103: {want: 0x494, have: 0x3e2, distance: 0xa, oneway: true},
- 104: {want: 0x49d, have: 0x139, distance: 0xa, oneway: true},
- 105: {want: 0x4ac, have: 0x529, distance: 0xa, oneway: true},
- 106: {want: 0x4b4, have: 0x139, distance: 0xa, oneway: true},
- 107: {want: 0x4bc, have: 0x3e2, distance: 0xa, oneway: true},
- 108: {want: 0x4e5, have: 0x15e, distance: 0xa, oneway: true},
- 109: {want: 0x4f2, have: 0x139, distance: 0xa, oneway: true},
- 110: {want: 0x512, have: 0x139, distance: 0xa, oneway: true},
- 111: {want: 0x518, have: 0x139, distance: 0xa, oneway: true},
- 112: {want: 0x52f, have: 0x139, distance: 0xa, oneway: true},
-} // Size: 702 bytes
-
-// matchScript holds pairs of scriptIDs where readers of one script
-// can typically also read the other. Each is associated with a confidence.
-var matchScript = []scriptIntelligibility{ // 26 elements
- 0: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x5b, haveScript: 0x20, distance: 0x5},
- 1: {wantLang: 0x432, haveLang: 0x432, wantScript: 0x20, haveScript: 0x5b, distance: 0x5},
- 2: {wantLang: 0x58, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa},
- 3: {wantLang: 0xa5, haveLang: 0x139, wantScript: 0xe, haveScript: 0x5b, distance: 0xa},
- 4: {wantLang: 0x1d7, haveLang: 0x3e2, wantScript: 0x8, haveScript: 0x20, distance: 0xa},
- 5: {wantLang: 0x210, haveLang: 0x139, wantScript: 0x2e, haveScript: 0x5b, distance: 0xa},
- 6: {wantLang: 0x24a, haveLang: 0x139, wantScript: 0x4f, haveScript: 0x5b, distance: 0xa},
- 7: {wantLang: 0x251, haveLang: 0x139, wantScript: 0x53, haveScript: 0x5b, distance: 0xa},
- 8: {wantLang: 0x2b8, haveLang: 0x139, wantScript: 0x58, haveScript: 0x5b, distance: 0xa},
- 9: {wantLang: 0x304, haveLang: 0x139, wantScript: 0x6f, haveScript: 0x5b, distance: 0xa},
- 10: {wantLang: 0x331, haveLang: 0x139, wantScript: 0x76, haveScript: 0x5b, distance: 0xa},
- 11: {wantLang: 0x351, haveLang: 0x139, wantScript: 0x22, haveScript: 0x5b, distance: 0xa},
- 12: {wantLang: 0x395, haveLang: 0x139, wantScript: 0x83, haveScript: 0x5b, distance: 0xa},
- 13: {wantLang: 0x39d, haveLang: 0x139, wantScript: 0x36, haveScript: 0x5b, distance: 0xa},
- 14: {wantLang: 0x3be, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa},
- 15: {wantLang: 0x3fa, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa},
- 16: {wantLang: 0x40c, haveLang: 0x139, wantScript: 0xd6, haveScript: 0x5b, distance: 0xa},
- 17: {wantLang: 0x450, haveLang: 0x139, wantScript: 0xe6, haveScript: 0x5b, distance: 0xa},
- 18: {wantLang: 0x461, haveLang: 0x139, wantScript: 0xe9, haveScript: 0x5b, distance: 0xa},
- 19: {wantLang: 0x46f, haveLang: 0x139, wantScript: 0x2c, haveScript: 0x5b, distance: 0xa},
- 20: {wantLang: 0x476, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa},
- 21: {wantLang: 0x4b4, haveLang: 0x139, wantScript: 0x5, haveScript: 0x5b, distance: 0xa},
- 22: {wantLang: 0x4bc, haveLang: 0x3e2, wantScript: 0x5b, haveScript: 0x20, distance: 0xa},
- 23: {wantLang: 0x512, haveLang: 0x139, wantScript: 0x3e, haveScript: 0x5b, distance: 0xa},
- 24: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3b, haveScript: 0x3c, distance: 0xf},
- 25: {wantLang: 0x529, haveLang: 0x529, wantScript: 0x3c, haveScript: 0x3b, distance: 0x13},
-} // Size: 232 bytes
-
-var matchRegion = []regionIntelligibility{ // 15 elements
- 0: {lang: 0x3a, script: 0x0, group: 0x4, distance: 0x4},
- 1: {lang: 0x3a, script: 0x0, group: 0x84, distance: 0x4},
- 2: {lang: 0x139, script: 0x0, group: 0x1, distance: 0x4},
- 3: {lang: 0x139, script: 0x0, group: 0x81, distance: 0x4},
- 4: {lang: 0x13e, script: 0x0, group: 0x3, distance: 0x4},
- 5: {lang: 0x13e, script: 0x0, group: 0x83, distance: 0x4},
- 6: {lang: 0x3c0, script: 0x0, group: 0x3, distance: 0x4},
- 7: {lang: 0x3c0, script: 0x0, group: 0x83, distance: 0x4},
- 8: {lang: 0x529, script: 0x3c, group: 0x2, distance: 0x4},
- 9: {lang: 0x529, script: 0x3c, group: 0x82, distance: 0x4},
- 10: {lang: 0x3a, script: 0x0, group: 0x80, distance: 0x5},
- 11: {lang: 0x139, script: 0x0, group: 0x80, distance: 0x5},
- 12: {lang: 0x13e, script: 0x0, group: 0x80, distance: 0x5},
- 13: {lang: 0x3c0, script: 0x0, group: 0x80, distance: 0x5},
- 14: {lang: 0x529, script: 0x3c, group: 0x80, distance: 0x5},
-} // Size: 114 bytes
-
-// Total table size 1473 bytes (1KiB); checksum: 7BB90B5C
diff --git a/vendor/golang.org/x/text/language/tags.go b/vendor/golang.org/x/text/language/tags.go
deleted file mode 100644
index 42ea792..0000000
--- a/vendor/golang.org/x/text/language/tags.go
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package language
-
-import "golang.org/x/text/internal/language/compact"
-
-// TODO: Various sets of commonly use tags and regions.
-
-// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
-// It simplifies safe initialization of Tag values.
-func MustParse(s string) Tag {
- t, err := Parse(s)
- if err != nil {
- panic(err)
- }
- return t
-}
-
-// MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed.
-// It simplifies safe initialization of Tag values.
-func (c CanonType) MustParse(s string) Tag {
- t, err := c.Parse(s)
- if err != nil {
- panic(err)
- }
- return t
-}
-
-// MustParseBase is like ParseBase, but panics if the given base cannot be parsed.
-// It simplifies safe initialization of Base values.
-func MustParseBase(s string) Base {
- b, err := ParseBase(s)
- if err != nil {
- panic(err)
- }
- return b
-}
-
-// MustParseScript is like ParseScript, but panics if the given script cannot be
-// parsed. It simplifies safe initialization of Script values.
-func MustParseScript(s string) Script {
- scr, err := ParseScript(s)
- if err != nil {
- panic(err)
- }
- return scr
-}
-
-// MustParseRegion is like ParseRegion, but panics if the given region cannot be
-// parsed. It simplifies safe initialization of Region values.
-func MustParseRegion(s string) Region {
- r, err := ParseRegion(s)
- if err != nil {
- panic(err)
- }
- return r
-}
-
-var (
- und = Tag{}
-
- Und Tag = Tag{}
-
- Afrikaans Tag = Tag(compact.Afrikaans)
- Amharic Tag = Tag(compact.Amharic)
- Arabic Tag = Tag(compact.Arabic)
- ModernStandardArabic Tag = Tag(compact.ModernStandardArabic)
- Azerbaijani Tag = Tag(compact.Azerbaijani)
- Bulgarian Tag = Tag(compact.Bulgarian)
- Bengali Tag = Tag(compact.Bengali)
- Catalan Tag = Tag(compact.Catalan)
- Czech Tag = Tag(compact.Czech)
- Danish Tag = Tag(compact.Danish)
- German Tag = Tag(compact.German)
- Greek Tag = Tag(compact.Greek)
- English Tag = Tag(compact.English)
- AmericanEnglish Tag = Tag(compact.AmericanEnglish)
- BritishEnglish Tag = Tag(compact.BritishEnglish)
- Spanish Tag = Tag(compact.Spanish)
- EuropeanSpanish Tag = Tag(compact.EuropeanSpanish)
- LatinAmericanSpanish Tag = Tag(compact.LatinAmericanSpanish)
- Estonian Tag = Tag(compact.Estonian)
- Persian Tag = Tag(compact.Persian)
- Finnish Tag = Tag(compact.Finnish)
- Filipino Tag = Tag(compact.Filipino)
- French Tag = Tag(compact.French)
- CanadianFrench Tag = Tag(compact.CanadianFrench)
- Gujarati Tag = Tag(compact.Gujarati)
- Hebrew Tag = Tag(compact.Hebrew)
- Hindi Tag = Tag(compact.Hindi)
- Croatian Tag = Tag(compact.Croatian)
- Hungarian Tag = Tag(compact.Hungarian)
- Armenian Tag = Tag(compact.Armenian)
- Indonesian Tag = Tag(compact.Indonesian)
- Icelandic Tag = Tag(compact.Icelandic)
- Italian Tag = Tag(compact.Italian)
- Japanese Tag = Tag(compact.Japanese)
- Georgian Tag = Tag(compact.Georgian)
- Kazakh Tag = Tag(compact.Kazakh)
- Khmer Tag = Tag(compact.Khmer)
- Kannada Tag = Tag(compact.Kannada)
- Korean Tag = Tag(compact.Korean)
- Kirghiz Tag = Tag(compact.Kirghiz)
- Lao Tag = Tag(compact.Lao)
- Lithuanian Tag = Tag(compact.Lithuanian)
- Latvian Tag = Tag(compact.Latvian)
- Macedonian Tag = Tag(compact.Macedonian)
- Malayalam Tag = Tag(compact.Malayalam)
- Mongolian Tag = Tag(compact.Mongolian)
- Marathi Tag = Tag(compact.Marathi)
- Malay Tag = Tag(compact.Malay)
- Burmese Tag = Tag(compact.Burmese)
- Nepali Tag = Tag(compact.Nepali)
- Dutch Tag = Tag(compact.Dutch)
- Norwegian Tag = Tag(compact.Norwegian)
- Punjabi Tag = Tag(compact.Punjabi)
- Polish Tag = Tag(compact.Polish)
- Portuguese Tag = Tag(compact.Portuguese)
- BrazilianPortuguese Tag = Tag(compact.BrazilianPortuguese)
- EuropeanPortuguese Tag = Tag(compact.EuropeanPortuguese)
- Romanian Tag = Tag(compact.Romanian)
- Russian Tag = Tag(compact.Russian)
- Sinhala Tag = Tag(compact.Sinhala)
- Slovak Tag = Tag(compact.Slovak)
- Slovenian Tag = Tag(compact.Slovenian)
- Albanian Tag = Tag(compact.Albanian)
- Serbian Tag = Tag(compact.Serbian)
- SerbianLatin Tag = Tag(compact.SerbianLatin)
- Swedish Tag = Tag(compact.Swedish)
- Swahili Tag = Tag(compact.Swahili)
- Tamil Tag = Tag(compact.Tamil)
- Telugu Tag = Tag(compact.Telugu)
- Thai Tag = Tag(compact.Thai)
- Turkish Tag = Tag(compact.Turkish)
- Ukrainian Tag = Tag(compact.Ukrainian)
- Urdu Tag = Tag(compact.Urdu)
- Uzbek Tag = Tag(compact.Uzbek)
- Vietnamese Tag = Tag(compact.Vietnamese)
- Chinese Tag = Tag(compact.Chinese)
- SimplifiedChinese Tag = Tag(compact.SimplifiedChinese)
- TraditionalChinese Tag = Tag(compact.TraditionalChinese)
- Zulu Tag = Tag(compact.Zulu)
-)
diff --git a/vendor/golang.org/x/text/message/catalog.go b/vendor/golang.org/x/text/message/catalog.go
deleted file mode 100644
index 068271d..0000000
--- a/vendor/golang.org/x/text/message/catalog.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package message
-
-// TODO: some types in this file will need to be made public at some time.
-// Documentation and method names will reflect this by using the exported name.
-
-import (
- "golang.org/x/text/language"
- "golang.org/x/text/message/catalog"
-)
-
-// MatchLanguage reports the matched tag obtained from language.MatchStrings for
-// the Matcher of the DefaultCatalog.
-func MatchLanguage(preferred ...string) language.Tag {
- c := DefaultCatalog
- tag, _ := language.MatchStrings(c.Matcher(), preferred...)
- return tag
-}
-
-// DefaultCatalog is used by SetString.
-var DefaultCatalog catalog.Catalog = defaultCatalog
-
-var defaultCatalog = catalog.NewBuilder()
-
-// SetString calls SetString on the initial default Catalog.
-func SetString(tag language.Tag, key string, msg string) error {
- return defaultCatalog.SetString(tag, key, msg)
-}
-
-// Set calls Set on the initial default Catalog.
-func Set(tag language.Tag, key string, msg ...catalog.Message) error {
- return defaultCatalog.Set(tag, key, msg...)
-}
diff --git a/vendor/golang.org/x/text/message/catalog/catalog.go b/vendor/golang.org/x/text/message/catalog/catalog.go
deleted file mode 100644
index 96955d0..0000000
--- a/vendor/golang.org/x/text/message/catalog/catalog.go
+++ /dev/null
@@ -1,365 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package catalog defines collections of translated format strings.
-//
-// This package mostly defines types for populating catalogs with messages. The
-// catmsg package contains further definitions for creating custom message and
-// dictionary types as well as packages that use Catalogs.
-//
-// Package catalog defines various interfaces: Dictionary, Loader, and Message.
-// A Dictionary maintains a set of translations of format strings for a single
-// language. The Loader interface defines a source of dictionaries. A
-// translation of a format string is represented by a Message.
-//
-// # Catalogs
-//
-// A Catalog defines a programmatic interface for setting message translations.
-// It maintains a set of per-language dictionaries with translations for a set
-// of keys. For message translation to function properly, a translation should
-// be defined for each key for each supported language. A dictionary may be
-// underspecified, though, if there is a parent language that already defines
-// the key. For example, a Dictionary for "en-GB" could leave out entries that
-// are identical to those in a dictionary for "en".
-//
-// # Messages
-//
-// A Message is a format string which varies on the value of substitution
-// variables. For instance, to indicate the number of results one could want "no
-// results" if there are none, "1 result" if there is 1, and "%d results" for
-// any other number. Catalog is agnostic to the kind of format strings that are
-// used: for instance, messages can follow either the printf-style substitution
-// from package fmt or use templates.
-//
-// A Message does not substitute arguments in the format string. This job is
-// reserved for packages that render strings, such as message, that use Catalogs
-// to selected string. This separation of concerns allows Catalog to be used to
-// store any kind of formatting strings.
-//
-// # Selecting messages based on linguistic features of substitution arguments
-//
-// Messages may vary based on any linguistic features of the argument values.
-// The most common one is plural form, but others exist.
-//
-// Selection messages are provided in packages that provide support for a
-// specific linguistic feature. The following snippet uses plural.Selectf:
-//
-// catalog.Set(language.English, "You are %d minute(s) late.",
-// plural.Selectf(1, "",
-// plural.One, "You are 1 minute late.",
-// plural.Other, "You are %d minutes late."))
-//
-// In this example, a message is stored in the Catalog where one of two messages
-// is selected based on the first argument, a number. The first message is
-// selected if the argument is singular (identified by the selector "one") and
-// the second message is selected in all other cases. The selectors are defined
-// by the plural rules defined in CLDR. The selector "other" is special and will
-// always match. Each language always defines one of the linguistic categories
-// to be "other." For English, singular is "one" and plural is "other".
-//
-// Selects can be nested. This allows selecting sentences based on features of
-// multiple arguments or multiple linguistic properties of a single argument.
-//
-// # String interpolation
-//
-// There is often a lot of commonality between the possible variants of a
-// message. For instance, in the example above the word "minute" varies based on
-// the plural catogory of the argument, but the rest of the sentence is
-// identical. Using interpolation the above message can be rewritten as:
-//
-// catalog.Set(language.English, "You are %d minute(s) late.",
-// catalog.Var("minutes",
-// plural.Selectf(1, "", plural.One, "minute", plural.Other, "minutes")),
-// catalog.String("You are %[1]d ${minutes} late."))
-//
-// Var is defined to return the variable name if the message does not yield a
-// match. This allows us to further simplify this snippet to
-//
-// catalog.Set(language.English, "You are %d minute(s) late.",
-// catalog.Var("minutes", plural.Selectf(1, "", plural.One, "minute")),
-// catalog.String("You are %d ${minutes} late."))
-//
-// Overall this is still only a minor improvement, but things can get a lot more
-// unwieldy if more than one linguistic feature is used to determine a message
-// variant. Consider the following example:
-//
-// // argument 1: list of hosts, argument 2: list of guests
-// catalog.Set(language.English, "%[1]v invite(s) %[2]v to their party.",
-// catalog.Var("their",
-// plural.Selectf(1, ""
-// plural.One, gender.Select(1, "female", "her", "other", "his"))),
-// catalog.Var("invites", plural.Selectf(1, "", plural.One, "invite"))
-// catalog.String("%[1]v ${invites} %[2]v to ${their} party.")),
-//
-// Without variable substitution, this would have to be written as
-//
-// // argument 1: list of hosts, argument 2: list of guests
-// catalog.Set(language.English, "%[1]v invite(s) %[2]v to their party.",
-// plural.Selectf(1, "",
-// plural.One, gender.Select(1,
-// "female", "%[1]v invites %[2]v to her party."
-// "other", "%[1]v invites %[2]v to his party."),
-// plural.Other, "%[1]v invites %[2]v to their party."))
-//
-// Not necessarily shorter, but using variables there is less duplication and
-// the messages are more maintenance friendly. Moreover, languages may have up
-// to six plural forms. This makes the use of variables more welcome.
-//
-// Different messages using the same inflections can reuse variables by moving
-// them to macros. Using macros we can rewrite the message as:
-//
-// // argument 1: list of hosts, argument 2: list of guests
-// catalog.SetString(language.English, "%[1]v invite(s) %[2]v to their party.",
-// "%[1]v ${invites(1)} %[2]v to ${their(1)} party.")
-//
-// Where the following macros were defined separately.
-//
-// catalog.SetMacro(language.English, "invites", plural.Selectf(1, "",
-// plural.One, "invite"))
-// catalog.SetMacro(language.English, "their", plural.Selectf(1, "",
-// plural.One, gender.Select(1, "female", "her", "other", "his"))),
-//
-// Placeholders use parentheses and the arguments to invoke a macro.
-//
-// # Looking up messages
-//
-// Message lookup using Catalogs is typically only done by specialized packages
-// and is not something the user should be concerned with. For instance, to
-// express the tardiness of a user using the related message we defined earlier,
-// the user may use the package message like so:
-//
-// p := message.NewPrinter(language.English)
-// p.Printf("You are %d minute(s) late.", 5)
-//
-// Which would print:
-//
-// You are 5 minutes late.
-//
-// This package is UNDER CONSTRUCTION and its API may change.
-package catalog // import "golang.org/x/text/message/catalog"
-
-// TODO:
-// Some way to freeze a catalog.
-// - Locking on each lockup turns out to be about 50% of the total running time
-// for some of the benchmarks in the message package.
-// Consider these:
-// - Sequence type to support sequences in user-defined messages.
-// - Garbage collection: Remove dictionaries that can no longer be reached
-// as other dictionaries have been added that cover all possible keys.
-
-import (
- "errors"
- "fmt"
-
- "golang.org/x/text/internal"
-
- "golang.org/x/text/internal/catmsg"
- "golang.org/x/text/language"
-)
-
-// A Catalog allows lookup of translated messages.
-type Catalog interface {
- // Languages returns all languages for which the Catalog contains variants.
- Languages() []language.Tag
-
- // Matcher returns a Matcher for languages from this Catalog.
- Matcher() language.Matcher
-
- // A Context is used for evaluating Messages.
- Context(tag language.Tag, r catmsg.Renderer) *Context
-
- // This method also makes Catalog a private interface.
- lookup(tag language.Tag, key string) (data string, ok bool)
-}
-
-// NewFromMap creates a Catalog from the given map. If a Dictionary is
-// underspecified the entry is retrieved from a parent language.
-func NewFromMap(dictionaries map[string]Dictionary, opts ...Option) (Catalog, error) {
- options := options{}
- for _, o := range opts {
- o(&options)
- }
- c := &catalog{
- dicts: map[language.Tag]Dictionary{},
- }
- _, hasFallback := dictionaries[options.fallback.String()]
- if hasFallback {
- // TODO: Should it be okay to not have a fallback language?
- // Catalog generators could enforce there is always a fallback.
- c.langs = append(c.langs, options.fallback)
- }
- for lang, dict := range dictionaries {
- tag, err := language.Parse(lang)
- if err != nil {
- return nil, fmt.Errorf("catalog: invalid language tag %q", lang)
- }
- if _, ok := c.dicts[tag]; ok {
- return nil, fmt.Errorf("catalog: duplicate entry for tag %q after normalization", tag)
- }
- c.dicts[tag] = dict
- if !hasFallback || tag != options.fallback {
- c.langs = append(c.langs, tag)
- }
- }
- if hasFallback {
- internal.SortTags(c.langs[1:])
- } else {
- internal.SortTags(c.langs)
- }
- c.matcher = language.NewMatcher(c.langs)
- return c, nil
-}
-
-// A Dictionary is a source of translations for a single language.
-type Dictionary interface {
- // Lookup returns a message compiled with catmsg.Compile for the given key.
- // It returns false for ok if such a message could not be found.
- Lookup(key string) (data string, ok bool)
-}
-
-type catalog struct {
- langs []language.Tag
- dicts map[language.Tag]Dictionary
- macros store
- matcher language.Matcher
-}
-
-func (c *catalog) Languages() []language.Tag { return c.langs }
-func (c *catalog) Matcher() language.Matcher { return c.matcher }
-
-func (c *catalog) lookup(tag language.Tag, key string) (data string, ok bool) {
- for ; ; tag = tag.Parent() {
- if dict, ok := c.dicts[tag]; ok {
- if data, ok := dict.Lookup(key); ok {
- return data, true
- }
- }
- if tag == language.Und {
- break
- }
- }
- return "", false
-}
-
-// Context returns a Context for formatting messages.
-// Only one Message may be formatted per context at any given time.
-func (c *catalog) Context(tag language.Tag, r catmsg.Renderer) *Context {
- return &Context{
- cat: c,
- tag: tag,
- dec: catmsg.NewDecoder(tag, r, &dict{&c.macros, tag}),
- }
-}
-
-// A Builder allows building a Catalog programmatically.
-type Builder struct {
- options
- matcher language.Matcher
-
- index store
- macros store
-}
-
-type options struct {
- fallback language.Tag
-}
-
-// An Option configures Catalog behavior.
-type Option func(*options)
-
-// Fallback specifies the default fallback language. The default is Und.
-func Fallback(tag language.Tag) Option {
- return func(o *options) { o.fallback = tag }
-}
-
-// TODO:
-// // Catalogs specifies one or more sources for a Catalog.
-// // Lookups are in order.
-// // This can be changed inserting a Catalog used for setting, which implements
-// // Loader, used for setting in the chain.
-// func Catalogs(d ...Loader) Option {
-// return nil
-// }
-//
-// func Delims(start, end string) Option {}
-//
-// func Dict(tag language.Tag, d ...Dictionary) Option
-
-// NewBuilder returns an empty mutable Catalog.
-func NewBuilder(opts ...Option) *Builder {
- c := &Builder{}
- for _, o := range opts {
- o(&c.options)
- }
- return c
-}
-
-// SetString is shorthand for Set(tag, key, String(msg)).
-func (c *Builder) SetString(tag language.Tag, key string, msg string) error {
- return c.set(tag, key, &c.index, String(msg))
-}
-
-// Set sets the translation for the given language and key.
-//
-// When evaluation this message, the first Message in the sequence to msgs to
-// evaluate to a string will be the message returned.
-func (c *Builder) Set(tag language.Tag, key string, msg ...Message) error {
- return c.set(tag, key, &c.index, msg...)
-}
-
-// SetMacro defines a Message that may be substituted in another message.
-// The arguments to a macro Message are passed as arguments in the
-// placeholder the form "${foo(arg1, arg2)}".
-func (c *Builder) SetMacro(tag language.Tag, name string, msg ...Message) error {
- return c.set(tag, name, &c.macros, msg...)
-}
-
-// ErrNotFound indicates there was no message for the given key.
-var ErrNotFound = errors.New("catalog: message not found")
-
-// String specifies a plain message string. It can be used as fallback if no
-// other strings match or as a simple standalone message.
-//
-// It is an error to pass more than one String in a message sequence.
-func String(name string) Message {
- return catmsg.String(name)
-}
-
-// Var sets a variable that may be substituted in formatting patterns using
-// named substitution of the form "${name}". The name argument is used as a
-// fallback if the statements do not produce a match. The statement sequence may
-// not contain any Var calls.
-//
-// The name passed to a Var must be unique within message sequence.
-func Var(name string, msg ...Message) Message {
- return &catmsg.Var{Name: name, Message: firstInSequence(msg)}
-}
-
-// Context returns a Context for formatting messages.
-// Only one Message may be formatted per context at any given time.
-func (b *Builder) Context(tag language.Tag, r catmsg.Renderer) *Context {
- return &Context{
- cat: b,
- tag: tag,
- dec: catmsg.NewDecoder(tag, r, &dict{&b.macros, tag}),
- }
-}
-
-// A Context is used for evaluating Messages.
-// Only one Message may be formatted per context at any given time.
-type Context struct {
- cat Catalog
- tag language.Tag // TODO: use compact index.
- dec *catmsg.Decoder
-}
-
-// Execute looks up and executes the message with the given key.
-// It returns ErrNotFound if no message could be found in the index.
-func (c *Context) Execute(key string) error {
- data, ok := c.cat.lookup(c.tag, key)
- if !ok {
- return ErrNotFound
- }
- return c.dec.Execute(data)
-}
diff --git a/vendor/golang.org/x/text/message/catalog/dict.go b/vendor/golang.org/x/text/message/catalog/dict.go
deleted file mode 100644
index a0eb818..0000000
--- a/vendor/golang.org/x/text/message/catalog/dict.go
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package catalog
-
-import (
- "sync"
-
- "golang.org/x/text/internal"
- "golang.org/x/text/internal/catmsg"
- "golang.org/x/text/language"
-)
-
-// TODO:
-// Dictionary returns a Dictionary that returns the first Message, using the
-// given language tag, that matches:
-// 1. the last one registered by one of the Set methods
-// 2. returned by one of the Loaders
-// 3. repeat from 1. using the parent language
-// This approach allows messages to be underspecified.
-// func (c *Catalog) Dictionary(tag language.Tag) (Dictionary, error) {
-// // TODO: verify dictionary exists.
-// return &dict{&c.index, tag}, nil
-// }
-
-type dict struct {
- s *store
- tag language.Tag // TODO: make compact tag.
-}
-
-func (d *dict) Lookup(key string) (data string, ok bool) {
- return d.s.lookup(d.tag, key)
-}
-
-func (b *Builder) lookup(tag language.Tag, key string) (data string, ok bool) {
- return b.index.lookup(tag, key)
-}
-
-func (c *Builder) set(tag language.Tag, key string, s *store, msg ...Message) error {
- data, err := catmsg.Compile(tag, &dict{&c.macros, tag}, firstInSequence(msg))
-
- s.mutex.Lock()
- defer s.mutex.Unlock()
-
- m := s.index[tag]
- if m == nil {
- m = msgMap{}
- if s.index == nil {
- s.index = map[language.Tag]msgMap{}
- }
- c.matcher = nil
- s.index[tag] = m
- }
-
- m[key] = data
- return err
-}
-
-func (c *Builder) Matcher() language.Matcher {
- c.index.mutex.RLock()
- m := c.matcher
- c.index.mutex.RUnlock()
- if m != nil {
- return m
- }
-
- c.index.mutex.Lock()
- if c.matcher == nil {
- c.matcher = language.NewMatcher(c.unlockedLanguages())
- }
- m = c.matcher
- c.index.mutex.Unlock()
- return m
-}
-
-type store struct {
- mutex sync.RWMutex
- index map[language.Tag]msgMap
-}
-
-type msgMap map[string]string
-
-func (s *store) lookup(tag language.Tag, key string) (data string, ok bool) {
- s.mutex.RLock()
- defer s.mutex.RUnlock()
-
- for ; ; tag = tag.Parent() {
- if msgs, ok := s.index[tag]; ok {
- if msg, ok := msgs[key]; ok {
- return msg, true
- }
- }
- if tag == language.Und {
- break
- }
- }
- return "", false
-}
-
-// Languages returns all languages for which the Catalog contains variants.
-func (b *Builder) Languages() []language.Tag {
- s := &b.index
- s.mutex.RLock()
- defer s.mutex.RUnlock()
-
- return b.unlockedLanguages()
-}
-
-func (b *Builder) unlockedLanguages() []language.Tag {
- s := &b.index
- if len(s.index) == 0 {
- return nil
- }
- tags := make([]language.Tag, 0, len(s.index))
- _, hasFallback := s.index[b.options.fallback]
- offset := 0
- if hasFallback {
- tags = append(tags, b.options.fallback)
- offset = 1
- }
- for t := range s.index {
- if t != b.options.fallback {
- tags = append(tags, t)
- }
- }
- internal.SortTags(tags[offset:])
- return tags
-}
diff --git a/vendor/golang.org/x/text/message/catalog/go19.go b/vendor/golang.org/x/text/message/catalog/go19.go
deleted file mode 100644
index 291a4df..0000000
--- a/vendor/golang.org/x/text/message/catalog/go19.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build go1.9
-
-package catalog
-
-import "golang.org/x/text/internal/catmsg"
-
-// A Message holds a collection of translations for the same phrase that may
-// vary based on the values of substitution arguments.
-type Message = catmsg.Message
-
-type firstInSequence = catmsg.FirstOf
diff --git a/vendor/golang.org/x/text/message/catalog/gopre19.go b/vendor/golang.org/x/text/message/catalog/gopre19.go
deleted file mode 100644
index da44ebb..0000000
--- a/vendor/golang.org/x/text/message/catalog/gopre19.go
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build !go1.9
-
-package catalog
-
-import "golang.org/x/text/internal/catmsg"
-
-// A Message holds a collection of translations for the same phrase that may
-// vary based on the values of substitution arguments.
-type Message interface {
- catmsg.Message
-}
-
-func firstInSequence(m []Message) catmsg.Message {
- a := []catmsg.Message{}
- for _, m := range m {
- a = append(a, m)
- }
- return catmsg.FirstOf(a)
-}
diff --git a/vendor/golang.org/x/text/message/doc.go b/vendor/golang.org/x/text/message/doc.go
deleted file mode 100644
index 4bf7bdc..0000000
--- a/vendor/golang.org/x/text/message/doc.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package message implements formatted I/O for localized strings with functions
-// analogous to the fmt's print functions. It is a drop-in replacement for fmt.
-//
-// # Localized Formatting
-//
-// A format string can be localized by replacing any of the print functions of
-// fmt with an equivalent call to a Printer.
-//
-// p := message.NewPrinter(message.MatchLanguage("en"))
-// p.Println(123456.78) // Prints 123,456.78
-//
-// p.Printf("%d ducks in a row", 4331) // Prints 4,331 ducks in a row
-//
-// p := message.NewPrinter(message.MatchLanguage("nl"))
-// p.Printf("Hoogte: %.1f meter", 1244.9) // Prints Hoogte: 1,244.9 meter
-//
-// p := message.NewPrinter(message.MatchLanguage("bn"))
-// p.Println(123456.78) // Prints ১,২৩,৪৫৬.৭৮
-//
-// Printer currently supports numbers and specialized types for which packages
-// exist in x/text. Other builtin types such as time.Time and slices are
-// planned.
-//
-// Format strings largely have the same meaning as with fmt with the following
-// notable exceptions:
-// - flag # always resorts to fmt for printing
-// - verb 'f', 'e', 'g', 'd' use localized formatting unless the '#' flag is
-// specified.
-// - verb 'm' inserts a translation of a string argument.
-//
-// See package fmt for more options.
-//
-// # Translation
-//
-// The format strings that are passed to Printf, Sprintf, Fprintf, or Errorf
-// are used as keys to look up translations for the specified languages.
-// More on how these need to be specified below.
-//
-// One can use arbitrary keys to distinguish between otherwise ambiguous
-// strings:
-//
-// p := message.NewPrinter(language.English)
-// p.Printf("archive(noun)") // Prints "archive"
-// p.Printf("archive(verb)") // Prints "archive"
-//
-// p := message.NewPrinter(language.German)
-// p.Printf("archive(noun)") // Prints "Archiv"
-// p.Printf("archive(verb)") // Prints "archivieren"
-//
-// To retain the fallback functionality, use Key:
-//
-// p.Printf(message.Key("archive(noun)", "archive"))
-// p.Printf(message.Key("archive(verb)", "archive"))
-//
-// # Translation Pipeline
-//
-// Format strings that contain text need to be translated to support different
-// locales. The first step is to extract strings that need to be translated.
-//
-// 1. Install gotext
-//
-// go get -u golang.org/x/text/cmd/gotext
-// gotext -help
-//
-// 2. Mark strings in your source to be translated by using message.Printer,
-// instead of the functions of the fmt package.
-//
-// 3. Extract the strings from your source
-//
-// gotext extract
-//
-// The output will be written to the textdata directory.
-//
-// 4. Send the files for translation
-//
-// It is planned to support multiple formats, but for now one will have to
-// rewrite the JSON output to the desired format.
-//
-// 5. Inject translations into program
-//
-// 6. Repeat from 2
-//
-// Right now this has to be done programmatically with calls to Set or
-// SetString. These functions as well as the methods defined in
-// see also package golang.org/x/text/message/catalog can be used to implement
-// either dynamic or static loading of messages.
-//
-// # Plural and Gender Forms
-//
-// Translated messages can vary based on the plural and gender forms of
-// substitution values. In general, it is up to the translators to provide
-// alternative translations for such forms. See the packages in
-// golang.org/x/text/feature and golang.org/x/text/message/catalog for more
-// information.
-package message
diff --git a/vendor/golang.org/x/text/message/format.go b/vendor/golang.org/x/text/message/format.go
deleted file mode 100644
index a47d17d..0000000
--- a/vendor/golang.org/x/text/message/format.go
+++ /dev/null
@@ -1,510 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package message
-
-import (
- "bytes"
- "strconv"
- "unicode/utf8"
-
- "golang.org/x/text/internal/format"
-)
-
-const (
- ldigits = "0123456789abcdefx"
- udigits = "0123456789ABCDEFX"
-)
-
-const (
- signed = true
- unsigned = false
-)
-
-// A formatInfo is the raw formatter used by Printf etc.
-// It prints into a buffer that must be set up separately.
-type formatInfo struct {
- buf *bytes.Buffer
-
- format.Parser
-
- // intbuf is large enough to store %b of an int64 with a sign and
- // avoids padding at the end of the struct on 32 bit architectures.
- intbuf [68]byte
-}
-
-func (f *formatInfo) init(buf *bytes.Buffer) {
- f.ClearFlags()
- f.buf = buf
-}
-
-// writePadding generates n bytes of padding.
-func (f *formatInfo) writePadding(n int) {
- if n <= 0 { // No padding bytes needed.
- return
- }
- f.buf.Grow(n)
- // Decide which byte the padding should be filled with.
- padByte := byte(' ')
- if f.Zero {
- padByte = byte('0')
- }
- // Fill padding with padByte.
- for i := 0; i < n; i++ {
- f.buf.WriteByte(padByte) // TODO: make more efficient.
- }
-}
-
-// pad appends b to f.buf, padded on left (!f.minus) or right (f.minus).
-func (f *formatInfo) pad(b []byte) {
- if !f.WidthPresent || f.Width == 0 {
- f.buf.Write(b)
- return
- }
- width := f.Width - utf8.RuneCount(b)
- if !f.Minus {
- // left padding
- f.writePadding(width)
- f.buf.Write(b)
- } else {
- // right padding
- f.buf.Write(b)
- f.writePadding(width)
- }
-}
-
-// padString appends s to f.buf, padded on left (!f.minus) or right (f.minus).
-func (f *formatInfo) padString(s string) {
- if !f.WidthPresent || f.Width == 0 {
- f.buf.WriteString(s)
- return
- }
- width := f.Width - utf8.RuneCountInString(s)
- if !f.Minus {
- // left padding
- f.writePadding(width)
- f.buf.WriteString(s)
- } else {
- // right padding
- f.buf.WriteString(s)
- f.writePadding(width)
- }
-}
-
-// fmt_boolean formats a boolean.
-func (f *formatInfo) fmt_boolean(v bool) {
- if v {
- f.padString("true")
- } else {
- f.padString("false")
- }
-}
-
-// fmt_unicode formats a uint64 as "U+0078" or with f.sharp set as "U+0078 'x'".
-func (f *formatInfo) fmt_unicode(u uint64) {
- buf := f.intbuf[0:]
-
- // With default precision set the maximum needed buf length is 18
- // for formatting -1 with %#U ("U+FFFFFFFFFFFFFFFF") which fits
- // into the already allocated intbuf with a capacity of 68 bytes.
- prec := 4
- if f.PrecPresent && f.Prec > 4 {
- prec = f.Prec
- // Compute space needed for "U+" , number, " '", character, "'".
- width := 2 + prec + 2 + utf8.UTFMax + 1
- if width > len(buf) {
- buf = make([]byte, width)
- }
- }
-
- // Format into buf, ending at buf[i]. Formatting numbers is easier right-to-left.
- i := len(buf)
-
- // For %#U we want to add a space and a quoted character at the end of the buffer.
- if f.Sharp && u <= utf8.MaxRune && strconv.IsPrint(rune(u)) {
- i--
- buf[i] = '\''
- i -= utf8.RuneLen(rune(u))
- utf8.EncodeRune(buf[i:], rune(u))
- i--
- buf[i] = '\''
- i--
- buf[i] = ' '
- }
- // Format the Unicode code point u as a hexadecimal number.
- for u >= 16 {
- i--
- buf[i] = udigits[u&0xF]
- prec--
- u >>= 4
- }
- i--
- buf[i] = udigits[u]
- prec--
- // Add zeros in front of the number until requested precision is reached.
- for prec > 0 {
- i--
- buf[i] = '0'
- prec--
- }
- // Add a leading "U+".
- i--
- buf[i] = '+'
- i--
- buf[i] = 'U'
-
- oldZero := f.Zero
- f.Zero = false
- f.pad(buf[i:])
- f.Zero = oldZero
-}
-
-// fmt_integer formats signed and unsigned integers.
-func (f *formatInfo) fmt_integer(u uint64, base int, isSigned bool, digits string) {
- negative := isSigned && int64(u) < 0
- if negative {
- u = -u
- }
-
- buf := f.intbuf[0:]
- // The already allocated f.intbuf with a capacity of 68 bytes
- // is large enough for integer formatting when no precision or width is set.
- if f.WidthPresent || f.PrecPresent {
- // Account 3 extra bytes for possible addition of a sign and "0x".
- width := 3 + f.Width + f.Prec // wid and prec are always positive.
- if width > len(buf) {
- // We're going to need a bigger boat.
- buf = make([]byte, width)
- }
- }
-
- // Two ways to ask for extra leading zero digits: %.3d or %03d.
- // If both are specified the f.zero flag is ignored and
- // padding with spaces is used instead.
- prec := 0
- if f.PrecPresent {
- prec = f.Prec
- // Precision of 0 and value of 0 means "print nothing" but padding.
- if prec == 0 && u == 0 {
- oldZero := f.Zero
- f.Zero = false
- f.writePadding(f.Width)
- f.Zero = oldZero
- return
- }
- } else if f.Zero && f.WidthPresent {
- prec = f.Width
- if negative || f.Plus || f.Space {
- prec-- // leave room for sign
- }
- }
-
- // Because printing is easier right-to-left: format u into buf, ending at buf[i].
- // We could make things marginally faster by splitting the 32-bit case out
- // into a separate block but it's not worth the duplication, so u has 64 bits.
- i := len(buf)
- // Use constants for the division and modulo for more efficient code.
- // Switch cases ordered by popularity.
- switch base {
- case 10:
- for u >= 10 {
- i--
- next := u / 10
- buf[i] = byte('0' + u - next*10)
- u = next
- }
- case 16:
- for u >= 16 {
- i--
- buf[i] = digits[u&0xF]
- u >>= 4
- }
- case 8:
- for u >= 8 {
- i--
- buf[i] = byte('0' + u&7)
- u >>= 3
- }
- case 2:
- for u >= 2 {
- i--
- buf[i] = byte('0' + u&1)
- u >>= 1
- }
- default:
- panic("fmt: unknown base; can't happen")
- }
- i--
- buf[i] = digits[u]
- for i > 0 && prec > len(buf)-i {
- i--
- buf[i] = '0'
- }
-
- // Various prefixes: 0x, -, etc.
- if f.Sharp {
- switch base {
- case 8:
- if buf[i] != '0' {
- i--
- buf[i] = '0'
- }
- case 16:
- // Add a leading 0x or 0X.
- i--
- buf[i] = digits[16]
- i--
- buf[i] = '0'
- }
- }
-
- if negative {
- i--
- buf[i] = '-'
- } else if f.Plus {
- i--
- buf[i] = '+'
- } else if f.Space {
- i--
- buf[i] = ' '
- }
-
- // Left padding with zeros has already been handled like precision earlier
- // or the f.zero flag is ignored due to an explicitly set precision.
- oldZero := f.Zero
- f.Zero = false
- f.pad(buf[i:])
- f.Zero = oldZero
-}
-
-// truncate truncates the string to the specified precision, if present.
-func (f *formatInfo) truncate(s string) string {
- if f.PrecPresent {
- n := f.Prec
- for i := range s {
- n--
- if n < 0 {
- return s[:i]
- }
- }
- }
- return s
-}
-
-// fmt_s formats a string.
-func (f *formatInfo) fmt_s(s string) {
- s = f.truncate(s)
- f.padString(s)
-}
-
-// fmt_sbx formats a string or byte slice as a hexadecimal encoding of its bytes.
-func (f *formatInfo) fmt_sbx(s string, b []byte, digits string) {
- length := len(b)
- if b == nil {
- // No byte slice present. Assume string s should be encoded.
- length = len(s)
- }
- // Set length to not process more bytes than the precision demands.
- if f.PrecPresent && f.Prec < length {
- length = f.Prec
- }
- // Compute width of the encoding taking into account the f.sharp and f.space flag.
- width := 2 * length
- if width > 0 {
- if f.Space {
- // Each element encoded by two hexadecimals will get a leading 0x or 0X.
- if f.Sharp {
- width *= 2
- }
- // Elements will be separated by a space.
- width += length - 1
- } else if f.Sharp {
- // Only a leading 0x or 0X will be added for the whole string.
- width += 2
- }
- } else { // The byte slice or string that should be encoded is empty.
- if f.WidthPresent {
- f.writePadding(f.Width)
- }
- return
- }
- // Handle padding to the left.
- if f.WidthPresent && f.Width > width && !f.Minus {
- f.writePadding(f.Width - width)
- }
- // Write the encoding directly into the output buffer.
- buf := f.buf
- if f.Sharp {
- // Add leading 0x or 0X.
- buf.WriteByte('0')
- buf.WriteByte(digits[16])
- }
- var c byte
- for i := 0; i < length; i++ {
- if f.Space && i > 0 {
- // Separate elements with a space.
- buf.WriteByte(' ')
- if f.Sharp {
- // Add leading 0x or 0X for each element.
- buf.WriteByte('0')
- buf.WriteByte(digits[16])
- }
- }
- if b != nil {
- c = b[i] // Take a byte from the input byte slice.
- } else {
- c = s[i] // Take a byte from the input string.
- }
- // Encode each byte as two hexadecimal digits.
- buf.WriteByte(digits[c>>4])
- buf.WriteByte(digits[c&0xF])
- }
- // Handle padding to the right.
- if f.WidthPresent && f.Width > width && f.Minus {
- f.writePadding(f.Width - width)
- }
-}
-
-// fmt_sx formats a string as a hexadecimal encoding of its bytes.
-func (f *formatInfo) fmt_sx(s, digits string) {
- f.fmt_sbx(s, nil, digits)
-}
-
-// fmt_bx formats a byte slice as a hexadecimal encoding of its bytes.
-func (f *formatInfo) fmt_bx(b []byte, digits string) {
- f.fmt_sbx("", b, digits)
-}
-
-// fmt_q formats a string as a double-quoted, escaped Go string constant.
-// If f.sharp is set a raw (backquoted) string may be returned instead
-// if the string does not contain any control characters other than tab.
-func (f *formatInfo) fmt_q(s string) {
- s = f.truncate(s)
- if f.Sharp && strconv.CanBackquote(s) {
- f.padString("`" + s + "`")
- return
- }
- buf := f.intbuf[:0]
- if f.Plus {
- f.pad(strconv.AppendQuoteToASCII(buf, s))
- } else {
- f.pad(strconv.AppendQuote(buf, s))
- }
-}
-
-// fmt_c formats an integer as a Unicode character.
-// If the character is not valid Unicode, it will print '\ufffd'.
-func (f *formatInfo) fmt_c(c uint64) {
- r := rune(c)
- if c > utf8.MaxRune {
- r = utf8.RuneError
- }
- buf := f.intbuf[:0]
- w := utf8.EncodeRune(buf[:utf8.UTFMax], r)
- f.pad(buf[:w])
-}
-
-// fmt_qc formats an integer as a single-quoted, escaped Go character constant.
-// If the character is not valid Unicode, it will print '\ufffd'.
-func (f *formatInfo) fmt_qc(c uint64) {
- r := rune(c)
- if c > utf8.MaxRune {
- r = utf8.RuneError
- }
- buf := f.intbuf[:0]
- if f.Plus {
- f.pad(strconv.AppendQuoteRuneToASCII(buf, r))
- } else {
- f.pad(strconv.AppendQuoteRune(buf, r))
- }
-}
-
-// fmt_float formats a float64. It assumes that verb is a valid format specifier
-// for strconv.AppendFloat and therefore fits into a byte.
-func (f *formatInfo) fmt_float(v float64, size int, verb rune, prec int) {
- // Explicit precision in format specifier overrules default precision.
- if f.PrecPresent {
- prec = f.Prec
- }
- // Format number, reserving space for leading + sign if needed.
- num := strconv.AppendFloat(f.intbuf[:1], v, byte(verb), prec, size)
- if num[1] == '-' || num[1] == '+' {
- num = num[1:]
- } else {
- num[0] = '+'
- }
- // f.space means to add a leading space instead of a "+" sign unless
- // the sign is explicitly asked for by f.plus.
- if f.Space && num[0] == '+' && !f.Plus {
- num[0] = ' '
- }
- // Special handling for infinities and NaN,
- // which don't look like a number so shouldn't be padded with zeros.
- if num[1] == 'I' || num[1] == 'N' {
- oldZero := f.Zero
- f.Zero = false
- // Remove sign before NaN if not asked for.
- if num[1] == 'N' && !f.Space && !f.Plus {
- num = num[1:]
- }
- f.pad(num)
- f.Zero = oldZero
- return
- }
- // The sharp flag forces printing a decimal point for non-binary formats
- // and retains trailing zeros, which we may need to restore.
- if f.Sharp && verb != 'b' {
- digits := 0
- switch verb {
- case 'v', 'g', 'G':
- digits = prec
- // If no precision is set explicitly use a precision of 6.
- if digits == -1 {
- digits = 6
- }
- }
-
- // Buffer pre-allocated with enough room for
- // exponent notations of the form "e+123".
- var tailBuf [5]byte
- tail := tailBuf[:0]
-
- hasDecimalPoint := false
- // Starting from i = 1 to skip sign at num[0].
- for i := 1; i < len(num); i++ {
- switch num[i] {
- case '.':
- hasDecimalPoint = true
- case 'e', 'E':
- tail = append(tail, num[i:]...)
- num = num[:i]
- default:
- digits--
- }
- }
- if !hasDecimalPoint {
- num = append(num, '.')
- }
- for digits > 0 {
- num = append(num, '0')
- digits--
- }
- num = append(num, tail...)
- }
- // We want a sign if asked for and if the sign is not positive.
- if f.Plus || num[0] != '+' {
- // If we're zero padding to the left we want the sign before the leading zeros.
- // Achieve this by writing the sign out and then padding the unsigned number.
- if f.Zero && f.WidthPresent && f.Width > len(num) {
- f.buf.WriteByte(num[0])
- f.writePadding(f.Width - len(num))
- f.buf.Write(num[1:])
- return
- }
- f.pad(num)
- return
- }
- // No sign to show and the number is positive; just print the unsigned number.
- f.pad(num[1:])
-}
diff --git a/vendor/golang.org/x/text/message/message.go b/vendor/golang.org/x/text/message/message.go
deleted file mode 100644
index 48d7663..0000000
--- a/vendor/golang.org/x/text/message/message.go
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package message // import "golang.org/x/text/message"
-
-import (
- "io"
- "os"
-
- // Include features to facilitate generated catalogs.
- _ "golang.org/x/text/feature/plural"
-
- "golang.org/x/text/internal/number"
- "golang.org/x/text/language"
- "golang.org/x/text/message/catalog"
-)
-
-// A Printer implements language-specific formatted I/O analogous to the fmt
-// package.
-type Printer struct {
- // the language
- tag language.Tag
-
- toDecimal number.Formatter
- toScientific number.Formatter
-
- cat catalog.Catalog
-}
-
-type options struct {
- cat catalog.Catalog
- // TODO:
- // - allow %s to print integers in written form (tables are likely too large
- // to enable this by default).
- // - list behavior
- //
-}
-
-// An Option defines an option of a Printer.
-type Option func(o *options)
-
-// Catalog defines the catalog to be used.
-func Catalog(c catalog.Catalog) Option {
- return func(o *options) { o.cat = c }
-}
-
-// NewPrinter returns a Printer that formats messages tailored to language t.
-func NewPrinter(t language.Tag, opts ...Option) *Printer {
- options := &options{
- cat: DefaultCatalog,
- }
- for _, o := range opts {
- o(options)
- }
- p := &Printer{
- tag: t,
- cat: options.cat,
- }
- p.toDecimal.InitDecimal(t)
- p.toScientific.InitScientific(t)
- return p
-}
-
-// Sprint is like fmt.Sprint, but using language-specific formatting.
-func (p *Printer) Sprint(a ...interface{}) string {
- pp := newPrinter(p)
- pp.doPrint(a)
- s := pp.String()
- pp.free()
- return s
-}
-
-// Fprint is like fmt.Fprint, but using language-specific formatting.
-func (p *Printer) Fprint(w io.Writer, a ...interface{}) (n int, err error) {
- pp := newPrinter(p)
- pp.doPrint(a)
- n64, err := io.Copy(w, &pp.Buffer)
- pp.free()
- return int(n64), err
-}
-
-// Print is like fmt.Print, but using language-specific formatting.
-func (p *Printer) Print(a ...interface{}) (n int, err error) {
- return p.Fprint(os.Stdout, a...)
-}
-
-// Sprintln is like fmt.Sprintln, but using language-specific formatting.
-func (p *Printer) Sprintln(a ...interface{}) string {
- pp := newPrinter(p)
- pp.doPrintln(a)
- s := pp.String()
- pp.free()
- return s
-}
-
-// Fprintln is like fmt.Fprintln, but using language-specific formatting.
-func (p *Printer) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
- pp := newPrinter(p)
- pp.doPrintln(a)
- n64, err := io.Copy(w, &pp.Buffer)
- pp.free()
- return int(n64), err
-}
-
-// Println is like fmt.Println, but using language-specific formatting.
-func (p *Printer) Println(a ...interface{}) (n int, err error) {
- return p.Fprintln(os.Stdout, a...)
-}
-
-// Sprintf is like fmt.Sprintf, but using language-specific formatting.
-func (p *Printer) Sprintf(key Reference, a ...interface{}) string {
- pp := newPrinter(p)
- lookupAndFormat(pp, key, a)
- s := pp.String()
- pp.free()
- return s
-}
-
-// Fprintf is like fmt.Fprintf, but using language-specific formatting.
-func (p *Printer) Fprintf(w io.Writer, key Reference, a ...interface{}) (n int, err error) {
- pp := newPrinter(p)
- lookupAndFormat(pp, key, a)
- n, err = w.Write(pp.Bytes())
- pp.free()
- return n, err
-
-}
-
-// Printf is like fmt.Printf, but using language-specific formatting.
-func (p *Printer) Printf(key Reference, a ...interface{}) (n int, err error) {
- pp := newPrinter(p)
- lookupAndFormat(pp, key, a)
- n, err = os.Stdout.Write(pp.Bytes())
- pp.free()
- return n, err
-}
-
-func lookupAndFormat(p *printer, r Reference, a []interface{}) {
- p.fmt.Reset(a)
- var id, msg string
- switch v := r.(type) {
- case string:
- id, msg = v, v
- case key:
- id, msg = v.id, v.fallback
- default:
- panic("key argument is not a Reference")
- }
-
- if p.catContext.Execute(id) == catalog.ErrNotFound {
- if p.catContext.Execute(msg) == catalog.ErrNotFound {
- p.Render(msg)
- return
- }
- }
-}
-
-type rawPrinter struct {
- p *printer
-}
-
-func (p rawPrinter) Render(msg string) { p.p.WriteString(msg) }
-func (p rawPrinter) Arg(i int) interface{} { return nil }
-
-// Arg implements catmsg.Renderer.
-func (p *printer) Arg(i int) interface{} { // TODO, also return "ok" bool
- i--
- if uint(i) < uint(len(p.fmt.Args)) {
- return p.fmt.Args[i]
- }
- return nil
-}
-
-// Render implements catmsg.Renderer.
-func (p *printer) Render(msg string) {
- p.doPrintf(msg)
-}
-
-// A Reference is a string or a message reference.
-type Reference interface {
- // TODO: also allow []string
-}
-
-// Key creates a message Reference for a message where the given id is used for
-// message lookup and the fallback is returned when no matches are found.
-func Key(id string, fallback string) Reference {
- return key{id, fallback}
-}
-
-type key struct {
- id, fallback string
-}
diff --git a/vendor/golang.org/x/text/message/print.go b/vendor/golang.org/x/text/message/print.go
deleted file mode 100644
index da304cc..0000000
--- a/vendor/golang.org/x/text/message/print.go
+++ /dev/null
@@ -1,984 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package message
-
-import (
- "bytes"
- "fmt" // TODO: consider copying interfaces from package fmt to avoid dependency.
- "math"
- "reflect"
- "sync"
- "unicode/utf8"
-
- "golang.org/x/text/internal/format"
- "golang.org/x/text/internal/number"
- "golang.org/x/text/language"
- "golang.org/x/text/message/catalog"
-)
-
-// Strings for use with buffer.WriteString.
-// This is less overhead than using buffer.Write with byte arrays.
-const (
- commaSpaceString = ", "
- nilAngleString = ""
- nilParenString = "(nil)"
- nilString = "nil"
- mapString = "map["
- percentBangString = "%!"
- missingString = "(MISSING)"
- badIndexString = "(BADINDEX)"
- panicString = "(PANIC="
- extraString = "%!(EXTRA "
- badWidthString = "%!(BADWIDTH)"
- badPrecString = "%!(BADPREC)"
- noVerbString = "%!(NOVERB)"
-
- invReflectString = ""
-)
-
-var printerPool = sync.Pool{
- New: func() interface{} { return new(printer) },
-}
-
-// newPrinter allocates a new printer struct or grabs a cached one.
-func newPrinter(pp *Printer) *printer {
- p := printerPool.Get().(*printer)
- p.Printer = *pp
- // TODO: cache most of the following call.
- p.catContext = pp.cat.Context(pp.tag, p)
-
- p.panicking = false
- p.erroring = false
- p.fmt.init(&p.Buffer)
- return p
-}
-
-// free saves used printer structs in printerFree; avoids an allocation per invocation.
-func (p *printer) free() {
- p.Buffer.Reset()
- p.arg = nil
- p.value = reflect.Value{}
- printerPool.Put(p)
-}
-
-// printer is used to store a printer's state.
-// It implements "golang.org/x/text/internal/format".State.
-type printer struct {
- Printer
-
- // the context for looking up message translations
- catContext *catalog.Context
-
- // buffer for accumulating output.
- bytes.Buffer
-
- // arg holds the current item, as an interface{}.
- arg interface{}
- // value is used instead of arg for reflect values.
- value reflect.Value
-
- // fmt is used to format basic items such as integers or strings.
- fmt formatInfo
-
- // panicking is set by catchPanic to avoid infinite panic, recover, panic, ... recursion.
- panicking bool
- // erroring is set when printing an error string to guard against calling handleMethods.
- erroring bool
-}
-
-// Language implements "golang.org/x/text/internal/format".State.
-func (p *printer) Language() language.Tag { return p.tag }
-
-func (p *printer) Width() (wid int, ok bool) { return p.fmt.Width, p.fmt.WidthPresent }
-
-func (p *printer) Precision() (prec int, ok bool) { return p.fmt.Prec, p.fmt.PrecPresent }
-
-func (p *printer) Flag(b int) bool {
- switch b {
- case '-':
- return p.fmt.Minus
- case '+':
- return p.fmt.Plus || p.fmt.PlusV
- case '#':
- return p.fmt.Sharp || p.fmt.SharpV
- case ' ':
- return p.fmt.Space
- case '0':
- return p.fmt.Zero
- }
- return false
-}
-
-// getField gets the i'th field of the struct value.
-// If the field is itself is an interface, return a value for
-// the thing inside the interface, not the interface itself.
-func getField(v reflect.Value, i int) reflect.Value {
- val := v.Field(i)
- if val.Kind() == reflect.Interface && !val.IsNil() {
- val = val.Elem()
- }
- return val
-}
-
-func (p *printer) unknownType(v reflect.Value) {
- if !v.IsValid() {
- p.WriteString(nilAngleString)
- return
- }
- p.WriteByte('?')
- p.WriteString(v.Type().String())
- p.WriteByte('?')
-}
-
-func (p *printer) badVerb(verb rune) {
- p.erroring = true
- p.WriteString(percentBangString)
- p.WriteRune(verb)
- p.WriteByte('(')
- switch {
- case p.arg != nil:
- p.WriteString(reflect.TypeOf(p.arg).String())
- p.WriteByte('=')
- p.printArg(p.arg, 'v')
- case p.value.IsValid():
- p.WriteString(p.value.Type().String())
- p.WriteByte('=')
- p.printValue(p.value, 'v', 0)
- default:
- p.WriteString(nilAngleString)
- }
- p.WriteByte(')')
- p.erroring = false
-}
-
-func (p *printer) fmtBool(v bool, verb rune) {
- switch verb {
- case 't', 'v':
- p.fmt.fmt_boolean(v)
- default:
- p.badVerb(verb)
- }
-}
-
-// fmt0x64 formats a uint64 in hexadecimal and prefixes it with 0x or
-// not, as requested, by temporarily setting the sharp flag.
-func (p *printer) fmt0x64(v uint64, leading0x bool) {
- sharp := p.fmt.Sharp
- p.fmt.Sharp = leading0x
- p.fmt.fmt_integer(v, 16, unsigned, ldigits)
- p.fmt.Sharp = sharp
-}
-
-// fmtInteger formats a signed or unsigned integer.
-func (p *printer) fmtInteger(v uint64, isSigned bool, verb rune) {
- switch verb {
- case 'v':
- if p.fmt.SharpV && !isSigned {
- p.fmt0x64(v, true)
- return
- }
- fallthrough
- case 'd':
- if p.fmt.Sharp || p.fmt.SharpV {
- p.fmt.fmt_integer(v, 10, isSigned, ldigits)
- } else {
- p.fmtDecimalInt(v, isSigned)
- }
- case 'b':
- p.fmt.fmt_integer(v, 2, isSigned, ldigits)
- case 'o':
- p.fmt.fmt_integer(v, 8, isSigned, ldigits)
- case 'x':
- p.fmt.fmt_integer(v, 16, isSigned, ldigits)
- case 'X':
- p.fmt.fmt_integer(v, 16, isSigned, udigits)
- case 'c':
- p.fmt.fmt_c(v)
- case 'q':
- if v <= utf8.MaxRune {
- p.fmt.fmt_qc(v)
- } else {
- p.badVerb(verb)
- }
- case 'U':
- p.fmt.fmt_unicode(v)
- default:
- p.badVerb(verb)
- }
-}
-
-// fmtFloat formats a float. The default precision for each verb
-// is specified as last argument in the call to fmt_float.
-func (p *printer) fmtFloat(v float64, size int, verb rune) {
- switch verb {
- case 'b':
- p.fmt.fmt_float(v, size, verb, -1)
- case 'v':
- verb = 'g'
- fallthrough
- case 'g', 'G':
- if p.fmt.Sharp || p.fmt.SharpV {
- p.fmt.fmt_float(v, size, verb, -1)
- } else {
- p.fmtVariableFloat(v, size)
- }
- case 'e', 'E':
- if p.fmt.Sharp || p.fmt.SharpV {
- p.fmt.fmt_float(v, size, verb, 6)
- } else {
- p.fmtScientific(v, size, 6)
- }
- case 'f', 'F':
- if p.fmt.Sharp || p.fmt.SharpV {
- p.fmt.fmt_float(v, size, verb, 6)
- } else {
- p.fmtDecimalFloat(v, size, 6)
- }
- default:
- p.badVerb(verb)
- }
-}
-
-func (p *printer) setFlags(f *number.Formatter) {
- f.Flags &^= number.ElideSign
- if p.fmt.Plus || p.fmt.Space {
- f.Flags |= number.AlwaysSign
- if !p.fmt.Plus {
- f.Flags |= number.ElideSign
- }
- } else {
- f.Flags &^= number.AlwaysSign
- }
-}
-
-func (p *printer) updatePadding(f *number.Formatter) {
- f.Flags &^= number.PadMask
- if p.fmt.Minus {
- f.Flags |= number.PadAfterSuffix
- } else {
- f.Flags |= number.PadBeforePrefix
- }
- f.PadRune = ' '
- f.FormatWidth = uint16(p.fmt.Width)
-}
-
-func (p *printer) initDecimal(minFrac, maxFrac int) {
- f := &p.toDecimal
- f.MinIntegerDigits = 1
- f.MaxIntegerDigits = 0
- f.MinFractionDigits = uint8(minFrac)
- f.MaxFractionDigits = int16(maxFrac)
- p.setFlags(f)
- f.PadRune = 0
- if p.fmt.WidthPresent {
- if p.fmt.Zero {
- wid := p.fmt.Width
- // Use significant integers for this.
- // TODO: this is not the same as width, but so be it.
- if f.MinFractionDigits > 0 {
- wid -= 1 + int(f.MinFractionDigits)
- }
- if p.fmt.Plus || p.fmt.Space {
- wid--
- }
- if wid > 0 && wid > int(f.MinIntegerDigits) {
- f.MinIntegerDigits = uint8(wid)
- }
- }
- p.updatePadding(f)
- }
-}
-
-func (p *printer) initScientific(minFrac, maxFrac int) {
- f := &p.toScientific
- if maxFrac < 0 {
- f.SetPrecision(maxFrac)
- } else {
- f.SetPrecision(maxFrac + 1)
- f.MinFractionDigits = uint8(minFrac)
- f.MaxFractionDigits = int16(maxFrac)
- }
- f.MinExponentDigits = 2
- p.setFlags(f)
- f.PadRune = 0
- if p.fmt.WidthPresent {
- f.Flags &^= number.PadMask
- if p.fmt.Zero {
- f.PadRune = f.Digit(0)
- f.Flags |= number.PadAfterPrefix
- } else {
- f.PadRune = ' '
- f.Flags |= number.PadBeforePrefix
- }
- p.updatePadding(f)
- }
-}
-
-func (p *printer) fmtDecimalInt(v uint64, isSigned bool) {
- var d number.Decimal
-
- f := &p.toDecimal
- if p.fmt.PrecPresent {
- p.setFlags(f)
- f.MinIntegerDigits = uint8(p.fmt.Prec)
- f.MaxIntegerDigits = 0
- f.MinFractionDigits = 0
- f.MaxFractionDigits = 0
- if p.fmt.WidthPresent {
- p.updatePadding(f)
- }
- } else {
- p.initDecimal(0, 0)
- }
- d.ConvertInt(p.toDecimal.RoundingContext, isSigned, v)
-
- out := p.toDecimal.Format([]byte(nil), &d)
- p.Buffer.Write(out)
-}
-
-func (p *printer) fmtDecimalFloat(v float64, size, prec int) {
- var d number.Decimal
- if p.fmt.PrecPresent {
- prec = p.fmt.Prec
- }
- p.initDecimal(prec, prec)
- d.ConvertFloat(p.toDecimal.RoundingContext, v, size)
-
- out := p.toDecimal.Format([]byte(nil), &d)
- p.Buffer.Write(out)
-}
-
-func (p *printer) fmtVariableFloat(v float64, size int) {
- prec := -1
- if p.fmt.PrecPresent {
- prec = p.fmt.Prec
- }
- var d number.Decimal
- p.initScientific(0, prec)
- d.ConvertFloat(p.toScientific.RoundingContext, v, size)
-
- // Copy logic of 'g' formatting from strconv. It is simplified a bit as
- // we don't have to mind having prec > len(d.Digits).
- shortest := prec < 0
- ePrec := prec
- if shortest {
- prec = len(d.Digits)
- ePrec = 6
- } else if prec == 0 {
- prec = 1
- ePrec = 1
- }
- exp := int(d.Exp) - 1
- if exp < -4 || exp >= ePrec {
- p.initScientific(0, prec)
-
- out := p.toScientific.Format([]byte(nil), &d)
- p.Buffer.Write(out)
- } else {
- if prec > int(d.Exp) {
- prec = len(d.Digits)
- }
- if prec -= int(d.Exp); prec < 0 {
- prec = 0
- }
- p.initDecimal(0, prec)
-
- out := p.toDecimal.Format([]byte(nil), &d)
- p.Buffer.Write(out)
- }
-}
-
-func (p *printer) fmtScientific(v float64, size, prec int) {
- var d number.Decimal
- if p.fmt.PrecPresent {
- prec = p.fmt.Prec
- }
- p.initScientific(prec, prec)
- rc := p.toScientific.RoundingContext
- d.ConvertFloat(rc, v, size)
-
- out := p.toScientific.Format([]byte(nil), &d)
- p.Buffer.Write(out)
-
-}
-
-// fmtComplex formats a complex number v with
-// r = real(v) and j = imag(v) as (r+ji) using
-// fmtFloat for r and j formatting.
-func (p *printer) fmtComplex(v complex128, size int, verb rune) {
- // Make sure any unsupported verbs are found before the
- // calls to fmtFloat to not generate an incorrect error string.
- switch verb {
- case 'v', 'b', 'g', 'G', 'f', 'F', 'e', 'E':
- p.WriteByte('(')
- p.fmtFloat(real(v), size/2, verb)
- // Imaginary part always has a sign.
- if math.IsNaN(imag(v)) {
- // By CLDR's rules, NaNs do not use patterns or signs. As this code
- // relies on AlwaysSign working for imaginary parts, we need to
- // manually handle NaNs.
- f := &p.toScientific
- p.setFlags(f)
- p.updatePadding(f)
- p.setFlags(f)
- nan := f.Symbol(number.SymNan)
- extra := 0
- if w, ok := p.Width(); ok {
- extra = w - utf8.RuneCountInString(nan) - 1
- }
- if f.Flags&number.PadAfterNumber == 0 {
- for ; extra > 0; extra-- {
- p.WriteRune(f.PadRune)
- }
- }
- p.WriteString(f.Symbol(number.SymPlusSign))
- p.WriteString(nan)
- for ; extra > 0; extra-- {
- p.WriteRune(f.PadRune)
- }
- p.WriteString("i)")
- return
- }
- oldPlus := p.fmt.Plus
- p.fmt.Plus = true
- p.fmtFloat(imag(v), size/2, verb)
- p.WriteString("i)") // TODO: use symbol?
- p.fmt.Plus = oldPlus
- default:
- p.badVerb(verb)
- }
-}
-
-func (p *printer) fmtString(v string, verb rune) {
- switch verb {
- case 'v':
- if p.fmt.SharpV {
- p.fmt.fmt_q(v)
- } else {
- p.fmt.fmt_s(v)
- }
- case 's':
- p.fmt.fmt_s(v)
- case 'x':
- p.fmt.fmt_sx(v, ldigits)
- case 'X':
- p.fmt.fmt_sx(v, udigits)
- case 'q':
- p.fmt.fmt_q(v)
- case 'm':
- ctx := p.cat.Context(p.tag, rawPrinter{p})
- if ctx.Execute(v) == catalog.ErrNotFound {
- p.WriteString(v)
- }
- default:
- p.badVerb(verb)
- }
-}
-
-func (p *printer) fmtBytes(v []byte, verb rune, typeString string) {
- switch verb {
- case 'v', 'd':
- if p.fmt.SharpV {
- p.WriteString(typeString)
- if v == nil {
- p.WriteString(nilParenString)
- return
- }
- p.WriteByte('{')
- for i, c := range v {
- if i > 0 {
- p.WriteString(commaSpaceString)
- }
- p.fmt0x64(uint64(c), true)
- }
- p.WriteByte('}')
- } else {
- p.WriteByte('[')
- for i, c := range v {
- if i > 0 {
- p.WriteByte(' ')
- }
- p.fmt.fmt_integer(uint64(c), 10, unsigned, ldigits)
- }
- p.WriteByte(']')
- }
- case 's':
- p.fmt.fmt_s(string(v))
- case 'x':
- p.fmt.fmt_bx(v, ldigits)
- case 'X':
- p.fmt.fmt_bx(v, udigits)
- case 'q':
- p.fmt.fmt_q(string(v))
- default:
- p.printValue(reflect.ValueOf(v), verb, 0)
- }
-}
-
-func (p *printer) fmtPointer(value reflect.Value, verb rune) {
- var u uintptr
- switch value.Kind() {
- case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
- u = value.Pointer()
- default:
- p.badVerb(verb)
- return
- }
-
- switch verb {
- case 'v':
- if p.fmt.SharpV {
- p.WriteByte('(')
- p.WriteString(value.Type().String())
- p.WriteString(")(")
- if u == 0 {
- p.WriteString(nilString)
- } else {
- p.fmt0x64(uint64(u), true)
- }
- p.WriteByte(')')
- } else {
- if u == 0 {
- p.fmt.padString(nilAngleString)
- } else {
- p.fmt0x64(uint64(u), !p.fmt.Sharp)
- }
- }
- case 'p':
- p.fmt0x64(uint64(u), !p.fmt.Sharp)
- case 'b', 'o', 'd', 'x', 'X':
- if verb == 'd' {
- p.fmt.Sharp = true // Print as standard go. TODO: does this make sense?
- }
- p.fmtInteger(uint64(u), unsigned, verb)
- default:
- p.badVerb(verb)
- }
-}
-
-func (p *printer) catchPanic(arg interface{}, verb rune) {
- if err := recover(); err != nil {
- // If it's a nil pointer, just say "". The likeliest causes are a
- // Stringer that fails to guard against nil or a nil pointer for a
- // value receiver, and in either case, "" is a nice result.
- if v := reflect.ValueOf(arg); v.Kind() == reflect.Ptr && v.IsNil() {
- p.WriteString(nilAngleString)
- return
- }
- // Otherwise print a concise panic message. Most of the time the panic
- // value will print itself nicely.
- if p.panicking {
- // Nested panics; the recursion in printArg cannot succeed.
- panic(err)
- }
-
- oldFlags := p.fmt.Parser
- // For this output we want default behavior.
- p.fmt.ClearFlags()
-
- p.WriteString(percentBangString)
- p.WriteRune(verb)
- p.WriteString(panicString)
- p.panicking = true
- p.printArg(err, 'v')
- p.panicking = false
- p.WriteByte(')')
-
- p.fmt.Parser = oldFlags
- }
-}
-
-func (p *printer) handleMethods(verb rune) (handled bool) {
- if p.erroring {
- return
- }
- // Is it a Formatter?
- if formatter, ok := p.arg.(format.Formatter); ok {
- handled = true
- defer p.catchPanic(p.arg, verb)
- formatter.Format(p, verb)
- return
- }
- if formatter, ok := p.arg.(fmt.Formatter); ok {
- handled = true
- defer p.catchPanic(p.arg, verb)
- formatter.Format(p, verb)
- return
- }
-
- // If we're doing Go syntax and the argument knows how to supply it, take care of it now.
- if p.fmt.SharpV {
- if stringer, ok := p.arg.(fmt.GoStringer); ok {
- handled = true
- defer p.catchPanic(p.arg, verb)
- // Print the result of GoString unadorned.
- p.fmt.fmt_s(stringer.GoString())
- return
- }
- } else {
- // If a string is acceptable according to the format, see if
- // the value satisfies one of the string-valued interfaces.
- // Println etc. set verb to %v, which is "stringable".
- switch verb {
- case 'v', 's', 'x', 'X', 'q':
- // Is it an error or Stringer?
- // The duplication in the bodies is necessary:
- // setting handled and deferring catchPanic
- // must happen before calling the method.
- switch v := p.arg.(type) {
- case error:
- handled = true
- defer p.catchPanic(p.arg, verb)
- p.fmtString(v.Error(), verb)
- return
-
- case fmt.Stringer:
- handled = true
- defer p.catchPanic(p.arg, verb)
- p.fmtString(v.String(), verb)
- return
- }
- }
- }
- return false
-}
-
-func (p *printer) printArg(arg interface{}, verb rune) {
- p.arg = arg
- p.value = reflect.Value{}
-
- if arg == nil {
- switch verb {
- case 'T', 'v':
- p.fmt.padString(nilAngleString)
- default:
- p.badVerb(verb)
- }
- return
- }
-
- // Special processing considerations.
- // %T (the value's type) and %p (its address) are special; we always do them first.
- switch verb {
- case 'T':
- p.fmt.fmt_s(reflect.TypeOf(arg).String())
- return
- case 'p':
- p.fmtPointer(reflect.ValueOf(arg), 'p')
- return
- }
-
- // Some types can be done without reflection.
- switch f := arg.(type) {
- case bool:
- p.fmtBool(f, verb)
- case float32:
- p.fmtFloat(float64(f), 32, verb)
- case float64:
- p.fmtFloat(f, 64, verb)
- case complex64:
- p.fmtComplex(complex128(f), 64, verb)
- case complex128:
- p.fmtComplex(f, 128, verb)
- case int:
- p.fmtInteger(uint64(f), signed, verb)
- case int8:
- p.fmtInteger(uint64(f), signed, verb)
- case int16:
- p.fmtInteger(uint64(f), signed, verb)
- case int32:
- p.fmtInteger(uint64(f), signed, verb)
- case int64:
- p.fmtInteger(uint64(f), signed, verb)
- case uint:
- p.fmtInteger(uint64(f), unsigned, verb)
- case uint8:
- p.fmtInteger(uint64(f), unsigned, verb)
- case uint16:
- p.fmtInteger(uint64(f), unsigned, verb)
- case uint32:
- p.fmtInteger(uint64(f), unsigned, verb)
- case uint64:
- p.fmtInteger(f, unsigned, verb)
- case uintptr:
- p.fmtInteger(uint64(f), unsigned, verb)
- case string:
- p.fmtString(f, verb)
- case []byte:
- p.fmtBytes(f, verb, "[]byte")
- case reflect.Value:
- // Handle extractable values with special methods
- // since printValue does not handle them at depth 0.
- if f.IsValid() && f.CanInterface() {
- p.arg = f.Interface()
- if p.handleMethods(verb) {
- return
- }
- }
- p.printValue(f, verb, 0)
- default:
- // If the type is not simple, it might have methods.
- if !p.handleMethods(verb) {
- // Need to use reflection, since the type had no
- // interface methods that could be used for formatting.
- p.printValue(reflect.ValueOf(f), verb, 0)
- }
- }
-}
-
-// printValue is similar to printArg but starts with a reflect value, not an interface{} value.
-// It does not handle 'p' and 'T' verbs because these should have been already handled by printArg.
-func (p *printer) printValue(value reflect.Value, verb rune, depth int) {
- // Handle values with special methods if not already handled by printArg (depth == 0).
- if depth > 0 && value.IsValid() && value.CanInterface() {
- p.arg = value.Interface()
- if p.handleMethods(verb) {
- return
- }
- }
- p.arg = nil
- p.value = value
-
- switch f := value; value.Kind() {
- case reflect.Invalid:
- if depth == 0 {
- p.WriteString(invReflectString)
- } else {
- switch verb {
- case 'v':
- p.WriteString(nilAngleString)
- default:
- p.badVerb(verb)
- }
- }
- case reflect.Bool:
- p.fmtBool(f.Bool(), verb)
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- p.fmtInteger(uint64(f.Int()), signed, verb)
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- p.fmtInteger(f.Uint(), unsigned, verb)
- case reflect.Float32:
- p.fmtFloat(f.Float(), 32, verb)
- case reflect.Float64:
- p.fmtFloat(f.Float(), 64, verb)
- case reflect.Complex64:
- p.fmtComplex(f.Complex(), 64, verb)
- case reflect.Complex128:
- p.fmtComplex(f.Complex(), 128, verb)
- case reflect.String:
- p.fmtString(f.String(), verb)
- case reflect.Map:
- if p.fmt.SharpV {
- p.WriteString(f.Type().String())
- if f.IsNil() {
- p.WriteString(nilParenString)
- return
- }
- p.WriteByte('{')
- } else {
- p.WriteString(mapString)
- }
- keys := f.MapKeys()
- for i, key := range keys {
- if i > 0 {
- if p.fmt.SharpV {
- p.WriteString(commaSpaceString)
- } else {
- p.WriteByte(' ')
- }
- }
- p.printValue(key, verb, depth+1)
- p.WriteByte(':')
- p.printValue(f.MapIndex(key), verb, depth+1)
- }
- if p.fmt.SharpV {
- p.WriteByte('}')
- } else {
- p.WriteByte(']')
- }
- case reflect.Struct:
- if p.fmt.SharpV {
- p.WriteString(f.Type().String())
- }
- p.WriteByte('{')
- for i := 0; i < f.NumField(); i++ {
- if i > 0 {
- if p.fmt.SharpV {
- p.WriteString(commaSpaceString)
- } else {
- p.WriteByte(' ')
- }
- }
- if p.fmt.PlusV || p.fmt.SharpV {
- if name := f.Type().Field(i).Name; name != "" {
- p.WriteString(name)
- p.WriteByte(':')
- }
- }
- p.printValue(getField(f, i), verb, depth+1)
- }
- p.WriteByte('}')
- case reflect.Interface:
- value := f.Elem()
- if !value.IsValid() {
- if p.fmt.SharpV {
- p.WriteString(f.Type().String())
- p.WriteString(nilParenString)
- } else {
- p.WriteString(nilAngleString)
- }
- } else {
- p.printValue(value, verb, depth+1)
- }
- case reflect.Array, reflect.Slice:
- switch verb {
- case 's', 'q', 'x', 'X':
- // Handle byte and uint8 slices and arrays special for the above verbs.
- t := f.Type()
- if t.Elem().Kind() == reflect.Uint8 {
- var bytes []byte
- if f.Kind() == reflect.Slice {
- bytes = f.Bytes()
- } else if f.CanAddr() {
- bytes = f.Slice(0, f.Len()).Bytes()
- } else {
- // We have an array, but we cannot Slice() a non-addressable array,
- // so we build a slice by hand. This is a rare case but it would be nice
- // if reflection could help a little more.
- bytes = make([]byte, f.Len())
- for i := range bytes {
- bytes[i] = byte(f.Index(i).Uint())
- }
- }
- p.fmtBytes(bytes, verb, t.String())
- return
- }
- }
- if p.fmt.SharpV {
- p.WriteString(f.Type().String())
- if f.Kind() == reflect.Slice && f.IsNil() {
- p.WriteString(nilParenString)
- return
- }
- p.WriteByte('{')
- for i := 0; i < f.Len(); i++ {
- if i > 0 {
- p.WriteString(commaSpaceString)
- }
- p.printValue(f.Index(i), verb, depth+1)
- }
- p.WriteByte('}')
- } else {
- p.WriteByte('[')
- for i := 0; i < f.Len(); i++ {
- if i > 0 {
- p.WriteByte(' ')
- }
- p.printValue(f.Index(i), verb, depth+1)
- }
- p.WriteByte(']')
- }
- case reflect.Ptr:
- // pointer to array or slice or struct? ok at top level
- // but not embedded (avoid loops)
- if depth == 0 && f.Pointer() != 0 {
- switch a := f.Elem(); a.Kind() {
- case reflect.Array, reflect.Slice, reflect.Struct, reflect.Map:
- p.WriteByte('&')
- p.printValue(a, verb, depth+1)
- return
- }
- }
- fallthrough
- case reflect.Chan, reflect.Func, reflect.UnsafePointer:
- p.fmtPointer(f, verb)
- default:
- p.unknownType(f)
- }
-}
-
-func (p *printer) badArgNum(verb rune) {
- p.WriteString(percentBangString)
- p.WriteRune(verb)
- p.WriteString(badIndexString)
-}
-
-func (p *printer) missingArg(verb rune) {
- p.WriteString(percentBangString)
- p.WriteRune(verb)
- p.WriteString(missingString)
-}
-
-func (p *printer) doPrintf(fmt string) {
- for p.fmt.Parser.SetFormat(fmt); p.fmt.Scan(); {
- switch p.fmt.Status {
- case format.StatusText:
- p.WriteString(p.fmt.Text())
- case format.StatusSubstitution:
- p.printArg(p.Arg(p.fmt.ArgNum), p.fmt.Verb)
- case format.StatusBadWidthSubstitution:
- p.WriteString(badWidthString)
- p.printArg(p.Arg(p.fmt.ArgNum), p.fmt.Verb)
- case format.StatusBadPrecSubstitution:
- p.WriteString(badPrecString)
- p.printArg(p.Arg(p.fmt.ArgNum), p.fmt.Verb)
- case format.StatusNoVerb:
- p.WriteString(noVerbString)
- case format.StatusBadArgNum:
- p.badArgNum(p.fmt.Verb)
- case format.StatusMissingArg:
- p.missingArg(p.fmt.Verb)
- default:
- panic("unreachable")
- }
- }
-
- // Check for extra arguments, but only if there was at least one ordered
- // argument. Note that this behavior is necessarily different from fmt:
- // different variants of messages may opt to drop some or all of the
- // arguments.
- if !p.fmt.Reordered && p.fmt.ArgNum < len(p.fmt.Args) && p.fmt.ArgNum != 0 {
- p.fmt.ClearFlags()
- p.WriteString(extraString)
- for i, arg := range p.fmt.Args[p.fmt.ArgNum:] {
- if i > 0 {
- p.WriteString(commaSpaceString)
- }
- if arg == nil {
- p.WriteString(nilAngleString)
- } else {
- p.WriteString(reflect.TypeOf(arg).String())
- p.WriteString("=")
- p.printArg(arg, 'v')
- }
- }
- p.WriteByte(')')
- }
-}
-
-func (p *printer) doPrint(a []interface{}) {
- prevString := false
- for argNum, arg := range a {
- isString := arg != nil && reflect.TypeOf(arg).Kind() == reflect.String
- // Add a space between two non-string arguments.
- if argNum > 0 && !isString && !prevString {
- p.WriteByte(' ')
- }
- p.printArg(arg, 'v')
- prevString = isString
- }
-}
-
-// doPrintln is like doPrint but always adds a space between arguments
-// and a newline after the last argument.
-func (p *printer) doPrintln(a []interface{}) {
- for argNum, arg := range a {
- if argNum > 0 {
- p.WriteByte(' ')
- }
- p.printArg(arg, 'v')
- }
- p.WriteByte('\n')
-}
diff --git a/vendor/golang.org/x/text/number/doc.go b/vendor/golang.org/x/text/number/doc.go
deleted file mode 100644
index 8766230..0000000
--- a/vendor/golang.org/x/text/number/doc.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package number formats numbers according to the customs of different locales.
-//
-// The number formats of this package allow for greater formatting flexibility
-// than passing values to message.Printf calls as is. It currently supports the
-// builtin Go types and anything that implements the Convert interface
-// (currently internal).
-//
-// p := message.NewPrinter(language.English)
-//
-// p.Printf("%v bottles of beer on the wall.", number.Decimal(1234))
-// // Prints: 1,234 bottles of beer on the wall.
-//
-// p.Printf("%v of gophers lose too much fur", number.Percent(0.12))
-// // Prints: 12% of gophers lose too much fur.
-//
-// p := message.NewPrinter(language.Dutch)
-//
-// p.Printf("There are %v bikes per household.", number.Decimal(1.2))
-// // Prints: Er zijn 1,2 fietsen per huishouden.
-//
-// The width and scale specified in the formatting directives override the
-// configuration of the formatter.
-package number
diff --git a/vendor/golang.org/x/text/number/format.go b/vendor/golang.org/x/text/number/format.go
deleted file mode 100644
index f2bdfdc..0000000
--- a/vendor/golang.org/x/text/number/format.go
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package number
-
-import (
- "fmt"
- "strings"
-
- "golang.org/x/text/feature/plural"
- "golang.org/x/text/internal/format"
- "golang.org/x/text/internal/number"
- "golang.org/x/text/language"
-)
-
-// A FormatFunc formats a number.
-type FormatFunc func(x interface{}, opts ...Option) Formatter
-
-// NewFormat creates a FormatFunc based on another FormatFunc and new options.
-// Use NewFormat to cash the creation of formatters.
-func NewFormat(format FormatFunc, opts ...Option) FormatFunc {
- o := *format(nil).options
- n := len(o.options)
- o.options = append(o.options[:n:n], opts...)
- return func(x interface{}, opts ...Option) Formatter {
- return newFormatter(&o, opts, x)
- }
-}
-
-type options struct {
- verbs string
- initFunc initFunc
- options []Option
- pluralFunc func(t language.Tag, scale int) (f plural.Form, n int)
-}
-
-type optionFlag uint16
-
-const (
- hasScale optionFlag = 1 << iota
- hasPrecision
- noSeparator
- exact
-)
-
-type initFunc func(f *number.Formatter, t language.Tag)
-
-func newFormatter(o *options, opts []Option, value interface{}) Formatter {
- if len(opts) > 0 {
- n := *o
- n.options = opts
- o = &n
- }
- return Formatter{o, value}
-}
-
-func newOptions(verbs string, f initFunc) *options {
- return &options{verbs: verbs, initFunc: f}
-}
-
-type Formatter struct {
- *options
- value interface{}
-}
-
-// Format implements format.Formatter. It is for internal use only for now.
-func (f Formatter) Format(state format.State, verb rune) {
- // TODO: consider implementing fmt.Formatter instead and using the following
- // piece of code. This allows numbers to be rendered mostly as expected
- // when using fmt. But it may get weird with the spellout options and we
- // may need more of format.State over time.
- // lang := language.Und
- // if s, ok := state.(format.State); ok {
- // lang = s.Language()
- // }
-
- lang := state.Language()
- if !strings.Contains(f.verbs, string(verb)) {
- fmt.Fprintf(state, "%%!%s(%T=%v)", string(verb), f.value, f.value)
- return
- }
- var p number.Formatter
- f.initFunc(&p, lang)
- for _, o := range f.options.options {
- o(lang, &p)
- }
- if w, ok := state.Width(); ok {
- p.FormatWidth = uint16(w)
- }
- if prec, ok := state.Precision(); ok {
- switch verb {
- case 'd':
- p.SetScale(0)
- case 'f':
- p.SetScale(prec)
- case 'e':
- p.SetPrecision(prec + 1)
- case 'g':
- p.SetPrecision(prec)
- }
- }
- var d number.Decimal
- d.Convert(p.RoundingContext, f.value)
- state.Write(p.Format(nil, &d))
-}
-
-// Digits returns information about which logical digits will be presented to
-// the user. This information is relevant, for instance, to determine plural
-// forms.
-func (f Formatter) Digits(buf []byte, tag language.Tag, scale int) number.Digits {
- var p number.Formatter
- f.initFunc(&p, tag)
- if scale >= 0 {
- // TODO: this only works well for decimal numbers, which is generally
- // fine.
- p.SetScale(scale)
- }
- var d number.Decimal
- d.Convert(p.RoundingContext, f.value)
- return number.FormatDigits(&d, p.RoundingContext)
-}
diff --git a/vendor/golang.org/x/text/number/number.go b/vendor/golang.org/x/text/number/number.go
deleted file mode 100644
index f5ca93b..0000000
--- a/vendor/golang.org/x/text/number/number.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package number
-
-// TODO:
-// p.Printf("The gauge was at %v.", number.Spell(number.Percent(23)))
-// // Prints: The gauge was at twenty-three percent.
-//
-// p.Printf("From here to %v!", number.Spell(math.Inf()))
-// // Prints: From here to infinity!
-//
-
-import (
- "golang.org/x/text/internal/number"
-)
-
-const (
- decimalVerbs = "vfgd"
- scientificVerbs = "veg"
-)
-
-// Decimal formats a number as a floating point decimal.
-func Decimal(x interface{}, opts ...Option) Formatter {
- return newFormatter(decimalOptions, opts, x)
-}
-
-var decimalOptions = newOptions(decimalVerbs, (*number.Formatter).InitDecimal)
-
-// Scientific formats a number in scientific format.
-func Scientific(x interface{}, opts ...Option) Formatter {
- return newFormatter(scientificOptions, opts, x)
-}
-
-var scientificOptions = newOptions(scientificVerbs, (*number.Formatter).InitScientific)
-
-// Engineering formats a number using engineering notation, which is like
-// scientific notation, but with the exponent normalized to multiples of 3.
-func Engineering(x interface{}, opts ...Option) Formatter {
- return newFormatter(engineeringOptions, opts, x)
-}
-
-var engineeringOptions = newOptions(scientificVerbs, (*number.Formatter).InitEngineering)
-
-// Percent formats a number as a percentage. A value of 1.0 means 100%.
-func Percent(x interface{}, opts ...Option) Formatter {
- return newFormatter(percentOptions, opts, x)
-}
-
-var percentOptions = newOptions(decimalVerbs, (*number.Formatter).InitPercent)
-
-// PerMille formats a number as a per mille indication. A value of 1.0 means
-// 1000‰.
-func PerMille(x interface{}, opts ...Option) Formatter {
- return newFormatter(perMilleOptions, opts, x)
-}
-
-var perMilleOptions = newOptions(decimalVerbs, (*number.Formatter).InitPerMille)
-
-// TODO:
-// - Shortest: akin to verb 'g' of 'G'
-//
-// TODO: RBNF forms:
-// - Compact: 1M 3.5T
-// - CompactBinary: 1Mi 3.5Ti
-// - Long: 1 million
-// - Ordinal:
-// - Roman: MCMIIXX
-// - RomanSmall: mcmiixx
-// - Text: numbers as it typically appears in running text, allowing
-// language-specific choices for when to use numbers and when to use words.
-// - Spell?: spelled-out number. Maybe just allow as an option?
-
-// NOTE: both spelled-out numbers and ordinals, to render correctly, need
-// detailed linguistic information from the translated string into which they
-// are substituted. We will need to implement that first.
diff --git a/vendor/golang.org/x/text/number/option.go b/vendor/golang.org/x/text/number/option.go
deleted file mode 100644
index eab1e3b..0000000
--- a/vendor/golang.org/x/text/number/option.go
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package number
-
-import (
- "fmt"
-
- "golang.org/x/text/internal/number"
- "golang.org/x/text/language"
-)
-
-// An Option configures a Formatter.
-type Option option
-
-type option func(tag language.Tag, f *number.Formatter)
-
-// TODO: SpellOut requires support of the ICU RBNF format.
-// func SpellOut() Option
-
-// NoSeparator causes a number to be displayed without grouping separators.
-func NoSeparator() Option {
- return func(t language.Tag, f *number.Formatter) {
- f.GroupingSize = [2]uint8{}
- }
-}
-
-// MaxIntegerDigits limits the number of integer digits, eliminating the
-// most significant digits.
-func MaxIntegerDigits(max int) Option {
- return func(t language.Tag, f *number.Formatter) {
- if max >= 1<<8 {
- max = (1 << 8) - 1
- }
- f.MaxIntegerDigits = uint8(max)
- }
-}
-
-// MinIntegerDigits specifies the minimum number of integer digits, adding
-// leading zeros when needed.
-func MinIntegerDigits(min int) Option {
- return func(t language.Tag, f *number.Formatter) {
- if min >= 1<<8 {
- min = (1 << 8) - 1
- }
- f.MinIntegerDigits = uint8(min)
- }
-}
-
-// MaxFractionDigits specifies the maximum number of fractional digits.
-func MaxFractionDigits(max int) Option {
- return func(t language.Tag, f *number.Formatter) {
- if max >= 1<<15 {
- max = (1 << 15) - 1
- }
- f.MaxFractionDigits = int16(max)
- }
-}
-
-// MinFractionDigits specifies the minimum number of fractional digits.
-func MinFractionDigits(min int) Option {
- return func(t language.Tag, f *number.Formatter) {
- if min >= 1<<8 {
- min = (1 << 8) - 1
- }
- f.MinFractionDigits = uint8(min)
- }
-}
-
-// Precision sets the maximum number of significant digits. A negative value
-// means exact.
-func Precision(prec int) Option {
- return func(t language.Tag, f *number.Formatter) {
- f.SetPrecision(prec)
- }
-}
-
-// Scale simultaneously sets MinFractionDigits and MaxFractionDigits to the
-// given value.
-func Scale(decimals int) Option {
- return func(t language.Tag, f *number.Formatter) {
- f.SetScale(decimals)
- }
-}
-
-// IncrementString sets the incremental value to which numbers should be
-// rounded. For instance: Increment("0.05") will cause 1.44 to round to 1.45.
-// IncrementString also sets scale to the scale of the increment.
-func IncrementString(decimal string) Option {
- increment := 0
- scale := 0
- d := decimal
- p := 0
- for ; p < len(d) && '0' <= d[p] && d[p] <= '9'; p++ {
- increment *= 10
- increment += int(d[p]) - '0'
- }
- if p < len(d) && d[p] == '.' {
- for p++; p < len(d) && '0' <= d[p] && d[p] <= '9'; p++ {
- increment *= 10
- increment += int(d[p]) - '0'
- scale++
- }
- }
- if p < len(d) {
- increment = 0
- scale = 0
- }
- return func(t language.Tag, f *number.Formatter) {
- f.Increment = uint32(increment)
- f.IncrementScale = uint8(scale)
- f.SetScale(scale)
- }
-}
-
-func noop(language.Tag, *number.Formatter) {}
-
-// PatternOverrides allows users to specify alternative patterns for specific
-// languages. The Pattern will be overridden for all languages in a subgroup as
-// well. The function will panic for invalid input. It is best to create this
-// option at startup time.
-// PatternOverrides must be the first Option passed to a formatter.
-func PatternOverrides(patterns map[string]string) Option {
- // TODO: make it so that it does not have to be the first option.
- // TODO: use -x-nochild to indicate it does not override child tags.
- m := map[language.Tag]*number.Pattern{}
- for k, v := range patterns {
- tag := language.MustParse(k)
- p, err := number.ParsePattern(v)
- if err != nil {
- panic(fmt.Errorf("number: PatternOverrides: %v", err))
- }
- m[tag] = p
- }
- return func(t language.Tag, f *number.Formatter) {
- // TODO: Use language grouping relation instead of parent relation.
- // TODO: Should parent implement the grouping relation?
- for lang := t; ; lang = t.Parent() {
- if p, ok := m[lang]; ok {
- f.Pattern = *p
- break
- }
- if lang == language.Und {
- break
- }
- }
- }
-}
-
-// FormatWidth sets the total format width.
-func FormatWidth(n int) Option {
- if n <= 0 {
- return noop
- }
- return func(t language.Tag, f *number.Formatter) {
- f.FormatWidth = uint16(n)
- if f.PadRune == 0 {
- f.PadRune = ' '
- }
- }
-}
-
-// Pad sets the rune to be used for filling up to the format width.
-func Pad(r rune) Option {
- return func(t language.Tag, f *number.Formatter) {
- f.PadRune = r
- }
-}
-
-// TODO:
-// - FormatPosition (using type aliasing?)
-// - Multiplier: find a better way to represent and figure out what to do
-// with clashes with percent/permille.
-// - NumberingSystem(nu string): not accessible in number.Info now. Also, should
-// this be keyed by language or generic?
-// - SymbolOverrides(symbols map[string]map[number.SymbolType]string) Option
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/.gitignore b/vendor/gopkg.in/cenkalti/backoff.v1/.gitignore
deleted file mode 100644
index 0026861..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/.travis.yml b/vendor/gopkg.in/cenkalti/backoff.v1/.travis.yml
deleted file mode 100644
index 1040404..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: go
-go:
- - 1.3.3
- - tip
-before_install:
- - go get github.com/mattn/goveralls
- - go get golang.org/x/tools/cmd/cover
-script:
- - $HOME/gopath/bin/goveralls -service=travis-ci
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/LICENSE b/vendor/gopkg.in/cenkalti/backoff.v1/LICENSE
deleted file mode 100644
index 89b8179..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Cenk Altı
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/README.md b/vendor/gopkg.in/cenkalti/backoff.v1/README.md
deleted file mode 100644
index 13b347f..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls]
-
-This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].
-
-[Exponential backoff][exponential backoff wiki]
-is an algorithm that uses feedback to multiplicatively decrease the rate of some process,
-in order to gradually find an acceptable rate.
-The retries exponentially increase and stop increasing when a certain threshold is met.
-
-## Usage
-
-See https://godoc.org/github.com/cenkalti/backoff#pkg-examples
-
-## Contributing
-
-* I would like to keep this library as small as possible.
-* Please don't send a PR without opening an issue and discussing it first.
-* If proposed change is not a common use case, I will probably not accept it.
-
-[godoc]: https://godoc.org/github.com/cenkalti/backoff
-[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png
-[travis]: https://travis-ci.org/cenkalti/backoff
-[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master
-[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master
-[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master
-
-[google-http-java-client]: https://github.com/google/google-http-java-client
-[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff
-
-[advanced example]: https://godoc.org/github.com/cenkalti/backoff#example_
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/backoff.go b/vendor/gopkg.in/cenkalti/backoff.v1/backoff.go
deleted file mode 100644
index 2102c5f..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/backoff.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Package backoff implements backoff algorithms for retrying operations.
-//
-// Use Retry function for retrying operations that may fail.
-// If Retry does not meet your needs,
-// copy/paste the function into your project and modify as you wish.
-//
-// There is also Ticker type similar to time.Ticker.
-// You can use it if you need to work with channels.
-//
-// See Examples section below for usage examples.
-package backoff
-
-import "time"
-
-// BackOff is a backoff policy for retrying an operation.
-type BackOff interface {
- // NextBackOff returns the duration to wait before retrying the operation,
- // or backoff.Stop to indicate that no more retries should be made.
- //
- // Example usage:
- //
- // duration := backoff.NextBackOff();
- // if (duration == backoff.Stop) {
- // // Do not retry operation.
- // } else {
- // // Sleep for duration and retry operation.
- // }
- //
- NextBackOff() time.Duration
-
- // Reset to initial state.
- Reset()
-}
-
-// Stop indicates that no more retries should be made for use in NextBackOff().
-const Stop time.Duration = -1
-
-// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,
-// meaning that the operation is retried immediately without waiting, indefinitely.
-type ZeroBackOff struct{}
-
-func (b *ZeroBackOff) Reset() {}
-
-func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
-
-// StopBackOff is a fixed backoff policy that always returns backoff.Stop for
-// NextBackOff(), meaning that the operation should never be retried.
-type StopBackOff struct{}
-
-func (b *StopBackOff) Reset() {}
-
-func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
-
-// ConstantBackOff is a backoff policy that always returns the same backoff delay.
-// This is in contrast to an exponential backoff policy,
-// which returns a delay that grows longer as you call NextBackOff() over and over again.
-type ConstantBackOff struct {
- Interval time.Duration
-}
-
-func (b *ConstantBackOff) Reset() {}
-func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
-
-func NewConstantBackOff(d time.Duration) *ConstantBackOff {
- return &ConstantBackOff{Interval: d}
-}
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/context.go b/vendor/gopkg.in/cenkalti/backoff.v1/context.go
deleted file mode 100644
index 5d15709..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/context.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package backoff
-
-import (
- "time"
-
- "golang.org/x/net/context"
-)
-
-// BackOffContext is a backoff policy that stops retrying after the context
-// is canceled.
-type BackOffContext interface {
- BackOff
- Context() context.Context
-}
-
-type backOffContext struct {
- BackOff
- ctx context.Context
-}
-
-// WithContext returns a BackOffContext with context ctx
-//
-// ctx must not be nil
-func WithContext(b BackOff, ctx context.Context) BackOffContext {
- if ctx == nil {
- panic("nil context")
- }
-
- if b, ok := b.(*backOffContext); ok {
- return &backOffContext{
- BackOff: b.BackOff,
- ctx: ctx,
- }
- }
-
- return &backOffContext{
- BackOff: b,
- ctx: ctx,
- }
-}
-
-func ensureContext(b BackOff) BackOffContext {
- if cb, ok := b.(BackOffContext); ok {
- return cb
- }
- return WithContext(b, context.Background())
-}
-
-func (b *backOffContext) Context() context.Context {
- return b.ctx
-}
-
-func (b *backOffContext) NextBackOff() time.Duration {
- select {
- case <-b.Context().Done():
- return Stop
- default:
- return b.BackOff.NextBackOff()
- }
-}
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/exponential.go b/vendor/gopkg.in/cenkalti/backoff.v1/exponential.go
deleted file mode 100644
index 9a6addf..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/exponential.go
+++ /dev/null
@@ -1,156 +0,0 @@
-package backoff
-
-import (
- "math/rand"
- "time"
-)
-
-/*
-ExponentialBackOff is a backoff implementation that increases the backoff
-period for each retry attempt using a randomization function that grows exponentially.
-
-NextBackOff() is calculated using the following formula:
-
- randomized interval =
- RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])
-
-In other words NextBackOff() will range between the randomization factor
-percentage below and above the retry interval.
-
-For example, given the following parameters:
-
- RetryInterval = 2
- RandomizationFactor = 0.5
- Multiplier = 2
-
-the actual backoff period used in the next retry attempt will range between 1 and 3 seconds,
-multiplied by the exponential, that is, between 2 and 6 seconds.
-
-Note: MaxInterval caps the RetryInterval and not the randomized interval.
-
-If the time elapsed since an ExponentialBackOff instance is created goes past the
-MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop.
-
-The elapsed time can be reset by calling Reset().
-
-Example: Given the following default arguments, for 10 tries the sequence will be,
-and assuming we go over the MaxElapsedTime on the 10th try:
-
- Request # RetryInterval (seconds) Randomized Interval (seconds)
-
- 1 0.5 [0.25, 0.75]
- 2 0.75 [0.375, 1.125]
- 3 1.125 [0.562, 1.687]
- 4 1.687 [0.8435, 2.53]
- 5 2.53 [1.265, 3.795]
- 6 3.795 [1.897, 5.692]
- 7 5.692 [2.846, 8.538]
- 8 8.538 [4.269, 12.807]
- 9 12.807 [6.403, 19.210]
- 10 19.210 backoff.Stop
-
-Note: Implementation is not thread-safe.
-*/
-type ExponentialBackOff struct {
- InitialInterval time.Duration
- RandomizationFactor float64
- Multiplier float64
- MaxInterval time.Duration
- // After MaxElapsedTime the ExponentialBackOff stops.
- // It never stops if MaxElapsedTime == 0.
- MaxElapsedTime time.Duration
- Clock Clock
-
- currentInterval time.Duration
- startTime time.Time
- random *rand.Rand
-}
-
-// Clock is an interface that returns current time for BackOff.
-type Clock interface {
- Now() time.Time
-}
-
-// Default values for ExponentialBackOff.
-const (
- DefaultInitialInterval = 500 * time.Millisecond
- DefaultRandomizationFactor = 0.5
- DefaultMultiplier = 1.5
- DefaultMaxInterval = 60 * time.Second
- DefaultMaxElapsedTime = 15 * time.Minute
-)
-
-// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
-func NewExponentialBackOff() *ExponentialBackOff {
- b := &ExponentialBackOff{
- InitialInterval: DefaultInitialInterval,
- RandomizationFactor: DefaultRandomizationFactor,
- Multiplier: DefaultMultiplier,
- MaxInterval: DefaultMaxInterval,
- MaxElapsedTime: DefaultMaxElapsedTime,
- Clock: SystemClock,
- random: rand.New(rand.NewSource(time.Now().UnixNano())),
- }
- b.Reset()
- return b
-}
-
-type systemClock struct{}
-
-func (t systemClock) Now() time.Time {
- return time.Now()
-}
-
-// SystemClock implements Clock interface that uses time.Now().
-var SystemClock = systemClock{}
-
-// Reset the interval back to the initial retry interval and restarts the timer.
-func (b *ExponentialBackOff) Reset() {
- b.currentInterval = b.InitialInterval
- b.startTime = b.Clock.Now()
-}
-
-// NextBackOff calculates the next backoff interval using the formula:
-// Randomized interval = RetryInterval +/- (RandomizationFactor * RetryInterval)
-func (b *ExponentialBackOff) NextBackOff() time.Duration {
- // Make sure we have not gone over the maximum elapsed time.
- if b.MaxElapsedTime != 0 && b.GetElapsedTime() > b.MaxElapsedTime {
- return Stop
- }
- defer b.incrementCurrentInterval()
- if b.random == nil {
- b.random = rand.New(rand.NewSource(time.Now().UnixNano()))
- }
- return getRandomValueFromInterval(b.RandomizationFactor, b.random.Float64(), b.currentInterval)
-}
-
-// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance
-// is created and is reset when Reset() is called.
-//
-// The elapsed time is computed using time.Now().UnixNano().
-func (b *ExponentialBackOff) GetElapsedTime() time.Duration {
- return b.Clock.Now().Sub(b.startTime)
-}
-
-// Increments the current interval by multiplying it with the multiplier.
-func (b *ExponentialBackOff) incrementCurrentInterval() {
- // Check for overflow, if overflow is detected set the current interval to the max interval.
- if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {
- b.currentInterval = b.MaxInterval
- } else {
- b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
- }
-}
-
-// Returns a random value from the following interval:
-// [randomizationFactor * currentInterval, randomizationFactor * currentInterval].
-func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
- var delta = randomizationFactor * float64(currentInterval)
- var minInterval = float64(currentInterval) - delta
- var maxInterval = float64(currentInterval) + delta
-
- // Get a random value from the range [minInterval, maxInterval].
- // The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then
- // we want a 33% chance for selecting either 1, 2 or 3.
- return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
-}
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/retry.go b/vendor/gopkg.in/cenkalti/backoff.v1/retry.go
deleted file mode 100644
index 5dbd825..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/retry.go
+++ /dev/null
@@ -1,78 +0,0 @@
-package backoff
-
-import "time"
-
-// An Operation is executing by Retry() or RetryNotify().
-// The operation will be retried using a backoff policy if it returns an error.
-type Operation func() error
-
-// Notify is a notify-on-error function. It receives an operation error and
-// backoff delay if the operation failed (with an error).
-//
-// NOTE that if the backoff policy stated to stop retrying,
-// the notify function isn't called.
-type Notify func(error, time.Duration)
-
-// Retry the operation o until it does not return error or BackOff stops.
-// o is guaranteed to be run at least once.
-// It is the caller's responsibility to reset b after Retry returns.
-//
-// If o returns a *PermanentError, the operation is not retried, and the
-// wrapped error is returned.
-//
-// Retry sleeps the goroutine for the duration returned by BackOff after a
-// failed operation returns.
-func Retry(o Operation, b BackOff) error { return RetryNotify(o, b, nil) }
-
-// RetryNotify calls notify function with the error and wait duration
-// for each failed attempt before sleep.
-func RetryNotify(operation Operation, b BackOff, notify Notify) error {
- var err error
- var next time.Duration
-
- cb := ensureContext(b)
-
- b.Reset()
- for {
- if err = operation(); err == nil {
- return nil
- }
-
- if permanent, ok := err.(*PermanentError); ok {
- return permanent.Err
- }
-
- if next = b.NextBackOff(); next == Stop {
- return err
- }
-
- if notify != nil {
- notify(err, next)
- }
-
- t := time.NewTimer(next)
-
- select {
- case <-cb.Context().Done():
- t.Stop()
- return err
- case <-t.C:
- }
- }
-}
-
-// PermanentError signals that the operation should not be retried.
-type PermanentError struct {
- Err error
-}
-
-func (e *PermanentError) Error() string {
- return e.Err.Error()
-}
-
-// Permanent wraps the given err in a *PermanentError.
-func Permanent(err error) *PermanentError {
- return &PermanentError{
- Err: err,
- }
-}
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/ticker.go b/vendor/gopkg.in/cenkalti/backoff.v1/ticker.go
deleted file mode 100644
index 49a9971..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/ticker.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package backoff
-
-import (
- "runtime"
- "sync"
- "time"
-)
-
-// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.
-//
-// Ticks will continue to arrive when the previous operation is still running,
-// so operations that take a while to fail could run in quick succession.
-type Ticker struct {
- C <-chan time.Time
- c chan time.Time
- b BackOffContext
- stop chan struct{}
- stopOnce sync.Once
-}
-
-// NewTicker returns a new Ticker containing a channel that will send the time at times
-// specified by the BackOff argument. Ticker is guaranteed to tick at least once.
-// The channel is closed when Stop method is called or BackOff stops.
-func NewTicker(b BackOff) *Ticker {
- c := make(chan time.Time)
- t := &Ticker{
- C: c,
- c: c,
- b: ensureContext(b),
- stop: make(chan struct{}),
- }
- go t.run()
- runtime.SetFinalizer(t, (*Ticker).Stop)
- return t
-}
-
-// Stop turns off a ticker. After Stop, no more ticks will be sent.
-func (t *Ticker) Stop() {
- t.stopOnce.Do(func() { close(t.stop) })
-}
-
-func (t *Ticker) run() {
- c := t.c
- defer close(c)
- t.b.Reset()
-
- // Ticker is guaranteed to tick at least once.
- afterC := t.send(time.Now())
-
- for {
- if afterC == nil {
- return
- }
-
- select {
- case tick := <-afterC:
- afterC = t.send(tick)
- case <-t.stop:
- t.c = nil // Prevent future ticks from being sent to the channel.
- return
- case <-t.b.Context().Done():
- return
- }
- }
-}
-
-func (t *Ticker) send(tick time.Time) <-chan time.Time {
- select {
- case t.c <- tick:
- case <-t.stop:
- return nil
- }
-
- next := t.b.NextBackOff()
- if next == Stop {
- t.Stop()
- return nil
- }
-
- return time.After(next)
-}
diff --git a/vendor/gopkg.in/cenkalti/backoff.v1/tries.go b/vendor/gopkg.in/cenkalti/backoff.v1/tries.go
deleted file mode 100644
index d2da730..0000000
--- a/vendor/gopkg.in/cenkalti/backoff.v1/tries.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package backoff
-
-import "time"
-
-/*
-WithMaxTries creates a wrapper around another BackOff, which will
-return Stop if NextBackOff() has been called too many times since
-the last time Reset() was called
-
-Note: Implementation is not thread-safe.
-*/
-func WithMaxTries(b BackOff, max uint64) BackOff {
- return &backOffTries{delegate: b, maxTries: max}
-}
-
-type backOffTries struct {
- delegate BackOff
- maxTries uint64
- numTries uint64
-}
-
-func (b *backOffTries) NextBackOff() time.Duration {
- if b.maxTries > 0 {
- if b.maxTries <= b.numTries {
- return Stop
- }
- b.numTries++
- }
- return b.delegate.NextBackOff()
-}
-
-func (b *backOffTries) Reset() {
- b.numTries = 0
- b.delegate.Reset()
-}
diff --git a/vendor/gopkg.in/sourcemap.v1/.travis.yml b/vendor/gopkg.in/sourcemap.v1/.travis.yml
deleted file mode 100644
index 229abef..0000000
--- a/vendor/gopkg.in/sourcemap.v1/.travis.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-sudo: false
-language: go
-
-go:
- - 1.6
- - 1.7
- - tip
-
-matrix:
- allow_failures:
- - go: tip
-
-install:
- - mkdir -p $HOME/gopath/src/gopkg.in
- - mv $HOME/gopath/src/github.com/go-sourcemap/sourcemap $HOME/gopath/src/gopkg.in/sourcemap.v1
- - cd $HOME/gopath/src/gopkg.in/sourcemap.v1
diff --git a/vendor/gopkg.in/sourcemap.v1/LICENSE b/vendor/gopkg.in/sourcemap.v1/LICENSE
deleted file mode 100644
index 405d20f..0000000
--- a/vendor/gopkg.in/sourcemap.v1/LICENSE
+++ /dev/null
@@ -1,25 +0,0 @@
-Copyright (c) 2016 The github.com/go-sourcemap/sourcemap Contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/gopkg.in/sourcemap.v1/Makefile b/vendor/gopkg.in/sourcemap.v1/Makefile
deleted file mode 100644
index 161c4fd..0000000
--- a/vendor/gopkg.in/sourcemap.v1/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-all:
- go test ./...
- go test ./... -short -race
- go vet
diff --git a/vendor/gopkg.in/sourcemap.v1/README.md b/vendor/gopkg.in/sourcemap.v1/README.md
deleted file mode 100644
index fb319d2..0000000
--- a/vendor/gopkg.in/sourcemap.v1/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Source Maps consumer for Golang [![Build Status](https://travis-ci.org/go-sourcemap/sourcemap.svg?branch=v1)](https://travis-ci.org/go-sourcemap/sourcemap)
-
-## Installation
-
-Install:
-
- go get gopkg.in/sourcemap.v1
-
-## Quickstart
-
-```go
-func ExampleParse() {
- mapURL := "http://code.jquery.com/jquery-2.0.3.min.map"
- resp, err := http.Get(mapURL)
- if err != nil {
- panic(err)
- }
- defer resp.Body.Close()
-
- b, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- panic(err)
- }
-
- smap, err := sourcemap.Parse(mapURL, b)
- if err != nil {
- panic(err)
- }
-
- line, column := 5, 6789
- file, fn, line, col, ok := smap.Source(line, column)
- fmt.Println(file, fn, line, col, ok)
- // Output: http://code.jquery.com/jquery-2.0.3.js apply 4360 27 true
-}
-```
diff --git a/vendor/gopkg.in/sourcemap.v1/base64vlq/base64_vlq.go b/vendor/gopkg.in/sourcemap.v1/base64vlq/base64_vlq.go
deleted file mode 100644
index 16cbfb5..0000000
--- a/vendor/gopkg.in/sourcemap.v1/base64vlq/base64_vlq.go
+++ /dev/null
@@ -1,92 +0,0 @@
-package base64vlq
-
-import (
- "io"
-)
-
-const encodeStd = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
-
-const (
- vlqBaseShift = 5
- vlqBase = 1 << vlqBaseShift
- vlqBaseMask = vlqBase - 1
- vlqSignBit = 1
- vlqContinuationBit = vlqBase
-)
-
-var decodeMap [256]byte
-
-func init() {
- for i := 0; i < len(encodeStd); i++ {
- decodeMap[encodeStd[i]] = byte(i)
- }
-}
-
-func toVLQSigned(n int) int {
- if n < 0 {
- return -n<<1 + 1
- }
- return n << 1
-}
-
-func fromVLQSigned(n int) int {
- isNeg := n&vlqSignBit != 0
- n >>= 1
- if isNeg {
- return -n
- }
- return n
-}
-
-type Encoder struct {
- w io.ByteWriter
-}
-
-func NewEncoder(w io.ByteWriter) *Encoder {
- return &Encoder{
- w: w,
- }
-}
-
-func (enc Encoder) Encode(n int) error {
- n = toVLQSigned(n)
- for digit := vlqContinuationBit; digit&vlqContinuationBit != 0; {
- digit = n & vlqBaseMask
- n >>= vlqBaseShift
- if n > 0 {
- digit |= vlqContinuationBit
- }
-
- err := enc.w.WriteByte(encodeStd[digit])
- if err != nil {
- return err
- }
- }
- return nil
-}
-
-type Decoder struct {
- r io.ByteReader
-}
-
-func NewDecoder(r io.ByteReader) *Decoder {
- return &Decoder{
- r: r,
- }
-}
-
-func (dec Decoder) Decode() (n int, err error) {
- shift := uint(0)
- for continuation := true; continuation; {
- c, err := dec.r.ReadByte()
- if err != nil {
- return 0, err
- }
-
- c = decodeMap[c]
- continuation = c&vlqContinuationBit != 0
- n += int(c&vlqBaseMask) << shift
- shift += vlqBaseShift
- }
- return fromVLQSigned(n), nil
-}
diff --git a/vendor/gopkg.in/sourcemap.v1/consumer.go b/vendor/gopkg.in/sourcemap.v1/consumer.go
deleted file mode 100644
index 3bed06a..0000000
--- a/vendor/gopkg.in/sourcemap.v1/consumer.go
+++ /dev/null
@@ -1,134 +0,0 @@
-package sourcemap
-
-import (
- "encoding/json"
- "fmt"
- "net/url"
- "path"
- "sort"
- "strconv"
-)
-
-type Consumer struct {
- sourceRootURL *url.URL
- smap *sourceMap
- mappings []mapping
-}
-
-func Parse(mapURL string, b []byte) (*Consumer, error) {
- smap := new(sourceMap)
- err := json.Unmarshal(b, smap)
- if err != nil {
- return nil, err
- }
-
- if smap.Version != 3 {
- return nil, fmt.Errorf(
- "sourcemap: got version=%d, but only 3rd version is supported",
- smap.Version,
- )
- }
-
- var sourceRootURL *url.URL
- if smap.SourceRoot != "" {
- u, err := url.Parse(smap.SourceRoot)
- if err != nil {
- return nil, err
- }
- if u.IsAbs() {
- sourceRootURL = u
- }
- } else if mapURL != "" {
- u, err := url.Parse(mapURL)
- if err != nil {
- return nil, err
- }
- if u.IsAbs() {
- u.Path = path.Dir(u.Path)
- sourceRootURL = u
- }
- }
-
- mappings, err := parseMappings(smap.Mappings)
- if err != nil {
- return nil, err
- }
- // Free memory.
- smap.Mappings = ""
-
- return &Consumer{
- sourceRootURL: sourceRootURL,
- smap: smap,
- mappings: mappings,
- }, nil
-}
-
-func (c *Consumer) File() string {
- return c.smap.File
-}
-
-func (c *Consumer) Source(genLine, genCol int) (source, name string, line, col int, ok bool) {
- i := sort.Search(len(c.mappings), func(i int) bool {
- m := &c.mappings[i]
- if m.genLine == genLine {
- return m.genCol >= genCol
- }
- return m.genLine >= genLine
- })
-
- // Mapping not found.
- if i == len(c.mappings) {
- return
- }
-
- match := &c.mappings[i]
-
- // Fuzzy match.
- if match.genLine > genLine || match.genCol > genCol {
- if i == 0 {
- return
- }
- match = &c.mappings[i-1]
- }
-
- if match.sourcesInd >= 0 {
- source = c.absSource(c.smap.Sources[match.sourcesInd])
- }
- if match.namesInd >= 0 {
- v := c.smap.Names[match.namesInd]
- switch v := v.(type) {
- case string:
- name = v
- case float64:
- name = strconv.FormatFloat(v, 'f', -1, 64)
- default:
- name = fmt.Sprint(v)
- }
- }
- line = match.sourceLine
- col = match.sourceCol
- ok = true
- return
-}
-
-func (c *Consumer) absSource(source string) string {
- if path.IsAbs(source) {
- return source
- }
-
- if u, err := url.Parse(source); err == nil && u.IsAbs() {
- return source
- }
-
- if c.sourceRootURL != nil {
- u := *c.sourceRootURL
- u.Path = path.Join(c.sourceRootURL.Path, source)
- return u.String()
- }
-
- if c.smap.SourceRoot != "" {
- return path.Join(c.smap.SourceRoot, source)
- }
-
- return source
-}
diff --git a/vendor/gopkg.in/sourcemap.v1/sourcemap.go b/vendor/gopkg.in/sourcemap.v1/sourcemap.go
deleted file mode 100644
index 0e9af1a..0000000
--- a/vendor/gopkg.in/sourcemap.v1/sourcemap.go
+++ /dev/null
@@ -1,157 +0,0 @@
-package sourcemap // import "gopkg.in/sourcemap.v1"
-
-import (
- "io"
- "strings"
-
- "gopkg.in/sourcemap.v1/base64vlq"
-)
-
-type fn func(m *mappings) (fn, error)
-
-type sourceMap struct {
- Version int `json:"version"`
- File string `json:"file"`
- SourceRoot string `json:"sourceRoot"`
- Sources []string `json:"sources"`
- Names []interface{} `json:"names"`
- Mappings string `json:"mappings"`
-}
-
-type mapping struct {
- genLine int
- genCol int
- sourcesInd int
- sourceLine int
- sourceCol int
- namesInd int
-}
-
-type mappings struct {
- rd *strings.Reader
- dec *base64vlq.Decoder
-
- hasName bool
- value mapping
-
- values []mapping
-}
-
-func parseMappings(s string) ([]mapping, error) {
- rd := strings.NewReader(s)
- m := &mappings{
- rd: rd,
- dec: base64vlq.NewDecoder(rd),
- }
- m.value.genLine = 1
- m.value.sourceLine = 1
-
- err := m.parse()
- if err != nil {
- return nil, err
- }
- return m.values, nil
-}
-
-func (m *mappings) parse() error {
- next := parseGenCol
- for {
- c, err := m.rd.ReadByte()
- if err == io.EOF {
- m.pushValue()
- return nil
- }
- if err != nil {
- return err
- }
-
- switch c {
- case ',':
- m.pushValue()
- next = parseGenCol
- case ';':
- m.pushValue()
-
- m.value.genLine++
- m.value.genCol = 0
-
- next = parseGenCol
- default:
- err := m.rd.UnreadByte()
- if err != nil {
- return err
- }
-
- next, err = next(m)
- if err != nil {
- return err
- }
- }
- }
-}
-
-func parseGenCol(m *mappings) (fn, error) {
- n, err := m.dec.Decode()
- if err != nil {
- return nil, err
- }
- m.value.genCol += n
- return parseSourcesInd, nil
-}
-
-func parseSourcesInd(m *mappings) (fn, error) {
- n, err := m.dec.Decode()
- if err != nil {
- return nil, err
- }
- m.value.sourcesInd += n
- return parseSourceLine, nil
-}
-
-func parseSourceLine(m *mappings) (fn, error) {
- n, err := m.dec.Decode()
- if err != nil {
- return nil, err
- }
- m.value.sourceLine += n
- return parseSourceCol, nil
-}
-
-func parseSourceCol(m *mappings) (fn, error) {
- n, err := m.dec.Decode()
- if err != nil {
- return nil, err
- }
- m.value.sourceCol += n
- return parseNamesInd, nil
-}
-
-func parseNamesInd(m *mappings) (fn, error) {
- n, err := m.dec.Decode()
- if err != nil {
- return nil, err
- }
- m.hasName = true
- m.value.namesInd += n
- return parseGenCol, nil
-}
-
-func (m *mappings) pushValue() {
- if m.value.sourceLine == 1 && m.value.sourceCol == 0 {
- return
- }
-
- if m.hasName {
- m.values = append(m.values, m.value)
- m.hasName = false
- } else {
- m.values = append(m.values, mapping{
- genLine: m.value.genLine,
- genCol: m.value.genCol,
- sourcesInd: m.value.sourcesInd,
- sourceLine: m.value.sourceLine,
- sourceCol: m.value.sourceCol,
- namesInd: -1,
- })
- }
-}