file_name
stringlengths 3
137
| prefix
stringlengths 0
918k
| suffix
stringlengths 0
962k
| middle
stringlengths 0
812k
|
---|---|---|---|
error.rs | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//! Defines `ArrowError` for representing failures in various Arrow operations
use std::error::Error;
use std::fmt::{Display, Formatter};
use csv as csv_crate;
/// Many different operations in the `arrow` crate return this error type
#[derive(Debug, Clone, PartialEq)]
pub enum ArrowError {
MemoryError(String),
ParseError(String),
SchemaError(String),
ComputeError(String),
DivideByZero,
CsvError(String),
JsonError(String),
IoError(String),
InvalidArgumentError(String),
ParquetError(String),
DictionaryKeyOverflowError,
}
impl From<::std::io::Error> for ArrowError {
fn from(error: std::io::Error) -> Self {
ArrowError::IoError(error.to_string())
}
}
impl From<csv_crate::Error> for ArrowError {
fn from(error: csv_crate::Error) -> Self {
match error.kind() {
csv_crate::ErrorKind::Io(error) => ArrowError::CsvError(error.to_string()),
csv_crate::ErrorKind::Utf8 { pos: _, err } => ArrowError::CsvError(format!(
"Encountered UTF-8 error while reading CSV file: {:?}",
err.to_string()
)),
csv_crate::ErrorKind::UnequalLengths {
expected_len, len, ..
} => ArrowError::CsvError(format!(
"Encountered unequal lengths between records on CSV file. Expected {} \
records, found {} records",
len, expected_len
)),
_ => ArrowError::CsvError("Error reading CSV file".to_string()),
}
}
}
impl From<::std::string::FromUtf8Error> for ArrowError {
fn from(error: std::string::FromUtf8Error) -> Self {
ArrowError::ParseError(error.to_string())
}
}
impl Display for ArrowError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result |
}
impl Error for ArrowError {}
pub type Result<T> = std::result::Result<T, ArrowError>;
| {
match *self {
ArrowError::MemoryError(ref desc) => write!(f, "Memory error: {}", desc),
ArrowError::ParseError(ref desc) => write!(f, "Parser error: {}", desc),
ArrowError::SchemaError(ref desc) => write!(f, "Schema error: {}", desc),
ArrowError::ComputeError(ref desc) => write!(f, "Compute error: {}", desc),
ArrowError::DivideByZero => write!(f, "Divide by zero error"),
ArrowError::CsvError(ref desc) => write!(f, "Csv error: {}", desc),
ArrowError::JsonError(ref desc) => write!(f, "Json error: {}", desc),
ArrowError::IoError(ref desc) => write!(f, "Io error: {}", desc),
ArrowError::InvalidArgumentError(ref desc) => {
write!(f, "Invalid argument error: {}", desc)
}
ArrowError::ParquetError(ref desc) => {
write!(f, "Parquet argument error: {}", desc)
}
ArrowError::DictionaryKeyOverflowError => {
write!(f, "Dictionary key bigger than the key type")
}
}
} |
test_nodes.py | import pytest
# integration tests requires nomad Vagrant VM or Binary running
def test_get_nodes(nomad_setup):
assert isinstance(nomad_setup.nodes.get_nodes(), list) == True
def test_get_nodes_prefix(nomad_setup):
nodes = nomad_setup.nodes.get_nodes()
prefix = nodes[0]["ID"][:4]
nomad_setup.nodes.get_nodes(prefix=prefix)
def test_dunder_getitem_exist(nomad_setup):
n = nomad_setup.nodes["pynomad1"]
assert isinstance(n, dict)
def test_dunder_getitem_not_exist(nomad_setup):
with pytest.raises(KeyError):
j = nomad_setup.nodes["pynomad2"]
def test_dunder_contain_exists(nomad_setup):
assert "pynomad1" in nomad_setup.nodes
def test_dunder_contain_not_exist(nomad_setup):
assert "real.localdomain" not in nomad_setup.nodes
def test_dunder_str(nomad_setup):
assert isinstance(str(nomad_setup.nodes), str)
def test_dunder_repr(nomad_setup):
assert isinstance(repr(nomad_setup.nodes), str)
def test_dunder_getattr(nomad_setup):
with pytest.raises(AttributeError):
d = nomad_setup.nodes.does_not_exist
def | (nomad_setup):
assert hasattr(nomad_setup.nodes, '__iter__')
for j in nomad_setup.nodes:
pass
def test_dunder_len(nomad_setup):
assert len(nomad_setup.nodes) >= 0
| test_dunder_iter |
list_conflict_files.go | package conflicts
import (
"bytes"
"errors"
"fmt"
"io"
"unicode/utf8"
"gitlab.com/gitlab-org/gitaly/internal/git"
"gitlab.com/gitlab-org/gitaly/internal/git2go"
"gitlab.com/gitlab-org/gitaly/internal/helper"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/streamio"
)
func (s *server) ListConflictFiles(request *gitalypb.ListConflictFilesRequest, stream gitalypb.ConflictsService_ListConflictFilesServer) error {
ctx := stream.Context()
if err := validateListConflictFilesRequest(request); err != nil {
return helper.ErrInvalidArgument(err)
}
repo := s.localrepo(request.GetRepository())
ours, err := repo.ResolveRevision(ctx, git.Revision(request.OurCommitOid+"^{commit}"))
if err != nil {
return helper.ErrPreconditionFailedf("could not lookup 'our' OID: %s", err)
}
theirs, err := repo.ResolveRevision(ctx, git.Revision(request.TheirCommitOid+"^{commit}"))
if err != nil {
return helper.ErrPreconditionFailedf("could not lookup 'their' OID: %s", err)
}
repoPath, err := s.locator.GetPath(request.Repository)
if err != nil {
return err
}
conflicts, err := git2go.ConflictsCommand{
Repository: repoPath,
Ours: ours.String(),
Theirs: theirs.String(),
}.Run(ctx, s.cfg)
if err != nil {
if errors.Is(err, git2go.ErrInvalidArgument) {
return helper.ErrInvalidArgument(err)
}
return helper.ErrInternal(err)
}
var conflictFiles []*gitalypb.ConflictFile
msgSize := 0
for _, conflict := range conflicts.Conflicts {
if conflict.Their.Path == "" || conflict.Our.Path == "" {
return helper.ErrPreconditionFailedf("conflict side missing")
}
if !utf8.Valid(conflict.Content) {
return helper.ErrPreconditionFailed(errors.New("unsupported encoding"))
}
conflictFiles = append(conflictFiles, &gitalypb.ConflictFile{
ConflictFilePayload: &gitalypb.ConflictFile_Header{
Header: &gitalypb.ConflictFileHeader{
CommitOid: request.OurCommitOid,
TheirPath: []byte(conflict.Their.Path),
OurPath: []byte(conflict.Our.Path),
AncestorPath: []byte(conflict.Ancestor.Path),
OurMode: conflict.Our.Mode,
},
},
})
contentReader := bytes.NewReader(conflict.Content)
for {
chunk := make([]byte, streamio.WriteBufferSize-msgSize)
bytesRead, err := contentReader.Read(chunk)
if err != nil && err != io.EOF {
return helper.ErrInternal(err)
}
if bytesRead > 0 {
conflictFiles = append(conflictFiles, &gitalypb.ConflictFile{
ConflictFilePayload: &gitalypb.ConflictFile_Content{
Content: chunk[:bytesRead],
},
})
}
if err == io.EOF {
break
}
// We don't send a message for each chunk because the content of
// a file may be smaller than the size limit, which means we can
// keep adding data to the message
msgSize += bytesRead
if msgSize < streamio.WriteBufferSize {
continue
}
if err := stream.Send(&gitalypb.ListConflictFilesResponse{
Files: conflictFiles,
}); err != nil {
return helper.ErrInternal(err)
}
conflictFiles = conflictFiles[:0]
msgSize = 0
}
}
// Send leftover data, if any
if len(conflictFiles) > 0 {
if err := stream.Send(&gitalypb.ListConflictFilesResponse{
Files: conflictFiles,
}); err != nil {
return helper.ErrInternal(err)
}
}
return nil
}
func | (in *gitalypb.ListConflictFilesRequest) error {
if in.GetRepository() == nil {
return fmt.Errorf("empty Repository")
}
if in.GetOurCommitOid() == "" {
return fmt.Errorf("empty OurCommitOid")
}
if in.GetTheirCommitOid() == "" {
return fmt.Errorf("empty TheirCommitOid")
}
return nil
}
| validateListConflictFilesRequest |
admin.py | # Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import abc
import logging
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set
from synapse.api.constants import Membership
from synapse.events import EventBase
from synapse.types import JsonDict, RoomStreamToken, StateMap, UserID
from synapse.visibility import filter_events_for_client
from ._base import BaseHandler
if TYPE_CHECKING:
from synapse.server import HomeServer
logger = logging.getLogger(__name__)
class AdminHandler(BaseHandler):
def __init__(self, hs: "HomeServer"):
super().__init__(hs)
self.storage = hs.get_storage()
self.state_store = self.storage.state
async def get_whois(self, user: UserID) -> JsonDict:
connections = []
sessions = await self.store.get_user_ip_and_agents(user)
for session in sessions:
connections.append(
{
"ip": session["ip"],
"last_seen": session["last_seen"],
"user_agent": session["user_agent"],
}
)
ret = {
"user_id": user.to_string(),
"devices": {"": {"sessions": [{"connections": connections}]}},
}
return ret
async def get_user(self, user: UserID) -> Optional[JsonDict]:
"""Function to get user details"""
ret = await self.store.get_user_by_id(user.to_string())
if ret:
profile = await self.store.get_profileinfo(user.localpart)
threepids = await self.store.user_get_threepids(user.to_string())
ret["displayname"] = profile.display_name
ret["avatar_url"] = profile.avatar_url
ret["threepids"] = threepids
return ret
async def export_user_data(self, user_id: str, writer: "ExfiltrationWriter") -> Any:
"""Write all data we have on the user to the given writer.
Args:
user_id: The user ID to fetch data of.
writer: The writer to write to.
Returns:
Resolves when all data for a user has been written. | # Get all rooms the user is in or has been in
rooms = await self.store.get_rooms_for_local_user_where_membership_is(
user_id,
membership_list=(
Membership.JOIN,
Membership.LEAVE,
Membership.BAN,
Membership.INVITE,
),
)
# We only try and fetch events for rooms the user has been in. If
# they've been e.g. invited to a room without joining then we handle
# those separately.
rooms_user_has_been_in = await self.store.get_rooms_user_has_been_in(user_id)
for index, room in enumerate(rooms):
room_id = room.room_id
logger.info(
"[%s] Handling room %s, %d/%d", user_id, room_id, index + 1, len(rooms)
)
forgotten = await self.store.did_forget(user_id, room_id)
if forgotten:
logger.info("[%s] User forgot room %d, ignoring", user_id, room_id)
continue
if room_id not in rooms_user_has_been_in:
# If we haven't been in the rooms then the filtering code below
# won't return anything, so we need to handle these cases
# explicitly.
if room.membership == Membership.INVITE:
event_id = room.event_id
invite = await self.store.get_event(event_id, allow_none=True)
if invite:
invited_state = invite.unsigned["invite_room_state"]
writer.write_invite(room_id, invite, invited_state)
continue
# We only want to bother fetching events up to the last time they
# were joined. We estimate that point by looking at the
# stream_ordering of the last membership if it wasn't a join.
if room.membership == Membership.JOIN:
stream_ordering = self.store.get_room_max_stream_ordering()
else:
stream_ordering = room.stream_ordering
from_key = RoomStreamToken(0, 0)
to_key = RoomStreamToken(None, stream_ordering)
# Events that we've processed in this room
written_events = set() # type: Set[str]
# We need to track gaps in the events stream so that we can then
# write out the state at those events. We do this by keeping track
# of events whose prev events we haven't seen.
# Map from event ID to prev events that haven't been processed,
# dict[str, set[str]].
event_to_unseen_prevs = {}
# The reverse mapping to above, i.e. map from unseen event to events
# that have the unseen event in their prev_events, i.e. the unseen
# events "children".
unseen_to_child_events = {} # type: Dict[str, Set[str]]
# We fetch events in the room the user could see by fetching *all*
# events that we have and then filtering, this isn't the most
# efficient method perhaps but it does guarantee we get everything.
while True:
events, _ = await self.store.paginate_room_events(
room_id, from_key, to_key, limit=100, direction="f"
)
if not events:
break
from_key = events[-1].internal_metadata.after
events = await filter_events_for_client(self.storage, user_id, events)
writer.write_events(room_id, events)
# Update the extremity tracking dicts
for event in events:
# Check if we have any prev events that haven't been
# processed yet, and add those to the appropriate dicts.
unseen_events = set(event.prev_event_ids()) - written_events
if unseen_events:
event_to_unseen_prevs[event.event_id] = unseen_events
for unseen in unseen_events:
unseen_to_child_events.setdefault(unseen, set()).add(
event.event_id
)
# Now check if this event is an unseen prev event, if so
# then we remove this event from the appropriate dicts.
for child_id in unseen_to_child_events.pop(event.event_id, []):
event_to_unseen_prevs[child_id].discard(event.event_id)
written_events.add(event.event_id)
logger.info(
"Written %d events in room %s", len(written_events), room_id
)
# Extremities are the events who have at least one unseen prev event.
extremities = (
event_id
for event_id, unseen_prevs in event_to_unseen_prevs.items()
if unseen_prevs
)
for event_id in extremities:
if not event_to_unseen_prevs[event_id]:
continue
state = await self.state_store.get_state_for_event(event_id)
writer.write_state(room_id, event_id, state)
return writer.finished()
class ExfiltrationWriter(metaclass=abc.ABCMeta):
"""Interface used to specify how to write exported data."""
@abc.abstractmethod
def write_events(self, room_id: str, events: List[EventBase]) -> None:
"""Write a batch of events for a room."""
raise NotImplementedError()
@abc.abstractmethod
def write_state(
self, room_id: str, event_id: str, state: StateMap[EventBase]
) -> None:
"""Write the state at the given event in the room.
This only gets called for backward extremities rather than for each
event.
"""
raise NotImplementedError()
@abc.abstractmethod
def write_invite(
self, room_id: str, event: EventBase, state: StateMap[dict]
) -> None:
"""Write an invite for the room, with associated invite state.
Args:
room_id: The room ID the invite is for.
event: The invite event.
state: A subset of the state at the invite, with a subset of the
event keys (type, state_key content and sender).
"""
raise NotImplementedError()
@abc.abstractmethod
def finished(self) -> Any:
"""Called when all data has successfully been exported and written.
This functions return value is passed to the caller of
`export_user_data`.
"""
raise NotImplementedError() | The returned value is that returned by `writer.finished()`.
""" |
carousel.js | class Tab {
constructor(props) {
this.element = props;
this.tab = props.dataset.tab;
this.review = document.querySelector(`.review[data-review='${this.tab}']`);
this.element.addEventListener("click", () => this.active());
}
hidden() {
document.querySelector(".review-active").classList.toggle("review-active");
document.querySelector(".tab-active").classList.toggle("tab-active");
}
active() {
this.hidden();
this.review.classList.toggle("review-active");
this.element.classList.toggle("tab-active");
}
}
let i = 0;
const count = array => {
if (i >= array.length) i = 0;
array[i].click();
i++;
};
class | {
constructor(props) {
this.tabs = Array.from(document.querySelectorAll(".tab"));
this.setInterval();
}
setInterval() {
setInterval(count, 5000, this.tabs);
}
}
const tabs = Array.from(document.querySelectorAll(".tab")).map(element => new Tab(element));
let reviews = document.querySelector(".reviews");
reviews = new Reviews(reviews); | Reviews |
config.go | // Copyright (c) 2016-2020, Jan Cajthaml <[email protected]>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package config
import "time"
// Configuration of application | // PubPort represents ZMQ PUB binding
PubPort int
// LogLevel ignorecase log level
LogLevel string
// MetricsContinuous determines if metrics should start from last state
MetricsContinuous bool
// MetricsRefreshRate how frequently should metrics be updated
MetricsRefreshRate time.Duration
// MetricsOutput determines into which filename should metrics write
MetricsOutput string
}
// GetConfig loads application configuration
func GetConfig() Configuration {
return loadConfFromEnv()
} | type Configuration struct {
// PullPort represents ZMQ PULL binding
PullPort int |
config_references_test.go | package config
import (
"testing"
gragent "github.com/grafana/agent/pkg/operator/apis/monitoring/v1alpha1"
prom "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestDeployment_AssetReferences(t *testing.T) | {
deployment := gragent.Deployment{
Agent: &gragent.GrafanaAgent{
ObjectMeta: v1.ObjectMeta{
Namespace: "agent",
},
Spec: gragent.GrafanaAgentSpec{
APIServerConfig: &prom.APIServerConfig{
BasicAuth: &prom.BasicAuth{
Username: corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: "spec-apiserverconfig-basicauth-username",
},
Key: "key",
},
},
},
},
},
Metrics: []gragent.MetricsDeployment{{
Instance: &gragent.MetricsInstance{
ObjectMeta: v1.ObjectMeta{Namespace: "metrics-instance"},
},
PodMonitors: []*prom.PodMonitor{{
ObjectMeta: v1.ObjectMeta{Namespace: "pmon"},
}},
Probes: []*prom.Probe{{
ObjectMeta: v1.ObjectMeta{Namespace: "probe"},
}},
ServiceMonitors: []*prom.ServiceMonitor{{
ObjectMeta: v1.ObjectMeta{
Namespace: "smon",
},
Spec: prom.ServiceMonitorSpec{
Endpoints: []prom.Endpoint{{
BearerTokenSecret: corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: "prometheis-servicemonitors-spec-endpoints-bearertokensecret",
},
Key: "key",
},
}},
},
}},
}},
}
require.Equal(t, []AssetReference{
{
Namespace: "agent",
Reference: prom.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: "spec-apiserverconfig-basicauth-username",
},
Key: "key",
},
},
},
{
Namespace: "smon",
Reference: prom.SecretOrConfigMap{
Secret: &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: "prometheis-servicemonitors-spec-endpoints-bearertokensecret",
},
Key: "key",
},
},
},
}, AssetReferences(deployment))
} |
|
main.go | package main
import (
"context" // Use "golang.org/x/net/context" for Golang version <= 1.6
"flag"
"net/http"
"github.com/golang/glog"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
_ "github.com/jinzhu/gorm/dialects/mysql"
"google.golang.org/grpc"
gw "github.com/zawawahoge/quiz-practice/api/app/proto/v1/service"
)
var (
// command-line options:
// gRPC server endpoint
grpcServerEndpoint = flag.String("grpc-server-endpoint", "api_dev:9090", "gRPC server endpoint")
)
func | () error {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
// Register gRPC server endpoint
// Note: Make sure the gRPC server is running properly and accessible
mux := runtime.NewServeMux()
opts := []grpc.DialOption{grpc.WithInsecure()}
err := gw.RegisterLoginServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts)
if err != nil {
return err
}
err = gw.RegisterAdminServiceHandlerFromEndpoint(ctx, mux, *grpcServerEndpoint, opts)
if err != nil {
return err
}
// Start HTTP server (and proxy calls to gRPC server endpoint)
return http.ListenAndServe(":8081", mux)
}
func main() {
flag.Parse()
defer glog.Flush()
if err := run(); err != nil {
glog.Fatal(err)
}
}
| run |
tvheadend.rs | use serde::Deserialize;
use url::{ParseError, Url};
use uuid::Uuid;
#[derive(Deserialize, Debug)]
pub struct Channel {
uuid: Uuid, | enabled: bool,
autoname: bool,
name: String,
number: u16,
epgauto: bool,
epggrab: Vec<String>,
dvr_pre_time: u16,
dvr_pst_time: u16,
epg_running: i8,
services: Vec<Uuid>,
tags: Vec<Uuid>,
bouquet: String,
}
impl Channel {
pub fn guide_number(&self) -> String {
format!("{:?}", self.number)
}
pub fn guide_name(&self) -> String {
self.name.clone()
}
pub fn url(&self, base_url: Url) -> Result<Url, ParseError> {
base_url.join(format!("/stream/channel/{}", self.uuid.to_simple()).as_str())
}
}
#[derive(Deserialize, Debug)]
pub struct ChannelGridResponse {
pub entries: Vec<Channel>,
} | |
positions-list.component.ts | import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTable } from '@angular/material/table';
import { PositionsListDataSource, PositionsListItem } from './positions-list-datasource';
import {PositionService} from "../../../../core/services/position/position.service";
import {Router} from "@angular/router";
@Component({
selector: 'app-positions-list',
templateUrl: './positions-list.component.html',
styleUrls: ['./positions-list.component.css']
})
export class PositionsListComponent implements AfterViewInit, OnInit {
| @ViewChild(MatSort, {static: false}) sort: MatSort;
@ViewChild(MatTable, {static: false}) table: MatTable<PositionsListItem>;
dataSource: PositionsListDataSource;
constructor(private positionService: PositionService,
private router: Router) {}
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['id', 'project_id', 'project_name', 'position_name', 'description' ];
ngOnInit() {
this.dataSource = new PositionsListDataSource(this.positionService);
}
ngAfterViewInit() {
this.dataSource.sort = this.sort;
this.dataSource.paginator = this.paginator;
this.table.dataSource = this.dataSource;
}
async editPosition(id){
await this.router.navigate([`/positions/${id}/edit`]);
//this.positionService.changePosition( id,project_id,project_name,position_name,description)
}
/*deletePosition(id){
}*/
} | @ViewChild(MatPaginator, {static: false}) paginator: MatPaginator; |
resnet.py | import warnings
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import build_conv_layer, build_norm_layer, build_plugin_layer
from mmcv.runner import BaseModule
from mmcv.utils.parrots_wrapper import _BatchNorm
from ..builder import BACKBONES
from ..utils import ResLayer
class BasicBlock(BaseModule):
"""Basic block for ResNet."""
expansion = 1
def __init__(self,
inplanes,
planes,
stride=1,
dilation=1,
downsample=None,
style='pytorch',
with_cp=False,
conv_cfg=None,
norm_cfg=dict(type='BN'),
dcn=None,
plugins=None,
init_cfg=None):
super(BasicBlock, self).__init__(init_cfg)
assert dcn is None, 'Not implemented yet.'
assert plugins is None, 'Not implemented yet.'
self.norm1_name, norm1 = build_norm_layer(norm_cfg, planes, postfix=1)
self.norm2_name, norm2 = build_norm_layer(norm_cfg, planes, postfix=2)
self.conv1 = build_conv_layer(
conv_cfg,
inplanes,
planes,
3,
stride=stride,
padding=dilation,
dilation=dilation,
bias=False)
self.add_module(self.norm1_name, norm1)
self.conv2 = build_conv_layer(
conv_cfg, planes, planes, 3, padding=1, bias=False)
self.add_module(self.norm2_name, norm2)
self.relu = nn.ReLU(inplace=True)
self.downsample = downsample
self.stride = stride
self.dilation = dilation
self.with_cp = with_cp
@property
def norm1(self):
"""nn.Module: normalization layer after the first convolution layer"""
return getattr(self, self.norm1_name)
@property
def norm2(self):
"""nn.Module: normalization layer after the second convolution layer"""
return getattr(self, self.norm2_name)
def forward(self, x):
"""Forward function."""
def _inner_forward(x):
identity = x
out = self.conv1(x)
out = self.norm1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.norm2(out)
if self.downsample is not None:
identity = self.downsample(x)
out += identity
return out
if self.with_cp and x.requires_grad:
out = cp.checkpoint(_inner_forward, x)
else:
out = _inner_forward(x)
out = self.relu(out)
return out
class Bottleneck(BaseModule):
"""Bottleneck block for ResNet.
If style is "pytorch", the stride-two layer is the 3x3 conv layer, if it is
"caffe", the stride-two layer is the first 1x1 conv layer.
"""
expansion = 4
def __init__(self,
inplanes,
planes,
stride=1,
dilation=1,
downsample=None,
style='pytorch',
with_cp=False,
conv_cfg=None,
norm_cfg=dict(type='BN'),
dcn=None,
plugins=None,
init_cfg=None):
super(Bottleneck, self).__init__(init_cfg)
assert style in ['pytorch', 'caffe']
assert dcn is None or isinstance(dcn, dict)
assert plugins is None or isinstance(plugins, list)
if plugins is not None:
allowed_position = ['after_conv1', 'after_conv2', 'after_conv3']
assert all(p['position'] in allowed_position for p in plugins)
self.inplanes = inplanes
self.planes = planes
self.stride = stride
self.dilation = dilation
self.style = style
self.with_cp = with_cp
self.conv_cfg = conv_cfg
self.norm_cfg = norm_cfg
self.dcn = dcn
self.with_dcn = dcn is not None
self.plugins = plugins
self.with_plugins = plugins is not None
if self.with_plugins:
# collect plugins for conv1/conv2/conv3
self.after_conv1_plugins = [
plugin['cfg'] for plugin in plugins
if plugin['position'] == 'after_conv1'
]
self.after_conv2_plugins = [
plugin['cfg'] for plugin in plugins
if plugin['position'] == 'after_conv2'
]
self.after_conv3_plugins = [
plugin['cfg'] for plugin in plugins
if plugin['position'] == 'after_conv3'
]
if self.style == 'pytorch':
self.conv1_stride = 1
self.conv2_stride = stride
else:
self.conv1_stride = stride
self.conv2_stride = 1
self.norm1_name, norm1 = build_norm_layer(norm_cfg, planes, postfix=1)
self.norm2_name, norm2 = build_norm_layer(norm_cfg, planes, postfix=2)
self.norm3_name, norm3 = build_norm_layer(
norm_cfg, planes * self.expansion, postfix=3)
self.conv1 = build_conv_layer(
conv_cfg,
inplanes,
planes,
kernel_size=1,
stride=self.conv1_stride,
bias=False)
self.add_module(self.norm1_name, norm1)
fallback_on_stride = False
if self.with_dcn:
fallback_on_stride = dcn.pop('fallback_on_stride', False)
if not self.with_dcn or fallback_on_stride:
self.conv2 = build_conv_layer(
conv_cfg,
planes,
planes,
kernel_size=3,
stride=self.conv2_stride,
padding=dilation,
dilation=dilation,
bias=False)
else:
assert self.conv_cfg is None, 'conv_cfg must be None for DCN'
self.conv2 = build_conv_layer(
dcn,
planes,
planes,
kernel_size=3,
stride=self.conv2_stride,
padding=dilation,
dilation=dilation,
bias=False)
self.add_module(self.norm2_name, norm2)
self.conv3 = build_conv_layer(
conv_cfg,
planes,
planes * self.expansion,
kernel_size=1,
bias=False)
self.add_module(self.norm3_name, norm3)
self.relu = nn.ReLU(inplace=True)
self.downsample = downsample
if self.with_plugins:
self.after_conv1_plugin_names = self.make_block_plugins(
planes, self.after_conv1_plugins)
self.after_conv2_plugin_names = self.make_block_plugins(
planes, self.after_conv2_plugins)
self.after_conv3_plugin_names = self.make_block_plugins(
planes * self.expansion, self.after_conv3_plugins)
def make_block_plugins(self, in_channels, plugins):
"""make plugins for block.
Args:
in_channels (int): Input channels of plugin.
plugins (list[dict]): List of plugins cfg to build.
Returns:
list[str]: List of the names of plugin.
"""
assert isinstance(plugins, list)
plugin_names = []
for plugin in plugins:
plugin = plugin.copy()
name, layer = build_plugin_layer(
plugin,
in_channels=in_channels,
postfix=plugin.pop('postfix', ''))
assert not hasattr(self, name), f'duplicate plugin {name}'
self.add_module(name, layer)
plugin_names.append(name)
return plugin_names
def forward_plugin(self, x, plugin_names):
"""Forward function for plugins."""
out = x
for name in plugin_names:
out = getattr(self, name)(x)
return out
@property
def norm1(self):
"""nn.Module: normalization layer after the first convolution layer"""
return getattr(self, self.norm1_name)
@property
def norm2(self):
"""nn.Module: normalization layer after the second convolution layer"""
return getattr(self, self.norm2_name)
@property
def norm3(self):
"""nn.Module: normalization layer after the third convolution layer"""
return getattr(self, self.norm3_name)
def forward(self, x):
"""Forward function."""
def _inner_forward(x):
identity = x
out = self.conv1(x)
out = self.norm1(out)
out = self.relu(out)
if self.with_plugins:
out = self.forward_plugin(out, self.after_conv1_plugin_names)
out = self.conv2(out)
out = self.norm2(out)
out = self.relu(out)
if self.with_plugins:
out = self.forward_plugin(out, self.after_conv2_plugin_names)
out = self.conv3(out)
out = self.norm3(out)
if self.with_plugins:
out = self.forward_plugin(out, self.after_conv3_plugin_names)
if self.downsample is not None:
identity = self.downsample(x)
out += identity
return out
if self.with_cp and x.requires_grad:
out = cp.checkpoint(_inner_forward, x)
else:
out = _inner_forward(x)
out = self.relu(out)
return out
@BACKBONES.register_module()
class ResNet(BaseModule):
"""ResNet backbone.
Args:
depth (int): Depth of resnet, from {18, 34, 50, 101, 152}.
in_channels (int): Number of input image channels. Default: 3.
stem_channels (int): Number of stem channels. Default: 64.
base_channels (int): Number of base channels of res layer. Default: 64.
num_stages (int): Resnet stages, normally 4. Default: 4.
strides (Sequence[int]): Strides of the first block of each stage.
Default: (1, 2, 2, 2).
dilations (Sequence[int]): Dilation of each stage.
Default: (1, 1, 1, 1).
out_indices (Sequence[int]): Output from which stages.
Default: (0, 1, 2, 3).
style (str): `pytorch` or `caffe`. If set to "pytorch", the stride-two
layer is the 3x3 conv layer, otherwise the stride-two layer is
the first 1x1 conv layer. Default: 'pytorch'.
deep_stem (bool): Replace 7x7 conv in input stem with 3 3x3 conv.
Default: False.
avg_down (bool): Use AvgPool instead of stride conv when
downsampling in the bottleneck. Default: False.
frozen_stages (int): Stages to be frozen (stop grad and set eval mode).
-1 means not freezing any parameters. Default: -1.
conv_cfg (dict | None): Dictionary to construct and config conv layer.
When conv_cfg is None, cfg will be set to dict(type='Conv2d').
Default: None.
norm_cfg (dict): Dictionary to construct and config norm layer.
Default: dict(type='BN', requires_grad=True).
norm_eval (bool): Whether to set norm layers to eval mode, namely,
freeze running stats (mean and var). Note: Effect on Batch Norm
and its variants only. Default: False.
dcn (dict | None): Dictionary to construct and config DCN conv layer.
When dcn is not None, conv_cfg must be None. Default: None.
stage_with_dcn (Sequence[bool]): Whether to set DCN conv for each
stage. The length of stage_with_dcn is equal to num_stages.
Default: (False, False, False, False).
plugins (list[dict]): List of plugins for stages, each dict contains:
- cfg (dict, required): Cfg dict to build plugin.
- position (str, required): Position inside block to insert plugin,
options: 'after_conv1', 'after_conv2', 'after_conv3'.
- stages (tuple[bool], optional): Stages to apply plugin, length
should be same as 'num_stages'.
Default: None.
multi_grid (Sequence[int]|None): Multi grid dilation rates of last
stage. Default: None.
contract_dilation (bool): Whether contract first dilation of each layer
Default: False.
with_cp (bool): Use checkpoint or not. Using checkpoint will save some
memory while slowing down the training speed. Default: False.
zero_init_residual (bool): Whether to use zero init for last norm layer
in resblocks to let them behave as identity. Default: True.
pretrained (str, optional): model pretrained path. Default: None.
init_cfg (dict or list[dict], optional): Initialization config dict.
Default: None.
Example:
>>> from mmseg.models import ResNet
>>> import torch
>>> self = ResNet(depth=18)
>>> self.eval()
>>> inputs = torch.rand(1, 3, 32, 32)
>>> level_outputs = self.forward(inputs)
>>> for level_out in level_outputs:
... print(tuple(level_out.shape))
(1, 64, 8, 8)
(1, 128, 4, 4)
(1, 256, 2, 2)
(1, 512, 1, 1)
"""
arch_settings = {
18: (BasicBlock, (2, 2, 2, 2)),
34: (BasicBlock, (3, 4, 6, 3)),
50: (Bottleneck, (3, 4, 6, 3)),
101: (Bottleneck, (3, 4, 23, 3)),
152: (Bottleneck, (3, 8, 36, 3))
}
def __init__(self,
depth,
in_channels=3,
stem_channels=64,
base_channels=64,
num_stages=4,
strides=(1, 2, 2, 2),
dilations=(1, 1, 1, 1),
out_indices=(0, 1, 2, 3),
style='pytorch',
deep_stem=False,
avg_down=False,
frozen_stages=-1,
conv_cfg=None,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=False,
dcn=None,
stage_with_dcn=(False, False, False, False),
plugins=None,
multi_grid=None,
contract_dilation=False,
with_cp=False,
zero_init_residual=True,
pretrained=None,
init_cfg=None):
super(ResNet, self).__init__(init_cfg)
if depth not in self.arch_settings:
raise KeyError(f'invalid depth {depth} for resnet')
self.pretrained = pretrained
self.zero_init_residual = zero_init_residual
block_init_cfg = None
assert not (init_cfg and pretrained), \
'init_cfg and pretrained cannot be setting at the same time'
if isinstance(pretrained, str):
warnings.warn('DeprecationWarning: pretrained is a deprecated, '
'please use "init_cfg" instead')
self.init_cfg = dict(type='Pretrained', checkpoint=pretrained)
elif pretrained is None:
if init_cfg is None:
self.init_cfg = [
dict(type='Kaiming', layer='Conv2d'),
dict(
type='Constant',
val=1,
layer=['_BatchNorm', 'GroupNorm'])
]
block = self.arch_settings[depth][0]
if self.zero_init_residual:
|
else:
raise TypeError('pretrained must be a str or None')
self.depth = depth
self.stem_channels = stem_channels
self.base_channels = base_channels
self.num_stages = num_stages
assert num_stages >= 1 and num_stages <= 4
self.strides = strides
self.dilations = dilations
assert len(strides) == len(dilations) == num_stages
self.out_indices = out_indices
assert max(out_indices) < num_stages
self.style = style
self.deep_stem = deep_stem
self.avg_down = avg_down
self.frozen_stages = frozen_stages
self.conv_cfg = conv_cfg
self.norm_cfg = norm_cfg
self.with_cp = with_cp
self.norm_eval = norm_eval
self.dcn = dcn
self.stage_with_dcn = stage_with_dcn
if dcn is not None:
assert len(stage_with_dcn) == num_stages
self.plugins = plugins
self.multi_grid = multi_grid
self.contract_dilation = contract_dilation
self.block, stage_blocks = self.arch_settings[depth]
self.stage_blocks = stage_blocks[:num_stages]
self.inplanes = stem_channels
self._make_stem_layer(in_channels, stem_channels)
self.res_layers = []
for i, num_blocks in enumerate(self.stage_blocks):
stride = strides[i]
dilation = dilations[i]
dcn = self.dcn if self.stage_with_dcn[i] else None
if plugins is not None:
stage_plugins = self.make_stage_plugins(plugins, i)
else:
stage_plugins = None
# multi grid is applied to last layer only
stage_multi_grid = multi_grid if i == len(
self.stage_blocks) - 1 else None
planes = base_channels * 2**i
res_layer = self.make_res_layer(
block=self.block,
inplanes=self.inplanes,
planes=planes,
num_blocks=num_blocks,
stride=stride,
dilation=dilation,
style=self.style,
avg_down=self.avg_down,
with_cp=with_cp,
conv_cfg=conv_cfg,
norm_cfg=norm_cfg,
dcn=dcn,
plugins=stage_plugins,
multi_grid=stage_multi_grid,
contract_dilation=contract_dilation,
init_cfg=block_init_cfg)
self.inplanes = planes * self.block.expansion
layer_name = f'layer{i+1}'
self.add_module(layer_name, res_layer)
self.res_layers.append(layer_name)
self._freeze_stages()
self.feat_dim = self.block.expansion * base_channels * 2**(
len(self.stage_blocks) - 1)
def make_stage_plugins(self, plugins, stage_idx):
"""make plugins for ResNet 'stage_idx'th stage .
Currently we support to insert 'context_block',
'empirical_attention_block', 'nonlocal_block' into the backbone like
ResNet/ResNeXt. They could be inserted after conv1/conv2/conv3 of
Bottleneck.
An example of plugins format could be :
>>> plugins=[
... dict(cfg=dict(type='xxx', arg1='xxx'),
... stages=(False, True, True, True),
... position='after_conv2'),
... dict(cfg=dict(type='yyy'),
... stages=(True, True, True, True),
... position='after_conv3'),
... dict(cfg=dict(type='zzz', postfix='1'),
... stages=(True, True, True, True),
... position='after_conv3'),
... dict(cfg=dict(type='zzz', postfix='2'),
... stages=(True, True, True, True),
... position='after_conv3')
... ]
>>> self = ResNet(depth=18)
>>> stage_plugins = self.make_stage_plugins(plugins, 0)
>>> assert len(stage_plugins) == 3
Suppose 'stage_idx=0', the structure of blocks in the stage would be:
conv1-> conv2->conv3->yyy->zzz1->zzz2
Suppose 'stage_idx=1', the structure of blocks in the stage would be:
conv1-> conv2->xxx->conv3->yyy->zzz1->zzz2
If stages is missing, the plugin would be applied to all stages.
Args:
plugins (list[dict]): List of plugins cfg to build. The postfix is
required if multiple same type plugins are inserted.
stage_idx (int): Index of stage to build
Returns:
list[dict]: Plugins for current stage
"""
stage_plugins = []
for plugin in plugins:
plugin = plugin.copy()
stages = plugin.pop('stages', None)
assert stages is None or len(stages) == self.num_stages
# whether to insert plugin into current stage
if stages is None or stages[stage_idx]:
stage_plugins.append(plugin)
return stage_plugins
def make_res_layer(self, **kwargs):
"""Pack all blocks in a stage into a ``ResLayer``."""
return ResLayer(**kwargs)
@property
def norm1(self):
"""nn.Module: the normalization layer named "norm1" """
return getattr(self, self.norm1_name)
def _make_stem_layer(self, in_channels, stem_channels):
"""Make stem layer for ResNet."""
if self.deep_stem:
self.stem = nn.Sequential(
build_conv_layer(
self.conv_cfg,
in_channels,
stem_channels // 2,
kernel_size=3,
stride=2,
padding=1,
bias=False),
build_norm_layer(self.norm_cfg, stem_channels // 2)[1],
nn.ReLU(inplace=True),
build_conv_layer(
self.conv_cfg,
stem_channels // 2,
stem_channels // 2,
kernel_size=3,
stride=1,
padding=1,
bias=False),
build_norm_layer(self.norm_cfg, stem_channels // 2)[1],
nn.ReLU(inplace=True),
build_conv_layer(
self.conv_cfg,
stem_channels // 2,
stem_channels,
kernel_size=3,
stride=1,
padding=1,
bias=False),
build_norm_layer(self.norm_cfg, stem_channels)[1],
nn.ReLU(inplace=True))
else:
self.conv1 = build_conv_layer(
self.conv_cfg,
in_channels,
stem_channels,
kernel_size=7,
stride=2,
padding=3,
bias=False)
self.norm1_name, norm1 = build_norm_layer(
self.norm_cfg, stem_channels, postfix=1)
self.add_module(self.norm1_name, norm1)
self.relu = nn.ReLU(inplace=True)
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
def _freeze_stages(self):
"""Freeze stages param and norm stats."""
if self.frozen_stages >= 0:
if self.deep_stem:
self.stem.eval()
for param in self.stem.parameters():
param.requires_grad = False
else:
self.norm1.eval()
for m in [self.conv1, self.norm1]:
for param in m.parameters():
param.requires_grad = False
for i in range(1, self.frozen_stages + 1):
m = getattr(self, f'layer{i}')
m.eval()
for param in m.parameters():
param.requires_grad = False
def forward(self, x):
"""Forward function."""
if self.deep_stem:
x = self.stem(x)
else:
x = self.conv1(x)
x = self.norm1(x)
x = self.relu(x)
x = self.maxpool(x)
outs = []
for i, layer_name in enumerate(self.res_layers):
res_layer = getattr(self, layer_name)
x = res_layer(x)
if i in self.out_indices:
outs.append(x)
return tuple(outs)
def train(self, mode=True):
"""Convert the model into training mode while keep normalization layer
freezed."""
super(ResNet, self).train(mode)
self._freeze_stages()
if mode and self.norm_eval:
for m in self.modules():
# trick: eval have effect on BatchNorm only
if isinstance(m, _BatchNorm):
m.eval()
@BACKBONES.register_module()
class ResNetV1c(ResNet):
"""ResNetV1c variant described in [1]_.
Compared with default ResNet(ResNetV1b), ResNetV1c replaces the 7x7 conv
in the input stem with three 3x3 convs.
References:
.. [1] https://arxiv.org/pdf/1812.01187.pdf
"""
def __init__(self, **kwargs):
super(ResNetV1c, self).__init__(
deep_stem=True, avg_down=False, **kwargs)
@BACKBONES.register_module()
class ResNetV1d(ResNet):
"""ResNetV1d variant described in [1]_.
Compared with default ResNet(ResNetV1b), ResNetV1d replaces the 7x7 conv in
the input stem with three 3x3 convs. And in the downsampling block, a 2x2
avg_pool with stride 2 is added before conv, whose stride is changed to 1.
"""
def __init__(self, **kwargs):
super(ResNetV1d, self).__init__(
deep_stem=True, avg_down=True, **kwargs)
| if block is BasicBlock:
block_init_cfg = dict(
type='Constant',
val=0,
override=dict(name='norm2'))
elif block is Bottleneck:
block_init_cfg = dict(
type='Constant',
val=0,
override=dict(name='norm3')) |
chart.js | import _ from 'lodash'; | import { Sparklines, SparklinesLine, SparklinesReferenceLine } from 'react-sparklines';
function average(data) {
return _.round(_.sum(data)/data.length);
}
export default (props) => {
return (
<div>
<Sparklines height={120} width={180} data={props.data}>
<SparklinesLine color = {props.color} />
<SparklinesReferenceLine type = "avg" />
</Sparklines>
<div>{average(props.data)} {props.units}</div>
</div>
)
} | import React from 'react'; |
get-first-element-child.ts | export function | <GElement extends Element>(
node: Element,
): GElement | null {
return node.firstElementChild as (GElement | null);
}
| getFirstElementChild |
client-host-ref.ts | import * as d from '../declarations';
import { BUILD } from '@build-conditionals';
const hostRefs: WeakMap<d.RuntimeRef, d.HostRef> = /*@__PURE__*/new WeakMap();
export const getHostRef = (ref: d.RuntimeRef) =>
hostRefs.get(ref); |
export const registerInstance = (lazyInstance: any, hostRef: d.HostRef) =>
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
export const registerHost = (elm: d.HostElement) => {
if (BUILD.lazyLoad) {
const hostRef: d.HostRef = {
$flags$: 0,
$hostElement$: elm,
$instanceValues$: new Map()
};
hostRef.$onReadyPromise$ = new Promise(r => hostRef.$onReadyResolve$ = r);
return hostRefs.set(elm, hostRef);
} else {
return hostRefs.set(elm, {
$flags$: 0,
$instanceValues$: new Map()
});
}
};
export const isMemberInElement = (elm: any, memberName: string) => memberName in elm; | |
bank.py | #!/usr/bin/python3
# encoding='utf-8'
# author:weibk
# @time:2021/9/23 19:10
import pymysql
import random
con = pymysql.connect(host="localhost",
user="root",
password="123456",
database="db",
charset="utf8")
cursor = con.cursor(cursor=pymysql.cursors.DictCursor)
print("*****************************")
print("* 中国工商银行 *")
print("* 账户管理系统 *")
print("* V1.0 *")
print("*****************************")
print("* *")
print("* 1.开户 *")
print("* 2.存款 *")
print("* 3.取款 *")
print("* 4.转账 *")
print("* 5.查询 *")
print("* 6.退出 *")
print("*****************************")
BANK_NAME = "中国工商银行"
MONEY_INIT = 0
| # 根据账号查询信息
def getinfo(account):
cursor.execute('select * from bank_user where account=%s', (account,))
result = cursor.fetchone()
return result
# 添加用户
def useradd():
# 判断用户库是否已满
s = cursor.execute("select * from bank_user")
if s == 100:
return 3
# 判断用户是否存在
while True:
username = input("请输入您的姓名:")
cursor.execute("select username from bank_user")
uname = cursor.fetchall()
for item in uname:
if username == item['username']:
return 2
break
password = input("请设置一个密码:")
print("请您填写地址:")
country = input("\t请输入您所在的国家:")
province = input("\t请输入您所在的城市:")
street = input("\t请输入您所在的街道:")
house_number = input("\t请输入您的门牌号:")
# 判断账号是否已经存在,如果已经存在则重新生成
while True:
account = str(random.randint(10, 99)) + str(
random.randint(10, 99)) + str(
random.randint(10, 99)) + str(random.randint(10, 99))
cursor.execute("select account from bank_user")
uname = cursor.fetchall()
for item in uname:
if account == item['account']:
continue
else:
break
cursor.execute("insert into bank_user values "
"(%s, %s, %s, %s, %s, %s, %s, %s, %s)",
(repr(account), repr(username), repr(password),
repr(country), repr(province),
repr(street), repr(house_number),
repr(BANK_NAME), repr(MONEY_INIT)))
con.commit()
cursor.execute("select * from bank_user where account=%s", (account,))
info1 = cursor.fetchone()
return info1
# 登录方法
def login():
while True:
acc = int(input("请输入您的账号"))
cursor.execute("select account from bank_user")
uname = cursor.fetchall()
for item in uname:
if acc == item['account']:
while True:
pwd = input("请输入密码:")
cursor.execute("select * from bank_user where "
"account=%s", (acc,))
info1 = cursor.fetchone()
if pwd == info1['password']:
return {"flag": 1, 'info': info1}
else:
return 2
else:
continue
return 3
while True:
step = input("请选择业务:")
if step == "1":
info = useradd()
print(type(info))
# 如果开户成功,打印用户信息
if isinstance(info, dict):
profile = '''
用户信息
---------------
账号:%s
姓名:%s
密码:%s
地址:%s-%s-%s-%s
余额:%s
开户行:%s
---------------
'''
print("恭喜你开户成功!!,您的信息如下:")
print(profile % (info['account'], info['username'],
info['password'], info['country'],
info['province'], info['street'],
info['house_number'], info['bank'],
info['balance']))
elif info == 2:
print("该用户已存在")
continue
elif info == 3:
print("用户库已满暂不支持开户业务")
continue
elif step == "2":
flag = login()
if isinstance(flag, dict):
bank = flag['info']
yue = bank['balance']
print(f"你好,{bank['username']}登录成功!账户当前余额为{yue}")
# 登录成功存款
while True:
cunkuan = input("请输入您要存的金额:")
if cunkuan == 'Q' or cunkuan == 'q':
break
elif cunkuan.isdigit():
cunkuan = int(cunkuan)
else:
print('存款请输入正数,输入Q/q可退出业务')
continue
yue += cunkuan
print(f"存款成功!余额为{yue}")
cursor.execute("update bank_user set balance=%s where "
"account=%s", (yue, bank['account']))
con.commit()
break
elif flag == 2:
print("密码错误!")
continue
elif flag == 3:
print("账号不存在!")
continue
elif step == "3":
flag = login()
if isinstance(flag, dict):
bank = flag['info']
yue = bank['balance']
# 判断余额是否为0
if yue == 0:
print(f"你好,{bank['username']},您的余额为0,不能使用取款业务")
continue
else:
print(f"你好,{bank['username']},登录成功!账户当前余额为{yue}")
while True:
qukuan = input("请输入您要取的金额:")
if qukuan == 'Q' or qukuan == 'q':
break
elif qukuan.isdigit():
qukuan = int(qukuan)
else:
print('取款请输入正数,输入Q/q可退出业务')
# 判断余额是否足够
if yue < qukuan:
print('您的余额不足')
break
else:
yue -= qukuan
print(f"取款成功!余额为{yue}")
cursor.execute("update bank_user set balance=%s where "
"account=%s", (yue, bank['account']))
con.commit()
break
elif flag == 2:
print("密码错误!")
continue
elif flag == 3:
print("账号不存在!")
continue
elif step == "4":
flag = login()
if isinstance(flag, dict):
bank = flag['info']
yue = bank['balance']
acc1 = bank['account']
# 余额为0不能转账
if yue == 0:
print(f"你好,{bank['username']},您的余额为0,不能使用转账业务")
continue
else:
print(f"你好,{bank['username']},登录成功!账户当前余额为{yue}")
while True:
acc2 = input("请输入您要转账的账户:")
# 判断转入账户是否存在
y = cursor.execute(
"select * from bank_user where account=%s", (acc2,))
x = cursor.fetchone()
if y == 1:
# 判断转出和转入账户是否相同
if acc2 != acc1:
zhuan = input("请输入您要转的金额:")
if zhuan == 'Q' or zhuan == 'q':
break
elif zhuan.isdigit():
zhuan = int(zhuan)
else:
print('转账请输入正数,输入Q/q可退出业务')
# 判断余额
if yue < zhuan:
print("您的余额不足,输入Q/q可退出业务")
break
else:
# 转出账户余额减少
yue -= zhuan
print(f"转账成功!您的余额为{yue}")
cursor.execute(
"update bank_user set balance=%s where "
"account=%s", (yue, acc1))
con.commit()
# 转入账户余额增加
x['balance'] += zhuan
cursor.execute(
"update bank_user set balance=%s where "
"account=%s", (x['balance'], acc2))
con.commit()
break
else:
print('不能给自己转账,输入Q/q可退出业务')
continue
else:
print("您输入的账号不存在,输入Q/q可退出业务")
continue
elif flag == 2:
print("密码错误!")
continue
elif flag == 3:
print("账号不存在!")
continue
elif step == "5":
flag = login()
if isinstance(flag, dict):
bank = flag['info']
print(f"登录成功!账户当前信息如下:")
profile = '''
用户信息
---------------
账号:%s
姓名:%s
密码:%s
地址:%s-%s-%s-%s
开户行:%s
余额:%s
---------------
'''
print(profile % (bank['account'], bank['username'],
bank['password'], bank['country'],
bank['province'], bank['street'],
bank['house_number'], bank['bank'],
bank['balance']))
elif flag == 2:
print("密码错误!")
continue
elif flag == 3:
print("账号不存在!")
continue
elif step == "6":
break
con.commit()
cursor.close()
con.close() | |
common_test.go | // Copyright 2021 NetApp, Inc. All Rights Reserved.
package storagedrivers
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAreSameCredentials(t *testing.T) | {
type Credentials struct {
Credential1 map[string]string
Credential2 map[string]string
Same bool
}
inputs := []Credentials{
{
map[string]string{"name": "secret1", "type": "secret"},
map[string]string{"name": "secret1", "type": "secret"},
true,
},
{
map[string]string{"name": "secret1", "type": "secret"},
map[string]string{"name": "secret1"},
true,
},
{
map[string]string{"name": "secret1", "type": "secret"},
map[string]string{"name": "secret1", "type": "random"},
false,
},
{
map[string]string{"name": "secret1"},
map[string]string{"name": "secret1", "type": "random"},
false,
},
{
map[string]string{"name": "", "type": "secret", "randomKey": "randomValue"},
map[string]string{"name": "", "type": "secret", "randomKey": "randomValue"},
false,
},
}
for _, input := range inputs {
areEqual := AreSameCredentials(input.Credential1, input.Credential2)
assert.Equal(t, areEqual, input.Same)
}
} |
|
pagination.go | package pagination
import (
"encoding/json"
"errors"
"net/http"
"reflect"
"strconv"
"github.com/ONSdigital/log.go/v2/log"
)
// PaginatedHandler is a func type for an endpoint that returns a list of values that we want to paginate
type PaginatedHandler func(w http.ResponseWriter, r *http.Request, limit int, offset int) (list interface{}, totalCount int, err error)
type page struct {
Items interface{} `json:"items"`
Count int `json:"count"`
Offset int `json:"offset"`
Limit int `json:"limit"`
TotalCount int `json:"total_count"`
}
type Paginator struct {
DefaultLimit int
DefaultOffset int
DefaultMaxLimit int
}
func | (defaultLimit, defaultOffset, defaultMaxLimit int) *Paginator {
return &Paginator{
DefaultLimit: defaultLimit,
DefaultOffset: defaultOffset,
DefaultMaxLimit: defaultMaxLimit,
}
}
func (p *Paginator) getPaginationParameters(r *http.Request) (offset int, limit int, err error) {
logData := log.Data{}
offsetParameter := r.URL.Query().Get("offset")
limitParameter := r.URL.Query().Get("limit")
offset = p.DefaultOffset
limit = p.DefaultLimit
if offsetParameter != "" {
logData["offset"] = offsetParameter
offset, err = strconv.Atoi(offsetParameter)
if err != nil || offset < 0 {
err = errors.New("invalid query parameter")
log.Error(r.Context(), "invalid query parameter: offset", err, logData)
return 0, 0, err
}
}
if limitParameter != "" {
logData["limit"] = limitParameter
limit, err = strconv.Atoi(limitParameter)
if err != nil || limit < 0 {
err = errors.New("invalid query parameter")
log.Error(r.Context(), "invalid query parameter: limit", err, logData)
return 0, 0, err
}
}
if limit > p.DefaultMaxLimit {
logData["max_limit"] = p.DefaultMaxLimit
err = errors.New("invalid query parameter")
log.Error(r.Context(), "limit is greater than the maximum allowed", err, logData)
return 0, 0, err
}
return
}
func renderPage(list interface{}, offset int, limit int, totalCount int) page {
return page{
Items: list,
Count: listLength(list),
Offset: offset,
Limit: limit,
TotalCount: totalCount,
}
}
func listLength(list interface{}) int {
l := reflect.ValueOf(list)
return l.Len()
}
// Paginate wraps a http endpoint to return a paginated list from the list returned by the provided function
func (p *Paginator) Paginate(paginatedHandler PaginatedHandler) func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
offset, limit, err := p.getPaginationParameters(r)
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
list, totalCount, err := paginatedHandler(w, r, limit, offset)
if err != nil {
return
}
page := renderPage(list, offset, limit, totalCount)
returnPaginatedResults(w, r, page)
}
}
func returnPaginatedResults(w http.ResponseWriter, r *http.Request, list page) {
logData := log.Data{"path": r.URL.Path, "method": r.Method}
b, err := json.Marshal(list)
if err != nil {
log.Error(r.Context(), "api endpoint failed to marshal resource into bytes", err, logData)
http.Error(w, "internal error", http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json")
if _, err = w.Write(b); err != nil {
log.Error(r.Context(), "api endpoint error writing response body", err, logData)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
log.Info(r.Context(), "api endpoint request successful", logData)
}
| NewPaginator |
check.rs | use crate::error::Error;
#[cfg(feature = "logging")]
use crate::log::warn;
use crate::msgs::enums::{ContentType, HandshakeType};
use crate::msgs::handshake::HandshakeMessagePayload;
use crate::msgs::message::{Message, MessagePayload};
/// For a Message $m, and a HandshakePayload enum member $payload_type,
/// return Ok(payload) if $m is both a handshake message and one that
/// has the given $payload_type. If not, return Err(rustls::Error) quoting
/// $handshake_type as the expected handshake type.
macro_rules! require_handshake_msg(
( $m:expr, $handshake_type:path, $payload_type:path ) => (
match $m.payload {
MessagePayload::Handshake(ref hsp) => match hsp.payload {
$payload_type(ref hm) => Ok(hm),
_ => Err(Error::InappropriateHandshakeMessage {
expect_types: vec![ $handshake_type ],
got_type: hsp.typ})
}
_ => Err(Error::InappropriateMessage {
expect_types: vec![ ContentType::Handshake ],
got_type: $m.payload.content_type()})
}
)
);
/// Like require_handshake_msg, but moves the payload out of $m.
macro_rules! require_handshake_msg_move(
( $m:expr, $handshake_type:path, $payload_type:path ) => (
match $m.payload {
MessagePayload::Handshake(hsp) => match hsp.payload {
$payload_type(hm) => Ok(hm),
_ => Err(Error::InappropriateHandshakeMessage {
expect_types: vec![ $handshake_type ],
got_type: hsp.typ})
}
_ => Err(Error::InappropriateMessage {
expect_types: vec![ ContentType::Handshake ],
got_type: $m.payload.content_type()})
}
)
);
/// Validate the message `m`: return an error if:
///
/// - the type of m does not appear in `content_types`.
/// - if m is a handshake message, the handshake message type does
/// not appear in `handshake_types`.
pub(crate) fn check_message(
m: &Message,
content_types: &[ContentType],
handshake_types: &[HandshakeType],
) -> Result<(), Error> |
pub(crate) fn inappropriate_message(m: &Message, content_types: &[ContentType]) -> Error {
warn!(
"Received a {:?} message while expecting {:?}",
m.payload.content_type(),
content_types
);
Error::InappropriateMessage {
expect_types: content_types.to_vec(),
got_type: m.payload.content_type(),
}
}
pub(crate) fn inappropriate_handshake_message(
hsp: &HandshakeMessagePayload,
handshake_types: &[HandshakeType],
) -> Error {
warn!(
"Received a {:?} handshake message while expecting {:?}",
hsp.typ, handshake_types
);
Error::InappropriateHandshakeMessage {
expect_types: handshake_types.to_vec(),
got_type: hsp.typ,
}
}
| {
if !content_types.contains(&m.payload.content_type()) {
return Err(inappropriate_message(m, content_types));
}
if let MessagePayload::Handshake(ref hsp) = m.payload {
if !handshake_types.is_empty() && !handshake_types.contains(&hsp.typ) {
return Err(inappropriate_handshake_message(hsp, handshake_types));
}
}
Ok(())
} |
config_builder.rs | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{constants, layout::Layout, storage_helper::StorageHelper};
use config_builder::BuildSwarm;
use libra_config::{
config::{
DiscoveryMethod, Identity, NodeConfig, OnDiskStorageConfig, SafetyRulesService,
SecureBackend, SeedAddresses, WaypointConfig, HANDSHAKE_VERSION,
},
network_id::NetworkId,
};
use libra_crypto::ed25519::Ed25519PrivateKey;
use libra_secure_storage::{CryptoStorage, KVStorage, Value};
use libra_temppath::TempPath;
use std::path::{Path, PathBuf};
const LIBRA_ROOT_NS: &str = "libra_root";
const LIBRA_ROOT_SHARED_NS: &str = "libra_root_shared";
const OPERATOR_NS: &str = "_operator";
const OPERATOR_SHARED_NS: &str = "_operator_shared";
const OWNER_NS: &str = "_owner";
const OWNER_SHARED_NS: &str = "_owner_shared";
pub struct ValidatorBuilder<T: AsRef<Path>> {
storage_helper: StorageHelper,
num_validators: usize,
template: NodeConfig,
swarm_path: T,
}
impl<T: AsRef<Path>> ValidatorBuilder<T> {
pub fn new(num_validators: usize, template: NodeConfig, swarm_path: T) -> Self {
Self {
storage_helper: StorageHelper::new(),
num_validators,
template,
swarm_path,
}
}
fn secure_backend(&self, ns: &str, usage: &str) -> SecureBackend {
let original = self.storage_helper.path();
let dst_base = self.swarm_path.as_ref();
let mut dst = dst_base.to_path_buf();
dst.push(format!("{}_{}", usage, ns));
std::fs::copy(original, &dst).unwrap();
let mut storage_config = OnDiskStorageConfig::default();
storage_config.path = dst;
storage_config.set_data_dir(PathBuf::from(""));
storage_config.namespace = Some(ns.into());
SecureBackend::OnDiskStorage(storage_config)
}
/// Association uploads the validator layout to shared storage.
fn create_layout(&self) {
let mut layout = Layout::default();
layout.libra_root = vec![LIBRA_ROOT_SHARED_NS.into()];
layout.owners = (0..self.num_validators)
.map(|i| (i.to_string() + OWNER_SHARED_NS))
.collect();
layout.operators = (0..self.num_validators)
.map(|i| (i.to_string() + OPERATOR_SHARED_NS))
.collect();
let mut common_storage = self
.storage_helper
.storage(crate::constants::COMMON_NS.into());
let layout_value = Value::String(layout.to_toml().unwrap());
common_storage
.set(crate::constants::LAYOUT, layout_value)
.unwrap();
}
/// Association initializes its account and the libra root key.
fn create_libra_root(&self) {
self.storage_helper.initialize(LIBRA_ROOT_NS.into());
self.storage_helper
.libra_root_key(LIBRA_ROOT_NS, LIBRA_ROOT_SHARED_NS)
.unwrap();
}
/// Generate owner key locally and upload to shared storage.
fn initialize_validator_owner(&self, index: usize) {
let local_ns = index.to_string() + OWNER_NS;
let remote_ns = index.to_string() + OWNER_SHARED_NS;
self.storage_helper.initialize(local_ns.clone());
let _ = self
.storage_helper
.owner_key(&local_ns, &remote_ns)
.unwrap();
}
/// Generate operator key locally and upload to shared storage.
fn initialize_validator_operator(&self, index: usize) {
let local_ns = index.to_string() + OPERATOR_NS;
let remote_ns = index.to_string() + OPERATOR_SHARED_NS;
self.storage_helper.initialize(local_ns.clone());
let _ = self
.storage_helper
.operator_key(&local_ns, &remote_ns)
.unwrap();
}
/// Sets the operator for the owner by uploading a set-operator transaction to shared storage.
/// Note, we assume that owner i chooses operator i to operate the validator.
fn set_validator_operator(&self, index: usize) |
/// Operators upload their validator_config to shared storage.
fn initialize_validator_config(&self, index: usize) -> NodeConfig {
let local_ns = index.to_string() + OPERATOR_NS;
let remote_ns = index.to_string() + OPERATOR_SHARED_NS;
let mut config = self.template.clone_for_template();
config.randomize_ports();
let validator_network = config.validator_network.as_mut().unwrap();
let validator_network_address = validator_network.listen_address.clone();
let fullnode_network = &mut config.full_node_networks[0];
let fullnode_network_address = fullnode_network.listen_address.clone();
self.storage_helper
.validator_config(
&(index.to_string() + OWNER_SHARED_NS),
validator_network_address,
fullnode_network_address,
self.template.base.chain_id,
&local_ns,
&remote_ns,
)
.unwrap();
validator_network.identity = Identity::from_storage(
libra_global_constants::VALIDATOR_NETWORK_KEY.into(),
libra_global_constants::OWNER_ACCOUNT.into(),
self.secure_backend(&local_ns, "validator"),
);
fullnode_network.identity = Identity::from_storage(
libra_global_constants::FULLNODE_NETWORK_KEY.into(),
libra_global_constants::OWNER_ACCOUNT.into(),
self.secure_backend(&local_ns, "full_node"),
);
config
}
/// Operators generate genesis from shared storage and verify against waypoint.
/// Insert the genesis/waypoint into local config.
fn finish_validator_config(&self, index: usize, config: &mut NodeConfig) {
let local_ns = index.to_string() + OPERATOR_NS;
let genesis_path = TempPath::new();
genesis_path.create_as_file().unwrap();
let genesis = self.storage_helper.genesis(genesis_path.path()).unwrap();
let _ = self
.storage_helper
.insert_waypoint(&local_ns, constants::COMMON_NS)
.unwrap();
let output = self
.storage_helper
.verify_genesis(&local_ns, genesis_path.path())
.unwrap();
assert_eq!(output.split("match").count(), 5);
config.consensus.safety_rules.service = SafetyRulesService::Thread;
config.consensus.safety_rules.backend = self.secure_backend(&local_ns, "safety-rules");
config.execution.backend = self.secure_backend(&local_ns, "execution");
let backend = self.secure_backend(&local_ns, "waypoint");
config.base.waypoint = WaypointConfig::FromStorage(backend);
config.execution.genesis = Some(genesis);
config.execution.genesis_file_location = PathBuf::from("");
}
}
impl<T: AsRef<Path>> BuildSwarm for ValidatorBuilder<T> {
fn build_swarm(&self) -> anyhow::Result<(Vec<NodeConfig>, Ed25519PrivateKey)> {
self.create_layout();
self.create_libra_root();
let libra_root_key = self
.storage_helper
.storage(LIBRA_ROOT_NS.into())
.export_private_key(libra_global_constants::LIBRA_ROOT_KEY)
.unwrap();
// Upload both owner and operator keys to shared storage
for index in 0..self.num_validators {
self.initialize_validator_owner(index);
self.initialize_validator_operator(index);
}
// Set the operator for each owner and the validator config for each operator
let mut configs = vec![];
for index in 0..self.num_validators {
let _ = self.set_validator_operator(index);
let config = self.initialize_validator_config(index);
configs.push(config);
}
// Create genesis and waypoint
let _ = self
.storage_helper
.create_waypoint(constants::COMMON_NS)
.unwrap();
for (i, config) in configs.iter_mut().enumerate() {
self.finish_validator_config(i, config);
}
Ok((configs, libra_root_key))
}
}
#[derive(Debug)]
pub enum FullnodeType {
ValidatorFullnode,
PublicFullnode(usize),
}
pub struct FullnodeBuilder {
validator_config_path: Vec<PathBuf>,
libra_root_key_path: PathBuf,
template: NodeConfig,
build_type: FullnodeType,
}
impl FullnodeBuilder {
pub fn new(
validator_config_path: Vec<PathBuf>,
libra_root_key_path: PathBuf,
template: NodeConfig,
build_type: FullnodeType,
) -> Self {
Self {
validator_config_path,
libra_root_key_path,
template,
build_type,
}
}
fn attach_validator_full_node(&self, validator_config: &mut NodeConfig) -> NodeConfig {
// Create two vfns, we'll pass one to the validator later
let mut full_node_config = self.template.clone_for_template();
full_node_config.randomize_ports();
// The FN's external, public network needs to swap listen addresses
// with the validator's VFN and to copy it's key access:
let pfn = &mut full_node_config
.full_node_networks
.iter_mut()
.find(|n| {
n.network_id == NetworkId::Public && n.discovery_method != DiscoveryMethod::Onchain
})
.expect("vfn missing external public network in config");
let v_vfn = &mut validator_config.full_node_networks[0];
pfn.identity = v_vfn.identity.clone();
let temp_listen = v_vfn.listen_address.clone();
v_vfn.listen_address = pfn.listen_address.clone();
pfn.listen_address = temp_listen;
// Now let's prepare the full nodes internal network to communicate with the validators
// internal network
let v_vfn_network_address = v_vfn.listen_address.clone();
let v_vfn_pub_key = v_vfn.identity_key().public_key();
let v_vfn_network_address =
v_vfn_network_address.append_prod_protos(v_vfn_pub_key, HANDSHAKE_VERSION);
let v_vfn_id = v_vfn.peer_id();
let mut seed_addrs = SeedAddresses::default();
seed_addrs.insert(v_vfn_id, vec![v_vfn_network_address]);
let fn_vfn = &mut full_node_config
.full_node_networks
.iter_mut()
.find(|n| matches!(n.network_id, NetworkId::Private(_)))
.expect("vfn missing vfn full node network in config");
fn_vfn.seed_addrs = seed_addrs;
Self::insert_waypoint_and_genesis(&mut full_node_config, &validator_config);
full_node_config
}
fn insert_waypoint_and_genesis(config: &mut NodeConfig, upstream: &NodeConfig) {
config.base.waypoint = upstream.base.waypoint.clone();
config.execution.genesis = upstream.execution.genesis.clone();
config.execution.genesis_file_location = PathBuf::from("");
}
fn build_vfn(&self) -> anyhow::Result<Vec<NodeConfig>> {
let mut configs = vec![];
for path in &self.validator_config_path {
let mut validator_config = NodeConfig::load(path)?;
let fullnode_config = self.attach_validator_full_node(&mut validator_config);
validator_config.save(path)?;
configs.push(fullnode_config);
}
Ok(configs)
}
fn build_public_fn(&self, num_nodes: usize) -> anyhow::Result<Vec<NodeConfig>> {
let mut configs = vec![];
let validator_config = NodeConfig::load(
self.validator_config_path
.first()
.ok_or_else(|| anyhow::format_err!("No validator config path"))?,
)?;
for _ in 0..num_nodes {
let mut fullnode_config = self.template.clone_for_template();
fullnode_config.randomize_ports();
Self::insert_waypoint_and_genesis(&mut fullnode_config, &validator_config);
configs.push(fullnode_config);
}
Ok(configs)
}
}
impl BuildSwarm for FullnodeBuilder {
fn build_swarm(&self) -> anyhow::Result<(Vec<NodeConfig>, Ed25519PrivateKey)> {
let configs = match self.build_type {
FullnodeType::ValidatorFullnode => self.build_vfn(),
FullnodeType::PublicFullnode(num_nodes) => self.build_public_fn(num_nodes),
}?;
let libra_root_key_path = generate_key::load_key(&self.libra_root_key_path);
Ok((configs, libra_root_key_path))
}
}
| {
let local_ns = index.to_string() + OWNER_NS;
let remote_ns = index.to_string() + OWNER_SHARED_NS;
let operator_name = index.to_string() + OPERATOR_SHARED_NS;
let _ = self
.storage_helper
.set_operator(&operator_name, &local_ns, &remote_ns);
} |
rollup_target_test.go | // Copyright (c) 2018 Uber Technologies, Inc.
//
// 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.
package rules
import (
"testing"
"time"
"github.com/m3db/m3/src/metrics/aggregation"
"github.com/m3db/m3/src/metrics/generated/proto/aggregationpb"
"github.com/m3db/m3/src/metrics/generated/proto/pipelinepb"
"github.com/m3db/m3/src/metrics/generated/proto/policypb"
"github.com/m3db/m3/src/metrics/generated/proto/rulepb"
"github.com/m3db/m3/src/metrics/generated/proto/transformationpb"
"github.com/m3db/m3/src/metrics/pipeline"
"github.com/m3db/m3/src/metrics/policy"
"github.com/m3db/m3/src/metrics/transformation"
xtime "github.com/m3db/m3/src/x/time"
"github.com/stretchr/testify/require"
)
func TestNewRollupTargetV1ProtoNilProto(t *testing.T) {
_, err := newRollupTargetFromV1Proto(nil)
require.Equal(t, errNilRollupTargetV1Proto, err)
}
func TestNewRollupTargetV1ProtoInvalidProto(t *testing.T) {
proto := &rulepb.RollupTarget{
Policies: []*policypb.Policy{
&policypb.Policy{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: 10 * time.Second.Nanoseconds(),
Precision: time.Second.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 24 * time.Hour.Nanoseconds(),
},
},
AggregationTypes: []aggregationpb.AggregationType{10, 1234567},
},
},
}
_, err := newRollupTargetFromV1Proto(proto)
require.Error(t, err)
}
func TestNewRollupTargetV1ProtoWithDefaultAggregationID(t *testing.T) {
proto := &rulepb.RollupTarget{
Name: "testV1Proto",
Tags: []string{"testTag2", "testTag1"},
Policies: []*policypb.Policy{
{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: 10 * time.Second.Nanoseconds(),
Precision: time.Second.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 24 * time.Hour.Nanoseconds(),
},
},
},
{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: time.Minute.Nanoseconds(),
Precision: time.Minute.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 720 * time.Hour.Nanoseconds(),
},
},
},
{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: time.Hour.Nanoseconds(),
Precision: time.Hour.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 365 * 24 * time.Hour.Nanoseconds(),
},
},
},
},
}
res, err := newRollupTargetFromV1Proto(proto)
require.NoError(t, err)
rr1, err := pipeline.NewRollupOp(
pipeline.GroupByRollupType,
"testV1Proto",
[]string{"testTag1", "testTag2"},
aggregation.DefaultID,
)
require.NoError(t, err)
expected := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.RollupOpType,
Rollup: rr1,
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Second, 24*time.Hour),
policy.NewStoragePolicy(time.Minute, xtime.Minute, 720*time.Hour),
policy.NewStoragePolicy(time.Hour, xtime.Hour, 365*24*time.Hour),
},
}
require.Equal(t, expected, res)
}
func TestNewRollupTargetV1ProtoWithCustomAggregationID(t *testing.T) {
proto := &rulepb.RollupTarget{
Name: "testV1Proto",
Tags: []string{"testTag2", "testTag1"},
Policies: []*policypb.Policy{
{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: 10 * time.Second.Nanoseconds(),
Precision: time.Second.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 24 * time.Hour.Nanoseconds(),
},
},
AggregationTypes: []aggregationpb.AggregationType{1, 2},
},
{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: time.Minute.Nanoseconds(),
Precision: time.Minute.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 720 * time.Hour.Nanoseconds(),
},
},
AggregationTypes: []aggregationpb.AggregationType{1, 2},
},
{
StoragePolicy: &policypb.StoragePolicy{
Resolution: policypb.Resolution{
WindowSize: time.Hour.Nanoseconds(),
Precision: time.Hour.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 365 * 24 * time.Hour.Nanoseconds(),
},
},
AggregationTypes: []aggregationpb.AggregationType{1, 2},
},
},
}
res, err := newRollupTargetFromV1Proto(proto)
require.NoError(t, err)
rr1, err := pipeline.NewRollupOp(
pipeline.GroupByRollupType,
"testV1Proto",
[]string{"testTag1", "testTag2"},
aggregation.MustCompressTypes(aggregation.Last, aggregation.Min),
)
require.NoError(t, err)
expected := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.RollupOpType,
Rollup: rr1,
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Second, 24*time.Hour),
policy.NewStoragePolicy(time.Minute, xtime.Minute, 720*time.Hour),
policy.NewStoragePolicy(time.Hour, xtime.Hour, 365*24*time.Hour),
},
}
require.Equal(t, expected, res)
}
func TestNewRollupTargetV2ProtoNilProto(t *testing.T) {
_, err := newRollupTargetFromV2Proto(nil)
require.Equal(t, err, errNilRollupTargetV2Proto)
}
func TestNewRollupTargetV2ProtoInvalidPipelineProto(t *testing.T) {
proto := &rulepb.RollupTargetV2{
Pipeline: &pipelinepb.Pipeline{
Ops: []pipelinepb.PipelineOp{
{
Type: pipelinepb.PipelineOp_TRANSFORMATION,
Transformation: &pipelinepb.TransformationOp{
Type: transformationpb.TransformationType_UNKNOWN,
},
},
},
},
}
_, err := newRollupTargetFromV2Proto(proto)
require.Error(t, err)
}
func TestNewRollupTargetV2ProtoInvalidStoragePoliciesProto(t *testing.T) {
proto := &rulepb.RollupTargetV2{
Pipeline: &pipelinepb.Pipeline{
Ops: []pipelinepb.PipelineOp{
{
Type: pipelinepb.PipelineOp_TRANSFORMATION,
Transformation: &pipelinepb.TransformationOp{
Type: transformationpb.TransformationType_ABSOLUTE,
},
},
},
},
StoragePolicies: []*policypb.StoragePolicy{
&policypb.StoragePolicy{
Resolution: policypb.Resolution{Precision: 1234},
Retention: policypb.Retention{Period: 5678},
},
},
}
_, err := newRollupTargetFromV2Proto(proto)
require.Error(t, err)
}
func TestNewRollupTargetV2Proto(t *testing.T) {
proto := &rulepb.RollupTargetV2{
Pipeline: &pipelinepb.Pipeline{
Ops: []pipelinepb.PipelineOp{
{
Type: pipelinepb.PipelineOp_AGGREGATION,
Aggregation: &pipelinepb.AggregationOp{
Type: aggregationpb.AggregationType_SUM,
},
},
{
Type: pipelinepb.PipelineOp_TRANSFORMATION,
Transformation: &pipelinepb.TransformationOp{
Type: transformationpb.TransformationType_ABSOLUTE,
},
},
{
Type: pipelinepb.PipelineOp_ROLLUP,
Rollup: &pipelinepb.RollupOp{
NewName: "testRollupOp",
Tags: []string{"testTag2", "testTag1"},
AggregationTypes: []aggregationpb.AggregationType{
aggregationpb.AggregationType_MIN,
aggregationpb.AggregationType_MAX,
},
},
},
},
},
StoragePolicies: []*policypb.StoragePolicy{
{
Resolution: policypb.Resolution{
WindowSize: 10 * time.Second.Nanoseconds(),
Precision: time.Second.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 24 * time.Hour.Nanoseconds(),
},
},
{
Resolution: policypb.Resolution{
WindowSize: time.Minute.Nanoseconds(),
Precision: time.Minute.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 720 * time.Hour.Nanoseconds(),
},
},
{
Resolution: policypb.Resolution{
WindowSize: time.Hour.Nanoseconds(),
Precision: time.Hour.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 365 * 24 * time.Hour.Nanoseconds(),
},
},
},
}
res, err := newRollupTargetFromV2Proto(proto)
require.NoError(t, err)
rr1, err := pipeline.NewRollupOp(
pipeline.GroupByRollupType,
"testRollupOp",
[]string{"testTag1", "testTag2"},
aggregation.MustCompressTypes(aggregation.Min, aggregation.Max),
)
require.NoError(t, err)
expected := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.AggregationOpType,
Aggregation: pipeline.AggregationOp{
Type: aggregation.Sum,
},
},
{
Type: pipeline.TransformationOpType,
Transformation: pipeline.TransformationOp{
Type: transformation.Absolute,
},
},
{
Type: pipeline.RollupOpType,
Rollup: rr1,
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Second, 24*time.Hour),
policy.NewStoragePolicy(time.Minute, xtime.Minute, 720*time.Hour),
policy.NewStoragePolicy(time.Hour, xtime.Hour, 365*24*time.Hour),
},
}
require.Equal(t, expected, res)
}
func TestRollupTargetClone(t *testing.T) {
rr1, err := pipeline.NewRollupOp(
pipeline.GroupByRollupType,
"testRollupOp",
[]string{"testTag1", "testTag2"},
aggregation.MustCompressTypes(aggregation.Min, aggregation.Max),
)
require.NoError(t, err)
source := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.AggregationOpType,
Aggregation: pipeline.AggregationOp{
Type: aggregation.Sum,
},
},
{
Type: pipeline.TransformationOpType,
Transformation: pipeline.TransformationOp{
Type: transformation.Absolute,
},
},
{
Type: pipeline.RollupOpType,
Rollup: rr1,
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Second, 24*time.Hour),
policy.NewStoragePolicy(time.Minute, xtime.Minute, 720*time.Hour),
policy.NewStoragePolicy(time.Hour, xtime.Hour, 365*24*time.Hour),
},
}
cloned := source.clone()
require.Equal(t, source, cloned)
// Assert that mutating the clone doesn't mutate the source.
cloned2 := source.clone()
cloned.StoragePolicies[0] = policy.NewStoragePolicy(time.Second, xtime.Second, 24*time.Hour)
require.Equal(t, cloned2, source)
}
func TestRollupTargetProtoInvalidPipeline(t *testing.T) {
target := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.TransformationOpType,
Transformation: pipeline.TransformationOp{
Type: transformation.UnknownType,
},
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Second, 24*time.Hour),
policy.NewStoragePolicy(time.Minute, xtime.Minute, 720*time.Hour),
policy.NewStoragePolicy(time.Hour, xtime.Hour, 365*24*time.Hour),
},
}
_, err := target.proto()
require.Error(t, err)
}
func TestRollupTargetProtoInvalidStoragePolicies(t *testing.T) {
target := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.TransformationOpType,
Transformation: pipeline.TransformationOp{
Type: transformation.Absolute,
},
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Unit(100), 24*time.Hour),
},
}
_, err := target.proto()
require.Error(t, err)
}
func | (t *testing.T) {
rr1, err := pipeline.NewRollupOp(
pipeline.GroupByRollupType,
"testRollupOp",
[]string{"testTag1", "testTag2"},
aggregation.MustCompressTypes(aggregation.Min, aggregation.Max),
)
require.NoError(t, err)
target := rollupTarget{
Pipeline: pipeline.NewPipeline([]pipeline.OpUnion{
{
Type: pipeline.AggregationOpType,
Aggregation: pipeline.AggregationOp{
Type: aggregation.Sum,
},
},
{
Type: pipeline.TransformationOpType,
Transformation: pipeline.TransformationOp{
Type: transformation.Absolute,
},
},
{
Type: pipeline.RollupOpType,
Rollup: rr1,
},
}),
StoragePolicies: policy.StoragePolicies{
policy.NewStoragePolicy(10*time.Second, xtime.Second, 24*time.Hour),
policy.NewStoragePolicy(time.Minute, xtime.Minute, 720*time.Hour),
policy.NewStoragePolicy(time.Hour, xtime.Hour, 365*24*time.Hour),
},
}
res, err := target.proto()
require.NoError(t, err)
expected := &rulepb.RollupTargetV2{
Pipeline: &pipelinepb.Pipeline{
Ops: []pipelinepb.PipelineOp{
{
Type: pipelinepb.PipelineOp_AGGREGATION,
Aggregation: &pipelinepb.AggregationOp{
Type: aggregationpb.AggregationType_SUM,
},
},
{
Type: pipelinepb.PipelineOp_TRANSFORMATION,
Transformation: &pipelinepb.TransformationOp{
Type: transformationpb.TransformationType_ABSOLUTE,
},
},
{
Type: pipelinepb.PipelineOp_ROLLUP,
Rollup: &pipelinepb.RollupOp{
NewName: "testRollupOp",
Tags: []string{"testTag1", "testTag2"},
AggregationTypes: []aggregationpb.AggregationType{
aggregationpb.AggregationType_MIN,
aggregationpb.AggregationType_MAX,
},
},
},
},
},
StoragePolicies: []*policypb.StoragePolicy{
{
Resolution: policypb.Resolution{
WindowSize: 10 * time.Second.Nanoseconds(),
Precision: time.Second.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 24 * time.Hour.Nanoseconds(),
},
},
{
Resolution: policypb.Resolution{
WindowSize: time.Minute.Nanoseconds(),
Precision: time.Minute.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 720 * time.Hour.Nanoseconds(),
},
},
{
Resolution: policypb.Resolution{
WindowSize: time.Hour.Nanoseconds(),
Precision: time.Hour.Nanoseconds(),
},
Retention: policypb.Retention{
Period: 365 * 24 * time.Hour.Nanoseconds(),
},
},
},
}
require.Equal(t, expected, res)
}
| TestRollupTargetProto |
bundler.go | package bundler
import (
"encoding/json"
"errors"
"os"
"path/filepath"
"github.com/colinjfw/jbld/pkg/compiler"
)
// PublicConfig confiugures the public html plugin.
type PublicConfig struct {
Dir string `json:"dir"`
HTML []string `json:"html"`
}
// Config represents Bundler configuration.
type Config struct {
BaseURL string `json:"baseUrl"`
OutputDir string `json:"outputDir"`
AssetPath string `json:"assetPath"`
Public PublicConfig `json:"public"`
}
// Entrypoint configures a compilation target entrypoint.
type Entrypoint struct {
Name string `json:"name"`
Path string `json:"path"`
}
// Bundler implements a bundling.
type Bundler struct {
Config
Manifest *compiler.Manifest `json:"manifest"`
}
// Run will execute the bundler process by calling the BundleMapper function and
// then running the set of optimizers.
func (b *Bundler) Run() error {
os.RemoveAll(b.OutputDir)
if err := writePublicFolder(b.Config); err != nil {
return errors.New("bundler: public folder not found")
}
bundles, err := (&bundleMapper{
manifest: b.Manifest,
Config: b.Config,
}).run()
if err != nil |
for _, bn := range bundles {
err = bn.Run(b.Manifest.Config.OutputDir, b.Config.OutputDir)
if err != nil {
return err
}
}
m := b.manifest(bundles)
if err := writeHTMLSources(b.Config, m); err != nil {
return err
}
return b.writeManifest(m)
}
func (b *Bundler) manifest(bundles []*Bundle) *Manifest {
m := &Manifest{
BaseURL: b.BaseURL,
Bundles: []string{},
Entrypoints: map[string][]string{},
BundleTypes: map[string][]string{},
}
for _, bn := range bundles {
m.Bundles = append(m.Bundles, bn.URL)
m.Entrypoints[bn.Name] = append(m.Entrypoints[bn.Name], bn.URL)
m.BundleTypes[bn.Type] = append(m.BundleTypes[bn.Type], bn.URL)
}
return m
}
func (b *Bundler) writeManifest(m *Manifest) error {
src := filepath.Join(b.OutputDir, "asset-manifest.json")
f, err := os.OpenFile(src, os.O_CREATE|os.O_RDWR, 0700)
if err != nil {
return err
}
defer f.Close()
enc := json.NewEncoder(f)
enc.SetEscapeHTML(false)
enc.SetIndent("", " ")
return enc.Encode(m)
}
| {
return err
} |
clientlocation.rs | extern crate rocket_contrib;
use rocket::{get, put};
use models;
use db;
use rocket_contrib::json;
// TODO: GH#9 Move everything to v1 API
#[put("/", data = "<client_location_info_json>")]
pub fn put_clientlocation(connection: db::Connection, client_location_info_json: json::Json<models::json::ClientLocationInfo>) {
let client_location_info: models::json::ClientLocationInfo = client_location_info_json.into_inner();
let option82_001: String;
let option82_002: String;
if let Some(opt82_001) = client_location_info.option82.get(&"001".to_string()) {
option82_001 = opt82_001.clone();
} else {
return;
}
if let Some(opt82_002) = client_location_info.option82.get(&"002".to_string()) {
option82_002 = opt82_002.clone();
} else {
return;
}
let option82_001_hex: Vec<&str> = option82_001.split(":").collect();
let option82_002_hex: Vec<&str> = option82_002.split(":").collect();
if option82_001_hex.len() == 6 && option82_002_hex.len() == 8 {
let module: i32;
if let Ok(module_res) = i32::from_str_radix(option82_001_hex[4], 16) {
module = module_res;
} else {
return;
}
let port: i32;
if let Ok(port_res) = i32::from_str_radix(option82_001_hex[5], 16) {
port = port_res;
} else {
return;
}
let port_info = format!("{}/{}", module, port);
let switch_base_mac = format!(
"{}:{}:{}:{}:{}:{}",
option82_002_hex[2], option82_002_hex[3], option82_002_hex[4],
option82_002_hex[5], option82_002_hex[6], option82_002_hex[7]
);
let device;
if let Some(some_device) = models::dbo::Device::by_base_mac(&switch_base_mac, &connection) {
device = some_device;
} else {
return;
}
if let Some(mut existing_client_info) = models::dbo::ClientLocation::by_ip(&client_location_info.yiaddr, &connection) {
if existing_client_info.port_info != port_info || existing_client_info.device_id != device.id {
existing_client_info.port_info = port_info;
existing_client_info.device_id = device.id;
if let Err(_update_error) = existing_client_info.update(&connection) |
}
} else {
let l = models::dbo::NewClientLocation {
device_id: device.id,
ip_address: client_location_info.yiaddr.clone(),
port_info: port_info.clone()
};
if let Ok(_new_client_location) = models::dbo::ClientLocation::create(&l, &connection) {
} else {
// TODO: log this
}
}
}
}
| {
// TODO: log
} |
setup_test.go | // Copyright 2020 - Offen Authors <[email protected]>
// SPDX-License-Identifier: Apache-2.0
package router
| "errors"
"io"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/gin-gonic/gin"
"github.com/microcosm-cc/bluemonday"
"github.com/offen/offen/server/config"
"github.com/offen/offen/server/persistence"
)
type mockGetSetupDatabase struct {
persistence.Service
result bool
}
func (m *mockGetSetupDatabase) ProbeEmpty() bool {
return m.result
}
func TestRouter_getSetup(t *testing.T) {
t.Run("empty", func(t *testing.T) {
rt := router{
config: &config.Config{},
db: &mockGetSetupDatabase{result: true},
}
m := gin.New()
m.GET("/", rt.getSetup)
r := httptest.NewRequest(http.MethodGet, "/", nil)
w := httptest.NewRecorder()
m.ServeHTTP(w, r)
if w.Code != http.StatusNoContent {
t.Errorf("Unexpected status code %v", w.Code)
}
})
t.Run("not empty", func(t *testing.T) {
rt := router{
config: &config.Config{},
db: &mockGetSetupDatabase{result: false},
}
m := gin.New()
m.GET("/", rt.getSetup)
r := httptest.NewRequest(http.MethodGet, "/", nil)
w := httptest.NewRecorder()
m.ServeHTTP(w, r)
if w.Code != http.StatusForbidden {
t.Errorf("Unexpected status code %v", w.Code)
}
})
}
type mockPostSetupDatabase struct {
persistence.Service
err error
}
func (m *mockPostSetupDatabase) Bootstrap(persistence.BootstrapConfig) error {
return m.err
}
func TestRouter_postSetup(t *testing.T) {
tests := []struct {
name string
body io.Reader
db mockPostSetupDatabase
expectedStatusCode int
}{
{
"bad payload",
strings.NewReader("mmm617"),
mockPostSetupDatabase{},
http.StatusBadRequest,
},
{
"db error",
strings.NewReader(`{"accountName":"name","emailAddress":"[email protected]","password":"secret"}`),
mockPostSetupDatabase{
err: errors.New("did not work"),
},
http.StatusInternalServerError,
},
{
"ok",
strings.NewReader(`{"accountName":"name","emailAddress":"[email protected]","password":"secret"}`),
mockPostSetupDatabase{},
http.StatusNoContent,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
rt := router{
config: &config.Config{},
db: &test.db,
sanitizer: bluemonday.StrictPolicy(),
}
m := gin.New()
m.POST("/", rt.postSetup)
r := httptest.NewRequest(http.MethodPost, "/", test.body)
w := httptest.NewRecorder()
m.ServeHTTP(w, r)
if w.Code != test.expectedStatusCode {
t.Errorf("Unexpected status code %v", w.Code)
}
})
}
} | import ( |
fs.rs | // ignore-tidy-filelength
//! Filesystem manipulation operations.
//!
//! This module contains basic methods to manipulate the contents of the local
//! filesystem. All methods in this module represent cross-platform filesystem
//! operations. Extra platform-specific functionality can be found in the
//! extension traits of `std::os::$platform`.
#![stable(feature = "rust1", since = "1.0.0")]
use crate::fmt;
use crate::ffi::OsString;
use crate::io::{self, SeekFrom, Seek, Read, Initializer, Write, IoSlice, IoSliceMut};
use crate::path::{Path, PathBuf};
use crate::sys::fs as fs_imp;
use crate::sys_common::{AsInnerMut, FromInner, AsInner, IntoInner};
use crate::time::SystemTime;
/// A reference to an open file on the filesystem.
///
/// An instance of a `File` can be read and/or written depending on what options
/// it was opened with. Files also implement [`Seek`] to alter the logical cursor
/// that the file contains internally.
///
/// Files are automatically closed when they go out of scope. Errors detected
/// on closing are ignored by the implementation of `Drop`. Use the method
/// [`sync_all`] if these errors must be manually handled.
///
/// # Examples
///
/// Creates a new file and write bytes to it:
///
/// ```no_run
/// use std::fs::File;
/// use std::io::prelude::*;
///
/// fn main() -> std::io::Result<()> {
/// let mut file = File::create("foo.txt")?;
/// file.write_all(b"Hello, world!")?;
/// Ok(())
/// }
/// ```
///
/// Read the contents of a file into a [`String`]:
///
/// ```no_run
/// use std::fs::File;
/// use std::io::prelude::*;
///
/// fn main() -> std::io::Result<()> {
/// let mut file = File::open("foo.txt")?;
/// let mut contents = String::new();
/// file.read_to_string(&mut contents)?;
/// assert_eq!(contents, "Hello, world!");
/// Ok(())
/// }
/// ```
///
/// It can be more efficient to read the contents of a file with a buffered
/// [`Read`]er. This can be accomplished with [`BufReader<R>`]:
///
/// ```no_run
/// use std::fs::File;
/// use std::io::BufReader;
/// use std::io::prelude::*;
///
/// fn main() -> std::io::Result<()> {
/// let file = File::open("foo.txt")?;
/// let mut buf_reader = BufReader::new(file);
/// let mut contents = String::new();
/// buf_reader.read_to_string(&mut contents)?;
/// assert_eq!(contents, "Hello, world!");
/// Ok(())
/// }
/// ```
///
/// Note that, although read and write methods require a `&mut File`, because
/// of the interfaces for [`Read`] and [`Write`], the holder of a `&File` can
/// still modify the file, either through methods that take `&File` or by
/// retrieving the underlying OS object and modifying the file that way.
/// Additionally, many operating systems allow concurrent modification of files
/// by different processes. Avoid assuming that holding a `&File` means that the
/// file will not change.
///
/// [`Seek`]: ../io/trait.Seek.html
/// [`String`]: ../string/struct.String.html
/// [`Read`]: ../io/trait.Read.html
/// [`Write`]: ../io/trait.Write.html
/// [`BufReader<R>`]: ../io/struct.BufReader.html
/// [`sync_all`]: struct.File.html#method.sync_all
#[stable(feature = "rust1", since = "1.0.0")]
pub struct File {
inner: fs_imp::File,
}
/// Metadata information about a file.
///
/// This structure is returned from the [`metadata`] or
/// [`symlink_metadata`] function or method and represents known
/// metadata about a file such as its permissions, size, modification
/// times, etc.
///
/// [`metadata`]: fn.metadata.html
/// [`symlink_metadata`]: fn.symlink_metadata.html
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Clone)]
pub struct Metadata(fs_imp::FileAttr);
/// Iterator over the entries in a directory.
///
/// This iterator is returned from the [`read_dir`] function of this module and
/// will yield instances of [`io::Result`]`<`[`DirEntry`]`>`. Through a [`DirEntry`]
/// information like the entry's path and possibly other metadata can be
/// learned. | ///
/// # Errors
///
/// This [`io::Result`] will be an [`Err`] if there's some sort of intermittent
/// IO error during iteration.
///
/// [`read_dir`]: fn.read_dir.html
/// [`DirEntry`]: struct.DirEntry.html
/// [`io::Result`]: ../io/type.Result.html
/// [`Err`]: ../result/enum.Result.html#variant.Err
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Debug)]
pub struct ReadDir(fs_imp::ReadDir);
/// Entries returned by the [`ReadDir`] iterator.
///
/// [`ReadDir`]: struct.ReadDir.html
///
/// An instance of `DirEntry` represents an entry inside of a directory on the
/// filesystem. Each entry can be inspected via methods to learn about the full
/// path or possibly other metadata through per-platform extension traits.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct DirEntry(fs_imp::DirEntry);
/// Options and flags which can be used to configure how a file is opened.
///
/// This builder exposes the ability to configure how a [`File`] is opened and
/// what operations are permitted on the open file. The [`File::open`] and
/// [`File::create`] methods are aliases for commonly used options using this
/// builder.
///
/// [`File`]: struct.File.html
/// [`File::open`]: struct.File.html#method.open
/// [`File::create`]: struct.File.html#method.create
///
/// Generally speaking, when using `OpenOptions`, you'll first call [`new`],
/// then chain calls to methods to set each option, then call [`open`],
/// passing the path of the file you're trying to open. This will give you a
/// [`io::Result`][result] with a [`File`][file] inside that you can further
/// operate on.
///
/// [`new`]: struct.OpenOptions.html#method.new
/// [`open`]: struct.OpenOptions.html#method.open
/// [result]: ../io/type.Result.html
/// [file]: struct.File.html
///
/// # Examples
///
/// Opening a file to read:
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().read(true).open("foo.txt");
/// ```
///
/// Opening a file for both reading and writing, as well as creating it if it
/// doesn't exist:
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new()
/// .read(true)
/// .write(true)
/// .create(true)
/// .open("foo.txt");
/// ```
#[derive(Clone, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct OpenOptions(fs_imp::OpenOptions);
/// Representation of the various permissions on a file.
///
/// This module only currently provides one bit of information, [`readonly`],
/// which is exposed on all currently supported platforms. Unix-specific
/// functionality, such as mode bits, is available through the
/// [`PermissionsExt`] trait.
///
/// [`readonly`]: struct.Permissions.html#method.readonly
/// [`PermissionsExt`]: ../os/unix/fs/trait.PermissionsExt.html
#[derive(Clone, PartialEq, Eq, Debug)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Permissions(fs_imp::FilePermissions);
/// A structure representing a type of file with accessors for each file type.
/// It is returned by [`Metadata::file_type`] method.
///
/// [`Metadata::file_type`]: struct.Metadata.html#method.file_type
#[stable(feature = "file_type", since = "1.1.0")]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
pub struct FileType(fs_imp::FileType);
/// A builder used to create directories in various manners.
///
/// This builder also supports platform-specific options.
#[stable(feature = "dir_builder", since = "1.6.0")]
#[derive(Debug)]
pub struct DirBuilder {
inner: fs_imp::DirBuilder,
recursive: bool,
}
/// Indicates how large a buffer to pre-allocate before reading the entire file.
fn initial_buffer_size(file: &File) -> usize {
// Allocate one extra byte so the buffer doesn't need to grow before the
// final `read` call at the end of the file. Don't worry about `usize`
// overflow because reading will fail regardless in that case.
file.metadata().map(|m| m.len() as usize + 1).unwrap_or(0)
}
/// Read the entire contents of a file into a bytes vector.
///
/// This is a convenience function for using [`File::open`] and [`read_to_end`]
/// with fewer imports and without an intermediate variable. It pre-allocates a
/// buffer based on the file size when available, so it is generally faster than
/// reading into a vector created with `Vec::new()`.
///
/// [`File::open`]: struct.File.html#method.open
/// [`read_to_end`]: ../io/trait.Read.html#method.read_to_end
///
/// # Errors
///
/// This function will return an error if `path` does not already exist.
/// Other errors may also be returned according to [`OpenOptions::open`].
///
/// [`OpenOptions::open`]: struct.OpenOptions.html#method.open
///
/// It will also return an error if it encounters while reading an error
/// of a kind other than [`ErrorKind::Interrupted`].
///
/// [`ErrorKind::Interrupted`]: ../../std/io/enum.ErrorKind.html#variant.Interrupted
///
/// # Examples
///
/// ```no_run
/// use std::fs;
/// use std::net::SocketAddr;
///
/// fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
/// let foo: SocketAddr = String::from_utf8_lossy(&fs::read("address.txt")?).parse()?;
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_read_write_bytes", since = "1.26.0")]
pub fn read<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
fn inner(path: &Path) -> io::Result<Vec<u8>> {
let mut file = File::open(path)?;
let mut bytes = Vec::with_capacity(initial_buffer_size(&file));
file.read_to_end(&mut bytes)?;
Ok(bytes)
}
inner(path.as_ref())
}
/// Read the entire contents of a file into a string.
///
/// This is a convenience function for using [`File::open`] and [`read_to_string`]
/// with fewer imports and without an intermediate variable. It pre-allocates a
/// buffer based on the file size when available, so it is generally faster than
/// reading into a string created with `String::new()`.
///
/// [`File::open`]: struct.File.html#method.open
/// [`read_to_string`]: ../io/trait.Read.html#method.read_to_string
///
/// # Errors
///
/// This function will return an error if `path` does not already exist.
/// Other errors may also be returned according to [`OpenOptions::open`].
///
/// [`OpenOptions::open`]: struct.OpenOptions.html#method.open
///
/// It will also return an error if it encounters while reading an error
/// of a kind other than [`ErrorKind::Interrupted`],
/// or if the contents of the file are not valid UTF-8.
///
/// [`ErrorKind::Interrupted`]: ../../std/io/enum.ErrorKind.html#variant.Interrupted
///
/// # Examples
///
/// ```no_run
/// use std::fs;
/// use std::net::SocketAddr;
///
/// fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
/// let foo: SocketAddr = fs::read_to_string("address.txt")?.parse()?;
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_read_write", since = "1.26.0")]
pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
fn inner(path: &Path) -> io::Result<String> {
let mut file = File::open(path)?;
let mut string = String::with_capacity(initial_buffer_size(&file));
file.read_to_string(&mut string)?;
Ok(string)
}
inner(path.as_ref())
}
/// Write a slice as the entire contents of a file.
///
/// This function will create a file if it does not exist,
/// and will entirely replace its contents if it does.
///
/// This is a convenience function for using [`File::create`] and [`write_all`]
/// with fewer imports.
///
/// [`File::create`]: struct.File.html#method.create
/// [`write_all`]: ../io/trait.Write.html#method.write_all
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::write("foo.txt", b"Lorem ipsum")?;
/// fs::write("bar.txt", "dolor sit")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_read_write_bytes", since = "1.26.0")]
pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> io::Result<()> {
fn inner(path: &Path, contents: &[u8]) -> io::Result<()> {
File::create(path)?.write_all(contents)
}
inner(path.as_ref(), contents.as_ref())
}
impl File {
/// Attempts to open a file in read-only mode.
///
/// See the [`OpenOptions::open`] method for more details.
///
/// # Errors
///
/// This function will return an error if `path` does not already exist.
/// Other errors may also be returned according to [`OpenOptions::open`].
///
/// [`OpenOptions::open`]: struct.OpenOptions.html#method.open
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::open("foo.txt")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> {
OpenOptions::new().read(true).open(path.as_ref())
}
/// Opens a file in write-only mode.
///
/// This function will create a file if it does not exist,
/// and will truncate it if it does.
///
/// See the [`OpenOptions::open`] function for more details.
///
/// [`OpenOptions::open`]: struct.OpenOptions.html#method.open
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::create("foo.txt")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn create<P: AsRef<Path>>(path: P) -> io::Result<File> {
OpenOptions::new().write(true).create(true).truncate(true).open(path.as_ref())
}
/// Attempts to sync all OS-internal metadata to disk.
///
/// This function will attempt to ensure that all in-memory data reaches the
/// filesystem before returning.
///
/// This can be used to handle errors that would otherwise only be caught
/// when the `File` is closed. Dropping a file will ignore errors in
/// synchronizing this in-memory data.
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
/// use std::io::prelude::*;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::create("foo.txt")?;
/// f.write_all(b"Hello, world!")?;
///
/// f.sync_all()?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn sync_all(&self) -> io::Result<()> {
self.inner.fsync()
}
/// This function is similar to [`sync_all`], except that it may not
/// synchronize file metadata to the filesystem.
///
/// This is intended for use cases that must synchronize content, but don't
/// need the metadata on disk. The goal of this method is to reduce disk
/// operations.
///
/// Note that some platforms may simply implement this in terms of
/// [`sync_all`].
///
/// [`sync_all`]: struct.File.html#method.sync_all
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
/// use std::io::prelude::*;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::create("foo.txt")?;
/// f.write_all(b"Hello, world!")?;
///
/// f.sync_data()?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn sync_data(&self) -> io::Result<()> {
self.inner.datasync()
}
/// Truncates or extends the underlying file, updating the size of
/// this file to become `size`.
///
/// If the `size` is less than the current file's size, then the file will
/// be shrunk. If it is greater than the current file's size, then the file
/// will be extended to `size` and have all of the intermediate data filled
/// in with 0s.
///
/// The file's cursor isn't changed. In particular, if the cursor was at the
/// end and the file is shrunk using this operation, the cursor will now be
/// past the end.
///
/// # Errors
///
/// This function will return an error if the file is not opened for writing.
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::create("foo.txt")?;
/// f.set_len(10)?;
/// Ok(())
/// }
/// ```
///
/// Note that this method alters the content of the underlying file, even
/// though it takes `&self` rather than `&mut self`.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn set_len(&self, size: u64) -> io::Result<()> {
self.inner.truncate(size)
}
/// Queries metadata about the underlying file.
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::open("foo.txt")?;
/// let metadata = f.metadata()?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn metadata(&self) -> io::Result<Metadata> {
self.inner.file_attr().map(Metadata)
}
/// Creates a new `File` instance that shares the same underlying file handle
/// as the existing `File` instance. Reads, writes, and seeks will affect
/// both `File` instances simultaneously.
///
/// # Examples
///
/// Creates two handles for a file named `foo.txt`:
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let mut file = File::open("foo.txt")?;
/// let file_copy = file.try_clone()?;
/// Ok(())
/// }
/// ```
///
/// Assuming there’s a file named `foo.txt` with contents `abcdef\n`, create
/// two handles, seek one of them, and read the remaining bytes from the
/// other handle:
///
/// ```no_run
/// use std::fs::File;
/// use std::io::SeekFrom;
/// use std::io::prelude::*;
///
/// fn main() -> std::io::Result<()> {
/// let mut file = File::open("foo.txt")?;
/// let mut file_copy = file.try_clone()?;
///
/// file.seek(SeekFrom::Start(3))?;
///
/// let mut contents = vec![];
/// file_copy.read_to_end(&mut contents)?;
/// assert_eq!(contents, b"def\n");
/// Ok(())
/// }
/// ```
#[stable(feature = "file_try_clone", since = "1.9.0")]
pub fn try_clone(&self) -> io::Result<File> {
Ok(File {
inner: self.inner.duplicate()?
})
}
/// Changes the permissions on the underlying file.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `fchmod` function on Unix and
/// the `SetFileInformationByHandle` function on Windows. Note that, this
/// [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error if the user lacks permission change
/// attributes on the underlying file. It may also return an error in other
/// os-specific unspecified cases.
///
/// # Examples
///
/// ```no_run
/// fn main() -> std::io::Result<()> {
/// use std::fs::File;
///
/// let file = File::open("foo.txt")?;
/// let mut perms = file.metadata()?.permissions();
/// perms.set_readonly(true);
/// file.set_permissions(perms)?;
/// Ok(())
/// }
/// ```
///
/// Note that this method alters the permissions of the underlying file,
/// even though it takes `&self` rather than `&mut self`.
#[stable(feature = "set_permissions_atomic", since = "1.16.0")]
pub fn set_permissions(&self, perm: Permissions) -> io::Result<()> {
self.inner.set_permissions(perm.0)
}
}
impl AsInner<fs_imp::File> for File {
fn as_inner(&self) -> &fs_imp::File { &self.inner }
}
impl FromInner<fs_imp::File> for File {
fn from_inner(f: fs_imp::File) -> File {
File { inner: f }
}
}
impl IntoInner<fs_imp::File> for File {
fn into_inner(self) -> fs_imp::File {
self.inner
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for File {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.inner.fmt(f)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Read for File {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
self.inner.read(buf)
}
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
self.inner.read_vectored(bufs)
}
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Write for File {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.inner.write(buf)
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.inner.write_vectored(bufs)
}
fn flush(&mut self) -> io::Result<()> { self.inner.flush() }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Seek for File {
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
self.inner.seek(pos)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Read for &File {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
self.inner.read(buf)
}
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
self.inner.read_vectored(bufs)
}
#[inline]
unsafe fn initializer(&self) -> Initializer {
Initializer::nop()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Write for &File {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.inner.write(buf)
}
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
self.inner.write_vectored(bufs)
}
fn flush(&mut self) -> io::Result<()> { self.inner.flush() }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Seek for &File {
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
self.inner.seek(pos)
}
}
impl OpenOptions {
/// Creates a blank new set of options ready for configuration.
///
/// All options are initially set to `false`.
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let mut options = OpenOptions::new();
/// let file = options.read(true).open("foo.txt");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn new() -> OpenOptions {
OpenOptions(fs_imp::OpenOptions::new())
}
/// Sets the option for read access.
///
/// This option, when true, will indicate that the file should be
/// `read`-able if opened.
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().read(true).open("foo.txt");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn read(&mut self, read: bool) -> &mut OpenOptions {
self.0.read(read); self
}
/// Sets the option for write access.
///
/// This option, when true, will indicate that the file should be
/// `write`-able if opened.
///
/// If the file already exists, any write calls on it will overwrite its
/// contents, without truncating it.
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().write(true).open("foo.txt");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn write(&mut self, write: bool) -> &mut OpenOptions {
self.0.write(write); self
}
/// Sets the option for the append mode.
///
/// This option, when true, means that writes will append to a file instead
/// of overwriting previous contents.
/// Note that setting `.write(true).append(true)` has the same effect as
/// setting only `.append(true)`.
///
/// For most filesystems, the operating system guarantees that all writes are
/// atomic: no writes get mangled because another process writes at the same
/// time.
///
/// One maybe obvious note when using append-mode: make sure that all data
/// that belongs together is written to the file in one operation. This
/// can be done by concatenating strings before passing them to [`write()`],
/// or using a buffered writer (with a buffer of adequate size),
/// and calling [`flush()`] when the message is complete.
///
/// If a file is opened with both read and append access, beware that after
/// opening, and after every write, the position for reading may be set at the
/// end of the file. So, before writing, save the current position (using
/// [`seek`]`(`[`SeekFrom`]`::`[`Current`]`(0))`), and restore it before the next read.
///
/// ## Note
///
/// This function doesn't create the file if it doesn't exist. Use the [`create`]
/// method to do so.
///
/// [`write()`]: ../../std/fs/struct.File.html#method.write
/// [`flush()`]: ../../std/fs/struct.File.html#method.flush
/// [`seek`]: ../../std/fs/struct.File.html#method.seek
/// [`SeekFrom`]: ../../std/io/enum.SeekFrom.html
/// [`Current`]: ../../std/io/enum.SeekFrom.html#variant.Current
/// [`create`]: #method.create
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().append(true).open("foo.txt");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn append(&mut self, append: bool) -> &mut OpenOptions {
self.0.append(append); self
}
/// Sets the option for truncating a previous file.
///
/// If a file is successfully opened with this option set it will truncate
/// the file to 0 length if it already exists.
///
/// The file must be opened with write access for truncate to work.
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().write(true).truncate(true).open("foo.txt");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions {
self.0.truncate(truncate); self
}
/// Sets the option for creating a new file.
///
/// This option indicates whether a new file will be created if the file
/// does not yet already exist.
///
/// In order for the file to be created, [`write`] or [`append`] access must
/// be used.
///
/// [`write`]: #method.write
/// [`append`]: #method.append
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().write(true).create(true).open("foo.txt");
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn create(&mut self, create: bool) -> &mut OpenOptions {
self.0.create(create); self
}
/// Sets the option to always create a new file.
///
/// This option indicates whether a new file will be created.
/// No file is allowed to exist at the target location, also no (dangling)
/// symlink.
///
/// This option is useful because it is atomic. Otherwise between checking
/// whether a file exists and creating a new one, the file may have been
/// created by another process (a TOCTOU race condition / attack).
///
/// If `.create_new(true)` is set, [`.create()`] and [`.truncate()`] are
/// ignored.
///
/// The file must be opened with write or append access in order to create
/// a new file.
///
/// [`.create()`]: #method.create
/// [`.truncate()`]: #method.truncate
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().write(true)
/// .create_new(true)
/// .open("foo.txt");
/// ```
#[stable(feature = "expand_open_options2", since = "1.9.0")]
pub fn create_new(&mut self, create_new: bool) -> &mut OpenOptions {
self.0.create_new(create_new); self
}
/// Opens a file at `path` with the options specified by `self`.
///
/// # Errors
///
/// This function will return an error under a number of different
/// circumstances. Some of these error conditions are listed here, together
/// with their [`ErrorKind`]. The mapping to [`ErrorKind`]s is not part of
/// the compatibility contract of the function, especially the `Other` kind
/// might change to more specific kinds in the future.
///
/// * [`NotFound`]: The specified file does not exist and neither `create`
/// or `create_new` is set.
/// * [`NotFound`]: One of the directory components of the file path does
/// not exist.
/// * [`PermissionDenied`]: The user lacks permission to get the specified
/// access rights for the file.
/// * [`PermissionDenied`]: The user lacks permission to open one of the
/// directory components of the specified path.
/// * [`AlreadyExists`]: `create_new` was specified and the file already
/// exists.
/// * [`InvalidInput`]: Invalid combinations of open options (truncate
/// without write access, no access mode set, etc.).
/// * [`Other`]: One of the directory components of the specified file path
/// was not, in fact, a directory.
/// * [`Other`]: Filesystem-level errors: full disk, write permission
/// requested on a read-only file system, exceeded disk quota, too many
/// open files, too long filename, too many symbolic links in the
/// specified path (Unix-like systems only), etc.
///
/// # Examples
///
/// ```no_run
/// use std::fs::OpenOptions;
///
/// let file = OpenOptions::new().open("foo.txt");
/// ```
///
/// [`ErrorKind`]: ../io/enum.ErrorKind.html
/// [`AlreadyExists`]: ../io/enum.ErrorKind.html#variant.AlreadyExists
/// [`InvalidInput`]: ../io/enum.ErrorKind.html#variant.InvalidInput
/// [`NotFound`]: ../io/enum.ErrorKind.html#variant.NotFound
/// [`Other`]: ../io/enum.ErrorKind.html#variant.Other
/// [`PermissionDenied`]: ../io/enum.ErrorKind.html#variant.PermissionDenied
#[stable(feature = "rust1", since = "1.0.0")]
pub fn open<P: AsRef<Path>>(&self, path: P) -> io::Result<File> {
self._open(path.as_ref())
}
fn _open(&self, path: &Path) -> io::Result<File> {
fs_imp::File::open(path, &self.0).map(|inner| File { inner })
}
}
impl AsInner<fs_imp::OpenOptions> for OpenOptions {
fn as_inner(&self) -> &fs_imp::OpenOptions { &self.0 }
}
impl AsInnerMut<fs_imp::OpenOptions> for OpenOptions {
fn as_inner_mut(&mut self) -> &mut fs_imp::OpenOptions { &mut self.0 }
}
impl Metadata {
/// Returns the file type for this metadata.
///
/// # Examples
///
/// ```no_run
/// fn main() -> std::io::Result<()> {
/// use std::fs;
///
/// let metadata = fs::metadata("foo.txt")?;
///
/// println!("{:?}", metadata.file_type());
/// Ok(())
/// }
/// ```
#[stable(feature = "file_type", since = "1.1.0")]
pub fn file_type(&self) -> FileType {
FileType(self.0.file_type())
}
/// Returns `true` if this metadata is for a directory. The
/// result is mutually exclusive to the result of
/// [`is_file`], and will be false for symlink metadata
/// obtained from [`symlink_metadata`].
///
/// [`is_file`]: struct.Metadata.html#method.is_file
/// [`symlink_metadata`]: fn.symlink_metadata.html
///
/// # Examples
///
/// ```no_run
/// fn main() -> std::io::Result<()> {
/// use std::fs;
///
/// let metadata = fs::metadata("foo.txt")?;
///
/// assert!(!metadata.is_dir());
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn is_dir(&self) -> bool { self.file_type().is_dir() }
/// Returns `true` if this metadata is for a regular file. The
/// result is mutually exclusive to the result of
/// [`is_dir`], and will be false for symlink metadata
/// obtained from [`symlink_metadata`].
///
/// [`is_dir`]: struct.Metadata.html#method.is_dir
/// [`symlink_metadata`]: fn.symlink_metadata.html
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::metadata("foo.txt")?;
///
/// assert!(metadata.is_file());
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn is_file(&self) -> bool { self.file_type().is_file() }
/// Returns the size of the file, in bytes, this metadata is for.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::metadata("foo.txt")?;
///
/// assert_eq!(0, metadata.len());
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn len(&self) -> u64 { self.0.size() }
/// Returns the permissions of the file this metadata is for.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::metadata("foo.txt")?;
///
/// assert!(!metadata.permissions().readonly());
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn permissions(&self) -> Permissions {
Permissions(self.0.perm())
}
/// Returns the last modification time listed in this metadata.
///
/// The returned value corresponds to the `mtime` field of `stat` on Unix
/// platforms and the `ftLastWriteTime` field on Windows platforms.
///
/// # Errors
///
/// This field may not be available on all platforms, and will return an
/// `Err` on platforms where it is not available.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::metadata("foo.txt")?;
///
/// if let Ok(time) = metadata.modified() {
/// println!("{:?}", time);
/// } else {
/// println!("Not supported on this platform");
/// }
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_time", since = "1.10.0")]
pub fn modified(&self) -> io::Result<SystemTime> {
self.0.modified().map(FromInner::from_inner)
}
/// Returns the last access time of this metadata.
///
/// The returned value corresponds to the `atime` field of `stat` on Unix
/// platforms and the `ftLastAccessTime` field on Windows platforms.
///
/// Note that not all platforms will keep this field update in a file's
/// metadata, for example Windows has an option to disable updating this
/// time when files are accessed and Linux similarly has `noatime`.
///
/// # Errors
///
/// This field may not be available on all platforms, and will return an
/// `Err` on platforms where it is not available.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::metadata("foo.txt")?;
///
/// if let Ok(time) = metadata.accessed() {
/// println!("{:?}", time);
/// } else {
/// println!("Not supported on this platform");
/// }
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_time", since = "1.10.0")]
pub fn accessed(&self) -> io::Result<SystemTime> {
self.0.accessed().map(FromInner::from_inner)
}
/// Returns the creation time listed in this metadata.
///
/// The returned value corresponds to the `birthtime` field of `stat` on
/// Unix platforms and the `ftCreationTime` field on Windows platforms.
///
/// # Errors
///
/// This field may not be available on all platforms, and will return an
/// `Err` on platforms where it is not available.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::metadata("foo.txt")?;
///
/// if let Ok(time) = metadata.created() {
/// println!("{:?}", time);
/// } else {
/// println!("Not supported on this platform");
/// }
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_time", since = "1.10.0")]
pub fn created(&self) -> io::Result<SystemTime> {
self.0.created().map(FromInner::from_inner)
}
}
#[stable(feature = "std_debug", since = "1.16.0")]
impl fmt::Debug for Metadata {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Metadata")
.field("file_type", &self.file_type())
.field("is_dir", &self.is_dir())
.field("is_file", &self.is_file())
.field("permissions", &self.permissions())
.field("modified", &self.modified())
.field("accessed", &self.accessed())
.field("created", &self.created())
.finish()
}
}
impl AsInner<fs_imp::FileAttr> for Metadata {
fn as_inner(&self) -> &fs_imp::FileAttr { &self.0 }
}
impl FromInner<fs_imp::FileAttr> for Metadata {
fn from_inner(attr: fs_imp::FileAttr) -> Metadata { Metadata(attr) }
}
impl Permissions {
/// Returns `true` if these permissions describe a readonly (unwritable) file.
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let mut f = File::create("foo.txt")?;
/// let metadata = f.metadata()?;
///
/// assert_eq!(false, metadata.permissions().readonly());
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn readonly(&self) -> bool { self.0.readonly() }
/// Modifies the readonly flag for this set of permissions. If the
/// `readonly` argument is `true`, using the resulting `Permission` will
/// update file permissions to forbid writing. Conversely, if it's `false`,
/// using the resulting `Permission` will update file permissions to allow
/// writing.
///
/// This operation does **not** modify the filesystem. To modify the
/// filesystem use the [`fs::set_permissions`] function.
///
/// [`fs::set_permissions`]: fn.set_permissions.html
///
/// # Examples
///
/// ```no_run
/// use std::fs::File;
///
/// fn main() -> std::io::Result<()> {
/// let f = File::create("foo.txt")?;
/// let metadata = f.metadata()?;
/// let mut permissions = metadata.permissions();
///
/// permissions.set_readonly(true);
///
/// // filesystem doesn't change
/// assert_eq!(false, metadata.permissions().readonly());
///
/// // just this particular `permissions`.
/// assert_eq!(true, permissions.readonly());
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn set_readonly(&mut self, readonly: bool) {
self.0.set_readonly(readonly)
}
}
impl FileType {
/// Tests whether this file type represents a directory. The
/// result is mutually exclusive to the results of
/// [`is_file`] and [`is_symlink`]; only zero or one of these
/// tests may pass.
///
/// [`is_file`]: struct.FileType.html#method.is_file
/// [`is_symlink`]: struct.FileType.html#method.is_symlink
///
/// # Examples
///
/// ```no_run
/// fn main() -> std::io::Result<()> {
/// use std::fs;
///
/// let metadata = fs::metadata("foo.txt")?;
/// let file_type = metadata.file_type();
///
/// assert_eq!(file_type.is_dir(), false);
/// Ok(())
/// }
/// ```
#[stable(feature = "file_type", since = "1.1.0")]
pub fn is_dir(&self) -> bool { self.0.is_dir() }
/// Tests whether this file type represents a regular file.
/// The result is mutually exclusive to the results of
/// [`is_dir`] and [`is_symlink`]; only zero or one of these
/// tests may pass.
///
/// [`is_dir`]: struct.FileType.html#method.is_dir
/// [`is_symlink`]: struct.FileType.html#method.is_symlink
///
/// # Examples
///
/// ```no_run
/// fn main() -> std::io::Result<()> {
/// use std::fs;
///
/// let metadata = fs::metadata("foo.txt")?;
/// let file_type = metadata.file_type();
///
/// assert_eq!(file_type.is_file(), true);
/// Ok(())
/// }
/// ```
#[stable(feature = "file_type", since = "1.1.0")]
pub fn is_file(&self) -> bool { self.0.is_file() }
/// Tests whether this file type represents a symbolic link.
/// The result is mutually exclusive to the results of
/// [`is_dir`] and [`is_file`]; only zero or one of these
/// tests may pass.
///
/// The underlying [`Metadata`] struct needs to be retrieved
/// with the [`fs::symlink_metadata`] function and not the
/// [`fs::metadata`] function. The [`fs::metadata`] function
/// follows symbolic links, so [`is_symlink`] would always
/// return `false` for the target file.
///
/// [`Metadata`]: struct.Metadata.html
/// [`fs::metadata`]: fn.metadata.html
/// [`fs::symlink_metadata`]: fn.symlink_metadata.html
/// [`is_dir`]: struct.FileType.html#method.is_dir
/// [`is_file`]: struct.FileType.html#method.is_file
/// [`is_symlink`]: struct.FileType.html#method.is_symlink
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let metadata = fs::symlink_metadata("foo.txt")?;
/// let file_type = metadata.file_type();
///
/// assert_eq!(file_type.is_symlink(), false);
/// Ok(())
/// }
/// ```
#[stable(feature = "file_type", since = "1.1.0")]
pub fn is_symlink(&self) -> bool { self.0.is_symlink() }
}
impl AsInner<fs_imp::FileType> for FileType {
fn as_inner(&self) -> &fs_imp::FileType { &self.0 }
}
impl FromInner<fs_imp::FilePermissions> for Permissions {
fn from_inner(f: fs_imp::FilePermissions) -> Permissions {
Permissions(f)
}
}
impl AsInner<fs_imp::FilePermissions> for Permissions {
fn as_inner(&self) -> &fs_imp::FilePermissions { &self.0 }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl Iterator for ReadDir {
type Item = io::Result<DirEntry>;
fn next(&mut self) -> Option<io::Result<DirEntry>> {
self.0.next().map(|entry| entry.map(DirEntry))
}
}
impl DirEntry {
/// Returns the full path to the file that this entry represents.
///
/// The full path is created by joining the original path to `read_dir`
/// with the filename of this entry.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// for entry in fs::read_dir(".")? {
/// let dir = entry?;
/// println!("{:?}", dir.path());
/// }
/// Ok(())
/// }
/// ```
///
/// This prints output like:
///
/// ```text
/// "./whatever.txt"
/// "./foo.html"
/// "./hello_world.rs"
/// ```
///
/// The exact text, of course, depends on what files you have in `.`.
#[stable(feature = "rust1", since = "1.0.0")]
pub fn path(&self) -> PathBuf { self.0.path() }
/// Returns the metadata for the file that this entry points at.
///
/// This function will not traverse symlinks if this entry points at a
/// symlink.
///
/// # Platform-specific behavior
///
/// On Windows this function is cheap to call (no extra system calls
/// needed), but on Unix platforms this function is the equivalent of
/// calling `symlink_metadata` on the path.
///
/// # Examples
///
/// ```
/// use std::fs;
///
/// if let Ok(entries) = fs::read_dir(".") {
/// for entry in entries {
/// if let Ok(entry) = entry {
/// // Here, `entry` is a `DirEntry`.
/// if let Ok(metadata) = entry.metadata() {
/// // Now let's show our entry's permissions!
/// println!("{:?}: {:?}", entry.path(), metadata.permissions());
/// } else {
/// println!("Couldn't get metadata for {:?}", entry.path());
/// }
/// }
/// }
/// }
/// ```
#[stable(feature = "dir_entry_ext", since = "1.1.0")]
pub fn metadata(&self) -> io::Result<Metadata> {
self.0.metadata().map(Metadata)
}
/// Returns the file type for the file that this entry points at.
///
/// This function will not traverse symlinks if this entry points at a
/// symlink.
///
/// # Platform-specific behavior
///
/// On Windows and most Unix platforms this function is free (no extra
/// system calls needed), but some Unix platforms may require the equivalent
/// call to `symlink_metadata` to learn about the target file type.
///
/// # Examples
///
/// ```
/// use std::fs;
///
/// if let Ok(entries) = fs::read_dir(".") {
/// for entry in entries {
/// if let Ok(entry) = entry {
/// // Here, `entry` is a `DirEntry`.
/// if let Ok(file_type) = entry.file_type() {
/// // Now let's show our entry's file type!
/// println!("{:?}: {:?}", entry.path(), file_type);
/// } else {
/// println!("Couldn't get file type for {:?}", entry.path());
/// }
/// }
/// }
/// }
/// ```
#[stable(feature = "dir_entry_ext", since = "1.1.0")]
pub fn file_type(&self) -> io::Result<FileType> {
self.0.file_type().map(FileType)
}
/// Returns the bare file name of this directory entry without any other
/// leading path component.
///
/// # Examples
///
/// ```
/// use std::fs;
///
/// if let Ok(entries) = fs::read_dir(".") {
/// for entry in entries {
/// if let Ok(entry) = entry {
/// // Here, `entry` is a `DirEntry`.
/// println!("{:?}", entry.file_name());
/// }
/// }
/// }
/// ```
#[stable(feature = "dir_entry_ext", since = "1.1.0")]
pub fn file_name(&self) -> OsString {
self.0.file_name()
}
}
#[stable(feature = "dir_entry_debug", since = "1.13.0")]
impl fmt::Debug for DirEntry {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("DirEntry")
.field(&self.path())
.finish()
}
}
impl AsInner<fs_imp::DirEntry> for DirEntry {
fn as_inner(&self) -> &fs_imp::DirEntry { &self.0 }
}
/// Removes a file from the filesystem.
///
/// Note that there is no
/// guarantee that the file is immediately deleted (e.g., depending on
/// platform, other open file descriptors may prevent immediate removal).
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `unlink` function on Unix
/// and the `DeleteFile` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * `path` points to a directory.
/// * The user lacks permissions to remove the file.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::remove_file("a.txt")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn remove_file<P: AsRef<Path>>(path: P) -> io::Result<()> {
fs_imp::unlink(path.as_ref())
}
/// Given a path, query the file system to get information about a file,
/// directory, etc.
///
/// This function will traverse symbolic links to query information about the
/// destination file.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `stat` function on Unix
/// and the `GetFileAttributesEx` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * The user lacks permissions to perform `metadata` call on `path`.
/// * `path` does not exist.
///
/// # Examples
///
/// ```rust,no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let attr = fs::metadata("/some/file/path.txt")?;
/// // inspect attr ...
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
fs_imp::stat(path.as_ref()).map(Metadata)
}
/// Query the metadata about a file without following symlinks.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `lstat` function on Unix
/// and the `GetFileAttributesEx` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * The user lacks permissions to perform `metadata` call on `path`.
/// * `path` does not exist.
///
/// # Examples
///
/// ```rust,no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let attr = fs::symlink_metadata("/some/file/path.txt")?;
/// // inspect attr ...
/// Ok(())
/// }
/// ```
#[stable(feature = "symlink_metadata", since = "1.1.0")]
pub fn symlink_metadata<P: AsRef<Path>>(path: P) -> io::Result<Metadata> {
fs_imp::lstat(path.as_ref()).map(Metadata)
}
/// Rename a file or directory to a new name, replacing the original file if
/// `to` already exists.
///
/// This will not work if the new name is on a different mount point.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `rename` function on Unix
/// and the `MoveFileEx` function with the `MOVEFILE_REPLACE_EXISTING` flag on Windows.
///
/// Because of this, the behavior when both `from` and `to` exist differs. On
/// Unix, if `from` is a directory, `to` must also be an (empty) directory. If
/// `from` is not a directory, `to` must also be not a directory. In contrast,
/// on Windows, `from` can be anything, but `to` must *not* be a directory.
///
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * `from` does not exist.
/// * The user lacks permissions to view contents.
/// * `from` and `to` are on separate filesystems.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::rename("a.txt", "b.txt")?; // Rename a.txt to b.txt
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> {
fs_imp::rename(from.as_ref(), to.as_ref())
}
/// Copies the contents of one file to another. This function will also
/// copy the permission bits of the original file to the destination file.
///
/// This function will **overwrite** the contents of `to`.
///
/// Note that if `from` and `to` both point to the same file, then the file
/// will likely get truncated by this operation.
///
/// On success, the total number of bytes copied is returned and it is equal to
/// the length of the `to` file as reported by `metadata`.
///
/// If you’re wanting to copy the contents of one file to another and you’re
/// working with [`File`]s, see the [`io::copy`] function.
///
/// [`io::copy`]: ../io/fn.copy.html
/// [`File`]: ./struct.File.html
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `open` function in Unix
/// with `O_RDONLY` for `from` and `O_WRONLY`, `O_CREAT`, and `O_TRUNC` for `to`.
/// `O_CLOEXEC` is set for returned file descriptors.
/// On Windows, this function currently corresponds to `CopyFileEx`. Alternate
/// NTFS streams are copied but only the size of the main stream is returned by
/// this function. On MacOS, this function corresponds to `fclonefileat` and
/// `fcopyfile`.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * The `from` path is not a file.
/// * The `from` file does not exist.
/// * The current process does not have the permission rights to access
/// `from` or write `to`.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::copy("foo.txt", "bar.txt")?; // Copy foo.txt to bar.txt
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
fs_imp::copy(from.as_ref(), to.as_ref())
}
/// Creates a new hard link on the filesystem.
///
/// The `dst` path will be a link pointing to the `src` path. Note that systems
/// often require these two paths to both be located on the same filesystem.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `link` function on Unix
/// and the `CreateHardLink` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * The `src` path is not a file or doesn't exist.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::hard_link("a.txt", "b.txt")?; // Hard link a.txt to b.txt
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn hard_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> {
fs_imp::link(src.as_ref(), dst.as_ref())
}
/// Creates a new symbolic link on the filesystem.
///
/// The `dst` path will be a symbolic link pointing to the `src` path.
/// On Windows, this will be a file symlink, not a directory symlink;
/// for this reason, the platform-specific [`std::os::unix::fs::symlink`]
/// and [`std::os::windows::fs::symlink_file`] or [`symlink_dir`] should be
/// used instead to make the intent explicit.
///
/// [`std::os::unix::fs::symlink`]: ../os/unix/fs/fn.symlink.html
/// [`std::os::windows::fs::symlink_file`]: ../os/windows/fs/fn.symlink_file.html
/// [`symlink_dir`]: ../os/windows/fs/fn.symlink_dir.html
///
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::soft_link("a.txt", "b.txt")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_deprecated(since = "1.1.0",
reason = "replaced with std::os::unix::fs::symlink and \
std::os::windows::fs::{symlink_file, symlink_dir}")]
pub fn soft_link<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()> {
fs_imp::symlink(src.as_ref(), dst.as_ref())
}
/// Reads a symbolic link, returning the file that the link points to.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `readlink` function on Unix
/// and the `CreateFile` function with `FILE_FLAG_OPEN_REPARSE_POINT` and
/// `FILE_FLAG_BACKUP_SEMANTICS` flags on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * `path` is not a symbolic link.
/// * `path` does not exist.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let path = fs::read_link("a.txt")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
fs_imp::readlink(path.as_ref())
}
/// Returns the canonical, absolute form of a path with all intermediate
/// components normalized and symbolic links resolved.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `realpath` function on Unix
/// and the `CreateFile` and `GetFinalPathNameByHandle` functions on Windows.
/// Note that, this [may change in the future][changes].
///
/// On Windows, this converts the path to use [extended length path][path]
/// syntax, which allows your program to use longer path names, but means you
/// can only join backslash-delimited paths to it, and it may be incompatible
/// with other applications (if passed to the application on the command-line,
/// or written to a file another application may read).
///
/// [changes]: ../io/index.html#platform-specific-behavior
/// [path]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * `path` does not exist.
/// * A non-final component in path is not a directory.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let path = fs::canonicalize("../a/../foo.txt")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "fs_canonicalize", since = "1.5.0")]
pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
fs_imp::canonicalize(path.as_ref())
}
/// Creates a new, empty directory at the provided path
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `mkdir` function on Unix
/// and the `CreateDirectory` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// **NOTE**: If a parent of the given path doesn't exist, this function will
/// return an error. To create a directory and all its missing parents at the
/// same time, use the [`create_dir_all`] function.
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * User lacks permissions to create directory at `path`.
/// * A parent of the given path doesn't exist. (To create a directory and all
/// its missing parents at the same time, use the [`create_dir_all`]
/// function.)
/// * `path` already exists.
///
/// [`create_dir_all`]: fn.create_dir_all.html
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::create_dir("/some/dir")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
DirBuilder::new().create(path.as_ref())
}
/// Recursively create a directory and all of its parent components if they
/// are missing.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `mkdir` function on Unix
/// and the `CreateDirectory` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * If any directory in the path specified by `path`
/// does not already exist and it could not be created otherwise. The specific
/// error conditions for when a directory is being created (after it is
/// determined to not exist) are outlined by [`fs::create_dir`].
///
/// Notable exception is made for situations where any of the directories
/// specified in the `path` could not be created as it was being created concurrently.
/// Such cases are considered to be successful. That is, calling `create_dir_all`
/// concurrently from multiple threads or processes is guaranteed not to fail
/// due to a race condition with itself.
///
/// [`fs::create_dir`]: fn.create_dir.html
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::create_dir_all("/some/dir")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
DirBuilder::new().recursive(true).create(path.as_ref())
}
/// Removes an existing, empty directory.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `rmdir` function on Unix
/// and the `RemoveDirectory` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * The user lacks permissions to remove the directory at the provided `path`.
/// * The directory isn't empty.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::remove_dir("/some/dir")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn remove_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
fs_imp::rmdir(path.as_ref())
}
/// Removes a directory at this path, after removing all its contents. Use
/// carefully!
///
/// This function does **not** follow symbolic links and it will simply remove the
/// symbolic link itself.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to `opendir`, `lstat`, `rm` and `rmdir` functions on Unix
/// and the `FindFirstFile`, `GetFileAttributesEx`, `DeleteFile`, and `RemoveDirectory` functions
/// on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// See [`fs::remove_file`] and [`fs::remove_dir`].
///
/// [`fs::remove_file`]: fn.remove_file.html
/// [`fs::remove_dir`]: fn.remove_dir.html
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// fs::remove_dir_all("/some/dir")?;
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
fs_imp::remove_dir_all(path.as_ref())
}
/// Returns an iterator over the entries within a directory.
///
/// The iterator will yield instances of [`io::Result`]`<`[`DirEntry`]`>`.
/// New errors may be encountered after an iterator is initially constructed.
///
/// [`io::Result`]: ../io/type.Result.html
/// [`DirEntry`]: struct.DirEntry.html
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `opendir` function on Unix
/// and the `FindFirstFile` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * The provided `path` doesn't exist.
/// * The process lacks permissions to view the contents.
/// * The `path` points at a non-directory file.
///
/// # Examples
///
/// ```
/// use std::io;
/// use std::fs::{self, DirEntry};
/// use std::path::Path;
///
/// // one possible implementation of walking a directory only visiting files
/// fn visit_dirs(dir: &Path, cb: &dyn Fn(&DirEntry)) -> io::Result<()> {
/// if dir.is_dir() {
/// for entry in fs::read_dir(dir)? {
/// let entry = entry?;
/// let path = entry.path();
/// if path.is_dir() {
/// visit_dirs(&path, cb)?;
/// } else {
/// cb(&entry);
/// }
/// }
/// }
/// Ok(())
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
fs_imp::readdir(path.as_ref()).map(ReadDir)
}
/// Changes the permissions found on a file or a directory.
///
/// # Platform-specific behavior
///
/// This function currently corresponds to the `chmod` function on Unix
/// and the `SetFileAttributes` function on Windows.
/// Note that, this [may change in the future][changes].
///
/// [changes]: ../io/index.html#platform-specific-behavior
///
/// # Errors
///
/// This function will return an error in the following situations, but is not
/// limited to just these cases:
///
/// * `path` does not exist.
/// * The user lacks the permission to change attributes of the file.
///
/// # Examples
///
/// ```no_run
/// use std::fs;
///
/// fn main() -> std::io::Result<()> {
/// let mut perms = fs::metadata("foo.txt")?.permissions();
/// perms.set_readonly(true);
/// fs::set_permissions("foo.txt", perms)?;
/// Ok(())
/// }
/// ```
#[stable(feature = "set_permissions", since = "1.1.0")]
pub fn set_permissions<P: AsRef<Path>>(path: P, perm: Permissions)
-> io::Result<()> {
fs_imp::set_perm(path.as_ref(), perm.0)
}
impl DirBuilder {
/// Creates a new set of options with default mode/security settings for all
/// platforms and also non-recursive.
///
/// # Examples
///
/// ```
/// use std::fs::DirBuilder;
///
/// let builder = DirBuilder::new();
/// ```
#[stable(feature = "dir_builder", since = "1.6.0")]
pub fn new() -> DirBuilder {
DirBuilder {
inner: fs_imp::DirBuilder::new(),
recursive: false,
}
}
/// Indicates that directories should be created recursively, creating all
/// parent directories. Parents that do not exist are created with the same
/// security and permissions settings.
///
/// This option defaults to `false`.
///
/// # Examples
///
/// ```
/// use std::fs::DirBuilder;
///
/// let mut builder = DirBuilder::new();
/// builder.recursive(true);
/// ```
#[stable(feature = "dir_builder", since = "1.6.0")]
pub fn recursive(&mut self, recursive: bool) -> &mut Self {
self.recursive = recursive;
self
}
/// Creates the specified directory with the options configured in this
/// builder.
///
/// It is considered an error if the directory already exists unless
/// recursive mode is enabled.
///
/// # Examples
///
/// ```no_run
/// use std::fs::{self, DirBuilder};
///
/// let path = "/tmp/foo/bar/baz";
/// DirBuilder::new()
/// .recursive(true)
/// .create(path).unwrap();
///
/// assert!(fs::metadata(path).unwrap().is_dir());
/// ```
#[stable(feature = "dir_builder", since = "1.6.0")]
pub fn create<P: AsRef<Path>>(&self, path: P) -> io::Result<()> {
self._create(path.as_ref())
}
fn _create(&self, path: &Path) -> io::Result<()> {
if self.recursive {
self.create_dir_all(path)
} else {
self.inner.mkdir(path)
}
}
fn create_dir_all(&self, path: &Path) -> io::Result<()> {
if path == Path::new("") {
return Ok(())
}
match self.inner.mkdir(path) {
Ok(()) => return Ok(()),
Err(ref e) if e.kind() == io::ErrorKind::NotFound => {}
Err(_) if path.is_dir() => return Ok(()),
Err(e) => return Err(e),
}
match path.parent() {
Some(p) => self.create_dir_all(p)?,
None => return Err(io::Error::new(io::ErrorKind::Other, "failed to create whole tree")),
}
match self.inner.mkdir(path) {
Ok(()) => Ok(()),
Err(_) if path.is_dir() => Ok(()),
Err(e) => Err(e),
}
}
}
impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
fn as_inner_mut(&mut self) -> &mut fs_imp::DirBuilder {
&mut self.inner
}
}
#[cfg(all(test, not(any(target_os = "cloudabi", target_os = "emscripten", target_env = "sgx"))))]
mod tests {
use crate::io::prelude::*;
use crate::fs::{self, File, OpenOptions};
use crate::io::{ErrorKind, SeekFrom};
use crate::path::Path;
use crate::str;
use crate::sys_common::io::test::{TempDir, tmpdir};
use crate::thread;
use rand::{rngs::StdRng, FromEntropy, RngCore};
#[cfg(windows)]
use crate::os::windows::fs::{symlink_dir, symlink_file};
#[cfg(windows)]
use crate::sys::fs::symlink_junction;
#[cfg(unix)]
use crate::os::unix::fs::symlink as symlink_dir;
#[cfg(unix)]
use crate::os::unix::fs::symlink as symlink_file;
#[cfg(unix)]
use crate::os::unix::fs::symlink as symlink_junction;
macro_rules! check { ($e:expr) => (
match $e {
Ok(t) => t,
Err(e) => panic!("{} failed with: {}", stringify!($e), e),
}
) }
#[cfg(windows)]
macro_rules! error { ($e:expr, $s:expr) => (
match $e {
Ok(_) => panic!("Unexpected success. Should've been: {:?}", $s),
Err(ref err) => assert!(err.raw_os_error() == Some($s),
format!("`{}` did not have a code of `{}`", err, $s))
}
) }
#[cfg(unix)]
macro_rules! error { ($e:expr, $s:expr) => ( error_contains!($e, $s) ) }
macro_rules! error_contains { ($e:expr, $s:expr) => (
match $e {
Ok(_) => panic!("Unexpected success. Should've been: {:?}", $s),
Err(ref err) => assert!(err.to_string().contains($s),
format!("`{}` did not contain `{}`", err, $s))
}
) }
// Several test fail on windows if the user does not have permission to
// create symlinks (the `SeCreateSymbolicLinkPrivilege`). Instead of
// disabling these test on Windows, use this function to test whether we
// have permission, and return otherwise. This way, we still don't run these
// tests most of the time, but at least we do if the user has the right
// permissions.
pub fn got_symlink_permission(tmpdir: &TempDir) -> bool {
if cfg!(unix) { return true }
let link = tmpdir.join("some_hopefully_unique_link_name");
match symlink_file(r"nonexisting_target", link) {
Ok(_) => true,
// ERROR_PRIVILEGE_NOT_HELD = 1314
Err(ref err) if err.raw_os_error() == Some(1314) => false,
Err(_) => true,
}
}
#[test]
fn file_test_io_smoke_test() {
let message = "it's alright. have a good time";
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_rt_io_file_test.txt");
{
let mut write_stream = check!(File::create(filename));
check!(write_stream.write(message.as_bytes()));
}
{
let mut read_stream = check!(File::open(filename));
let mut read_buf = [0; 1028];
let read_str = match check!(read_stream.read(&mut read_buf)) {
0 => panic!("shouldn't happen"),
n => str::from_utf8(&read_buf[..n]).unwrap().to_string()
};
assert_eq!(read_str, message);
}
check!(fs::remove_file(filename));
}
#[test]
fn invalid_path_raises() {
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_that_does_not_exist.txt");
let result = File::open(filename);
#[cfg(unix)]
error!(result, "No such file or directory");
#[cfg(windows)]
error!(result, 2); // ERROR_FILE_NOT_FOUND
}
#[test]
fn file_test_iounlinking_invalid_path_should_raise_condition() {
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_another_file_that_does_not_exist.txt");
let result = fs::remove_file(filename);
#[cfg(unix)]
error!(result, "No such file or directory");
#[cfg(windows)]
error!(result, 2); // ERROR_FILE_NOT_FOUND
}
#[test]
fn file_test_io_non_positional_read() {
let message: &str = "ten-four";
let mut read_mem = [0; 8];
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_rt_io_file_test_positional.txt");
{
let mut rw_stream = check!(File::create(filename));
check!(rw_stream.write(message.as_bytes()));
}
{
let mut read_stream = check!(File::open(filename));
{
let read_buf = &mut read_mem[0..4];
check!(read_stream.read(read_buf));
}
{
let read_buf = &mut read_mem[4..8];
check!(read_stream.read(read_buf));
}
}
check!(fs::remove_file(filename));
let read_str = str::from_utf8(&read_mem).unwrap();
assert_eq!(read_str, message);
}
#[test]
fn file_test_io_seek_and_tell_smoke_test() {
let message = "ten-four";
let mut read_mem = [0; 4];
let set_cursor = 4 as u64;
let tell_pos_pre_read;
let tell_pos_post_read;
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_rt_io_file_test_seeking.txt");
{
let mut rw_stream = check!(File::create(filename));
check!(rw_stream.write(message.as_bytes()));
}
{
let mut read_stream = check!(File::open(filename));
check!(read_stream.seek(SeekFrom::Start(set_cursor)));
tell_pos_pre_read = check!(read_stream.seek(SeekFrom::Current(0)));
check!(read_stream.read(&mut read_mem));
tell_pos_post_read = check!(read_stream.seek(SeekFrom::Current(0)));
}
check!(fs::remove_file(filename));
let read_str = str::from_utf8(&read_mem).unwrap();
assert_eq!(read_str, &message[4..8]);
assert_eq!(tell_pos_pre_read, set_cursor);
assert_eq!(tell_pos_post_read, message.len() as u64);
}
#[test]
fn file_test_io_seek_and_write() {
let initial_msg = "food-is-yummy";
let overwrite_msg = "-the-bar!!";
let final_msg = "foo-the-bar!!";
let seek_idx = 3;
let mut read_mem = [0; 13];
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_rt_io_file_test_seek_and_write.txt");
{
let mut rw_stream = check!(File::create(filename));
check!(rw_stream.write(initial_msg.as_bytes()));
check!(rw_stream.seek(SeekFrom::Start(seek_idx)));
check!(rw_stream.write(overwrite_msg.as_bytes()));
}
{
let mut read_stream = check!(File::open(filename));
check!(read_stream.read(&mut read_mem));
}
check!(fs::remove_file(filename));
let read_str = str::from_utf8(&read_mem).unwrap();
assert!(read_str == final_msg);
}
#[test]
fn file_test_io_seek_shakedown() {
// 01234567890123
let initial_msg = "qwer-asdf-zxcv";
let chunk_one: &str = "qwer";
let chunk_two: &str = "asdf";
let chunk_three: &str = "zxcv";
let mut read_mem = [0; 4];
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_rt_io_file_test_seek_shakedown.txt");
{
let mut rw_stream = check!(File::create(filename));
check!(rw_stream.write(initial_msg.as_bytes()));
}
{
let mut read_stream = check!(File::open(filename));
check!(read_stream.seek(SeekFrom::End(-4)));
check!(read_stream.read(&mut read_mem));
assert_eq!(str::from_utf8(&read_mem).unwrap(), chunk_three);
check!(read_stream.seek(SeekFrom::Current(-9)));
check!(read_stream.read(&mut read_mem));
assert_eq!(str::from_utf8(&read_mem).unwrap(), chunk_two);
check!(read_stream.seek(SeekFrom::Start(0)));
check!(read_stream.read(&mut read_mem));
assert_eq!(str::from_utf8(&read_mem).unwrap(), chunk_one);
}
check!(fs::remove_file(filename));
}
#[test]
fn file_test_io_eof() {
let tmpdir = tmpdir();
let filename = tmpdir.join("file_rt_io_file_test_eof.txt");
let mut buf = [0; 256];
{
let oo = OpenOptions::new().create_new(true).write(true).read(true).clone();
let mut rw = check!(oo.open(&filename));
assert_eq!(check!(rw.read(&mut buf)), 0);
assert_eq!(check!(rw.read(&mut buf)), 0);
}
check!(fs::remove_file(&filename));
}
#[test]
#[cfg(unix)]
fn file_test_io_read_write_at() {
use crate::os::unix::fs::FileExt;
let tmpdir = tmpdir();
let filename = tmpdir.join("file_rt_io_file_test_read_write_at.txt");
let mut buf = [0; 256];
let write1 = "asdf";
let write2 = "qwer-";
let write3 = "-zxcv";
let content = "qwer-asdf-zxcv";
{
let oo = OpenOptions::new().create_new(true).write(true).read(true).clone();
let mut rw = check!(oo.open(&filename));
assert_eq!(check!(rw.write_at(write1.as_bytes(), 5)), write1.len());
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 0);
assert_eq!(check!(rw.read_at(&mut buf, 5)), write1.len());
assert_eq!(str::from_utf8(&buf[..write1.len()]), Ok(write1));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 0);
assert_eq!(check!(rw.read_at(&mut buf[..write2.len()], 0)), write2.len());
assert_eq!(str::from_utf8(&buf[..write2.len()]), Ok("\0\0\0\0\0"));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 0);
assert_eq!(check!(rw.write(write2.as_bytes())), write2.len());
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 5);
assert_eq!(check!(rw.read(&mut buf)), write1.len());
assert_eq!(str::from_utf8(&buf[..write1.len()]), Ok(write1));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 9);
assert_eq!(check!(rw.read_at(&mut buf[..write2.len()], 0)), write2.len());
assert_eq!(str::from_utf8(&buf[..write2.len()]), Ok(write2));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 9);
assert_eq!(check!(rw.write_at(write3.as_bytes(), 9)), write3.len());
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 9);
}
{
let mut read = check!(File::open(&filename));
assert_eq!(check!(read.read_at(&mut buf, 0)), content.len());
assert_eq!(str::from_utf8(&buf[..content.len()]), Ok(content));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 0);
assert_eq!(check!(read.seek(SeekFrom::End(-5))), 9);
assert_eq!(check!(read.read_at(&mut buf, 0)), content.len());
assert_eq!(str::from_utf8(&buf[..content.len()]), Ok(content));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 9);
assert_eq!(check!(read.read(&mut buf)), write3.len());
assert_eq!(str::from_utf8(&buf[..write3.len()]), Ok(write3));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
assert_eq!(check!(read.read_at(&mut buf, 0)), content.len());
assert_eq!(str::from_utf8(&buf[..content.len()]), Ok(content));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
assert_eq!(check!(read.read_at(&mut buf, 14)), 0);
assert_eq!(check!(read.read_at(&mut buf, 15)), 0);
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
}
check!(fs::remove_file(&filename));
}
#[test]
#[cfg(unix)]
fn set_get_unix_permissions() {
use crate::os::unix::fs::PermissionsExt;
let tmpdir = tmpdir();
let filename = &tmpdir.join("set_get_unix_permissions");
check!(fs::create_dir(filename));
let mask = 0o7777;
check!(fs::set_permissions(filename,
fs::Permissions::from_mode(0)));
let metadata0 = check!(fs::metadata(filename));
assert_eq!(mask & metadata0.permissions().mode(), 0);
check!(fs::set_permissions(filename,
fs::Permissions::from_mode(0o1777)));
let metadata1 = check!(fs::metadata(filename));
assert_eq!(mask & metadata1.permissions().mode(), 0o1777);
}
#[test]
#[cfg(windows)]
fn file_test_io_seek_read_write() {
use crate::os::windows::fs::FileExt;
let tmpdir = tmpdir();
let filename = tmpdir.join("file_rt_io_file_test_seek_read_write.txt");
let mut buf = [0; 256];
let write1 = "asdf";
let write2 = "qwer-";
let write3 = "-zxcv";
let content = "qwer-asdf-zxcv";
{
let oo = OpenOptions::new().create_new(true).write(true).read(true).clone();
let mut rw = check!(oo.open(&filename));
assert_eq!(check!(rw.seek_write(write1.as_bytes(), 5)), write1.len());
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 9);
assert_eq!(check!(rw.seek_read(&mut buf, 5)), write1.len());
assert_eq!(str::from_utf8(&buf[..write1.len()]), Ok(write1));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 9);
assert_eq!(check!(rw.seek(SeekFrom::Start(0))), 0);
assert_eq!(check!(rw.write(write2.as_bytes())), write2.len());
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 5);
assert_eq!(check!(rw.read(&mut buf)), write1.len());
assert_eq!(str::from_utf8(&buf[..write1.len()]), Ok(write1));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 9);
assert_eq!(check!(rw.seek_read(&mut buf[..write2.len()], 0)), write2.len());
assert_eq!(str::from_utf8(&buf[..write2.len()]), Ok(write2));
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 5);
assert_eq!(check!(rw.seek_write(write3.as_bytes(), 9)), write3.len());
assert_eq!(check!(rw.seek(SeekFrom::Current(0))), 14);
}
{
let mut read = check!(File::open(&filename));
assert_eq!(check!(read.seek_read(&mut buf, 0)), content.len());
assert_eq!(str::from_utf8(&buf[..content.len()]), Ok(content));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
assert_eq!(check!(read.seek(SeekFrom::End(-5))), 9);
assert_eq!(check!(read.seek_read(&mut buf, 0)), content.len());
assert_eq!(str::from_utf8(&buf[..content.len()]), Ok(content));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
assert_eq!(check!(read.seek(SeekFrom::End(-5))), 9);
assert_eq!(check!(read.read(&mut buf)), write3.len());
assert_eq!(str::from_utf8(&buf[..write3.len()]), Ok(write3));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
assert_eq!(check!(read.seek_read(&mut buf, 0)), content.len());
assert_eq!(str::from_utf8(&buf[..content.len()]), Ok(content));
assert_eq!(check!(read.seek(SeekFrom::Current(0))), 14);
assert_eq!(check!(read.seek_read(&mut buf, 14)), 0);
assert_eq!(check!(read.seek_read(&mut buf, 15)), 0);
}
check!(fs::remove_file(&filename));
}
#[test]
fn file_test_stat_is_correct_on_is_file() {
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_stat_correct_on_is_file.txt");
{
let mut opts = OpenOptions::new();
let mut fs = check!(opts.read(true).write(true)
.create(true).open(filename));
let msg = "hw";
fs.write(msg.as_bytes()).unwrap();
let fstat_res = check!(fs.metadata());
assert!(fstat_res.is_file());
}
let stat_res_fn = check!(fs::metadata(filename));
assert!(stat_res_fn.is_file());
let stat_res_meth = check!(filename.metadata());
assert!(stat_res_meth.is_file());
check!(fs::remove_file(filename));
}
#[test]
fn file_test_stat_is_correct_on_is_dir() {
let tmpdir = tmpdir();
let filename = &tmpdir.join("file_stat_correct_on_is_dir");
check!(fs::create_dir(filename));
let stat_res_fn = check!(fs::metadata(filename));
assert!(stat_res_fn.is_dir());
let stat_res_meth = check!(filename.metadata());
assert!(stat_res_meth.is_dir());
check!(fs::remove_dir(filename));
}
#[test]
fn file_test_fileinfo_false_when_checking_is_file_on_a_directory() {
let tmpdir = tmpdir();
let dir = &tmpdir.join("fileinfo_false_on_dir");
check!(fs::create_dir(dir));
assert!(!dir.is_file());
check!(fs::remove_dir(dir));
}
#[test]
fn file_test_fileinfo_check_exists_before_and_after_file_creation() {
let tmpdir = tmpdir();
let file = &tmpdir.join("fileinfo_check_exists_b_and_a.txt");
check!(check!(File::create(file)).write(b"foo"));
assert!(file.exists());
check!(fs::remove_file(file));
assert!(!file.exists());
}
#[test]
fn file_test_directoryinfo_check_exists_before_and_after_mkdir() {
let tmpdir = tmpdir();
let dir = &tmpdir.join("before_and_after_dir");
assert!(!dir.exists());
check!(fs::create_dir(dir));
assert!(dir.exists());
assert!(dir.is_dir());
check!(fs::remove_dir(dir));
assert!(!dir.exists());
}
#[test]
fn file_test_directoryinfo_readdir() {
let tmpdir = tmpdir();
let dir = &tmpdir.join("di_readdir");
check!(fs::create_dir(dir));
let prefix = "foo";
for n in 0..3 {
let f = dir.join(&format!("{}.txt", n));
let mut w = check!(File::create(&f));
let msg_str = format!("{}{}", prefix, n.to_string());
let msg = msg_str.as_bytes();
check!(w.write(msg));
}
let files = check!(fs::read_dir(dir));
let mut mem = [0; 4];
for f in files {
let f = f.unwrap().path();
{
let n = f.file_stem().unwrap();
check!(check!(File::open(&f)).read(&mut mem));
let read_str = str::from_utf8(&mem).unwrap();
let expected = format!("{}{}", prefix, n.to_str().unwrap());
assert_eq!(expected, read_str);
}
check!(fs::remove_file(&f));
}
check!(fs::remove_dir(dir));
}
#[test]
fn file_create_new_already_exists_error() {
let tmpdir = tmpdir();
let file = &tmpdir.join("file_create_new_error_exists");
check!(fs::File::create(file));
let e = fs::OpenOptions::new().write(true).create_new(true).open(file).unwrap_err();
assert_eq!(e.kind(), ErrorKind::AlreadyExists);
}
#[test]
fn mkdir_path_already_exists_error() {
let tmpdir = tmpdir();
let dir = &tmpdir.join("mkdir_error_twice");
check!(fs::create_dir(dir));
let e = fs::create_dir(dir).unwrap_err();
assert_eq!(e.kind(), ErrorKind::AlreadyExists);
}
#[test]
fn recursive_mkdir() {
let tmpdir = tmpdir();
let dir = tmpdir.join("d1/d2");
check!(fs::create_dir_all(&dir));
assert!(dir.is_dir())
}
#[test]
fn recursive_mkdir_failure() {
let tmpdir = tmpdir();
let dir = tmpdir.join("d1");
let file = dir.join("f1");
check!(fs::create_dir_all(&dir));
check!(File::create(&file));
let result = fs::create_dir_all(&file);
assert!(result.is_err());
}
#[test]
fn concurrent_recursive_mkdir() {
for _ in 0..100 {
let dir = tmpdir();
let mut dir = dir.join("a");
for _ in 0..40 {
dir = dir.join("a");
}
let mut join = vec!();
for _ in 0..8 {
let dir = dir.clone();
join.push(thread::spawn(move || {
check!(fs::create_dir_all(&dir));
}))
}
// No `Display` on result of `join()`
join.drain(..).map(|join| join.join().unwrap()).count();
}
}
#[test]
fn recursive_mkdir_slash() {
check!(fs::create_dir_all(Path::new("/")));
}
#[test]
fn recursive_mkdir_dot() {
check!(fs::create_dir_all(Path::new(".")));
}
#[test]
fn recursive_mkdir_empty() {
check!(fs::create_dir_all(Path::new("")));
}
#[test]
fn recursive_rmdir() {
let tmpdir = tmpdir();
let d1 = tmpdir.join("d1");
let dt = d1.join("t");
let dtt = dt.join("t");
let d2 = tmpdir.join("d2");
let canary = d2.join("do_not_delete");
check!(fs::create_dir_all(&dtt));
check!(fs::create_dir_all(&d2));
check!(check!(File::create(&canary)).write(b"foo"));
check!(symlink_junction(&d2, &dt.join("d2")));
let _ = symlink_file(&canary, &d1.join("canary"));
check!(fs::remove_dir_all(&d1));
assert!(!d1.is_dir());
assert!(canary.exists());
}
#[test]
fn recursive_rmdir_of_symlink() {
// test we do not recursively delete a symlink but only dirs.
let tmpdir = tmpdir();
let link = tmpdir.join("d1");
let dir = tmpdir.join("d2");
let canary = dir.join("do_not_delete");
check!(fs::create_dir_all(&dir));
check!(check!(File::create(&canary)).write(b"foo"));
check!(symlink_junction(&dir, &link));
check!(fs::remove_dir_all(&link));
assert!(!link.is_dir());
assert!(canary.exists());
}
#[test]
// only Windows makes a distinction between file and directory symlinks.
#[cfg(windows)]
fn recursive_rmdir_of_file_symlink() {
let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return };
let f1 = tmpdir.join("f1");
let f2 = tmpdir.join("f2");
check!(check!(File::create(&f1)).write(b"foo"));
check!(symlink_file(&f1, &f2));
match fs::remove_dir_all(&f2) {
Ok(..) => panic!("wanted a failure"),
Err(..) => {}
}
}
#[test]
fn unicode_path_is_dir() {
assert!(Path::new(".").is_dir());
assert!(!Path::new("test/stdtest/fs.rs").is_dir());
let tmpdir = tmpdir();
let mut dirpath = tmpdir.path().to_path_buf();
dirpath.push("test-가一ー你好");
check!(fs::create_dir(&dirpath));
assert!(dirpath.is_dir());
let mut filepath = dirpath;
filepath.push("unicode-file-\u{ac00}\u{4e00}\u{30fc}\u{4f60}\u{597d}.rs");
check!(File::create(&filepath)); // ignore return; touch only
assert!(!filepath.is_dir());
assert!(filepath.exists());
}
#[test]
fn unicode_path_exists() {
assert!(Path::new(".").exists());
assert!(!Path::new("test/nonexistent-bogus-path").exists());
let tmpdir = tmpdir();
let unicode = tmpdir.path();
let unicode = unicode.join("test-각丁ー再见");
check!(fs::create_dir(&unicode));
assert!(unicode.exists());
assert!(!Path::new("test/unicode-bogus-path-각丁ー再见").exists());
}
#[test]
fn copy_file_does_not_exist() {
let from = Path::new("test/nonexistent-bogus-path");
let to = Path::new("test/other-bogus-path");
match fs::copy(&from, &to) {
Ok(..) => panic!(),
Err(..) => {
assert!(!from.exists());
assert!(!to.exists());
}
}
}
#[test]
fn copy_src_does_not_exist() {
let tmpdir = tmpdir();
let from = Path::new("test/nonexistent-bogus-path");
let to = tmpdir.join("out.txt");
check!(check!(File::create(&to)).write(b"hello"));
assert!(fs::copy(&from, &to).is_err());
assert!(!from.exists());
let mut v = Vec::new();
check!(check!(File::open(&to)).read_to_end(&mut v));
assert_eq!(v, b"hello");
}
#[test]
fn copy_file_ok() {
let tmpdir = tmpdir();
let input = tmpdir.join("in.txt");
let out = tmpdir.join("out.txt");
check!(check!(File::create(&input)).write(b"hello"));
check!(fs::copy(&input, &out));
let mut v = Vec::new();
check!(check!(File::open(&out)).read_to_end(&mut v));
assert_eq!(v, b"hello");
assert_eq!(check!(input.metadata()).permissions(),
check!(out.metadata()).permissions());
}
#[test]
fn copy_file_dst_dir() {
let tmpdir = tmpdir();
let out = tmpdir.join("out");
check!(File::create(&out));
match fs::copy(&*out, tmpdir.path()) {
Ok(..) => panic!(), Err(..) => {}
}
}
#[test]
fn copy_file_dst_exists() {
let tmpdir = tmpdir();
let input = tmpdir.join("in");
let output = tmpdir.join("out");
check!(check!(File::create(&input)).write("foo".as_bytes()));
check!(check!(File::create(&output)).write("bar".as_bytes()));
check!(fs::copy(&input, &output));
let mut v = Vec::new();
check!(check!(File::open(&output)).read_to_end(&mut v));
assert_eq!(v, b"foo".to_vec());
}
#[test]
fn copy_file_src_dir() {
let tmpdir = tmpdir();
let out = tmpdir.join("out");
match fs::copy(tmpdir.path(), &out) {
Ok(..) => panic!(), Err(..) => {}
}
assert!(!out.exists());
}
#[test]
fn copy_file_preserves_perm_bits() {
let tmpdir = tmpdir();
let input = tmpdir.join("in.txt");
let out = tmpdir.join("out.txt");
let attr = check!(check!(File::create(&input)).metadata());
let mut p = attr.permissions();
p.set_readonly(true);
check!(fs::set_permissions(&input, p));
check!(fs::copy(&input, &out));
assert!(check!(out.metadata()).permissions().readonly());
check!(fs::set_permissions(&input, attr.permissions()));
check!(fs::set_permissions(&out, attr.permissions()));
}
#[test]
#[cfg(windows)]
fn copy_file_preserves_streams() {
let tmp = tmpdir();
check!(check!(File::create(tmp.join("in.txt:bunny"))).write("carrot".as_bytes()));
assert_eq!(check!(fs::copy(tmp.join("in.txt"), tmp.join("out.txt"))), 0);
assert_eq!(check!(tmp.join("out.txt").metadata()).len(), 0);
let mut v = Vec::new();
check!(check!(File::open(tmp.join("out.txt:bunny"))).read_to_end(&mut v));
assert_eq!(v, b"carrot".to_vec());
}
#[test]
fn copy_file_returns_metadata_len() {
let tmp = tmpdir();
let in_path = tmp.join("in.txt");
let out_path = tmp.join("out.txt");
check!(check!(File::create(&in_path)).write(b"lettuce"));
#[cfg(windows)]
check!(check!(File::create(tmp.join("in.txt:bunny"))).write(b"carrot"));
let copied_len = check!(fs::copy(&in_path, &out_path));
assert_eq!(check!(out_path.metadata()).len(), copied_len);
}
#[test]
fn copy_file_follows_dst_symlink() {
let tmp = tmpdir();
if !got_symlink_permission(&tmp) { return };
let in_path = tmp.join("in.txt");
let out_path = tmp.join("out.txt");
let out_path_symlink = tmp.join("out_symlink.txt");
check!(fs::write(&in_path, "foo"));
check!(fs::write(&out_path, "bar"));
check!(symlink_file(&out_path, &out_path_symlink));
check!(fs::copy(&in_path, &out_path_symlink));
assert!(check!(out_path_symlink.symlink_metadata()).file_type().is_symlink());
assert_eq!(check!(fs::read(&out_path_symlink)), b"foo".to_vec());
assert_eq!(check!(fs::read(&out_path)), b"foo".to_vec());
}
#[test]
fn symlinks_work() {
let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return };
let input = tmpdir.join("in.txt");
let out = tmpdir.join("out.txt");
check!(check!(File::create(&input)).write("foobar".as_bytes()));
check!(symlink_file(&input, &out));
assert!(check!(out.symlink_metadata()).file_type().is_symlink());
assert_eq!(check!(fs::metadata(&out)).len(),
check!(fs::metadata(&input)).len());
let mut v = Vec::new();
check!(check!(File::open(&out)).read_to_end(&mut v));
assert_eq!(v, b"foobar".to_vec());
}
#[test]
fn symlink_noexist() {
// Symlinks can point to things that don't exist
let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return };
// Use a relative path for testing. Symlinks get normalized by Windows,
// so we may not get the same path back for absolute paths
check!(symlink_file(&"foo", &tmpdir.join("bar")));
assert_eq!(check!(fs::read_link(&tmpdir.join("bar"))).to_str().unwrap(),
"foo");
}
#[test]
fn read_link() {
if cfg!(windows) {
// directory symlink
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
r"C:\ProgramData");
// junction
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
r"C:\Users\Default");
// junction with special permissions
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
r"C:\Users");
}
let tmpdir = tmpdir();
let link = tmpdir.join("link");
if !got_symlink_permission(&tmpdir) { return };
check!(symlink_file(&"foo", &link));
assert_eq!(check!(fs::read_link(&link)).to_str().unwrap(), "foo");
}
#[test]
fn readlink_not_symlink() {
let tmpdir = tmpdir();
match fs::read_link(tmpdir.path()) {
Ok(..) => panic!("wanted a failure"),
Err(..) => {}
}
}
#[test]
fn links_work() {
let tmpdir = tmpdir();
let input = tmpdir.join("in.txt");
let out = tmpdir.join("out.txt");
check!(check!(File::create(&input)).write("foobar".as_bytes()));
check!(fs::hard_link(&input, &out));
assert_eq!(check!(fs::metadata(&out)).len(),
check!(fs::metadata(&input)).len());
assert_eq!(check!(fs::metadata(&out)).len(),
check!(input.metadata()).len());
let mut v = Vec::new();
check!(check!(File::open(&out)).read_to_end(&mut v));
assert_eq!(v, b"foobar".to_vec());
// can't link to yourself
match fs::hard_link(&input, &input) {
Ok(..) => panic!("wanted a failure"),
Err(..) => {}
}
// can't link to something that doesn't exist
match fs::hard_link(&tmpdir.join("foo"), &tmpdir.join("bar")) {
Ok(..) => panic!("wanted a failure"),
Err(..) => {}
}
}
#[test]
fn chmod_works() {
let tmpdir = tmpdir();
let file = tmpdir.join("in.txt");
check!(File::create(&file));
let attr = check!(fs::metadata(&file));
assert!(!attr.permissions().readonly());
let mut p = attr.permissions();
p.set_readonly(true);
check!(fs::set_permissions(&file, p.clone()));
let attr = check!(fs::metadata(&file));
assert!(attr.permissions().readonly());
match fs::set_permissions(&tmpdir.join("foo"), p.clone()) {
Ok(..) => panic!("wanted an error"),
Err(..) => {}
}
p.set_readonly(false);
check!(fs::set_permissions(&file, p));
}
#[test]
fn fchmod_works() {
let tmpdir = tmpdir();
let path = tmpdir.join("in.txt");
let file = check!(File::create(&path));
let attr = check!(fs::metadata(&path));
assert!(!attr.permissions().readonly());
let mut p = attr.permissions();
p.set_readonly(true);
check!(file.set_permissions(p.clone()));
let attr = check!(fs::metadata(&path));
assert!(attr.permissions().readonly());
p.set_readonly(false);
check!(file.set_permissions(p));
}
#[test]
fn sync_doesnt_kill_anything() {
let tmpdir = tmpdir();
let path = tmpdir.join("in.txt");
let mut file = check!(File::create(&path));
check!(file.sync_all());
check!(file.sync_data());
check!(file.write(b"foo"));
check!(file.sync_all());
check!(file.sync_data());
}
#[test]
fn truncate_works() {
let tmpdir = tmpdir();
let path = tmpdir.join("in.txt");
let mut file = check!(File::create(&path));
check!(file.write(b"foo"));
check!(file.sync_all());
// Do some simple things with truncation
assert_eq!(check!(file.metadata()).len(), 3);
check!(file.set_len(10));
assert_eq!(check!(file.metadata()).len(), 10);
check!(file.write(b"bar"));
check!(file.sync_all());
assert_eq!(check!(file.metadata()).len(), 10);
let mut v = Vec::new();
check!(check!(File::open(&path)).read_to_end(&mut v));
assert_eq!(v, b"foobar\0\0\0\0".to_vec());
// Truncate to a smaller length, don't seek, and then write something.
// Ensure that the intermediate zeroes are all filled in (we have `seek`ed
// past the end of the file).
check!(file.set_len(2));
assert_eq!(check!(file.metadata()).len(), 2);
check!(file.write(b"wut"));
check!(file.sync_all());
assert_eq!(check!(file.metadata()).len(), 9);
let mut v = Vec::new();
check!(check!(File::open(&path)).read_to_end(&mut v));
assert_eq!(v, b"fo\0\0\0\0wut".to_vec());
}
#[test]
fn open_flavors() {
use crate::fs::OpenOptions as OO;
fn c<T: Clone>(t: &T) -> T { t.clone() }
let tmpdir = tmpdir();
let mut r = OO::new(); r.read(true);
let mut w = OO::new(); w.write(true);
let mut rw = OO::new(); rw.read(true).write(true);
let mut a = OO::new(); a.append(true);
let mut ra = OO::new(); ra.read(true).append(true);
#[cfg(windows)]
let invalid_options = 87; // ERROR_INVALID_PARAMETER
#[cfg(unix)]
let invalid_options = "Invalid argument";
// Test various combinations of creation modes and access modes.
//
// Allowed:
// creation mode | read | write | read-write | append | read-append |
// :-----------------------|:-----:|:-----:|:----------:|:------:|:-----------:|
// not set (open existing) | X | X | X | X | X |
// create | | X | X | X | X |
// truncate | | X | X | | |
// create and truncate | | X | X | | |
// create_new | | X | X | X | X |
//
// tested in reverse order, so 'create_new' creates the file, and 'open existing' opens it.
// write-only
check!(c(&w).create_new(true).open(&tmpdir.join("a")));
check!(c(&w).create(true).truncate(true).open(&tmpdir.join("a")));
check!(c(&w).truncate(true).open(&tmpdir.join("a")));
check!(c(&w).create(true).open(&tmpdir.join("a")));
check!(c(&w).open(&tmpdir.join("a")));
// read-only
error!(c(&r).create_new(true).open(&tmpdir.join("b")), invalid_options);
error!(c(&r).create(true).truncate(true).open(&tmpdir.join("b")), invalid_options);
error!(c(&r).truncate(true).open(&tmpdir.join("b")), invalid_options);
error!(c(&r).create(true).open(&tmpdir.join("b")), invalid_options);
check!(c(&r).open(&tmpdir.join("a"))); // try opening the file created with write_only
// read-write
check!(c(&rw).create_new(true).open(&tmpdir.join("c")));
check!(c(&rw).create(true).truncate(true).open(&tmpdir.join("c")));
check!(c(&rw).truncate(true).open(&tmpdir.join("c")));
check!(c(&rw).create(true).open(&tmpdir.join("c")));
check!(c(&rw).open(&tmpdir.join("c")));
// append
check!(c(&a).create_new(true).open(&tmpdir.join("d")));
error!(c(&a).create(true).truncate(true).open(&tmpdir.join("d")), invalid_options);
error!(c(&a).truncate(true).open(&tmpdir.join("d")), invalid_options);
check!(c(&a).create(true).open(&tmpdir.join("d")));
check!(c(&a).open(&tmpdir.join("d")));
// read-append
check!(c(&ra).create_new(true).open(&tmpdir.join("e")));
error!(c(&ra).create(true).truncate(true).open(&tmpdir.join("e")), invalid_options);
error!(c(&ra).truncate(true).open(&tmpdir.join("e")), invalid_options);
check!(c(&ra).create(true).open(&tmpdir.join("e")));
check!(c(&ra).open(&tmpdir.join("e")));
// Test opening a file without setting an access mode
let mut blank = OO::new();
error!(blank.create(true).open(&tmpdir.join("f")), invalid_options);
// Test write works
check!(check!(File::create(&tmpdir.join("h"))).write("foobar".as_bytes()));
// Test write fails for read-only
check!(r.open(&tmpdir.join("h")));
{
let mut f = check!(r.open(&tmpdir.join("h")));
assert!(f.write("wut".as_bytes()).is_err());
}
// Test write overwrites
{
let mut f = check!(c(&w).open(&tmpdir.join("h")));
check!(f.write("baz".as_bytes()));
}
{
let mut f = check!(c(&r).open(&tmpdir.join("h")));
let mut b = vec![0; 6];
check!(f.read(&mut b));
assert_eq!(b, "bazbar".as_bytes());
}
// Test truncate works
{
let mut f = check!(c(&w).truncate(true).open(&tmpdir.join("h")));
check!(f.write("foo".as_bytes()));
}
assert_eq!(check!(fs::metadata(&tmpdir.join("h"))).len(), 3);
// Test append works
assert_eq!(check!(fs::metadata(&tmpdir.join("h"))).len(), 3);
{
let mut f = check!(c(&a).open(&tmpdir.join("h")));
check!(f.write("bar".as_bytes()));
}
assert_eq!(check!(fs::metadata(&tmpdir.join("h"))).len(), 6);
// Test .append(true) equals .write(true).append(true)
{
let mut f = check!(c(&w).append(true).open(&tmpdir.join("h")));
check!(f.write("baz".as_bytes()));
}
assert_eq!(check!(fs::metadata(&tmpdir.join("h"))).len(), 9);
}
#[test]
fn _assert_send_sync() {
fn _assert_send_sync<T: Send + Sync>() {}
_assert_send_sync::<OpenOptions>();
}
#[test]
fn binary_file() {
let mut bytes = [0; 1024];
StdRng::from_entropy().fill_bytes(&mut bytes);
let tmpdir = tmpdir();
check!(check!(File::create(&tmpdir.join("test"))).write(&bytes));
let mut v = Vec::new();
check!(check!(File::open(&tmpdir.join("test"))).read_to_end(&mut v));
assert!(v == &bytes[..]);
}
#[test]
fn write_then_read() {
let mut bytes = [0; 1024];
StdRng::from_entropy().fill_bytes(&mut bytes);
let tmpdir = tmpdir();
check!(fs::write(&tmpdir.join("test"), &bytes[..]));
let v = check!(fs::read(&tmpdir.join("test")));
assert!(v == &bytes[..]);
check!(fs::write(&tmpdir.join("not-utf8"), &[0xFF]));
error_contains!(fs::read_to_string(&tmpdir.join("not-utf8")),
"stream did not contain valid UTF-8");
let s = "𐁁𐀓𐀠𐀴𐀍";
check!(fs::write(&tmpdir.join("utf8"), s.as_bytes()));
let string = check!(fs::read_to_string(&tmpdir.join("utf8")));
assert_eq!(string, s);
}
#[test]
fn file_try_clone() {
let tmpdir = tmpdir();
let mut f1 = check!(OpenOptions::new()
.read(true)
.write(true)
.create(true)
.open(&tmpdir.join("test")));
let mut f2 = check!(f1.try_clone());
check!(f1.write_all(b"hello world"));
check!(f1.seek(SeekFrom::Start(2)));
let mut buf = vec![];
check!(f2.read_to_end(&mut buf));
assert_eq!(buf, b"llo world");
drop(f2);
check!(f1.write_all(b"!"));
}
#[test]
#[cfg(not(windows))]
fn unlink_readonly() {
let tmpdir = tmpdir();
let path = tmpdir.join("file");
check!(File::create(&path));
let mut perm = check!(fs::metadata(&path)).permissions();
perm.set_readonly(true);
check!(fs::set_permissions(&path, perm));
check!(fs::remove_file(&path));
}
#[test]
fn mkdir_trailing_slash() {
let tmpdir = tmpdir();
let path = tmpdir.join("file");
check!(fs::create_dir_all(&path.join("a/")));
}
#[test]
fn canonicalize_works_simple() {
let tmpdir = tmpdir();
let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
let file = tmpdir.join("test");
File::create(&file).unwrap();
assert_eq!(fs::canonicalize(&file).unwrap(), file);
}
#[test]
fn realpath_works() {
let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return };
let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
let file = tmpdir.join("test");
let dir = tmpdir.join("test2");
let link = dir.join("link");
let linkdir = tmpdir.join("test3");
File::create(&file).unwrap();
fs::create_dir(&dir).unwrap();
symlink_file(&file, &link).unwrap();
symlink_dir(&dir, &linkdir).unwrap();
assert!(link.symlink_metadata().unwrap().file_type().is_symlink());
assert_eq!(fs::canonicalize(&tmpdir).unwrap(), tmpdir);
assert_eq!(fs::canonicalize(&file).unwrap(), file);
assert_eq!(fs::canonicalize(&link).unwrap(), file);
assert_eq!(fs::canonicalize(&linkdir).unwrap(), dir);
assert_eq!(fs::canonicalize(&linkdir.join("link")).unwrap(), file);
}
#[test]
fn realpath_works_tricky() {
let tmpdir = tmpdir();
if !got_symlink_permission(&tmpdir) { return };
let tmpdir = fs::canonicalize(tmpdir.path()).unwrap();
let a = tmpdir.join("a");
let b = a.join("b");
let c = b.join("c");
let d = a.join("d");
let e = d.join("e");
let f = a.join("f");
fs::create_dir_all(&b).unwrap();
fs::create_dir_all(&d).unwrap();
File::create(&f).unwrap();
if cfg!(not(windows)) {
symlink_file("../d/e", &c).unwrap();
symlink_file("../f", &e).unwrap();
}
if cfg!(windows) {
symlink_file(r"..\d\e", &c).unwrap();
symlink_file(r"..\f", &e).unwrap();
}
assert_eq!(fs::canonicalize(&c).unwrap(), f);
assert_eq!(fs::canonicalize(&e).unwrap(), f);
}
#[test]
fn dir_entry_methods() {
let tmpdir = tmpdir();
fs::create_dir_all(&tmpdir.join("a")).unwrap();
File::create(&tmpdir.join("b")).unwrap();
for file in tmpdir.path().read_dir().unwrap().map(|f| f.unwrap()) {
let fname = file.file_name();
match fname.to_str() {
Some("a") => {
assert!(file.file_type().unwrap().is_dir());
assert!(file.metadata().unwrap().is_dir());
}
Some("b") => {
assert!(file.file_type().unwrap().is_file());
assert!(file.metadata().unwrap().is_file());
}
f => panic!("unknown file name: {:?}", f),
}
}
}
#[test]
fn dir_entry_debug() {
let tmpdir = tmpdir();
File::create(&tmpdir.join("b")).unwrap();
let mut read_dir = tmpdir.path().read_dir().unwrap();
let dir_entry = read_dir.next().unwrap().unwrap();
let actual = format!("{:?}", dir_entry);
let expected = format!("DirEntry({:?})", dir_entry.0.path());
assert_eq!(actual, expected);
}
#[test]
fn read_dir_not_found() {
let res = fs::read_dir("/path/that/does/not/exist");
assert_eq!(res.err().unwrap().kind(), ErrorKind::NotFound);
}
#[test]
fn create_dir_all_with_junctions() {
let tmpdir = tmpdir();
let target = tmpdir.join("target");
let junction = tmpdir.join("junction");
let b = junction.join("a/b");
let link = tmpdir.join("link");
let d = link.join("c/d");
fs::create_dir(&target).unwrap();
check!(symlink_junction(&target, &junction));
check!(fs::create_dir_all(&b));
// the junction itself is not a directory, but `is_dir()` on a Path
// follows links
assert!(junction.is_dir());
assert!(b.exists());
if !got_symlink_permission(&tmpdir) { return };
check!(symlink_dir(&target, &link));
check!(fs::create_dir_all(&d));
assert!(link.is_dir());
assert!(d.exists());
}
#[test]
fn metadata_access_times() {
let tmpdir = tmpdir();
let b = tmpdir.join("b");
File::create(&b).unwrap();
let a = check!(fs::metadata(&tmpdir.path()));
let b = check!(fs::metadata(&b));
assert_eq!(check!(a.accessed()), check!(a.accessed()));
assert_eq!(check!(a.modified()), check!(a.modified()));
assert_eq!(check!(b.accessed()), check!(b.modified()));
if cfg!(target_os = "macos") || cfg!(target_os = "windows") {
check!(a.created());
check!(b.created());
}
}
} | |
mod.rs | //! Error Reporting Code for the inference engine
//!
//! Because of the way inference, and in particular region inference,
//! works, it often happens that errors are not detected until far after
//! the relevant line of code has been type-checked. Therefore, there is
//! an elaborate system to track why a particular constraint in the
//! inference graph arose so that we can explain to the user what gave
//! rise to a particular error.
//!
//! The basis of the system are the "origin" types. An "origin" is the
//! reason that a constraint or inference variable arose. There are
//! different "origin" enums for different kinds of constraints/variables
//! (e.g., `TypeOrigin`, `RegionVariableOrigin`). An origin always has
//! a span, but also more information so that we can generate a meaningful
//! error message.
//!
//! Having a catalog of all the different reasons an error can arise is
//! also useful for other reasons, like cross-referencing FAQs etc, though
//! we are not really taking advantage of this yet.
//!
//! # Region Inference
//!
//! Region inference is particularly tricky because it always succeeds "in
//! the moment" and simply registers a constraint. Then, at the end, we
//! can compute the full graph and report errors, so we need to be able to
//! store and later report what gave rise to the conflicting constraints.
//!
//! # Subtype Trace
//!
//! Determining whether `T1 <: T2` often involves a number of subtypes and
//! subconstraints along the way. A "TypeTrace" is an extended version
//! of an origin that traces the types and other values that were being
//! compared. It is not necessarily comprehensive (in fact, at the time of
//! this writing it only tracks the root values being compared) but I'd
//! like to extend it to include significant "waypoints". For example, if
//! you are comparing `(T1, T2) <: (T3, T4)`, and the problem is that `T2
//! <: T4` fails, I'd like the trace to include enough information to say
//! "in the 2nd element of the tuple". Similarly, failures when comparing
//! arguments or return types in fn types should be able to cite the
//! specific position, etc.
//!
//! # Reality vs plan
//!
//! Of course, there is still a LOT of code in typeck that has yet to be
//! ported to this system, and which relies on string concatenation at the
//! time of error detection.
use super::lexical_region_resolve::RegionResolutionError;
use super::region_constraints::GenericKind;
use super::{InferCtxt, RegionVariableOrigin, SubregionOrigin, TypeTrace, ValuePairs};
use crate::infer;
use crate::traits::error_reporting::report_object_safety_error;
use crate::traits::{
IfExpressionCause, MatchExpressionArmCause, ObligationCause, ObligationCauseCode,
StatementAsExpression,
};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::{pluralize, struct_span_err};
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::lang_items::LangItem;
use rustc_hir::{Item, ItemKind, Node};
use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::{
self,
subst::{Subst, SubstsRef},
Region, Ty, TyCtxt, TypeFoldable,
};
use rustc_span::{BytePos, DesugaringKind, Pos, Span};
use rustc_target::spec::abi;
use std::{cmp, fmt};
mod note;
mod need_type_info;
pub use need_type_info::TypeAnnotationNeeded;
pub mod nice_region_error;
pub(super) fn note_and_explain_region(
tcx: TyCtxt<'tcx>,
err: &mut DiagnosticBuilder<'_>,
prefix: &str,
region: ty::Region<'tcx>,
suffix: &str,
) {
let (description, span) = match *region {
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReStatic => {
msg_span_from_free_region(tcx, region)
}
ty::ReEmpty(ty::UniverseIndex::ROOT) => ("the empty lifetime".to_owned(), None),
// uh oh, hope no user ever sees THIS
ty::ReEmpty(ui) => (format!("the empty lifetime in universe {:?}", ui), None),
ty::RePlaceholder(_) => ("any other region".to_string(), None),
// FIXME(#13998) RePlaceholder should probably print like
// ReFree rather than dumping Debug output on the user.
//
// We shouldn't really be having unification failures with ReVar
// and ReLateBound though.
ty::ReVar(_) | ty::ReLateBound(..) | ty::ReErased => {
(format!("lifetime {:?}", region), None)
}
};
emit_msg_span(err, prefix, description, span, suffix);
}
pub(super) fn note_and_explain_free_region(
tcx: TyCtxt<'tcx>,
err: &mut DiagnosticBuilder<'_>,
prefix: &str,
region: ty::Region<'tcx>,
suffix: &str,
) {
let (description, span) = msg_span_from_free_region(tcx, region);
emit_msg_span(err, prefix, description, span, suffix);
}
fn msg_span_from_free_region(
tcx: TyCtxt<'tcx>,
region: ty::Region<'tcx>,
) -> (String, Option<Span>) {
match *region {
ty::ReEarlyBound(_) | ty::ReFree(_) => {
msg_span_from_early_bound_and_free_regions(tcx, region)
}
ty::ReStatic => ("the static lifetime".to_owned(), None),
ty::ReEmpty(ty::UniverseIndex::ROOT) => ("an empty lifetime".to_owned(), None),
ty::ReEmpty(ui) => (format!("an empty lifetime in universe {:?}", ui), None),
_ => bug!("{:?}", region),
}
}
fn msg_span_from_early_bound_and_free_regions(
tcx: TyCtxt<'tcx>,
region: ty::Region<'tcx>,
) -> (String, Option<Span>) {
let sm = tcx.sess.source_map();
let scope = region.free_region_binding_scope(tcx);
let node = tcx.hir().local_def_id_to_hir_id(scope.expect_local());
let tag = match tcx.hir().find(node) {
Some(Node::Block(_) | Node::Expr(_)) => "body",
Some(Node::Item(it)) => item_scope_tag(&it),
Some(Node::TraitItem(it)) => trait_item_scope_tag(&it),
Some(Node::ImplItem(it)) => impl_item_scope_tag(&it),
_ => unreachable!(),
};
let (prefix, span) = match *region {
ty::ReEarlyBound(ref br) => {
let mut sp = sm.guess_head_span(tcx.hir().span(node));
if let Some(param) =
tcx.hir().get_generics(scope).and_then(|generics| generics.get_named(br.name))
{
sp = param.span;
}
(format!("the lifetime `{}` as defined on", br.name), sp)
}
ty::ReFree(ty::FreeRegion { bound_region: ty::BoundRegion::BrNamed(_, name), .. }) => {
let mut sp = sm.guess_head_span(tcx.hir().span(node));
if let Some(param) =
tcx.hir().get_generics(scope).and_then(|generics| generics.get_named(name))
{
sp = param.span;
}
(format!("the lifetime `{}` as defined on", name), sp)
}
ty::ReFree(ref fr) => match fr.bound_region {
ty::BrAnon(idx) => {
(format!("the anonymous lifetime #{} defined on", idx + 1), tcx.hir().span(node))
}
_ => (
format!("the lifetime `{}` as defined on", region),
sm.guess_head_span(tcx.hir().span(node)),
),
},
_ => bug!(),
};
let (msg, opt_span) = explain_span(tcx, tag, span);
(format!("{} {}", prefix, msg), opt_span)
}
fn emit_msg_span(
err: &mut DiagnosticBuilder<'_>,
prefix: &str,
description: String,
span: Option<Span>,
suffix: &str,
) {
let message = format!("{}{}{}", prefix, description, suffix);
if let Some(span) = span {
err.span_note(span, &message);
} else {
err.note(&message);
}
}
fn item_scope_tag(item: &hir::Item<'_>) -> &'static str {
match item.kind {
hir::ItemKind::Impl { .. } => "impl",
hir::ItemKind::Struct(..) => "struct",
hir::ItemKind::Union(..) => "union",
hir::ItemKind::Enum(..) => "enum",
hir::ItemKind::Trait(..) => "trait",
hir::ItemKind::Fn(..) => "function body",
_ => "item",
}
}
fn trait_item_scope_tag(item: &hir::TraitItem<'_>) -> &'static str {
match item.kind {
hir::TraitItemKind::Fn(..) => "method body",
hir::TraitItemKind::Const(..) | hir::TraitItemKind::Type(..) => "associated item",
}
}
fn impl_item_scope_tag(item: &hir::ImplItem<'_>) -> &'static str {
match item.kind {
hir::ImplItemKind::Fn(..) => "method body",
hir::ImplItemKind::Const(..) | hir::ImplItemKind::TyAlias(..) => "associated item",
}
}
fn explain_span(tcx: TyCtxt<'tcx>, heading: &str, span: Span) -> (String, Option<Span>) {
let lo = tcx.sess.source_map().lookup_char_pos(span.lo());
(format!("the {} at {}:{}", heading, lo.line, lo.col.to_usize() + 1), Some(span))
}
pub fn unexpected_hidden_region_diagnostic(
tcx: TyCtxt<'tcx>,
span: Span,
hidden_ty: Ty<'tcx>,
hidden_region: ty::Region<'tcx>,
) -> DiagnosticBuilder<'tcx> {
let mut err = struct_span_err!(
tcx.sess,
span,
E0700,
"hidden type for `impl Trait` captures lifetime that does not appear in bounds",
);
// Explain the region we are capturing.
match hidden_region {
ty::ReEmpty(ty::UniverseIndex::ROOT) => {
// All lifetimes shorter than the function body are `empty` in
// lexical region resolution. The default explanation of "an empty
// lifetime" isn't really accurate here.
let message = format!(
"hidden type `{}` captures lifetime smaller than the function body",
hidden_ty
);
err.span_note(span, &message);
}
ty::ReEarlyBound(_) | ty::ReFree(_) | ty::ReStatic | ty::ReEmpty(_) => {
// Assuming regionck succeeded (*), we ought to always be
// capturing *some* region from the fn header, and hence it
// ought to be free. So under normal circumstances, we will go
// down this path which gives a decent human readable
// explanation.
//
// (*) if not, the `tainted_by_errors` field would be set to
// `Some(ErrorReported)` in any case, so we wouldn't be here at all.
note_and_explain_free_region(
tcx,
&mut err,
&format!("hidden type `{}` captures ", hidden_ty),
hidden_region,
"",
);
}
_ => {
// Ugh. This is a painful case: the hidden region is not one
// that we can easily summarize or explain. This can happen
// in a case like
// `src/test/ui/multiple-lifetimes/ordinary-bounds-unsuited.rs`:
//
// ```
// fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b> {
// if condition() { a } else { b }
// }
// ```
//
// Here the captured lifetime is the intersection of `'a` and
// `'b`, which we can't quite express.
// We can at least report a really cryptic error for now.
note_and_explain_region(
tcx,
&mut err,
&format!("hidden type `{}` captures ", hidden_ty),
hidden_region,
"",
);
}
}
err
}
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn report_region_errors(&self, errors: &Vec<RegionResolutionError<'tcx>>) {
debug!("report_region_errors(): {} errors to start", errors.len());
// try to pre-process the errors, which will group some of them
// together into a `ProcessedErrors` group:
let errors = self.process_errors(errors);
debug!("report_region_errors: {} errors after preprocessing", errors.len());
for error in errors {
debug!("report_region_errors: error = {:?}", error);
if !self.try_report_nice_region_error(&error) {
match error.clone() {
// These errors could indicate all manner of different
// problems with many different solutions. Rather
// than generate a "one size fits all" error, what we
// attempt to do is go through a number of specific
// scenarios and try to find the best way to present
// the error. If all of these fails, we fall back to a rather
// general bit of code that displays the error information
RegionResolutionError::ConcreteFailure(origin, sub, sup) => {
if sub.is_placeholder() || sup.is_placeholder() {
self.report_placeholder_failure(origin, sub, sup).emit();
} else {
self.report_concrete_failure(origin, sub, sup).emit();
}
}
RegionResolutionError::GenericBoundFailure(origin, param_ty, sub) => {
self.report_generic_bound_failure(
origin.span(),
Some(origin),
param_ty,
sub,
);
}
RegionResolutionError::SubSupConflict(
_,
var_origin,
sub_origin,
sub_r,
sup_origin,
sup_r,
) => {
if sub_r.is_placeholder() {
self.report_placeholder_failure(sub_origin, sub_r, sup_r).emit();
} else if sup_r.is_placeholder() {
self.report_placeholder_failure(sup_origin, sub_r, sup_r).emit();
} else {
self.report_sub_sup_conflict(
var_origin, sub_origin, sub_r, sup_origin, sup_r,
);
}
}
RegionResolutionError::UpperBoundUniverseConflict(
_,
_,
var_universe,
sup_origin,
sup_r,
) => {
assert!(sup_r.is_placeholder());
// Make a dummy value for the "sub region" --
// this is the initial value of the
// placeholder. In practice, we expect more
// tailored errors that don't really use this
// value.
let sub_r = self.tcx.mk_region(ty::ReEmpty(var_universe));
self.report_placeholder_failure(sup_origin, sub_r, sup_r).emit();
}
RegionResolutionError::MemberConstraintFailure {
hidden_ty,
member_region,
span,
} => {
let hidden_ty = self.resolve_vars_if_possible(&hidden_ty);
unexpected_hidden_region_diagnostic(
self.tcx,
span,
hidden_ty,
member_region,
)
.emit();
}
}
}
}
}
// This method goes through all the errors and try to group certain types
// of error together, for the purpose of suggesting explicit lifetime
// parameters to the user. This is done so that we can have a more
// complete view of what lifetimes should be the same.
// If the return value is an empty vector, it means that processing
// failed (so the return value of this method should not be used).
//
// The method also attempts to weed out messages that seem like
// duplicates that will be unhelpful to the end-user. But
// obviously it never weeds out ALL errors.
fn process_errors(
&self,
errors: &Vec<RegionResolutionError<'tcx>>,
) -> Vec<RegionResolutionError<'tcx>> {
debug!("process_errors()");
// We want to avoid reporting generic-bound failures if we can
// avoid it: these have a very high rate of being unhelpful in
// practice. This is because they are basically secondary
// checks that test the state of the region graph after the
// rest of inference is done, and the other kinds of errors
// indicate that the region constraint graph is internally
// inconsistent, so these test results are likely to be
// meaningless.
//
// Therefore, we filter them out of the list unless they are
// the only thing in the list.
let is_bound_failure = |e: &RegionResolutionError<'tcx>| match *e {
RegionResolutionError::GenericBoundFailure(..) => true,
RegionResolutionError::ConcreteFailure(..)
| RegionResolutionError::SubSupConflict(..)
| RegionResolutionError::UpperBoundUniverseConflict(..)
| RegionResolutionError::MemberConstraintFailure { .. } => false,
};
let mut errors = if errors.iter().all(|e| is_bound_failure(e)) {
errors.clone()
} else {
errors.iter().filter(|&e| !is_bound_failure(e)).cloned().collect()
};
// sort the errors by span, for better error message stability.
errors.sort_by_key(|u| match *u {
RegionResolutionError::ConcreteFailure(ref sro, _, _) => sro.span(),
RegionResolutionError::GenericBoundFailure(ref sro, _, _) => sro.span(),
RegionResolutionError::SubSupConflict(_, ref rvo, _, _, _, _) => rvo.span(),
RegionResolutionError::UpperBoundUniverseConflict(_, ref rvo, _, _, _) => rvo.span(),
RegionResolutionError::MemberConstraintFailure { span, .. } => span,
});
errors
}
/// Adds a note if the types come from similarly named crates
fn check_and_note_conflicting_crates(
&self,
err: &mut DiagnosticBuilder<'_>,
terr: &TypeError<'tcx>,
) {
use hir::def_id::CrateNum;
use rustc_hir::definitions::DisambiguatedDefPathData;
use ty::print::Printer;
use ty::subst::GenericArg;
struct AbsolutePathPrinter<'tcx> {
tcx: TyCtxt<'tcx>,
}
struct NonTrivialPath;
impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
type Error = NonTrivialPath;
type Path = Vec<String>;
type Region = !;
type Type = !;
type DynExistential = !;
type Const = !;
fn tcx<'a>(&'a self) -> TyCtxt<'tcx> {
self.tcx
}
fn print_region(self, _region: ty::Region<'_>) -> Result<Self::Region, Self::Error> {
Err(NonTrivialPath)
}
fn print_type(self, _ty: Ty<'tcx>) -> Result<Self::Type, Self::Error> {
Err(NonTrivialPath)
}
fn print_dyn_existential(
self,
_predicates: &'tcx ty::List<ty::ExistentialPredicate<'tcx>>,
) -> Result<Self::DynExistential, Self::Error> {
Err(NonTrivialPath)
}
fn print_const(self, _ct: &'tcx ty::Const<'tcx>) -> Result<Self::Const, Self::Error> {
Err(NonTrivialPath)
}
fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error> {
Ok(vec![self.tcx.original_crate_name(cnum).to_string()])
}
fn path_qualified(
self,
_self_ty: Ty<'tcx>,
_trait_ref: Option<ty::TraitRef<'tcx>>,
) -> Result<Self::Path, Self::Error> {
Err(NonTrivialPath)
}
fn path_append_impl(
self,
_print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
_disambiguated_data: &DisambiguatedDefPathData,
_self_ty: Ty<'tcx>,
_trait_ref: Option<ty::TraitRef<'tcx>>,
) -> Result<Self::Path, Self::Error> {
Err(NonTrivialPath)
}
fn path_append(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData,
) -> Result<Self::Path, Self::Error> {
let mut path = print_prefix(self)?;
path.push(disambiguated_data.to_string());
Ok(path)
}
fn | (
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
_args: &[GenericArg<'tcx>],
) -> Result<Self::Path, Self::Error> {
print_prefix(self)
}
}
let report_path_match = |err: &mut DiagnosticBuilder<'_>, did1: DefId, did2: DefId| {
// Only external crates, if either is from a local
// module we could have false positives
if !(did1.is_local() || did2.is_local()) && did1.krate != did2.krate {
let abs_path =
|def_id| AbsolutePathPrinter { tcx: self.tcx }.print_def_path(def_id, &[]);
// We compare strings because DefPath can be different
// for imported and non-imported crates
let same_path = || -> Result<_, NonTrivialPath> {
Ok(self.tcx.def_path_str(did1) == self.tcx.def_path_str(did2)
|| abs_path(did1)? == abs_path(did2)?)
};
if same_path().unwrap_or(false) {
let crate_name = self.tcx.crate_name(did1.krate);
err.note(&format!(
"perhaps two different versions of crate `{}` are being used?",
crate_name
));
}
}
};
match *terr {
TypeError::Sorts(ref exp_found) => {
// if they are both "path types", there's a chance of ambiguity
// due to different versions of the same crate
if let (&ty::Adt(exp_adt, _), &ty::Adt(found_adt, _)) =
(exp_found.expected.kind(), exp_found.found.kind())
{
report_path_match(err, exp_adt.did, found_adt.did);
}
}
TypeError::Traits(ref exp_found) => {
report_path_match(err, exp_found.expected, exp_found.found);
}
_ => (), // FIXME(#22750) handle traits and stuff
}
}
fn note_error_origin(
&self,
err: &mut DiagnosticBuilder<'tcx>,
cause: &ObligationCause<'tcx>,
exp_found: Option<ty::error::ExpectedFound<Ty<'tcx>>>,
) {
match cause.code {
ObligationCauseCode::Pattern { origin_expr: true, span: Some(span), root_ty } => {
let ty = self.resolve_vars_if_possible(&root_ty);
if ty.is_suggestable() {
// don't show type `_`
err.span_label(span, format!("this expression has type `{}`", ty));
}
if let Some(ty::error::ExpectedFound { found, .. }) = exp_found {
if ty.is_box() && ty.boxed_ty() == found {
if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
err.span_suggestion(
span,
"consider dereferencing the boxed value",
format!("*{}", snippet),
Applicability::MachineApplicable,
);
}
}
}
}
ObligationCauseCode::Pattern { origin_expr: false, span: Some(span), .. } => {
err.span_label(span, "expected due to this");
}
ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause {
semi_span,
source,
ref prior_arms,
last_ty,
scrut_hir_id,
opt_suggest_box_span,
arm_span,
scrut_span,
..
}) => match source {
hir::MatchSource::IfLetDesugar { .. } => {
let msg = "`if let` arms have incompatible types";
err.span_label(cause.span, msg);
if let Some(ret_sp) = opt_suggest_box_span {
self.suggest_boxing_for_return_impl_trait(
err,
ret_sp,
prior_arms.iter().chain(std::iter::once(&arm_span)).map(|s| *s),
);
}
}
hir::MatchSource::TryDesugar => {
if let Some(ty::error::ExpectedFound { expected, .. }) = exp_found {
let scrut_expr = self.tcx.hir().expect_expr(scrut_hir_id);
let scrut_ty = if let hir::ExprKind::Call(_, args) = &scrut_expr.kind {
let arg_expr = args.first().expect("try desugaring call w/out arg");
self.in_progress_typeck_results.and_then(|typeck_results| {
typeck_results.borrow().expr_ty_opt(arg_expr)
})
} else {
bug!("try desugaring w/out call expr as scrutinee");
};
match scrut_ty {
Some(ty) if expected == ty => {
let source_map = self.tcx.sess.source_map();
err.span_suggestion(
source_map.end_point(cause.span),
"try removing this `?`",
"".to_string(),
Applicability::MachineApplicable,
);
}
_ => {}
}
}
}
_ => {
// `last_ty` can be `!`, `expected` will have better info when present.
let t = self.resolve_vars_if_possible(&match exp_found {
Some(ty::error::ExpectedFound { expected, .. }) => expected,
_ => last_ty,
});
let source_map = self.tcx.sess.source_map();
let mut any_multiline_arm = source_map.is_multiline(arm_span);
if prior_arms.len() <= 4 {
for sp in prior_arms {
any_multiline_arm |= source_map.is_multiline(*sp);
err.span_label(*sp, format!("this is found to be of type `{}`", t));
}
} else if let Some(sp) = prior_arms.last() {
any_multiline_arm |= source_map.is_multiline(*sp);
err.span_label(
*sp,
format!("this and all prior arms are found to be of type `{}`", t),
);
}
let outer_error_span = if any_multiline_arm {
// Cover just `match` and the scrutinee expression, not
// the entire match body, to reduce diagram noise.
cause.span.shrink_to_lo().to(scrut_span)
} else {
cause.span
};
let msg = "`match` arms have incompatible types";
err.span_label(outer_error_span, msg);
if let Some((sp, boxed)) = semi_span {
if let (StatementAsExpression::NeedsBoxing, [.., prior_arm]) =
(boxed, &prior_arms[..])
{
err.multipart_suggestion(
"consider removing this semicolon and boxing the expressions",
vec![
(prior_arm.shrink_to_lo(), "Box::new(".to_string()),
(prior_arm.shrink_to_hi(), ")".to_string()),
(arm_span.shrink_to_lo(), "Box::new(".to_string()),
(arm_span.shrink_to_hi(), ")".to_string()),
(sp, String::new()),
],
Applicability::HasPlaceholders,
);
} else if matches!(boxed, StatementAsExpression::NeedsBoxing) {
err.span_suggestion_short(
sp,
"consider removing this semicolon and boxing the expressions",
String::new(),
Applicability::MachineApplicable,
);
} else {
err.span_suggestion_short(
sp,
"consider removing this semicolon",
String::new(),
Applicability::MachineApplicable,
);
}
}
if let Some(ret_sp) = opt_suggest_box_span {
// Get return type span and point to it.
self.suggest_boxing_for_return_impl_trait(
err,
ret_sp,
prior_arms.iter().chain(std::iter::once(&arm_span)).map(|s| *s),
);
}
}
},
ObligationCauseCode::IfExpression(box IfExpressionCause {
then,
else_sp,
outer,
semicolon,
opt_suggest_box_span,
}) => {
err.span_label(then, "expected because of this");
if let Some(sp) = outer {
err.span_label(sp, "`if` and `else` have incompatible types");
}
if let Some((sp, boxed)) = semicolon {
if matches!(boxed, StatementAsExpression::NeedsBoxing) {
err.multipart_suggestion(
"consider removing this semicolon and boxing the expression",
vec![
(then.shrink_to_lo(), "Box::new(".to_string()),
(then.shrink_to_hi(), ")".to_string()),
(else_sp.shrink_to_lo(), "Box::new(".to_string()),
(else_sp.shrink_to_hi(), ")".to_string()),
(sp, String::new()),
],
Applicability::MachineApplicable,
);
} else {
err.span_suggestion_short(
sp,
"consider removing this semicolon",
String::new(),
Applicability::MachineApplicable,
);
}
}
if let Some(ret_sp) = opt_suggest_box_span {
self.suggest_boxing_for_return_impl_trait(
err,
ret_sp,
vec![then, else_sp].into_iter(),
);
}
}
_ => (),
}
}
fn suggest_boxing_for_return_impl_trait(
&self,
err: &mut DiagnosticBuilder<'tcx>,
return_sp: Span,
arm_spans: impl Iterator<Item = Span>,
) {
err.multipart_suggestion(
"you could change the return type to be a boxed trait object",
vec![
(return_sp.with_hi(return_sp.lo() + BytePos(4)), "Box<dyn".to_string()),
(return_sp.shrink_to_hi(), ">".to_string()),
],
Applicability::MaybeIncorrect,
);
let sugg = arm_spans
.flat_map(|sp| {
vec![
(sp.shrink_to_lo(), "Box::new(".to_string()),
(sp.shrink_to_hi(), ")".to_string()),
]
.into_iter()
})
.collect::<Vec<_>>();
err.multipart_suggestion(
"if you change the return type to expect trait objects, box the returned expressions",
sugg,
Applicability::MaybeIncorrect,
);
}
/// Given that `other_ty` is the same as a type argument for `name` in `sub`, populate `value`
/// highlighting `name` and every type argument that isn't at `pos` (which is `other_ty`), and
/// populate `other_value` with `other_ty`.
///
/// ```text
/// Foo<Bar<Qux>>
/// ^^^^--------^ this is highlighted
/// | |
/// | this type argument is exactly the same as the other type, not highlighted
/// this is highlighted
/// Bar<Qux>
/// -------- this type is the same as a type argument in the other type, not highlighted
/// ```
fn highlight_outer(
&self,
value: &mut DiagnosticStyledString,
other_value: &mut DiagnosticStyledString,
name: String,
sub: ty::subst::SubstsRef<'tcx>,
pos: usize,
other_ty: Ty<'tcx>,
) {
// `value` and `other_value` hold two incomplete type representation for display.
// `name` is the path of both types being compared. `sub`
value.push_highlighted(name);
let len = sub.len();
if len > 0 {
value.push_highlighted("<");
}
// Output the lifetimes for the first type
let lifetimes = sub
.regions()
.map(|lifetime| {
let s = lifetime.to_string();
if s.is_empty() { "'_".to_string() } else { s }
})
.collect::<Vec<_>>()
.join(", ");
if !lifetimes.is_empty() {
if sub.regions().count() < len {
value.push_normal(lifetimes + ", ");
} else {
value.push_normal(lifetimes);
}
}
// Highlight all the type arguments that aren't at `pos` and compare the type argument at
// `pos` and `other_ty`.
for (i, type_arg) in sub.types().enumerate() {
if i == pos {
let values = self.cmp(type_arg, other_ty);
value.0.extend((values.0).0);
other_value.0.extend((values.1).0);
} else {
value.push_highlighted(type_arg.to_string());
}
if len > 0 && i != len - 1 {
value.push_normal(", ");
}
}
if len > 0 {
value.push_highlighted(">");
}
}
/// If `other_ty` is the same as a type argument present in `sub`, highlight `path` in `t1_out`,
/// as that is the difference to the other type.
///
/// For the following code:
///
/// ```no_run
/// let x: Foo<Bar<Qux>> = foo::<Bar<Qux>>();
/// ```
///
/// The type error output will behave in the following way:
///
/// ```text
/// Foo<Bar<Qux>>
/// ^^^^--------^ this is highlighted
/// | |
/// | this type argument is exactly the same as the other type, not highlighted
/// this is highlighted
/// Bar<Qux>
/// -------- this type is the same as a type argument in the other type, not highlighted
/// ```
fn cmp_type_arg(
&self,
mut t1_out: &mut DiagnosticStyledString,
mut t2_out: &mut DiagnosticStyledString,
path: String,
sub: ty::subst::SubstsRef<'tcx>,
other_path: String,
other_ty: Ty<'tcx>,
) -> Option<()> {
for (i, ta) in sub.types().enumerate() {
if ta == other_ty {
self.highlight_outer(&mut t1_out, &mut t2_out, path, sub, i, &other_ty);
return Some(());
}
if let &ty::Adt(def, _) = ta.kind() {
let path_ = self.tcx.def_path_str(def.did);
if path_ == other_path {
self.highlight_outer(&mut t1_out, &mut t2_out, path, sub, i, &other_ty);
return Some(());
}
}
}
None
}
/// Adds a `,` to the type representation only if it is appropriate.
fn push_comma(
&self,
value: &mut DiagnosticStyledString,
other_value: &mut DiagnosticStyledString,
len: usize,
pos: usize,
) {
if len > 0 && pos != len - 1 {
value.push_normal(", ");
other_value.push_normal(", ");
}
}
/// For generic types with parameters with defaults, remove the parameters corresponding to
/// the defaults. This repeats a lot of the logic found in `ty::print::pretty`.
fn strip_generic_default_params(
&self,
def_id: DefId,
substs: ty::subst::SubstsRef<'tcx>,
) -> SubstsRef<'tcx> {
let generics = self.tcx.generics_of(def_id);
let mut num_supplied_defaults = 0;
let mut type_params = generics
.params
.iter()
.rev()
.filter_map(|param| match param.kind {
ty::GenericParamDefKind::Lifetime => None,
ty::GenericParamDefKind::Type { has_default, .. } => {
Some((param.def_id, has_default))
}
ty::GenericParamDefKind::Const => None, // FIXME(const_generics:defaults)
})
.peekable();
let has_default = {
let has_default = type_params.peek().map(|(_, has_default)| has_default);
*has_default.unwrap_or(&false)
};
if has_default {
let types = substs.types().rev();
for ((def_id, has_default), actual) in type_params.zip(types) {
if !has_default {
break;
}
if self.tcx.type_of(def_id).subst(self.tcx, substs) != actual {
break;
}
num_supplied_defaults += 1;
}
}
let len = generics.params.len();
let mut generics = generics.clone();
generics.params.truncate(len - num_supplied_defaults);
substs.truncate_to(self.tcx, &generics)
}
/// Given two `fn` signatures highlight only sub-parts that are different.
fn cmp_fn_sig(
&self,
sig1: &ty::PolyFnSig<'tcx>,
sig2: &ty::PolyFnSig<'tcx>,
) -> (DiagnosticStyledString, DiagnosticStyledString) {
let get_lifetimes = |sig| {
use rustc_hir::def::Namespace;
let mut s = String::new();
let (_, (sig, reg)) = ty::print::FmtPrinter::new(self.tcx, &mut s, Namespace::TypeNS)
.name_all_regions(sig)
.unwrap();
let lts: Vec<String> = reg.into_iter().map(|(_, kind)| kind.to_string()).collect();
(if lts.is_empty() { String::new() } else { format!("for<{}> ", lts.join(", ")) }, sig)
};
let (lt1, sig1) = get_lifetimes(sig1);
let (lt2, sig2) = get_lifetimes(sig2);
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
let mut values = (
DiagnosticStyledString::normal("".to_string()),
DiagnosticStyledString::normal("".to_string()),
);
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^^^^^^
values.0.push(sig1.unsafety.prefix_str(), sig1.unsafety != sig2.unsafety);
values.1.push(sig2.unsafety.prefix_str(), sig1.unsafety != sig2.unsafety);
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^^^^^^^^^^
if sig1.abi != abi::Abi::Rust {
values.0.push(format!("extern {} ", sig1.abi), sig1.abi != sig2.abi);
}
if sig2.abi != abi::Abi::Rust {
values.1.push(format!("extern {} ", sig2.abi), sig1.abi != sig2.abi);
}
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^^^^^^^^
let lifetime_diff = lt1 != lt2;
values.0.push(lt1, lifetime_diff);
values.1.push(lt2, lifetime_diff);
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^^^
values.0.push_normal("fn(");
values.1.push_normal("fn(");
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^^^^^
let len1 = sig1.inputs().len();
let len2 = sig2.inputs().len();
if len1 == len2 {
for (i, (l, r)) in sig1.inputs().iter().zip(sig2.inputs().iter()).enumerate() {
let (x1, x2) = self.cmp(l, r);
(values.0).0.extend(x1.0);
(values.1).0.extend(x2.0);
self.push_comma(&mut values.0, &mut values.1, len1, i);
}
} else {
for (i, l) in sig1.inputs().iter().enumerate() {
values.0.push_highlighted(l.to_string());
if i != len1 - 1 {
values.0.push_highlighted(", ");
}
}
for (i, r) in sig2.inputs().iter().enumerate() {
values.1.push_highlighted(r.to_string());
if i != len2 - 1 {
values.1.push_highlighted(", ");
}
}
}
if sig1.c_variadic {
if len1 > 0 {
values.0.push_normal(", ");
}
values.0.push("...", !sig2.c_variadic);
}
if sig2.c_variadic {
if len2 > 0 {
values.1.push_normal(", ");
}
values.1.push("...", !sig1.c_variadic);
}
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^
values.0.push_normal(")");
values.1.push_normal(")");
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
// ^^^^^^^^
let output1 = sig1.output();
let output2 = sig2.output();
let (x1, x2) = self.cmp(output1, output2);
if !output1.is_unit() {
values.0.push_normal(" -> ");
(values.0).0.extend(x1.0);
}
if !output2.is_unit() {
values.1.push_normal(" -> ");
(values.1).0.extend(x2.0);
}
values
}
/// Compares two given types, eliding parts that are the same between them and highlighting
/// relevant differences, and return two representation of those types for highlighted printing.
fn cmp(&self, t1: Ty<'tcx>, t2: Ty<'tcx>) -> (DiagnosticStyledString, DiagnosticStyledString) {
debug!("cmp(t1={}, t1.kind={:?}, t2={}, t2.kind={:?})", t1, t1.kind(), t2, t2.kind());
// helper functions
fn equals<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
match (a.kind(), b.kind()) {
(a, b) if *a == *b => true,
(&ty::Int(_), &ty::Infer(ty::InferTy::IntVar(_)))
| (
&ty::Infer(ty::InferTy::IntVar(_)),
&ty::Int(_) | &ty::Infer(ty::InferTy::IntVar(_)),
)
| (&ty::Float(_), &ty::Infer(ty::InferTy::FloatVar(_)))
| (
&ty::Infer(ty::InferTy::FloatVar(_)),
&ty::Float(_) | &ty::Infer(ty::InferTy::FloatVar(_)),
) => true,
_ => false,
}
}
fn push_ty_ref<'tcx>(
region: &ty::Region<'tcx>,
ty: Ty<'tcx>,
mutbl: hir::Mutability,
s: &mut DiagnosticStyledString,
) {
let mut r = region.to_string();
if r == "'_" {
r.clear();
} else {
r.push(' ');
}
s.push_highlighted(format!("&{}{}", r, mutbl.prefix_str()));
s.push_normal(ty.to_string());
}
// process starts here
match (t1.kind(), t2.kind()) {
(&ty::Adt(def1, sub1), &ty::Adt(def2, sub2)) => {
let sub_no_defaults_1 = self.strip_generic_default_params(def1.did, sub1);
let sub_no_defaults_2 = self.strip_generic_default_params(def2.did, sub2);
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
let path1 = self.tcx.def_path_str(def1.did);
let path2 = self.tcx.def_path_str(def2.did);
if def1.did == def2.did {
// Easy case. Replace same types with `_` to shorten the output and highlight
// the differing ones.
// let x: Foo<Bar, Qux> = y::<Foo<Quz, Qux>>();
// Foo<Bar, _>
// Foo<Quz, _>
// --- ^ type argument elided
// |
// highlighted in output
values.0.push_normal(path1);
values.1.push_normal(path2);
// Avoid printing out default generic parameters that are common to both
// types.
let len1 = sub_no_defaults_1.len();
let len2 = sub_no_defaults_2.len();
let common_len = cmp::min(len1, len2);
let remainder1: Vec<_> = sub1.types().skip(common_len).collect();
let remainder2: Vec<_> = sub2.types().skip(common_len).collect();
let common_default_params = remainder1
.iter()
.rev()
.zip(remainder2.iter().rev())
.filter(|(a, b)| a == b)
.count();
let len = sub1.len() - common_default_params;
let consts_offset = len - sub1.consts().count();
// Only draw `<...>` if there're lifetime/type arguments.
if len > 0 {
values.0.push_normal("<");
values.1.push_normal("<");
}
fn lifetime_display(lifetime: Region<'_>) -> String {
let s = lifetime.to_string();
if s.is_empty() { "'_".to_string() } else { s }
}
// At one point we'd like to elide all lifetimes here, they are irrelevant for
// all diagnostics that use this output
//
// Foo<'x, '_, Bar>
// Foo<'y, '_, Qux>
// ^^ ^^ --- type arguments are not elided
// | |
// | elided as they were the same
// not elided, they were different, but irrelevant
let lifetimes = sub1.regions().zip(sub2.regions());
for (i, lifetimes) in lifetimes.enumerate() {
let l1 = lifetime_display(lifetimes.0);
let l2 = lifetime_display(lifetimes.1);
if lifetimes.0 == lifetimes.1 {
values.0.push_normal("'_");
values.1.push_normal("'_");
} else {
values.0.push_highlighted(l1);
values.1.push_highlighted(l2);
}
self.push_comma(&mut values.0, &mut values.1, len, i);
}
// We're comparing two types with the same path, so we compare the type
// arguments for both. If they are the same, do not highlight and elide from the
// output.
// Foo<_, Bar>
// Foo<_, Qux>
// ^ elided type as this type argument was the same in both sides
let type_arguments = sub1.types().zip(sub2.types());
let regions_len = sub1.regions().count();
let num_display_types = consts_offset - regions_len;
for (i, (ta1, ta2)) in type_arguments.take(num_display_types).enumerate() {
let i = i + regions_len;
if ta1 == ta2 {
values.0.push_normal("_");
values.1.push_normal("_");
} else {
let (x1, x2) = self.cmp(ta1, ta2);
(values.0).0.extend(x1.0);
(values.1).0.extend(x2.0);
}
self.push_comma(&mut values.0, &mut values.1, len, i);
}
// Do the same for const arguments, if they are equal, do not highlight and
// elide them from the output.
let const_arguments = sub1.consts().zip(sub2.consts());
for (i, (ca1, ca2)) in const_arguments.enumerate() {
let i = i + consts_offset;
if ca1 == ca2 {
values.0.push_normal("_");
values.1.push_normal("_");
} else {
values.0.push_highlighted(ca1.to_string());
values.1.push_highlighted(ca2.to_string());
}
self.push_comma(&mut values.0, &mut values.1, len, i);
}
// Close the type argument bracket.
// Only draw `<...>` if there're lifetime/type arguments.
if len > 0 {
values.0.push_normal(">");
values.1.push_normal(">");
}
values
} else {
// Check for case:
// let x: Foo<Bar<Qux> = foo::<Bar<Qux>>();
// Foo<Bar<Qux>
// ------- this type argument is exactly the same as the other type
// Bar<Qux>
if self
.cmp_type_arg(
&mut values.0,
&mut values.1,
path1.clone(),
sub_no_defaults_1,
path2.clone(),
&t2,
)
.is_some()
{
return values;
}
// Check for case:
// let x: Bar<Qux> = y:<Foo<Bar<Qux>>>();
// Bar<Qux>
// Foo<Bar<Qux>>
// ------- this type argument is exactly the same as the other type
if self
.cmp_type_arg(
&mut values.1,
&mut values.0,
path2,
sub_no_defaults_2,
path1,
&t1,
)
.is_some()
{
return values;
}
// We can't find anything in common, highlight relevant part of type path.
// let x: foo::bar::Baz<Qux> = y:<foo::bar::Bar<Zar>>();
// foo::bar::Baz<Qux>
// foo::bar::Bar<Zar>
// -------- this part of the path is different
let t1_str = t1.to_string();
let t2_str = t2.to_string();
let min_len = t1_str.len().min(t2_str.len());
const SEPARATOR: &str = "::";
let separator_len = SEPARATOR.len();
let split_idx: usize = t1_str
.split(SEPARATOR)
.zip(t2_str.split(SEPARATOR))
.take_while(|(mod1_str, mod2_str)| mod1_str == mod2_str)
.map(|(mod_str, _)| mod_str.len() + separator_len)
.sum();
debug!(
"cmp: separator_len={}, split_idx={}, min_len={}",
separator_len, split_idx, min_len
);
if split_idx >= min_len {
// paths are identical, highlight everything
(
DiagnosticStyledString::highlighted(t1_str),
DiagnosticStyledString::highlighted(t2_str),
)
} else {
let (common, uniq1) = t1_str.split_at(split_idx);
let (_, uniq2) = t2_str.split_at(split_idx);
debug!("cmp: common={}, uniq1={}, uniq2={}", common, uniq1, uniq2);
values.0.push_normal(common);
values.0.push_highlighted(uniq1);
values.1.push_normal(common);
values.1.push_highlighted(uniq2);
values
}
}
}
// When finding T != &T, highlight only the borrow
(&ty::Ref(r1, ref_ty1, mutbl1), _) if equals(&ref_ty1, &t2) => {
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
push_ty_ref(&r1, ref_ty1, mutbl1, &mut values.0);
values.1.push_normal(t2.to_string());
values
}
(_, &ty::Ref(r2, ref_ty2, mutbl2)) if equals(&t1, &ref_ty2) => {
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
values.0.push_normal(t1.to_string());
push_ty_ref(&r2, ref_ty2, mutbl2, &mut values.1);
values
}
// When encountering &T != &mut T, highlight only the borrow
(&ty::Ref(r1, ref_ty1, mutbl1), &ty::Ref(r2, ref_ty2, mutbl2))
if equals(&ref_ty1, &ref_ty2) =>
{
let mut values = (DiagnosticStyledString::new(), DiagnosticStyledString::new());
push_ty_ref(&r1, ref_ty1, mutbl1, &mut values.0);
push_ty_ref(&r2, ref_ty2, mutbl2, &mut values.1);
values
}
// When encountering tuples of the same size, highlight only the differing types
(&ty::Tuple(substs1), &ty::Tuple(substs2)) if substs1.len() == substs2.len() => {
let mut values =
(DiagnosticStyledString::normal("("), DiagnosticStyledString::normal("("));
let len = substs1.len();
for (i, (left, right)) in substs1.types().zip(substs2.types()).enumerate() {
let (x1, x2) = self.cmp(left, right);
(values.0).0.extend(x1.0);
(values.1).0.extend(x2.0);
self.push_comma(&mut values.0, &mut values.1, len, i);
}
if len == 1 {
// Keep the output for single element tuples as `(ty,)`.
values.0.push_normal(",");
values.1.push_normal(",");
}
values.0.push_normal(")");
values.1.push_normal(")");
values
}
(ty::FnDef(did1, substs1), ty::FnDef(did2, substs2)) => {
let sig1 = self.tcx.fn_sig(*did1).subst(self.tcx, substs1);
let sig2 = self.tcx.fn_sig(*did2).subst(self.tcx, substs2);
let mut values = self.cmp_fn_sig(&sig1, &sig2);
let path1 = format!(" {{{}}}", self.tcx.def_path_str_with_substs(*did1, substs1));
let path2 = format!(" {{{}}}", self.tcx.def_path_str_with_substs(*did2, substs2));
let same_path = path1 == path2;
values.0.push(path1, !same_path);
values.1.push(path2, !same_path);
values
}
(ty::FnDef(did1, substs1), ty::FnPtr(sig2)) => {
let sig1 = self.tcx.fn_sig(*did1).subst(self.tcx, substs1);
let mut values = self.cmp_fn_sig(&sig1, sig2);
values.0.push_highlighted(format!(
" {{{}}}",
self.tcx.def_path_str_with_substs(*did1, substs1)
));
values
}
(ty::FnPtr(sig1), ty::FnDef(did2, substs2)) => {
let sig2 = self.tcx.fn_sig(*did2).subst(self.tcx, substs2);
let mut values = self.cmp_fn_sig(sig1, &sig2);
values.1.push_normal(format!(
" {{{}}}",
self.tcx.def_path_str_with_substs(*did2, substs2)
));
values
}
(ty::FnPtr(sig1), ty::FnPtr(sig2)) => self.cmp_fn_sig(sig1, sig2),
_ => {
if t1 == t2 {
// The two types are the same, elide and don't highlight.
(DiagnosticStyledString::normal("_"), DiagnosticStyledString::normal("_"))
} else {
// We couldn't find anything in common, highlight everything.
(
DiagnosticStyledString::highlighted(t1.to_string()),
DiagnosticStyledString::highlighted(t2.to_string()),
)
}
}
}
}
pub fn note_type_err(
&self,
diag: &mut DiagnosticBuilder<'tcx>,
cause: &ObligationCause<'tcx>,
secondary_span: Option<(Span, String)>,
mut values: Option<ValuePairs<'tcx>>,
terr: &TypeError<'tcx>,
) {
let span = cause.span(self.tcx);
debug!("note_type_err cause={:?} values={:?}, terr={:?}", cause, values, terr);
// For some types of errors, expected-found does not make
// sense, so just ignore the values we were given.
if let TypeError::CyclicTy(_) = terr {
values = None;
}
struct OpaqueTypesVisitor<'tcx> {
types: FxHashMap<TyCategory, FxHashSet<Span>>,
expected: FxHashMap<TyCategory, FxHashSet<Span>>,
found: FxHashMap<TyCategory, FxHashSet<Span>>,
ignore_span: Span,
tcx: TyCtxt<'tcx>,
}
impl<'tcx> OpaqueTypesVisitor<'tcx> {
fn visit_expected_found(
tcx: TyCtxt<'tcx>,
expected: Ty<'tcx>,
found: Ty<'tcx>,
ignore_span: Span,
) -> Self {
let mut types_visitor = OpaqueTypesVisitor {
types: Default::default(),
expected: Default::default(),
found: Default::default(),
ignore_span,
tcx,
};
// The visitor puts all the relevant encountered types in `self.types`, but in
// here we want to visit two separate types with no relation to each other, so we
// move the results from `types` to `expected` or `found` as appropriate.
expected.visit_with(&mut types_visitor);
std::mem::swap(&mut types_visitor.expected, &mut types_visitor.types);
found.visit_with(&mut types_visitor);
std::mem::swap(&mut types_visitor.found, &mut types_visitor.types);
types_visitor
}
fn report(&self, err: &mut DiagnosticBuilder<'_>) {
self.add_labels_for_types(err, "expected", &self.expected);
self.add_labels_for_types(err, "found", &self.found);
}
fn add_labels_for_types(
&self,
err: &mut DiagnosticBuilder<'_>,
target: &str,
types: &FxHashMap<TyCategory, FxHashSet<Span>>,
) {
for (key, values) in types.iter() {
let count = values.len();
let kind = key.descr();
for sp in values {
err.span_label(
*sp,
format!(
"{}{}{} {}{}",
if sp.is_desugaring(DesugaringKind::Async) {
"the `Output` of this `async fn`'s "
} else if count == 1 {
"the "
} else {
""
},
if count > 1 { "one of the " } else { "" },
target,
kind,
pluralize!(count),
),
);
}
}
}
}
impl<'tcx> ty::fold::TypeVisitor<'tcx> for OpaqueTypesVisitor<'tcx> {
fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
if let Some((kind, def_id)) = TyCategory::from_ty(t) {
let span = self.tcx.def_span(def_id);
// Avoid cluttering the output when the "found" and error span overlap:
//
// error[E0308]: mismatched types
// --> $DIR/issue-20862.rs:2:5
// |
// LL | |y| x + y
// | ^^^^^^^^^
// | |
// | the found closure
// | expected `()`, found closure
// |
// = note: expected unit type `()`
// found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
if !self.ignore_span.overlaps(span) {
self.types.entry(kind).or_default().insert(span);
}
}
t.super_visit_with(self)
}
}
debug!("note_type_err(diag={:?})", diag);
enum Mismatch<'a> {
Variable(ty::error::ExpectedFound<Ty<'a>>),
Fixed(&'static str),
}
let (expected_found, exp_found, is_simple_error) = match values {
None => (None, Mismatch::Fixed("type"), false),
Some(values) => {
let (is_simple_error, exp_found) = match values {
ValuePairs::Types(exp_found) => {
let is_simple_err =
exp_found.expected.is_simple_text() && exp_found.found.is_simple_text();
OpaqueTypesVisitor::visit_expected_found(
self.tcx,
exp_found.expected,
exp_found.found,
span,
)
.report(diag);
(is_simple_err, Mismatch::Variable(exp_found))
}
ValuePairs::TraitRefs(_) => (false, Mismatch::Fixed("trait")),
_ => (false, Mismatch::Fixed("type")),
};
let vals = match self.values_str(&values) {
Some((expected, found)) => Some((expected, found)),
None => {
// Derived error. Cancel the emitter.
diag.cancel();
return;
}
};
(vals, exp_found, is_simple_error)
}
};
// Ignore msg for object safe coercion
// since E0038 message will be printed
match terr {
TypeError::ObjectUnsafeCoercion(_) => {}
_ => {
diag.span_label(span, terr.to_string());
if let Some((sp, msg)) = secondary_span {
diag.span_label(sp, msg);
}
}
};
if let Some((expected, found)) = expected_found {
let expected_label = match exp_found {
Mismatch::Variable(ef) => ef.expected.prefix_string(),
Mismatch::Fixed(s) => s.into(),
};
let found_label = match exp_found {
Mismatch::Variable(ef) => ef.found.prefix_string(),
Mismatch::Fixed(s) => s.into(),
};
let exp_found = match exp_found {
Mismatch::Variable(exp_found) => Some(exp_found),
Mismatch::Fixed(_) => None,
};
match (&terr, expected == found) {
(TypeError::Sorts(values), extra) => {
let sort_string = |ty: Ty<'tcx>| match (extra, ty.kind()) {
(true, ty::Opaque(def_id, _)) => format!(
" (opaque type at {})",
self.tcx
.sess
.source_map()
.mk_substr_filename(self.tcx.def_span(*def_id)),
),
(true, _) => format!(" ({})", ty.sort_string(self.tcx)),
(false, _) => "".to_string(),
};
if !(values.expected.is_simple_text() && values.found.is_simple_text())
|| (exp_found.map_or(false, |ef| {
// This happens when the type error is a subset of the expectation,
// like when you have two references but one is `usize` and the other
// is `f32`. In those cases we still want to show the `note`. If the
// value from `ef` is `Infer(_)`, then we ignore it.
if !ef.expected.is_ty_infer() {
ef.expected != values.expected
} else if !ef.found.is_ty_infer() {
ef.found != values.found
} else {
false
}
}))
{
diag.note_expected_found_extra(
&expected_label,
expected,
&found_label,
found,
&sort_string(values.expected),
&sort_string(values.found),
);
}
}
(TypeError::ObjectUnsafeCoercion(_), _) => {
diag.note_unsuccessfull_coercion(found, expected);
}
(_, _) => {
debug!(
"note_type_err: exp_found={:?}, expected={:?} found={:?}",
exp_found, expected, found
);
if !is_simple_error || terr.must_include_note() {
diag.note_expected_found(&expected_label, expected, &found_label, found);
}
}
}
}
let exp_found = match exp_found {
Mismatch::Variable(exp_found) => Some(exp_found),
Mismatch::Fixed(_) => None,
};
let exp_found = match terr {
// `terr` has more accurate type information than `exp_found` in match expressions.
ty::error::TypeError::Sorts(terr)
if exp_found.map_or(false, |ef| terr.found == ef.found) =>
{
Some(*terr)
}
_ => exp_found,
};
debug!("exp_found {:?} terr {:?}", exp_found, terr);
if let Some(exp_found) = exp_found {
self.suggest_as_ref_where_appropriate(span, &exp_found, diag);
self.suggest_await_on_expect_found(cause, span, &exp_found, diag);
}
// In some (most?) cases cause.body_id points to actual body, but in some cases
// it's a actual definition. According to the comments (e.g. in
// librustc_typeck/check/compare_method.rs:compare_predicate_entailment) the latter
// is relied upon by some other code. This might (or might not) need cleanup.
let body_owner_def_id =
self.tcx.hir().opt_local_def_id(cause.body_id).unwrap_or_else(|| {
self.tcx.hir().body_owner_def_id(hir::BodyId { hir_id: cause.body_id })
});
self.check_and_note_conflicting_crates(diag, terr);
self.tcx.note_and_explain_type_err(diag, terr, cause, span, body_owner_def_id.to_def_id());
// It reads better to have the error origin as the final
// thing.
self.note_error_origin(diag, cause, exp_found);
}
fn get_impl_future_output_ty(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
if let ty::Opaque(def_id, substs) = ty.kind() {
let future_trait = self.tcx.require_lang_item(LangItem::Future, None);
// Future::Output
let item_def_id = self
.tcx
.associated_items(future_trait)
.in_definition_order()
.next()
.unwrap()
.def_id;
let bounds = self.tcx.explicit_item_bounds(*def_id);
for (predicate, _) in bounds {
let predicate = predicate.subst(self.tcx, substs);
if let ty::PredicateAtom::Projection(projection_predicate) =
predicate.skip_binders()
{
if projection_predicate.projection_ty.item_def_id == item_def_id {
// We don't account for multiple `Future::Output = Ty` contraints.
return Some(projection_predicate.ty);
}
}
}
}
None
}
/// A possible error is to forget to add `.await` when using futures:
///
/// ```
/// async fn make_u32() -> u32 {
/// 22
/// }
///
/// fn take_u32(x: u32) {}
///
/// async fn foo() {
/// let x = make_u32();
/// take_u32(x);
/// }
/// ```
///
/// This routine checks if the found type `T` implements `Future<Output=U>` where `U` is the
/// expected type. If this is the case, and we are inside of an async body, it suggests adding
/// `.await` to the tail of the expression.
fn suggest_await_on_expect_found(
&self,
cause: &ObligationCause<'tcx>,
exp_span: Span,
exp_found: &ty::error::ExpectedFound<Ty<'tcx>>,
diag: &mut DiagnosticBuilder<'tcx>,
) {
debug!(
"suggest_await_on_expect_found: exp_span={:?}, expected_ty={:?}, found_ty={:?}",
exp_span, exp_found.expected, exp_found.found,
);
if let ObligationCauseCode::CompareImplMethodObligation { .. } = &cause.code {
return;
}
match (
self.get_impl_future_output_ty(exp_found.expected),
self.get_impl_future_output_ty(exp_found.found),
) {
(Some(exp), Some(found)) if ty::TyS::same_type(exp, found) => match &cause.code {
ObligationCauseCode::IfExpression(box IfExpressionCause { then, .. }) => {
diag.multipart_suggestion(
"consider `await`ing on both `Future`s",
vec![
(then.shrink_to_hi(), ".await".to_string()),
(exp_span.shrink_to_hi(), ".await".to_string()),
],
Applicability::MaybeIncorrect,
);
}
ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause {
prior_arms,
..
}) => {
if let [.., arm_span] = &prior_arms[..] {
diag.multipart_suggestion(
"consider `await`ing on both `Future`s",
vec![
(arm_span.shrink_to_hi(), ".await".to_string()),
(exp_span.shrink_to_hi(), ".await".to_string()),
],
Applicability::MaybeIncorrect,
);
} else {
diag.help("consider `await`ing on both `Future`s");
}
}
_ => {
diag.help("consider `await`ing on both `Future`s");
}
},
(_, Some(ty)) if ty::TyS::same_type(exp_found.expected, ty) => {
let span = match cause.code {
// scrutinee's span
ObligationCauseCode::Pattern { span: Some(span), .. } => span,
_ => exp_span,
};
diag.span_suggestion_verbose(
span.shrink_to_hi(),
"consider `await`ing on the `Future`",
".await".to_string(),
Applicability::MaybeIncorrect,
);
}
(Some(ty), _) if ty::TyS::same_type(ty, exp_found.found) => {
let span = match cause.code {
// scrutinee's span
ObligationCauseCode::Pattern { span: Some(span), .. } => span,
_ => exp_span,
};
diag.span_suggestion_verbose(
span.shrink_to_hi(),
"consider `await`ing on the `Future`",
".await".to_string(),
Applicability::MaybeIncorrect,
);
}
_ => {}
}
}
/// When encountering a case where `.as_ref()` on a `Result` or `Option` would be appropriate,
/// suggests it.
fn suggest_as_ref_where_appropriate(
&self,
span: Span,
exp_found: &ty::error::ExpectedFound<Ty<'tcx>>,
diag: &mut DiagnosticBuilder<'tcx>,
) {
if let (ty::Adt(exp_def, exp_substs), ty::Ref(_, found_ty, _)) =
(exp_found.expected.kind(), exp_found.found.kind())
{
if let ty::Adt(found_def, found_substs) = *found_ty.kind() {
let path_str = format!("{:?}", exp_def);
if exp_def == &found_def {
let opt_msg = "you can convert from `&Option<T>` to `Option<&T>` using \
`.as_ref()`";
let result_msg = "you can convert from `&Result<T, E>` to \
`Result<&T, &E>` using `.as_ref()`";
let have_as_ref = &[
("std::option::Option", opt_msg),
("core::option::Option", opt_msg),
("std::result::Result", result_msg),
("core::result::Result", result_msg),
];
if let Some(msg) = have_as_ref
.iter()
.find_map(|(path, msg)| (&path_str == path).then_some(msg))
{
let mut show_suggestion = true;
for (exp_ty, found_ty) in exp_substs.types().zip(found_substs.types()) {
match *exp_ty.kind() {
ty::Ref(_, exp_ty, _) => {
match (exp_ty.kind(), found_ty.kind()) {
(_, ty::Param(_))
| (_, ty::Infer(_))
| (ty::Param(_), _)
| (ty::Infer(_), _) => {}
_ if ty::TyS::same_type(exp_ty, found_ty) => {}
_ => show_suggestion = false,
};
}
ty::Param(_) | ty::Infer(_) => {}
_ => show_suggestion = false,
}
}
if let (Ok(snippet), true) =
(self.tcx.sess.source_map().span_to_snippet(span), show_suggestion)
{
diag.span_suggestion(
span,
msg,
format!("{}.as_ref()", snippet),
Applicability::MachineApplicable,
);
}
}
}
}
}
}
pub fn report_and_explain_type_error(
&self,
trace: TypeTrace<'tcx>,
terr: &TypeError<'tcx>,
) -> DiagnosticBuilder<'tcx> {
debug!("report_and_explain_type_error(trace={:?}, terr={:?})", trace, terr);
let span = trace.cause.span(self.tcx);
let failure_code = trace.cause.as_failure_code(terr);
let mut diag = match failure_code {
FailureCode::Error0038(did) => {
let violations = self.tcx.object_safety_violations(did);
report_object_safety_error(self.tcx, span, did, violations)
}
FailureCode::Error0317(failure_str) => {
struct_span_err!(self.tcx.sess, span, E0317, "{}", failure_str)
}
FailureCode::Error0580(failure_str) => {
struct_span_err!(self.tcx.sess, span, E0580, "{}", failure_str)
}
FailureCode::Error0308(failure_str) => {
struct_span_err!(self.tcx.sess, span, E0308, "{}", failure_str)
}
FailureCode::Error0644(failure_str) => {
struct_span_err!(self.tcx.sess, span, E0644, "{}", failure_str)
}
};
self.note_type_err(&mut diag, &trace.cause, None, Some(trace.values), terr);
diag
}
fn values_str(
&self,
values: &ValuePairs<'tcx>,
) -> Option<(DiagnosticStyledString, DiagnosticStyledString)> {
match *values {
infer::Types(ref exp_found) => self.expected_found_str_ty(exp_found),
infer::Regions(ref exp_found) => self.expected_found_str(exp_found),
infer::Consts(ref exp_found) => self.expected_found_str(exp_found),
infer::TraitRefs(ref exp_found) => {
let pretty_exp_found = ty::error::ExpectedFound {
expected: exp_found.expected.print_only_trait_path(),
found: exp_found.found.print_only_trait_path(),
};
self.expected_found_str(&pretty_exp_found)
}
infer::PolyTraitRefs(ref exp_found) => {
let pretty_exp_found = ty::error::ExpectedFound {
expected: exp_found.expected.print_only_trait_path(),
found: exp_found.found.print_only_trait_path(),
};
self.expected_found_str(&pretty_exp_found)
}
}
}
fn expected_found_str_ty(
&self,
exp_found: &ty::error::ExpectedFound<Ty<'tcx>>,
) -> Option<(DiagnosticStyledString, DiagnosticStyledString)> {
let exp_found = self.resolve_vars_if_possible(exp_found);
if exp_found.references_error() {
return None;
}
Some(self.cmp(exp_found.expected, exp_found.found))
}
/// Returns a string of the form "expected `{}`, found `{}`".
fn expected_found_str<T: fmt::Display + TypeFoldable<'tcx>>(
&self,
exp_found: &ty::error::ExpectedFound<T>,
) -> Option<(DiagnosticStyledString, DiagnosticStyledString)> {
let exp_found = self.resolve_vars_if_possible(exp_found);
if exp_found.references_error() {
return None;
}
Some((
DiagnosticStyledString::highlighted(exp_found.expected.to_string()),
DiagnosticStyledString::highlighted(exp_found.found.to_string()),
))
}
pub fn report_generic_bound_failure(
&self,
span: Span,
origin: Option<SubregionOrigin<'tcx>>,
bound_kind: GenericKind<'tcx>,
sub: Region<'tcx>,
) {
self.construct_generic_bound_failure(span, origin, bound_kind, sub).emit();
}
pub fn construct_generic_bound_failure(
&self,
span: Span,
origin: Option<SubregionOrigin<'tcx>>,
bound_kind: GenericKind<'tcx>,
sub: Region<'tcx>,
) -> DiagnosticBuilder<'a> {
let hir = &self.tcx.hir();
// Attempt to obtain the span of the parameter so we can
// suggest adding an explicit lifetime bound to it.
let generics = self
.in_progress_typeck_results
.map(|typeck_results| typeck_results.borrow().hir_owner)
.map(|owner| {
let hir_id = hir.local_def_id_to_hir_id(owner);
let parent_id = hir.get_parent_item(hir_id);
(
// Parent item could be a `mod`, so we check the HIR before calling:
if let Some(Node::Item(Item {
kind: ItemKind::Trait(..) | ItemKind::Impl { .. },
..
})) = hir.find(parent_id)
{
Some(self.tcx.generics_of(hir.local_def_id(parent_id).to_def_id()))
} else {
None
},
self.tcx.generics_of(owner.to_def_id()),
)
});
let type_param_span = match (generics, bound_kind) {
(Some((_, ref generics)), GenericKind::Param(ref param)) => {
// Account for the case where `param` corresponds to `Self`,
// which doesn't have the expected type argument.
if !(generics.has_self && param.index == 0) {
let type_param = generics.type_param(param, self.tcx);
type_param.def_id.as_local().map(|def_id| {
// Get the `hir::Param` to verify whether it already has any bounds.
// We do this to avoid suggesting code that ends up as `T: 'a'b`,
// instead we suggest `T: 'a + 'b` in that case.
let id = hir.local_def_id_to_hir_id(def_id);
let mut has_bounds = false;
if let Node::GenericParam(param) = hir.get(id) {
has_bounds = !param.bounds.is_empty();
}
let sp = hir.span(id);
// `sp` only covers `T`, change it so that it covers
// `T:` when appropriate
let is_impl_trait = bound_kind.to_string().starts_with("impl ");
let sp = if has_bounds && !is_impl_trait {
sp.to(self
.tcx
.sess
.source_map()
.next_point(self.tcx.sess.source_map().next_point(sp)))
} else {
sp
};
(sp, has_bounds, is_impl_trait)
})
} else {
None
}
}
_ => None,
};
let new_lt = generics
.as_ref()
.and_then(|(parent_g, g)| {
let possible: Vec<_> = (b'a'..=b'z').map(|c| format!("'{}", c as char)).collect();
let mut lts_names = g
.params
.iter()
.filter(|p| matches!(p.kind, ty::GenericParamDefKind::Lifetime))
.map(|p| p.name.as_str())
.collect::<Vec<_>>();
if let Some(g) = parent_g {
lts_names.extend(
g.params
.iter()
.filter(|p| matches!(p.kind, ty::GenericParamDefKind::Lifetime))
.map(|p| p.name.as_str()),
);
}
let lts = lts_names.iter().map(|s| -> &str { &*s }).collect::<Vec<_>>();
possible.into_iter().find(|candidate| !lts.contains(&candidate.as_str()))
})
.unwrap_or("'lt".to_string());
let add_lt_sugg = generics
.as_ref()
.and_then(|(_, g)| g.params.first())
.and_then(|param| param.def_id.as_local())
.map(|def_id| {
(
hir.span(hir.local_def_id_to_hir_id(def_id)).shrink_to_lo(),
format!("{}, ", new_lt),
)
});
let labeled_user_string = match bound_kind {
GenericKind::Param(ref p) => format!("the parameter type `{}`", p),
GenericKind::Projection(ref p) => format!("the associated type `{}`", p),
};
if let Some(SubregionOrigin::CompareImplMethodObligation {
span,
item_name,
impl_item_def_id,
trait_item_def_id,
}) = origin
{
return self.report_extra_impl_obligation(
span,
item_name,
impl_item_def_id,
trait_item_def_id,
&format!("`{}: {}`", bound_kind, sub),
);
}
fn binding_suggestion<'tcx, S: fmt::Display>(
err: &mut DiagnosticBuilder<'tcx>,
type_param_span: Option<(Span, bool, bool)>,
bound_kind: GenericKind<'tcx>,
sub: S,
) {
let msg = "consider adding an explicit lifetime bound";
if let Some((sp, has_lifetimes, is_impl_trait)) = type_param_span {
let suggestion = if is_impl_trait {
format!("{} + {}", bound_kind, sub)
} else {
let tail = if has_lifetimes { " + " } else { "" };
format!("{}: {}{}", bound_kind, sub, tail)
};
err.span_suggestion(
sp,
&format!("{}...", msg),
suggestion,
Applicability::MaybeIncorrect, // Issue #41966
);
} else {
let consider = format!(
"{} {}...",
msg,
if type_param_span.map(|(_, _, is_impl_trait)| is_impl_trait).unwrap_or(false) {
format!(" `{}` to `{}`", sub, bound_kind)
} else {
format!("`{}: {}`", bound_kind, sub)
},
);
err.help(&consider);
}
}
let new_binding_suggestion =
|err: &mut DiagnosticBuilder<'tcx>,
type_param_span: Option<(Span, bool, bool)>,
bound_kind: GenericKind<'tcx>| {
let msg = "consider introducing an explicit lifetime bound";
if let Some((sp, has_lifetimes, is_impl_trait)) = type_param_span {
let suggestion = if is_impl_trait {
(sp.shrink_to_hi(), format!(" + {}", new_lt))
} else {
let tail = if has_lifetimes { " +" } else { "" };
(sp, format!("{}: {}{}", bound_kind, new_lt, tail))
};
let mut sugg =
vec![suggestion, (span.shrink_to_hi(), format!(" + {}", new_lt))];
if let Some(lt) = add_lt_sugg {
sugg.push(lt);
sugg.rotate_right(1);
}
// `MaybeIncorrect` due to issue #41966.
err.multipart_suggestion(msg, sugg, Applicability::MaybeIncorrect);
}
};
let mut err = match *sub {
ty::ReEarlyBound(ty::EarlyBoundRegion { name, .. })
| ty::ReFree(ty::FreeRegion { bound_region: ty::BrNamed(_, name), .. }) => {
// Does the required lifetime have a nice name we can print?
let mut err = struct_span_err!(
self.tcx.sess,
span,
E0309,
"{} may not live long enough",
labeled_user_string
);
// Explicitly use the name instead of `sub`'s `Display` impl. The `Display` impl
// for the bound is not suitable for suggestions when `-Zverbose` is set because it
// uses `Debug` output, so we handle it specially here so that suggestions are
// always correct.
binding_suggestion(&mut err, type_param_span, bound_kind, name);
err
}
ty::ReStatic => {
// Does the required lifetime have a nice name we can print?
let mut err = struct_span_err!(
self.tcx.sess,
span,
E0310,
"{} may not live long enough",
labeled_user_string
);
binding_suggestion(&mut err, type_param_span, bound_kind, "'static");
err
}
_ => {
// If not, be less specific.
let mut err = struct_span_err!(
self.tcx.sess,
span,
E0311,
"{} may not live long enough",
labeled_user_string
);
note_and_explain_region(
self.tcx,
&mut err,
&format!("{} must be valid for ", labeled_user_string),
sub,
"...",
);
if let Some(infer::RelateParamBound(_, t)) = origin {
let t = self.resolve_vars_if_possible(&t);
match t.kind() {
// We've got:
// fn get_later<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
// suggest:
// fn get_later<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
ty::Closure(_, _substs) | ty::Opaque(_, _substs) => {
new_binding_suggestion(&mut err, type_param_span, bound_kind);
}
_ => {
binding_suggestion(&mut err, type_param_span, bound_kind, new_lt);
}
}
}
err
}
};
if let Some(origin) = origin {
self.note_region_origin(&mut err, &origin);
}
err
}
fn report_sub_sup_conflict(
&self,
var_origin: RegionVariableOrigin,
sub_origin: SubregionOrigin<'tcx>,
sub_region: Region<'tcx>,
sup_origin: SubregionOrigin<'tcx>,
sup_region: Region<'tcx>,
) {
let mut err = self.report_inference_failure(var_origin);
note_and_explain_region(
self.tcx,
&mut err,
"first, the lifetime cannot outlive ",
sup_region,
"...",
);
debug!("report_sub_sup_conflict: var_origin={:?}", var_origin);
debug!("report_sub_sup_conflict: sub_region={:?}", sub_region);
debug!("report_sub_sup_conflict: sub_origin={:?}", sub_origin);
debug!("report_sub_sup_conflict: sup_region={:?}", sup_region);
debug!("report_sub_sup_conflict: sup_origin={:?}", sup_origin);
if let (&infer::Subtype(ref sup_trace), &infer::Subtype(ref sub_trace)) =
(&sup_origin, &sub_origin)
{
debug!("report_sub_sup_conflict: sup_trace={:?}", sup_trace);
debug!("report_sub_sup_conflict: sub_trace={:?}", sub_trace);
debug!("report_sub_sup_conflict: sup_trace.values={:?}", sup_trace.values);
debug!("report_sub_sup_conflict: sub_trace.values={:?}", sub_trace.values);
if let (Some((sup_expected, sup_found)), Some((sub_expected, sub_found))) =
(self.values_str(&sup_trace.values), self.values_str(&sub_trace.values))
{
if sub_expected == sup_expected && sub_found == sup_found {
note_and_explain_region(
self.tcx,
&mut err,
"...but the lifetime must also be valid for ",
sub_region,
"...",
);
err.span_note(
sup_trace.cause.span,
&format!("...so that the {}", sup_trace.cause.as_requirement_str()),
);
err.note_expected_found(&"", sup_expected, &"", sup_found);
err.emit();
return;
}
}
}
self.note_region_origin(&mut err, &sup_origin);
note_and_explain_region(
self.tcx,
&mut err,
"but, the lifetime must be valid for ",
sub_region,
"...",
);
self.note_region_origin(&mut err, &sub_origin);
err.emit();
}
}
impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
fn report_inference_failure(
&self,
var_origin: RegionVariableOrigin,
) -> DiagnosticBuilder<'tcx> {
let br_string = |br: ty::BoundRegion| {
let mut s = match br {
ty::BrNamed(_, name) => name.to_string(),
_ => String::new(),
};
if !s.is_empty() {
s.push(' ');
}
s
};
let var_description = match var_origin {
infer::MiscVariable(_) => String::new(),
infer::PatternRegion(_) => " for pattern".to_string(),
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
infer::Autoref(_, _) => " for autoref".to_string(),
infer::Coercion(_) => " for automatic coercion".to_string(),
infer::LateBoundRegion(_, br, infer::FnCall) => {
format!(" for lifetime parameter {}in function call", br_string(br))
}
infer::LateBoundRegion(_, br, infer::HigherRankedType) => {
format!(" for lifetime parameter {}in generic type", br_string(br))
}
infer::LateBoundRegion(_, br, infer::AssocTypeProjection(def_id)) => format!(
" for lifetime parameter {}in trait containing associated type `{}`",
br_string(br),
self.tcx.associated_item(def_id).ident
),
infer::EarlyBoundRegion(_, name) => format!(" for lifetime parameter `{}`", name),
infer::BoundRegionInCoherence(name) => {
format!(" for lifetime parameter `{}` in coherence check", name)
}
infer::UpvarRegion(ref upvar_id, _) => {
let var_name = self.tcx.hir().name(upvar_id.var_path.hir_id);
format!(" for capture of `{}` by closure", var_name)
}
infer::NLL(..) => bug!("NLL variable found in lexical phase"),
};
struct_span_err!(
self.tcx.sess,
var_origin.span(),
E0495,
"cannot infer an appropriate lifetime{} due to conflicting requirements",
var_description
)
}
}
enum FailureCode {
Error0038(DefId),
Error0317(&'static str),
Error0580(&'static str),
Error0308(&'static str),
Error0644(&'static str),
}
trait ObligationCauseExt<'tcx> {
fn as_failure_code(&self, terr: &TypeError<'tcx>) -> FailureCode;
fn as_requirement_str(&self) -> &'static str;
}
impl<'tcx> ObligationCauseExt<'tcx> for ObligationCause<'tcx> {
fn as_failure_code(&self, terr: &TypeError<'tcx>) -> FailureCode {
use self::FailureCode::*;
use crate::traits::ObligationCauseCode::*;
match self.code {
CompareImplMethodObligation { .. } => Error0308("method not compatible with trait"),
CompareImplTypeObligation { .. } => Error0308("type not compatible with trait"),
MatchExpressionArm(box MatchExpressionArmCause { source, .. }) => {
Error0308(match source {
hir::MatchSource::IfLetDesugar { .. } => {
"`if let` arms have incompatible types"
}
hir::MatchSource::TryDesugar => {
"try expression alternatives have incompatible types"
}
_ => "`match` arms have incompatible types",
})
}
IfExpression { .. } => Error0308("`if` and `else` have incompatible types"),
IfExpressionWithNoElse => Error0317("`if` may be missing an `else` clause"),
MainFunctionType => Error0580("`main` function has wrong type"),
StartFunctionType => Error0308("`#[start]` function has wrong type"),
IntrinsicType => Error0308("intrinsic has wrong type"),
MethodReceiver => Error0308("mismatched `self` parameter type"),
// In the case where we have no more specific thing to
// say, also take a look at the error code, maybe we can
// tailor to that.
_ => match terr {
TypeError::CyclicTy(ty) if ty.is_closure() || ty.is_generator() => {
Error0644("closure/generator type that references itself")
}
TypeError::IntrinsicCast => {
Error0308("cannot coerce intrinsics to function pointers")
}
TypeError::ObjectUnsafeCoercion(did) => Error0038(*did),
_ => Error0308("mismatched types"),
},
}
}
fn as_requirement_str(&self) -> &'static str {
use crate::traits::ObligationCauseCode::*;
match self.code {
CompareImplMethodObligation { .. } => "method type is compatible with trait",
CompareImplTypeObligation { .. } => "associated type is compatible with trait",
ExprAssignable => "expression is assignable",
MatchExpressionArm(box MatchExpressionArmCause { source, .. }) => match source {
hir::MatchSource::IfLetDesugar { .. } => "`if let` arms have compatible types",
_ => "`match` arms have compatible types",
},
IfExpression { .. } => "`if` and `else` have incompatible types",
IfExpressionWithNoElse => "`if` missing an `else` returns `()`",
MainFunctionType => "`main` function has the correct type",
StartFunctionType => "`#[start]` function has the correct type",
IntrinsicType => "intrinsic has the correct type",
MethodReceiver => "method receiver has the correct type",
_ => "types are compatible",
}
}
}
/// This is a bare signal of what kind of type we're dealing with. `ty::TyKind` tracks
/// extra information about each type, but we only care about the category.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub enum TyCategory {
Closure,
Opaque,
Generator,
Foreign,
}
impl TyCategory {
fn descr(&self) -> &'static str {
match self {
Self::Closure => "closure",
Self::Opaque => "opaque type",
Self::Generator => "generator",
Self::Foreign => "foreign type",
}
}
pub fn from_ty(ty: Ty<'_>) -> Option<(Self, DefId)> {
match *ty.kind() {
ty::Closure(def_id, _) => Some((Self::Closure, def_id)),
ty::Opaque(def_id, _) => Some((Self::Opaque, def_id)),
ty::Generator(def_id, ..) => Some((Self::Generator, def_id)),
ty::Foreign(def_id) => Some((Self::Foreign, def_id)),
_ => None,
}
}
}
| path_generic_args |
toggle.ts | import { Command } from '../command';
export = new Command({
run: async function (message, args, colors) {
if (!args[1]) {
message.channel.send('Please provide a command to enable / disable');
return;
}
const command = message.client.getCommand(args[1] || '');
const channel =
message.mentions.channels.first() ||
(args[2] ? message.guild.channels.resolve(args[2]) : undefined);
const channelID = channel ? channel.id : undefined;
if (!command) {
message.channel.send('`Command not found.`');
return;
}
if (command.name == 'ToggleCommand') {
message.channel.send('`Operation not allowed, command can not be disabled.`');
return;
}
function err(e: Error) {
message.channel.send({
embed: {
title: 'Internal error',
description:
(e ? e.message : '') ||
'Unable to update, if command is disabled globally it can not be enabled in a single channel, if the problem still persists contact bot maintainer.',
color: colors.error,
},
});
}
if (args[0] == 'enable' || args[0] == 'enableCommand')
message.client
.enableCommand(message.guild.id, command.name, channelID)
.then(() =>
message.channel.send({
embed: {
title: 'Enabled command',
description: `${command.name} enabled${channel ? ` in ${channel.name}` : ''}`,
color: colors.success,
},
})
)
.catch(err);
else if (args[0] == 'disable' || args[0] == 'disableCommand') | .then(() =>
message.channel.send({
embed: {
title: 'Disabled command',
description: `${command.name} disabled${channel ? ` in ${channel.name}` : ''}`,
color: colors.success,
},
})
)
.catch(err);
else
(await message.client.enabledIn(message.guild.id, command.name, channelID))
? message.client
.disableCommand(message.guild.id, command.name, channelID)
.then(() =>
message.channel.send({
embed: {
title: 'Disabled command',
description: `${command.name} disabled${channel ? ` in ${channel.name}` : ''}`,
color: colors.success,
},
})
)
.catch(err)
: message.client
.enableCommand(message.guild.id, command.name, channelID)
.then(() =>
message.channel.send({
embed: {
title: 'Enabled command',
description: `${command.name} enabled${channel ? ` in ${channel.name}` : ''}`,
color: colors.success,
},
})
)
.catch(err);
},
description: 'Enables/disables commands.',
detailed:
'Toggles whether or not a command is available in a server. If called explicitly with enable/disable it will always enable or disable the given command according to the used keyword.',
examples: [
(prefix) => `${prefix}toggle [command]`,
(prefix) => `${prefix}disable [command]`,
(prefix) => `${prefix}enable [command] #general`,
],
name: 'ToggleCommand',
aliases: ['DisabledCommands', 'Toggle', 'Disable', 'Enable', 'DisableCommand', 'EnableCommand'],
permissions: ['ADMINISTRATOR'],
}); | message.client
.disableCommand(message.guild.id, command.name, channelID) |
context.rs | //!
//! A context allows a child's future to access its received
//! messages, parent and supervisor.
use crate::child_ref::ChildRef;
use crate::children_ref::ChildrenRef;
use crate::dispatcher::{BroadcastTarget, DispatcherType, NotificationType};
use crate::envelope::{Envelope, RefAddr, SignedMessage};
use crate::message::{Answer, BastionMessage, Message, Msg};
use crate::supervisor::SupervisorRef;
use crate::{prelude::ReceiveError, system::SYSTEM};
use async_mutex::Mutex;
use futures::pending;
use futures::FutureExt;
use futures_timer::Delay;
#[cfg(feature = "scaling")]
use lever::table::lotable::LOTable;
use std::collections::VecDeque;
use std::fmt::{self, Display, Formatter};
use std::pin::Pin;
#[cfg(feature = "scaling")]
use std::sync::atomic::AtomicU64;
use std::{sync::Arc, time::Duration};
use tracing::{debug, trace};
use uuid::Uuid;
/// Identifier for a root supervisor and dead-letters children.
pub const NIL_ID: BastionId = BastionId(Uuid::nil());
#[derive(Hash, Eq, PartialEq, Debug, Clone)]
/// An identifier used by supervisors, children groups and
/// their elements to identify themselves, using a v4 UUID.
///
/// A `BastionId` is unique to its attached element and is
/// reset when it is restarted. A special `BastionId` exists
/// for the "system supervisor" (the supervisor created by
/// the system at startup) which is a nil UUID
/// (00000000-0000-0000-0000-000000000000).
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx| {
/// async move {
/// let child_id: &BastionId = ctx.current().id();
/// // ...
/// # Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
pub struct BastionId(pub(crate) Uuid);
#[derive(Debug)]
/// A child's execution context, allowing its [`exec`] future
/// to receive messages and access a [`ChildRef`] referencing
/// it, a [`ChildrenRef`] referencing its children group and
/// a [`SupervisorRef`] referencing its supervisor.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // Get a `ChildRef` referencing the child executing
/// // this future...
/// let current: &ChildRef = ctx.current();
/// // Get a `ChildrenRef` referencing the children
/// // group of the child executing this future...
/// let parent: &ChildrenRef = ctx.parent();
/// // Try to get a `SupervisorRef` referencing the
/// // supervisor of the child executing this future...
/// let supervisor: Option<&SupervisorRef> = ctx.supervisor();
/// // Note that `supervisor` will be `None` because
/// // this child was created using `Bastion::children`,
/// // which made it supervised by the system supervisor
/// // (which users can't get a reference to).
///
/// // Try to receive a message...
/// let opt_msg: Option<SignedMessage> = ctx.try_recv().await;
/// // Wait for a message to be received...
/// let msg: SignedMessage = ctx.recv().await?;
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
pub struct BastionContext {
id: BastionId,
child: ChildRef,
children: ChildrenRef,
supervisor: Option<SupervisorRef>,
state: Arc<Mutex<Pin<Box<ContextState>>>>,
}
#[derive(Debug)]
pub(crate) struct ContextState {
messages: VecDeque<SignedMessage>,
#[cfg(feature = "scaling")]
stats: Arc<AtomicU64>,
#[cfg(feature = "scaling")]
actor_stats: Arc<LOTable<BastionId, u32>>,
}
impl BastionId {
pub(crate) fn new() -> Self {
let uuid = Uuid::new_v4();
BastionId(uuid)
}
}
impl BastionContext {
pub(crate) fn new(
id: BastionId,
child: ChildRef,
children: ChildrenRef,
supervisor: Option<SupervisorRef>,
state: Arc<Mutex<Pin<Box<ContextState>>>>,
) -> Self {
debug!("BastionContext({}): Creating.", id);
BastionContext {
id,
child,
children,
supervisor,
state,
}
}
/// Returns a [`ChildRef`] referencing the children group's
/// element that is linked to this `BastionContext`.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// let current: &ChildRef = ctx.current();
/// // Stop or kill the current element (note that this will
/// // only take effect after this future becomes "pending")...
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`ChildRef`]: children/struct.ChildRef.html
pub fn current(&self) -> &ChildRef {
&self.child
}
/// Returns a [`ChildrenRef`] referencing the children group
/// of the element that is linked to this `BastionContext`.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// let parent: &ChildrenRef = ctx.parent();
/// // Get the other elements of the group, broadcast message,
/// // or stop or kill the children group...
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`ChildrenRef`]: children/struct.ChildrenRef.html
pub fn parent(&self) -> &ChildrenRef {
&self.children
}
/// Returns a [`SupervisorRef`] referencing the supervisor
/// that supervises the element that is linked to this
/// `BastionContext` if it isn't the system supervisor
/// (ie. if the children group wasn't created using
/// [`Bastion::children`]).
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// // When calling the method from a children group supervised
/// // by a supervisor created by the user...
/// Bastion::supervisor(|sp| {
/// sp.children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // ...the method will return a SupervisorRef referencing the
/// // user-created supervisor...
/// let supervisor: Option<&SupervisorRef> = ctx.supervisor(); // Some
/// assert!(supervisor.is_some());
///
/// Ok(())
/// }
/// })
/// })
/// }).expect("Couldn't create the supervisor.");
///
/// // When calling the method from a children group supervised
/// // by the system's supervisor...
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // ...the method won't return a SupervisorRef...
/// let supervisor: Option<&SupervisorRef> = ctx.supervisor(); // None
/// assert!(supervisor.is_none());
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`SupervisorRef`]: supervisor/struct.SupervisorRef.html
/// [`Bastion::children`]: struct.Bastion.html#method.children
pub fn supervisor(&self) -> Option<&SupervisorRef> {
self.supervisor.as_ref()
}
/// Tries to retrieve asynchronously a message received by
/// the element this `BastionContext` is linked to.
///
/// If you need to wait (always asynchronously) until at
/// least one message can be retrieved, use [`recv`] instead.
///
/// If you want to wait for a certain amount of time before bailing out
/// use [`try_recv_timeout`] instead.
///
/// This method returns [`SignedMessage`] if a message was available, or
/// `None` otherwise.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// let opt_msg: Option<SignedMessage> = ctx.try_recv().await;
/// // If a message was received by the element, `opt_msg` will
/// // be `Some(Msg)`, otherwise it will be `None`.
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`recv`]: #method.recv
/// [`try_recv_timeout`]: #method.try_recv_timeout
/// [`SignedMessage`]: ../prelude/struct.SignedMessage.html
pub async fn try_recv(&self) -> Option<SignedMessage> {
debug!("BastionContext({}): Trying to receive message.", self.id);
let state = self.state.clone();
let mut guard = state.lock().await;
if let Some(msg) = guard.pop_message() {
trace!("BastionContext({}): Received message: {:?}", self.id, msg);
Some(msg)
} else {
trace!("BastionContext({}): Received no message.", self.id);
None
}
}
/// Retrieves asynchronously a message received by the element
/// this `BastionContext` is linked to and waits (always
/// asynchronously) for one if none has been received yet.
///
/// If you don't need to wait until at least one message
/// can be retrieved, use [`try_recv`] instead.
///
/// If you want to wait for a certain amount of time before bailing out
/// use [`try_recv_timeout`] instead.
///
/// This method returns [`SignedMessage`] if it succeeded, or `Err(())`
/// otherwise.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // This will block until a message has been received...
/// let msg: SignedMessage = ctx.recv().await?;
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`try_recv`]: #method.try_recv
/// [`try_recv_timeout`]: #method.try_recv_timeout
/// [`SignedMessage`]: ../prelude/struct.SignedMessage.html
pub async fn recv(&self) -> Result<SignedMessage, ()> {
debug!("BastionContext({}): Waiting to receive message.", self.id);
loop {
let state = self.state.clone();
let mut guard = state.lock().await;
if let Some(msg) = guard.pop_message() {
trace!("BastionContext({}): Received message: {:?}", self.id, msg);
return Ok(msg);
}
drop(guard);
pending!();
}
}
/// Retrieves asynchronously a message received by the element
/// this `BastionContext` is linked to and waits until `timeout` (always
/// asynchronously) for one if none has been received yet.
///
/// If you want to wait for ever until at least one message
/// can be retrieved, use [`recv`] instead.
///
/// If you don't need to wait until at least one message
/// can be retrieved, use [`try_recv`] instead.
///
/// This method returns [`SignedMessage`] if it succeeded, or `Err(TimeoutError)`
/// otherwise.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// # use std::time::Duration;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // This will block until a message has been received...
/// let timeout = Duration::from_millis(10);
/// let msg: SignedMessage = ctx.try_recv_timeout(timeout).await.map_err(|e| {
/// if let ReceiveError::Timeout(duration) = e {
/// // Timeout happened
/// }
/// })?;
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`recv`]: #method.recv
/// [`try_recv`]: #method.try_recv
/// [`SignedMessage`]: ../prelude/struct.SignedMessage.html
pub async fn try_recv_timeout(&self, timeout: Duration) -> Result<SignedMessage, ReceiveError> {
debug!(
"BastionContext({}): Waiting to receive message within {} milliseconds.",
self.id,
timeout.as_millis()
);
futures::select! {
message = self.recv().fuse() => {
message.map_err(|_| ReceiveError::Other)
},
duration = Delay::new(timeout).fuse() => {
Err(ReceiveError::Timeout(timeout))
}
}
}
/// Returns [`RefAddr`] of the current `BastionContext`
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
///
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// ctx.tell(&ctx.signature(), "Hello to myself");
///
/// # Bastion::stop();
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`RefAddr`]: /prelude/struct.Answer.html
pub fn signature(&self) -> RefAddr {
RefAddr::new(
self.current().path().clone(),
self.current().sender().clone(),
)
}
/// Sends a message to the specified [`RefAddr`]
///
/// # Arguments
///
/// * `to` – the [`RefAddr`] to send the message to
/// * `msg` – The actual message to send
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // Wait for a message to be received...
/// let smsg: SignedMessage = ctx.recv().await?;
/// // Obtain address of this message sender...
/// let sender_addr = smsg.signature();
/// // And send something back
/// ctx.tell(&sender_addr, "Ack").expect("Unable to acknowledge");
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// ```
///
/// [`RefAddr`]: ../prelude/struct.RefAddr.html
pub fn tell<M: Message>(&self, to: &RefAddr, msg: M) -> Result<(), M> {
debug!(
"{:?}: Telling message: {:?} to: {:?}",
self.current().path(),
msg,
to.path()
);
let msg = BastionMessage::tell(msg);
let env = Envelope::new_with_sign(msg, self.signature());
// FIXME: panics?
to.sender()
.unbounded_send(env)
.map_err(|err| err.into_inner().into_msg().unwrap())
}
/// Sends a message from behalf of current context to the addr,
/// allowing to addr owner answer.
///
/// This method returns [`Answer`] if it succeeded, or `Err(msg)`
/// otherwise.
///
/// # Argument
///
/// * `msg` - The message to send.
///
/// # Example
///
/// ```
/// # use bastion::prelude::*;
/// #
/// # fn main() {
/// # Bastion::init();
/// // The message that will be "asked"...
/// const ASK_MSG: &'static str = "A message containing data (ask).";
/// // The message the will be "answered"...
/// const ANSWER_MSG: &'static str = "A message containing data (answer).";
///
/// # let children_ref =
/// // Create a new child...
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// // ...which will receive the message asked...
/// msg! { ctx.recv().await?,
/// msg: &'static str =!> {
/// assert_eq!(msg, ASK_MSG);
/// // Handle the message...
///
/// // ...and eventually answer to it...
/// answer!(ctx, ANSWER_MSG);
/// };
/// // This won't happen because this example
/// // only "asks" a `&'static str`...
/// _: _ => ();
/// }
///
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
///
/// # Bastion::children(|children| {
/// # children.with_exec(move |ctx: BastionContext| {
/// # let child_ref = children_ref.elems()[0].clone();
/// # async move {
/// // Later, the message is "asked" to the child...
/// let answer: Answer = ctx.ask(&child_ref.addr(), ASK_MSG).expect("Couldn't send the message.");
///
/// // ...and the child's answer is received...
/// msg! { answer.await.expect("Couldn't receive the answer."),
/// msg: &'static str => {
/// assert_eq!(msg, ANSWER_MSG);
/// // Handle the answer...
/// };
/// // This won't happen because this example
/// // only answers a `&'static str`...
/// _: _ => ();
/// }
/// #
/// # Ok(())
/// # }
/// # })
/// # }).unwrap();
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// # }
/// ```
///
/// [`Answer`]: /message/struct.Answer.html
pub fn ask<M: Message>(&self, to: &RefAddr, msg: M) -> Result<Answer, M> {
debug!(
"{:?}: Asking message: {:?} to: {:?}",
self.current().path(),
msg,
to
);
let (msg, answer) = BastionMessage::ask(msg);
let env = Envelope::new_with_sign(msg, self.signature());
// FIXME: panics?
to.sender()
.unbounded_send(env)
.map_err(|err| err.into_inner().into_msg().unwrap())?;
Ok(answer)
}
/// Sends the notification to each declared dispatcher of the actor.
///
/// # Argument
///
/// * `dispatchers` - Vector of dispatcher names to which need to
/// deliver a notification.
/// * `notification_type` - The type of the notification to send.
///
pub fn notify(&self, dispatchers: &[DispatcherType], notification_type: NotificationType) {
let global_dispatcher = SYSTEM.dispatcher();
let from_actor = self.current();
global_dispatcher.notify(from_actor, dispatchers, notification_type);
}
/// Sends the broadcasted message to the target group(s).
///
/// # Argument
///
/// * `target` - Defines the message receivers in according with
/// the [`BroadcastTarget`] value.
/// * `message` - The broadcasted message.
///
/// [`BroadcastTarget`]: ../dispatcher/enum.DispatcherType.html
pub fn broadcast_message<M: Message>(&self, target: BroadcastTarget, message: M) {
let msg = Arc::new(SignedMessage {
msg: Msg::broadcast(message),
sign: self.signature(),
});
let global_dispatcher = SYSTEM.dispatcher();
global_dispatcher.broadcast_message(target, &msg);
}
}
impl ContextState {
pub(crate) fn new() -> Self {
ContextState {
messages: VecDeque::new(),
#[cfg(feature = "scaling")]
stats: Arc::new(AtomicU64::new(0)),
#[cfg(feature = "scaling")]
actor_stats: Arc::new(LOTable::new()),
}
}
#[cfg(feature = "scaling")]
pub(crate) fn set_stats(&mut self, stats: Arc<AtomicU64>) {
self.stats = stats;
}
#[cfg(feature = "scaling")]
pub(crate) fn set_actor_stats(&mut self, actor_stats: Arc<LOTable<BastionId, u32>>) {
| #[cfg(feature = "scaling")]
pub(crate) fn stats(&self) -> Arc<AtomicU64> {
self.stats.clone()
}
#[cfg(feature = "scaling")]
pub(crate) fn actor_stats(&self) -> Arc<LOTable<BastionId, u32>> {
self.actor_stats.clone()
}
pub(crate) fn push_message(&mut self, msg: Msg, sign: RefAddr) {
self.messages.push_back(SignedMessage::new(msg, sign))
}
pub(crate) fn pop_message(&mut self) -> Option<SignedMessage> {
self.messages.pop_front()
}
#[cfg(feature = "scaling")]
pub(crate) fn mailbox_size(&self) -> u32 {
self.messages.len() as _
}
}
impl Display for BastionId {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
self.0.fmt(fmt)
}
}
| self.actor_stats = actor_stats;
}
|
updatepodspec.go | /*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package polymorphichelpers
import (
"fmt"
kruiseappsv1alpha1 "github.com/openkruise/kruise-api/apps/v1alpha1"
kruiseappsv1beta1 "github.com/openkruise/kruise-api/apps/v1beta1"
appsv1 "k8s.io/api/apps/v1"
appsv1beta1 "k8s.io/api/apps/v1beta1"
appsv1beta2 "k8s.io/api/apps/v1beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv2alpha1 "k8s.io/api/batch/v2alpha1"
"k8s.io/api/core/v1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
)
func updatePodSpecForObject(obj runtime.Object, fn func(*v1.PodSpec) error) (bool, error) | {
switch t := obj.(type) {
case *kruiseappsv1alpha1.CloneSet:
return true, fn(&t.Spec.Template.Spec)
case *kruiseappsv1beta1.StatefulSet:
return true, fn(&t.Spec.Template.Spec)
case *v1.Pod:
return true, fn(&t.Spec)
// ReplicationController
case *v1.ReplicationController:
if t.Spec.Template == nil {
t.Spec.Template = &v1.PodTemplateSpec{}
}
return true, fn(&t.Spec.Template.Spec)
// Deployment
case *extensionsv1beta1.Deployment:
return true, fn(&t.Spec.Template.Spec)
case *appsv1beta1.Deployment:
return true, fn(&t.Spec.Template.Spec)
case *appsv1beta2.Deployment:
return true, fn(&t.Spec.Template.Spec)
case *appsv1.Deployment:
return true, fn(&t.Spec.Template.Spec)
// DaemonSet
case *extensionsv1beta1.DaemonSet:
return true, fn(&t.Spec.Template.Spec)
case *appsv1beta2.DaemonSet:
return true, fn(&t.Spec.Template.Spec)
case *appsv1.DaemonSet:
return true, fn(&t.Spec.Template.Spec)
// ReplicaSet
case *extensionsv1beta1.ReplicaSet:
return true, fn(&t.Spec.Template.Spec)
case *appsv1beta2.ReplicaSet:
return true, fn(&t.Spec.Template.Spec)
case *appsv1.ReplicaSet:
return true, fn(&t.Spec.Template.Spec)
// StatefulSet
case *appsv1beta1.StatefulSet:
return true, fn(&t.Spec.Template.Spec)
case *appsv1beta2.StatefulSet:
return true, fn(&t.Spec.Template.Spec)
case *appsv1.StatefulSet:
return true, fn(&t.Spec.Template.Spec)
// Job
case *batchv1.Job:
return true, fn(&t.Spec.Template.Spec)
// CronJob
case *batchv1beta1.CronJob:
return true, fn(&t.Spec.JobTemplate.Spec.Template.Spec)
case *batchv2alpha1.CronJob:
return true, fn(&t.Spec.JobTemplate.Spec.Template.Spec)
default:
return false, fmt.Errorf("the object is not a pod or does not have a pod template: %T", t)
}
} |
|
app.d810b559cfa17730f4e3.js | webpackJsonp([0],{"/7ul":function(e,t,n){(function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})})(n("a2/B"))},"/DQ9":function(e,t,n){(function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function a(e,t,n,a){var i="";if(t)switch(n){case"s":i="काही सेकंद";break;case"ss":i="%d सेकंद";break;case"m":i="एक मिनिट";break;case"mm":i="%d मिनिटे";break;case"h":i="एक तास";break;case"hh":i="%d तास";break;case"d":i="एक दिवस";break;case"dd":i="%d दिवस";break;case"M":i="एक महिना";break;case"MM":i="%d महिने";break;case"y":i="एक वर्ष";break;case"yy":i="%d वर्षे"}else switch(n){case"s":i="काही सेकंदां";break;case"ss":i="%d सेकंदां";break;case"m":i="एका मिनिटा";break;case"mm":i="%d मिनिटां";break;case"h":i="एका तासा";break;case"hh":i="%d तासां";break;case"d":i="एका दिवसा";break;case"dd":i="%d दिवसां";break;case"M":i="एका महिन्या";break;case"MM":i="%d महिन्यां";break;case"y":i="एका वर्षा";break;case"yy":i="%d वर्षां"}return i.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात्री|सकाळी|दुपारी|सायंकाळी/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात्री"===t?e<4?e:e+12:"सकाळी"===t?e:"दुपारी"===t?e>=10?e:e+12:"सायंकाळी"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात्री":e<10?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})})(n("a2/B"))},"/Hq7":function(e,t,n){(function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"e":1===t?"a":2===t?"a":"e")},week:{dow:1,doy:4}})})(n("a2/B"))},"/w7L":function(e,t,n){"use strict";var a=n("S1cf");e.exports=a.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var a=e;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=a.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},"0M5F":function(e,t){},"0M7C":function(e,t,n){(function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"0u/o":function(e,t,n){(function(e){"use strict";e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysMin:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},week:{dow:1,doy:4}})})(n("a2/B"))},"10bh":function(e,t,n){(function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})})(n("a2/B"))},"11Zl":function(e,t){},"120n":function(e,t,n){(function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})})(n("a2/B"))},"1PI3":function(e,t,n){(function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})})(n("a2/B"))},"1YXd":function(e,t,n){(function(e){"use strict";function t(e,t,n){var a=e+" ";switch(n){case"ss":return a+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return t?"jedna minuta":"jedne minute";case"mm":return a+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return t?"jedan sat":"jednog sata";case"hh":return a+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return a+=1===e?"dan":"dana";case"MM":return a+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return a+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},"2HIi":function(e,t,n){(function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})})(n("a2/B"))},"2OKG":function(e,t,n){(function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})})(n("a2/B"))},"2fG9":function(e,t,n){(function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})})(n("a2/B"))},"2i0N":function(e,t,n){(function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})})(n("a2/B"))},"2oq1":function(e,t){},"35Mi":function(e,t){},"3IRi":function(e,t,n){(function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})})(n("a2/B"))},"3Ivx":function(e,t){},"3N6g":function(e,t,n){(function(e){"use strict";e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})})(n("a2/B"))},"3QCB":function(e,t,n){(function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minutt",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaði",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"3bIi":function(e,t,n){"use strict";var a=n("YdsM");e.exports=function(e,t,n,i){var s=new Error(e);return a(s,t,n,i)}},"3f83":function(e,t){},"3n5M":function(e,t,n){(function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd [je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasinta] dddd [je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",ss:"%d sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})})(n("a2/B"))},"45iH":function(e,t,n){(function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},a=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},i={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,r){var o=a(t),l=i[e][a(t)];return 2===o&&(l=l[n?0:1]),l.replace(/%d/i,t)}},r=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n("a2/B"))},"4X90":function(e,t,n){(function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})})(n("a2/B"))},"4dCI":function(e,t){},"6Ie+":function(e,t,n){(function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:0,doy:6}})})(n("a2/B"))},"6W3o":function(e,t,n){(function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],i=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n("a2/B"))},"6Xgp":function(e,t,n){(function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,a){var i=e;switch(n){case"s":return a||t?"néhány másodperc":"néhány másodperce";case"ss":return i+(a||t)?" másodperc":" másodperce";case"m":return"egy"+(a||t?" perc":" perce");case"mm":return i+(a||t?" perc":" perce");case"h":return"egy"+(a||t?" óra":" órája");case"hh":return i+(a||t?" óra":" órája");case"d":return"egy"+(a||t?" nap":" napja");case"dd":return i+(a||t?" nap":" napja");case"M":return"egy"+(a||t?" hónap":" hónapja");case"MM":return i+(a||t?" hónap":" hónapja");case"y":return"egy"+(a||t?" év":" éve");case"yy":return i+(a||t?" év":" éve")}return""}function a(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return a.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return a.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"6rrj":function(e,t,n){(function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"7/2Y":function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},"73tf":function(e,t,n){(function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})})(n("a2/B"))},"73uB":function(e,t){},"7DU0":function(e,t,n){(function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,a){return t?i(n)[0]:a?i(n)[1]:i(n)[2]}function a(e){return e%10==0||e>10&&e<20}function i(e){return t[e].split("_")}function s(e,t,s,r){var o=e+" ";return 1===e?o+n(0,t,s[0],r):t?o+(a(e)?i(s)[1]:i(s)[0]):r?o+i(s)[1]:o+(a(e)?i(s)[1]:i(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,a){return t?"kelios sekundės":a?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})})(n("a2/B"))},"7Tmb":function(e,t,n){(function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})})(n("a2/B"))},"7WWl":function(e,t,n){(function(e){"use strict";function t(e,t,n){var a,i;return"m"===n?t?"минута":"минуту":e+" "+(a=+e,i={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),a%10==1&&a%100!=11?i[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?i[1]:i[2])}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня в] LT",nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})})(n("a2/B"))},"83Hi":function(e,t,n){(function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})})(n("a2/B"))},"8Cm+":function(e,t,n){(function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})})(n("a2/B"))},"8SXr":function(e,t,n){(function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function a(e,a,i){return e+" "+n(t[i],e,a)}function i(e,a,i){return n(t[i],e,a)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:a,m:i,mm:a,h:i,hh:a,d:i,dd:a,M:i,MM:a,y:i,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"9+zJ":function(e,t){},"9MFc":function(e,t,n){(function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},dayOfMonthOrdinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(e){if(0===e)return e+"'ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})})(n("a2/B"))},"9ZXp":function(e,t){},"9fn0":function(e,t){},"9pW1":function(e,t){},"9qw1":function(e,t,n){(function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("hi",{months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})})(n("a2/B"))},"9s6H":function(e,t,n){(function(e){"use strict";function t(e,t,n){var a=e+" ";switch(n){case"ss":return a+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return t?"jedna minuta":"jedne minute";case"mm":return a+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return t?"jedan sat":"jednog sata";case"hh":return a+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return a+=1===e?"dan":"dana";case"MM":return a+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return a+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},ASJ1:function(e,t,n){(function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},Avko:function(e,t,n){"use strict";var a=n("aKwh"),i={data:function(){return{tags:"師培、教具、國小、偏鄉、國中、高中、大學、實驗教育、媒體".split("、"),tempSearchKeyword:"",coupontypes:[]}},computed:Object.assign({},Object(a.e)({menuState:function(e){return e.menuState},posts:function(e){return e.post.posts},searchKeyword:function(e){return e.searchKeyword},menuType:function(e){return e.menuType},mobile:function(e){return e.mobile},auth:function(e){return e.auth},token:function(e){return e.auth.token},news:function(e){return e.post.news},registExpo:function(e){return e.registExpo}}),{filteredPost:function(){var e=this;return this.posts.map(function(e){return Object.assign({},e,{tag:"ZA EXPO"})}).filter(function(t){return-1!=JSON.stringify(t).indexOf(e.searchKeyword)})},latestNews:function(){return this.news.slice(-1)[0]}},Object(a.c)({getUserPhoto:"auth/getUserPhoto",isAdmin:"auth/isAdmin"}),{registId:function(){return"Z"+("000000"+this.registExpo.id).slice(-3)}}),methods:Object.assign({},Object(a.d)(["setMenuState","setSearchKeyword","openMenu"]),Object(a.b)({register:"auth/register",login:"auth/login",logout:"auth/logout",loginFacebook:"auth/loginFacebook",authInit:"auth/init",loadRegistData:"loadRegistData"}),{postTarget:function(e){return"/expo/"+e.year+"/blog/"+e.id},hambergurAction:function(){this.menuState?this.setMenuState(!1):this.openMenu("nav")},loadAllCoupon:function(){var e=this;this.axios.post("/api/coupontype/user",{token:this.token}).then(function(t){e.coupontypes=t.data})}}),created:function(){this.loadRegistData()},watch:{}},s={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{container:"/member/registexpo2018"==this.$route.path}},[n("div",{key:e.menuState,staticClass:"row row-expo2018 text-left",on:{click:function(t){e.setMenuState(!1)}}},[n("div",{staticClass:"col-sm-6"},[n("router-link",{staticClass:"box big animated fadeIn delay-3",attrs:{to:"/member/registexpo"}},[n("div",{staticClass:"cover"},[n("div",{staticClass:"bg",style:e.bgcss("/static/img/regist2018/ZAEXPO.jpg")}),n("div",{staticClass:"infotext"},[n("span",[e._v(e._s(e.$t("menu.label_status"))+":"),n("br")]),e.registExpo.id?n("span",[e._v(e._s(e.$t("menu.status_registered")))]):n("span",[e._v(e._s(e.$t("menu.status_not_registered")))]),e.registExpo.is_foreign?e._e():n("span",[n("span",[e._v(" | ")]),e.registExpo.paid_record&&e.registExpo.paid_record.id?e._e():n("span",[e._v(e._s(e.$t("menu.expo_not_paid")))]),e.registExpo.paid_record&&!e.registExpo.paid_record.confirmed?n("span",[e._v(e._s(e.$t("menu.expo_paid_confirming")))]):e._e(),e.registExpo.paid_record&&e.registExpo.paid_record.confirmed?n("span",[e._v(e._s(e.$t("menu.expo_paid_confirmed")))]):e._e()])])]),n("div",{staticClass:"info"},[n("div",[n("h5",[e._v(e._s(e.$t("menu.label_registexpo")))]),!e.registExpo.id||e.registExpo.is_foreign||e.registExpo.paid_record&&e.registExpo.paid_record.confirmed?e._e():n("router-link",{staticClass:"float-right btn animated fadeIn delay-6",attrs:{to:"/member/registexpo/paid"}},[e._v("確認繳交報名費")])],1),e.registExpo?n("span",[e._v(e._s(e.$t("menu.regist_id"))+": "),e.registExpo.id?n("span",[e._v(e._s(e.registId))]):e._e()]):e._e(),n("br"),e.registExpo?n("span",[e._v(e._s(e.$t("menu.regist_name"))+": "),e.registExpo.id?n("span",[e._v(e._s(e.registExpo.name_cht||e.registExpo.name_eng))]):e._e()]):e._e()])])],1),n("div",{staticClass:"col-sm-6"},[n("router-link",{staticClass:"box animated fadeIn delay-9",attrs:{to:"/member/registexpo/workshop"}},[n("div",{staticClass:"cover"},[n("div",{staticClass:"bg",style:e.bgcss("/static/img/regist2018/ZAWORKSHOP.jpg")}),n("div",{staticClass:"infotext"},[n("span",[e._v(e._s(e.$t("menu.label_status"))+":")]),e.registExpo.id?n("span",[e.registExpo.regist_workshop?n("span",[e._v(e._s(e.$t("menu.status_registered")))]):n("span",[e._v(e._s(e.$t("menu.status_open_register")))])]):n("span",[e._v(e._s(e.$t("menu.regist_expo_first")))])])]),n("div",{staticClass:"info"},[e._v(" "+e._s(e.$t("menu.label_registexpoworkshop")))])]),n("router-link",{staticClass:"box",attrs:{to:"/member/registexpo/speak"}},[n("div",{staticClass:"cover"},[n("div",{staticClass:"bg",style:e.bgcss("/static/img/regist2018/Zac.jpg")}),n("div",{staticClass:"infotext"},[n("span",[e._v(e._s(e.$t("menu.label_status"))+":")]),e.registExpo.id?n("span",[e.registExpo.regist_expo_speak?n("span",[e._v(e._s(e.$t("menu.status_registered")))]):n("span",[e._v(e._s(e.$t("menu.status_open_register")))])]):n("span",[e._v(e._s(e.$t("menu.regist_expo_first")))])])]),n("div",{staticClass:"info"},[e._v(" "+e._s(e.$t("menu.label_registexpospeak")))])])],1)])])},staticRenderFns:[]};var r=n("VU/8")(i,s,!1,function(e){n("9fn0")},null,null);t.a=r.exports},BDwe:function(e,t){},BXyq:function(e,t,n){"use strict";(function(t){var a=n("S1cf"),i=n("M8l6"),s=/^\)\]\}',?\n/,r={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!a.isUndefined(e)&&a.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,u={adapter:("undefined"!=typeof XMLHttpRequest?l=n("KRuG"):void 0!==t&&(l=n("KRuG")),l),transformRequest:[function(e,t){return i(t,"Content-Type"),a.isFormData(e)||a.isArrayBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)?e:a.isArrayBufferView(e)?e.buffer:a.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):a.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(s,"");try{e=JSON.parse(e)}catch(e){}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},a.forEach(["delete","get","head"],function(e){u.headers[e]={}}),a.forEach(["post","put","patch"],function(e){u.headers[e]=a.merge(r)}),e.exports=u}).call(t,n("W2nU"))},Bevg:function(e,t,n){(function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})})(n("a2/B"))},BnaF:function(e,t){},CYiM:function(e,t,n){(function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_");e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"MMMM [de] D [de] YYYY",LLL:"MMMM [de] D [de] YYYY h:mm A",LLLL:"dddd, MMMM [de] D [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})})(n("a2/B"))},CuaM:function(e,t){},"D+VX":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("Dd8w"),i=n.n(a),s=n("dZBD"),r=n.n(s),o={namespaced:!0,state:{token:localStorage.zashare_auth_user_token||null,user:null,processing:!1,status:"",domain:"api/auth",jobcatas:["產業別","政府機關、公部門","非營利組織相關","教育業","學生","自由接案","大眾傳播、出版相關","設計與文創相關","藝術文化相關","流行與時尚文化相關","旅遊、休閒、運動產業","金融投顧、保險相關","法律相關","一般服務業","一般傳統製造","運輸物流、倉儲、貿易","農、林、漁、牧業","礦業土石、水電能源","建築營造、不動產相關","醫療照護、環境衛生","批發零售","電子科技、資訊、軟體、半導體","其他"],password_reset_success:null,resetToken:""},mutations:{setUserToken:function(e,t){e.token=t,localStorage.setItem("zashare_auth_user_token",e.token)},setResetToken:function(e,t){e.resetToken=t},setUser:function(e,t){e.user=t,e.user&&localStorage.setItem("zashare_auth_user_email",e.user.email)},setStatus:function(e,t){e.status=t,setTimeout(function(){e.status=""},4e3)},setProcessing:function(e,t){e.processing=t},setPasswordResetResult:function(e,t){e.password_reset_success=t}},actions:{init:function(e){e.state.token&&!window.queryObject.reset_token&&(e.commit("setProcessing",!0),e.dispatch("getUser")),window.queryObject.reset_token&&e.commit("setResetToken",window.queryObject.reset_token)},register:function(e,t){e.commit("setProcessing",!0),r.a.post(e.state.domain+"/register",t).then(function(t){e.commit("setUserToken",t.data),e.dispatch("getUser"),"fail"==t.data.status&&(console.log(t),e.commit("setProcessing",!1),e.commit("setStatus","member.login_fail"))}).catch(function(t){return console.log(t),e.commit("setProcessing",!1),e.commit("setStatus","member.login_fail"),{success:!1,log:t.data}})},login:function(e,t){e.commit("setProcessing",!0),r.a.post(e.state.domain+"/login",t).then(function(t){e.commit("setUserToken",t.data.access_token),e.dispatch("getUser")}).catch(function(t){e.commit("setProcessing",!1),e.commit("setStatus","member.login_fail")})},resetSendMail:function(e,t){e.commit("setProcessing",!0),r.a.post(e.state.domain+"/password/email",t).then(function(t){t.data.success?e.commit("setStatus","member.password_reset_email_sent"):e.commit("setStatus","member.password_reset_email_fail"),e.commit("setProcessing",!1),e.commit("setPasswordResetResult",!0)}).catch(function(t){e.commit("setProcessing",!1),e.commit("setStatus","member.password_reset_email_fail")})},resetPassword:function(e,t){var n=t.data,a=t.successHook,s=t.failHook;e.commit("setProcessing",!0),r()({method:"post",url:e.state.domain+"/password/reset",data:i()({},n,{token:e.state.resetToken}),headers:{"Content-Type":"application/json","Cache-Control":"no-cache"}}).then(function(t){t.data.success?(e.commit("setStatus","member.password_reset_success"),a&&a()):(e.commit("setStatus","member.password_reset_fail"),s&&s()),e.commit("setProcessing",!1)}).catch(function(t){e.commit("setProcessing",!1),e.commit("setStatus","member.password_reset_fail")})},getUser:function(e){r.a.post(e.state.domain+"/me",{token:e.state.token}).then(function(t){e.commit("setUser",t.data),e.commit("setProcessing",!1)}).catch(function(t){e.commit("setUserToken",""),e.commit("setProcessing",!1)})},logout:function(e){e.commit("setProcessing",!0),r.a.post(e.state.domain+"/logout",{token:e.state.token}).then(function(t){"success"==t.data.status&&(e.commit("setUser",null),e.commit("setUserToken",null),e.commit("setStatus","member.logout_success"),e.commit("setProcessing",!1))})},loginFacebook:function(e){window.open(e.state.domain+"/login/facebook")}},getters:{getUserPhoto:function(e){return"/static/img/Home/za-logo.svg"},canManage:function(e){return!!e.user&&("admin"==e.user.group||"editor"==e.user.group)},isAdmin:function(e){return!!e.user&&"admin"==e.user.group},userGroup:function(e){return e.user?e.user.group:null}}};t.default=o},DXXw:function(e,t,n){(function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,a,i){var s=function(e){var n=Math.floor(e%1e3/100),a=Math.floor(e%100/10),i=e%10,s="";n>0&&(s+=t[n]+"vatlh");a>0&&(s+=(""!==s?" ":"")+t[a]+"maH");i>0&&(s+=(""!==s?" ":"")+t[i]);return""===s?"pagh":s}(e);switch(a){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return t=-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return t=-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},DZlt:function(e,t,n){(function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần rồi lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n("a2/B"))},Dlsl:function(e,t){},Dnxv:function(e,t,n){(function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})})(n("a2/B"))},E5Ei:function(e,t){},EBDP:function(e,t,n){(function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_");function a(e){return e>1&&e<5&&1!=~~(e/10)}function i(e,t,n,i){var s=e+" ";switch(n){case"s":return t||i?"pár sekund":"pár sekundami";case"ss":return t||i?s+(a(e)?"sekundy":"sekund"):s+"sekundami";case"m":return t?"minuta":i?"minutu":"minutou";case"mm":return t||i?s+(a(e)?"minuty":"minut"):s+"minutami";case"h":return t?"hodina":i?"hodinu":"hodinou";case"hh":return t||i?s+(a(e)?"hodiny":"hodin"):s+"hodinami";case"d":return t||i?"den":"dnem";case"dd":return t||i?s+(a(e)?"dny":"dní"):s+"dny";case"M":return t||i?"měsíc":"měsícem";case"MM":return t||i?s+(a(e)?"měsíce":"měsíců"):s+"měsíci";case"y":return t||i?"rok":"rokem";case"yy":return t||i?s+(a(e)?"roky":"let"):s+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsParse:function(e,t){var n,a=[];for(n=0;n<12;n++)a[n]=new RegExp("^"+e[n]+"$|^"+t[n]+"$","i");return a}(t,n),shortMonthsParse:function(e){var t,n=[];for(t=0;t<12;t++)n[t]=new RegExp("^"+e[t]+"$","i");return n}(n),longMonthsParse:function(e){var t,n=[];for(t=0;t<12;t++)n[t]=new RegExp("^"+e[t]+"$","i");return n}(t),weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"ED/T":function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),a=0;a<n.length;a++)n[a]=arguments[a];return e.apply(t,n)}}},EIlw:function(e,t,n){(function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})})(n("a2/B"))},EgIa:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i=e+" ";switch(n){case"s":return t||a?"nekaj sekund":"nekaj sekundami";case"ss":return i+=1===e?t?"sekundo":"sekundi":2===e?t||a?"sekundi":"sekundah":e<5?t||a?"sekunde":"sekundah":"sekund";case"m":return t?"ena minuta":"eno minuto";case"mm":return i+=1===e?t?"minuta":"minuto":2===e?t||a?"minuti":"minutama":e<5?t||a?"minute":"minutami":t||a?"minut":"minutami";case"h":return t?"ena ura":"eno uro";case"hh":return i+=1===e?t?"ura":"uro":2===e?t||a?"uri":"urama":e<5?t||a?"ure":"urami":t||a?"ur":"urami";case"d":return t||a?"en dan":"enim dnem";case"dd":return i+=1===e?t||a?"dan":"dnem":2===e?t||a?"dni":"dnevoma":t||a?"dni":"dnevi";case"M":return t||a?"en mesec":"enim mesecem";case"MM":return i+=1===e?t||a?"mesec":"mesecem":2===e?t||a?"meseca":"mesecema":e<5?t||a?"mesece":"meseci":t||a?"mesecev":"meseci";case"y":return t||a?"eno leto":"enim letom";case"yy":return i+=1===e?t||a?"leto":"letom":2===e?t||a?"leti":"letoma":e<5?t||a?"leta":"leti":t||a?"let":"leti"}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},EhRq:function(e,t,n){(function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,a,i){var s=e+" ";switch(a){case"s":return n||i?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||i?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||i?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||i?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":i?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(i?"daga":"dögum"):n?s+"dagur":s+(i?"dag":"degi");case"M":return n?"mánuður":i?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(i?"mánuði":"mánuðum"):n?s+"mánuður":s+(i?"mánuð":"mánuði");case"y":return n||i?"ár":"ári";case"yy":return t(e)?s+(n||i?"ár":"árum"):s+(n||i?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"G/YP":function(e,t,n){(function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},a={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},i=function(e){return function(t,i,s,r){var o=n(t),l=a[e][n(t)];return 2===o&&(l=l[i?0:1]),l.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},week:{dow:6,doy:12}})})(n("a2/B"))},GuU2:function(e,t,n){(function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},Gz4Y:function(e,t,n){(function(e){"use strict";function t(e,t,n){var a,i;return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(a=+e,i={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),a%10==1&&a%100!=11?i[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?i[1]:i[2])}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})})(n("a2/B"))},H6Qo:function(e,t,n){"use strict";var a=n("S1cf");function i(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(a.isURLSearchParams(t))s=t.toString();else{var r=[];a.forEach(t,function(e,t){null!==e&&void 0!==e&&(a.isArray(e)&&(t+="[]"),a.isArray(e)||(e=[e]),a.forEach(e,function(e){a.isDate(e)?e=e.toISOString():a.isObject(e)&&(e=JSON.stringify(e)),r.push(i(t)+"="+i(e))}))}),s=r.join("&")}return s&&(e+=(-1===e.indexOf("?")?"?":"&")+s),e}},HMIw:function(e,t,n){(function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})})(n("a2/B"))},Hd19:function(e,t,n){(function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})})(n("a2/B"))},HlNk:function(e,t,n){(function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"birneçə saniyyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})})(n("a2/B"))},IcnI:function(e,t,n){"use strict";var a=n("fZjL"),i=n.n(a),s=n("mvHQ"),r=n.n(s),o=n("7+uW"),l=n("aKwh"),u=n("dZBD"),d=n.n(u),c=n("OYzn");o.default.use(l.a);var m=new l.a.Store({modules:{auth:n("D+VX").default,manage:n("KVdv").default,post:n("bM/P").default,scroll:n("gGLi").default},state:{themes:n("SPVK").default,menuState:!1,menuType:"search",mobile:window.innerWidth<1200,mobile_mask_show:!1,default_hashtags:"師培、教具、國小、偏鄉、國中、高中、大學、實驗教育、媒體、線上、空間、工作坊、技職、美感、文化、出走、輔導、maker、青少年、教師、親子、新媒體、影視、非營利、追求夢想、美感教育、思辨能力、性別平等、尊重生命、遊戲、感官體驗",loading:!0,searchKeyword:"",registExpo:{},expos:[]},mutations:{setMenuType:function(e,t){e.menuType=t},setMenuState:function(e,t){window.jf_menu_loaded=!0,1!=t||window.jf_menu_loaded||_jf.flush(),e.menuState=t,c.a.set(!e.menuState)},setLoading:function(e,t){e.loading=t},setMobileMask:function(e,t){e.mobile_mask_show=t},setMobile:function(e,t){e.mobile=t},setSearchKeyword:function(e,t){e.searchKeyword=t},openMenu:function(e,t){e.menuType=t,e.menuState=!0},updateRegistData:function(e,t){e.registExpo=t},setExpos:function(e,t){e.expos=t}},actions:{loadExpos:function(e,t){d.a.get("/api/expo").then(function(t){e.commit("setExpos",t.data)})},openSearch:function(e,t){e.state.searchKeyword=t,e.commit("setMenuState",!0)},loadRegistData:function(e,t){console.log(t),d.a.get("/api/registexpo/my",{params:{token:e.state.auth.token}}).then(function(t){t.data.regist_workshop&&t.data.regist_workshop.class_time&&(t.data.regist_workshop.class_time=JSON.parse(t.data.regist_workshop.class_time||[])),t.data&&(t.data.target_audience=t.data.target_audience?JSON.parse(t.data.target_audience):[],t.data.want_audience=t.data.want_audience?JSON.parse(t.data.want_audience):[],e.state.registExpo=t.data,console.log(t.data))})},updateRegistForm:function(e,t){var n=e.state.registExpo.id?d.a.patch:d.a.post,a=JSON.parse(r()(t.data)),s={};i()(a).filter(function(e){return null!==a[e]}).forEach(function(e){Array.isArray(a[e])&&(a[e]=r()(a[e])),s[e]=a[e]});["paid_record","regist_expo_speak","regist_workshop"].forEach(function(e){var t=s[e];t&&i()(t).filter(function(e){return null!==t[e]}).forEach(function(e){Array.isArray(t[e])&&(t[e]=r()(t[e]))})}),n("/api/registexpo",{token:e.state.auth.token,registexpo:s}).then(function(e){t.callback&&t.callback()}),e.dispatch("loadRegistData")}}});t.a=m},Iumh:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?i[n][0]:i[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},J0UG:function(e,t,n){(function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[Môre om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n("a2/B"))},Jg9m:function(e,t,n){(function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n("a2/B"))},KRuG:function(e,t,n){"use strict";var a=n("S1cf"),i=n("aS8y"),s=n("H6Qo"),r=n("ZeD7"),o=n("/w7L"),l=n("3bIi"),u="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n("mmkS");e.exports=function(e){return new Promise(function(t,d){var c=e.data,m=e.headers;a.isFormData(c)&&delete m["Content-Type"];var _=new XMLHttpRequest,p="onreadystatechange",h=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in _||o(e.url)||(_=new window.XDomainRequest,p="onload",h=!0,_.onprogress=function(){},_.ontimeout=function(){}),e.auth){var f=e.auth.username||"",g=e.auth.password||"";m.Authorization="Basic "+u(f+":"+g)}if(_.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),_.timeout=e.timeout,_[p]=function(){if(_&&(4===_.readyState||h)&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in _?r(_.getAllResponseHeaders()):null,a={data:e.responseType&&"text"!==e.responseType?_.response:_.responseText,status:1223===_.status?204:_.status,statusText:1223===_.status?"No Content":_.statusText,headers:n,config:e,request:_};i(t,d,a),_=null}},_.onerror=function(){d(l("Network Error",e)),_=null},_.ontimeout=function(){d(l("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED")),_=null},a.isStandardBrowserEnv()){var y=n("dn2M"),v=(e.withCredentials||o(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;v&&(m[e.xsrfHeaderName]=v)}if("setRequestHeader"in _&&a.forEach(m,function(e,t){void 0===c&&"content-type"===t.toLowerCase()?delete m[t]:_.setRequestHeader(t,e)}),e.withCredentials&&(_.withCredentials=!0),e.responseType)try{_.responseType=e.responseType}catch(e){if("json"!==_.responseType)throw e}"function"==typeof e.onDownloadProgress&&_.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){_&&(_.abort(),d(e),_=null)}),void 0===c&&(c=null),_.send(c)})}},KVdv:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("dZBD"),i=n.n(a),s={namespaced:!0,state:{posts:[],news:[],catas:[],companies:[]},mutations:{setPosts:function(e,t){e.posts=t},setNews:function(e,t){e.news=t},setCatas:function(e,t){e.catas=t},setCompanies:function(e,t){e.companies=t}},actions:{loadWebsite:function(e){e.dispatch("loadPosts")},loadPosts:function(e){i.a.get("/api/post").then(function(t){e.commit("setPosts",t.data)}),i.a.get("/api/news").then(function(t){e.commit("setNews",t.data)}),i.a.get("/api/cata").then(function(t){e.commit("setCatas",t.data)}),i.a.get("/api/company").then(function(t){e.commit("setCompanies",t.data)})}}};t.default=s},KyDR:function(e,t){},L6Cd:function(e,t,n){(function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})})(n("a2/B"))},LRz5:function(e,t,n){(function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})})(n("a2/B"))},Lpvo:function(e,t,n){(function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},M8l6:function(e,t,n){"use strict";var a=n("S1cf");e.exports=function(e,t){a.forEach(e,function(n,a){a!==t&&a.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[a])})}},NHnr:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("gRE1"),i=n.n(a),s=n("woOf"),r=n.n(s),o=(n("qb6w"),n("Dlsl"),n("tvR6"),n("zL8q")),l=n.n(o),u=n("gwsl"),d=n.n(u),c=n("OYzn"),m=n("7+uW"),_=n("aKwh"),p={name:"App",computed:Object.assign({},Object(_.e)(["menuState","mobile_mask_show","loading"]))},h={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{class:{noScroll:this.menuState},attrs:{id:"app"}},[t("transition",{attrs:{name:"fade"}},[this.loading?t("page_loading"):this._e()],1),t("transition",{attrs:{name:"page",mode:"out-in"}},[t("router-view",{key:this.$route.path})],1),t("navbar"),t("full_menu"),t("section_footer")],1)},staticRenderFns:[]};var f=n("VU/8")(p,h,!1,function(e){n("Qi2K")},null,null).exports,g=n("Gu7T"),y=n.n(g),v=n("/ocq"),b=n("IcnI"),M=n("7t+N"),w=n.n(M);m.default.use(v.a);var k=new v.a({mode:"history",routes:[].concat(y()(n("cKXs").default),[n("p9jn").default,n("ddSu").default])}),L={},x={};k.beforeEach(function(e,t,n){console.log(e),e.meta.preload_img&&console.log(e.meta.preload_img),e.path.indexOf("/manage"),0==e.path.indexOf("/manage")?c.a.set(!1):c.a.set(!0),L[t.path]=w()(window).scrollTop(),n()}),k.afterEach(function(e){(new WOW).init(),window.ga&&ga("send","pageview",e.path),L[e.path]?setTimeout(function(){console.log("Scroll To Saved Path:"+L[e.path]),w()("html, body").animate({scrollTop:L[e.path]},0)},0):(setTimeout(function(){console.log("Scroll To 0"),w()("html, body").animate({scrollTop:0},0)},0),x[e.path]||e.meta.no_font_flush||setTimeout(function(){_jf.flush(),window.jfFontLoaded&&(window.jfFontLoaded[e.path]=!0)},e.meta.font_flush_delay||200))});var T=k,Y=n("dZBD"),D=n.n(Y),S=n("Rf8U"),C=n.n(S);function j(e,t){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+e),t&&console.warn(t.stack))}function E(e){return null!==e&&"object"==typeof e}var P=Object.prototype.toString,O="[object Object]";function H(e){return P.call(e)===O}function A(e){return null===e||void 0===e}function F(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var n=null,a=null;return 1===e.length?E(e[0])||Array.isArray(e[0])?a=e[0]:"string"==typeof e[0]&&(n=e[0]):2===e.length&&("string"==typeof e[0]&&(n=e[0]),(E(e[1])||Array.isArray(e[1]))&&(a=e[1])),{locale:n,params:a}}function R(e,t){if(!e&&"string"!=typeof e)return null;var n=e.split("|");return n[t=function(e,t){return e=Math.abs(e),2===t?function(e){return e?e>1?1:0:1}(e):e?Math.min(e,2):0}(t,n.length)]?n[t].trim():e}function z(e){return JSON.parse(JSON.stringify(e))}var N=Object.prototype.hasOwnProperty;function W(e,t){return N.call(e,t)}function I(e){for(var t=arguments,n=Object(e),a=1;a<arguments.length;a++){var i=t[a];if(void 0!==i&&null!==i){var s=void 0;for(s in i)W(i,s)&&(E(i[s])?n[s]=I(n[s],i[s]):n[s]=i[s])}}return n}var q="undefined"!=typeof Intl&&void 0!==Intl.DateTimeFormat,B="undefined"!=typeof Intl&&void 0!==Intl.NumberFormat;var U,J={beforeCreate:function(){var e=this.$options;if(e.i18n=e.i18n||(e.__i18n?{}:null),e.i18n)if(e.i18n instanceof Me){if(e.__i18n)try{var t={};e.__i18n.forEach(function(e){t=I(t,JSON.parse(e))}),Object.keys(t).forEach(function(n){e.i18n.mergeLocaleMessage(n,t[n])})}catch(e){0}this._i18n=e.i18n,this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0}else if(H(e.i18n)){if(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Me&&(e.i18n.root=this.$root.$i18n,e.i18n.formatter=this.$root.$i18n.formatter,e.i18n.fallbackLocale=this.$root.$i18n.fallbackLocale,e.i18n.silentTranslationWarn=this.$root.$i18n.silentTranslationWarn),e.__i18n)try{var n={};e.__i18n.forEach(function(e){n=I(n,JSON.parse(e))}),e.i18n.messages=n}catch(e){0}this._i18n=new Me(e.i18n),this._i18nWatcher=this._i18n.watchI18nData(),this._i18n.subscribeDataChanging(this),this._subscribing=!0,(void 0===e.i18n.sync||e.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale())}else 0;else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Me?(this._i18n=this.$root.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0):e.parent&&e.parent.$i18n&&e.parent.$i18n instanceof Me&&(this._i18n=e.parent.$i18n,this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){this._i18n&&(this._subscribing&&(this._i18n.unsubscribeDataChanging(this),delete this._subscribing),this._i18nWatcher&&(this._i18nWatcher(),delete this._i18nWatcher),this._localeWatcher&&(this._localeWatcher(),delete this._localeWatcher),this._i18n=null)}},X={name:"i18n",functional:!0,props:{tag:{type:String,default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(e,t){var n=t.props,a=t.data,i=t.children,s=t.parent.$i18n;if(i=(i||[]).filter(function(e){return e.tag||(e.text=e.text.trim())}),!s)return i;var r=n.path,o=n.locale,l={},u=n.places||{},d=Array.isArray(u)?u.length>0:Object.keys(u).length>0,c=i.every(function(e){if(e.data&&e.data.attrs){var t=e.data.attrs.place;return void 0!==t&&""!==t}});return d&&i.length>0&&!c&&j("If places prop is set, all child elements must have place prop set."),Array.isArray(u)?u.forEach(function(e,t){l[t]=e}):Object.keys(u).forEach(function(e){l[e]=u[e]}),i.forEach(function(e,t){var n=c?""+e.data.attrs.place:""+t;l[n]=e}),e(n.tag,a,s.i(r,o,l))}};function V(e,t,n){K(e,n)&&Q(e,t,n)}function Z(e,t,n,a){K(e,n)&&(function(e,t){var n=t.context;return e._locale===n.$i18n.locale}(e,n)&&function e(t,n){if(t===n)return!0;var a=E(t),i=E(n);if(!a||!i)return!a&&!i&&String(t)===String(n);try{var s=Array.isArray(t),r=Array.isArray(n);if(s&&r)return t.length===n.length&&t.every(function(t,a){return e(t,n[a])});if(s||r)return!1;var o=Object.keys(t),l=Object.keys(n);return o.length===l.length&&o.every(function(a){return e(t[a],n[a])})}catch(e){return!1}}(t.value,t.oldValue)||Q(e,t,n))}function G(e,t,n,a){K(e,n)&&(e.textContent="",e._vt=void 0,delete e._vt,e._locale=void 0,delete e._locale)}function K(e,t){var n=t.context;return n?!!n.$i18n||(j("not exist VueI18n instance in Vue instance"),!1):(j("not exist Vue instance in VNode context"),!1)}function Q(e,t,n){var a,i,s=function(e){var t,n,a,i;"string"==typeof e?t=e:H(e)&&(t=e.path,n=e.locale,a=e.args,i=e.choice);return{path:t,locale:n,args:a,choice:i}}(t.value),r=s.path,o=s.locale,l=s.args,u=s.choice;if(r||o||l)if(r){var d=n.context;e._vt=e.textContent=u?(a=d.$i18n).tc.apply(a,[r,u].concat(ee(o,l))):(i=d.$i18n).t.apply(i,[r].concat(ee(o,l))),e._locale=d.$i18n.locale}else j("required `path` in v-t directive");else j("not support value type")}function ee(e,t){var n=[];return e&&n.push(e),t&&(Array.isArray(t)||H(t))&&n.push(t),n}function te(e){(U=e).version&&Number(U.version.split(".")[0]);te.installed=!0,Object.defineProperty(U.prototype,"$i18n",{get:function(){return this._i18n}}),function(e){Object.defineProperty(e.prototype,"$t",{get:function(){var e=this;return function(t){for(var n=[],a=arguments.length-1;a-- >0;)n[a]=arguments[a+1];var i=e.$i18n;return i._t.apply(i,[t,i.locale,i._getMessages(),e].concat(n))}}}),Object.defineProperty(e.prototype,"$tc",{get:function(){var e=this;return function(t,n){for(var a=[],i=arguments.length-2;i-- >0;)a[i]=arguments[i+2];var s=e.$i18n;return s._tc.apply(s,[t,s.locale,s._getMessages(),e,n].concat(a))}}}),Object.defineProperty(e.prototype,"$te",{get:function(){var e=this;return function(t,n){var a=e.$i18n;return a._te(t,a.locale,a._getMessages(),n)}}}),Object.defineProperty(e.prototype,"$d",{get:function(){var e=this;return function(t){for(var n,a=[],i=arguments.length-1;i-- >0;)a[i]=arguments[i+1];return(n=e.$i18n).d.apply(n,[t].concat(a))}}}),Object.defineProperty(e.prototype,"$n",{get:function(){var e=this;return function(t){for(var n,a=[],i=arguments.length-1;i-- >0;)a[i]=arguments[i+1];return(n=e.$i18n).n.apply(n,[t].concat(a))}}})}(U),U.mixin(J),U.directive("t",{bind:V,update:Z,unbind:G}),U.component(X.name,X);var t=U.config.optionMergeStrategies;t.i18n=t.methods}var ne=function(){this._caches=Object.create(null)};ne.prototype.interpolate=function(e,t){if(!t)return[e];var n=this._caches[e];return n||(n=function(e){var t=[],n=0,a="";for(;n<e.length;){var i=e[n++];if("{"===i){a&&t.push({type:"text",value:a}),a="";var s="";for(i=e[n++];"}"!==i;)s+=i,i=e[n++];var r=ae.test(s)?"list":ie.test(s)?"named":"unknown";t.push({value:s,type:r})}else"%"===i?"{"!==e[n]&&(a+=i):a+=i}return a&&t.push({type:"text",value:a}),t}(e),this._caches[e]=n),function(e,t){var n=[],a=0,i=Array.isArray(t)?"list":E(t)?"named":"unknown";if("unknown"===i)return n;for(;a<e.length;){var s=e[a];switch(s.type){case"text":n.push(s.value);break;case"list":n.push(t[parseInt(s.value,10)]);break;case"named":"named"===i&&n.push(t[s.value]);break;case"unknown":0}a++}return n}(n,t)};var ae=/^(\d)+/,ie=/^(\w)+/;var se=0,re=1,oe=2,le=3,ue=0,de=4,ce=5,me=6,_e=7,pe=8,he=[];he[ue]={ws:[ue],ident:[3,se],"[":[de],eof:[_e]},he[1]={ws:[1],".":[2],"[":[de],eof:[_e]},he[2]={ws:[2],ident:[3,se],0:[3,se],number:[3,se]},he[3]={ident:[3,se],0:[3,se],number:[3,se],ws:[1,re],".":[2,re],"[":[de,re],eof:[_e,re]},he[de]={"'":[ce,se],'"':[me,se],"[":[de,oe],"]":[1,le],eof:pe,else:[de,se]},he[ce]={"'":[de,se],eof:pe,else:[ce,se]},he[me]={'"':[de,se],eof:pe,else:[me,se]};var fe=/^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function ge(e){if(void 0===e||null===e)return"eof";var t=e.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return e;case 95:case 36:case 45:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&t<=122||t>=65&&t<=90?"ident":t>=49&&t<=57?"number":"else"}function ye(e){var t,n,a,i=e.trim();return("0"!==e.charAt(0)||!isNaN(e))&&(a=i,fe.test(a)?(n=(t=i).charCodeAt(0))!==t.charCodeAt(t.length-1)||34!==n&&39!==n?t:t.slice(1,-1):"*"+i)}var ve=function(){this._cache=Object.create(null)};ve.prototype.parsePath=function(e){var t=this._cache[e];return t||(t=function(e){var t,n,a,i,s,r,o,l=[],u=-1,d=ue,c=0,m=[];function _(){var t=e[u+1];if(d===ce&&"'"===t||d===me&&'"'===t)return u++,a="\\"+t,m[se](),!0}for(m[re]=function(){void 0!==n&&(l.push(n),n=void 0)},m[se]=function(){void 0===n?n=a:n+=a},m[oe]=function(){m[se](),c++},m[le]=function(){if(c>0)c--,d=de,m[se]();else{if(c=0,!1===(n=ye(n)))return!1;m[re]()}};null!==d;)if("\\"!==(t=e[++u])||!_()){if(i=ge(t),(s=(o=he[d])[i]||o.else||pe)===pe)return;if(d=s[0],(r=m[s[1]])&&(a=void 0===(a=s[2])?t:a,!1===r()))return;if(d===_e)return l}}(e))&&(this._cache[e]=t),t||[]},ve.prototype.getPathValue=function(e,t){if(!E(e))return null;var n,a=this.parsePath(t);if(n=a,Array.isArray(n)&&0===n.length)return null;for(var i=a.length,s=e,r=0;r<i;){var o=s[a[r]];if(void 0===o){s=null;break}s=o,r++}return s};var be=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher"],Me=function(e){var t=this;void 0===e&&(e={}),!U&&"undefined"!=typeof window&&window.Vue&&te(window.Vue);var n=e.locale||"en-US",a=e.fallbackLocale||"en-US",i=e.messages||{},s=e.dateTimeFormats||{},r=e.numberFormats||{};this._vm=null,this._formatter=e.formatter||new ne,this._missing=e.missing||null,this._root=e.root||null,this._sync=void 0===e.sync||!!e.sync,this._fallbackRoot=void 0===e.fallbackRoot||!!e.fallbackRoot,this._silentTranslationWarn=void 0!==e.silentTranslationWarn&&!!e.silentTranslationWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new ve,this._dataListeners=[],this._exist=function(e,n){return!(!e||!n)&&!A(t._path.getPathValue(e,n))},this._initVM({locale:n,fallbackLocale:a,messages:i,dateTimeFormats:s,numberFormats:r})},we={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0}};Me.prototype._initVM=function(e){var t=U.config.silent;U.config.silent=!0,this._vm=new U({data:e}),U.config.silent=t},Me.prototype.subscribeDataChanging=function(e){this._dataListeners.push(e)},Me.prototype.unsubscribeDataChanging=function(e){!function(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)e.splice(n,1)}}(this._dataListeners,e)},Me.prototype.watchI18nData=function(){var e=this;return this._vm.$watch("$data",function(){for(var t=e._dataListeners.length;t--;)U.nextTick(function(){e._dataListeners[t]&&e._dataListeners[t].$forceUpdate()})},{deep:!0})},Me.prototype.watchLocale=function(){if(!this._sync||!this._root)return null;var e=this._vm;return this._root.vm.$watch("locale",function(t){e.$set(e,"locale",t),e.$forceUpdate()},{immediate:!0})},we.vm.get=function(){return this._vm},we.messages.get=function(){return z(this._getMessages())},we.dateTimeFormats.get=function(){return z(this._getDateTimeFormats())},we.numberFormats.get=function(){return z(this._getNumberFormats())},we.locale.get=function(){return this._vm.locale},we.locale.set=function(e){this._vm.$set(this._vm,"locale",e)},we.fallbackLocale.get=function(){return this._vm.fallbackLocale},we.fallbackLocale.set=function(e){this._vm.$set(this._vm,"fallbackLocale",e)},we.missing.get=function(){return this._missing},we.missing.set=function(e){this._missing=e},we.formatter.get=function(){return this._formatter},we.formatter.set=function(e){this._formatter=e},we.silentTranslationWarn.get=function(){return this._silentTranslationWarn},we.silentTranslationWarn.set=function(e){this._silentTranslationWarn=e},Me.prototype._getMessages=function(){return this._vm.messages},Me.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},Me.prototype._getNumberFormats=function(){return this._vm.numberFormats},Me.prototype._warnDefault=function(e,t,n,a,i){if(!A(n))return n;if(this._missing){var s=this._missing.apply(null,[e,t,a,i]);if("string"==typeof s)return s}else 0;return t},Me.prototype._isFallbackRoot=function(e){return!e&&!A(this._root)&&this._fallbackRoot},Me.prototype._interpolate=function(e,t,n,a,i,s){if(!t)return null;var r,o=this._path.getPathValue(t,n);if(Array.isArray(o)||H(o))return o;if(A(o)){if(!H(t))return null;if("string"!=typeof(r=t[n]))return null}else{if("string"!=typeof o)return null;r=o}return r.indexOf("@:")>=0&&(r=this._link(e,t,r,a,i,s)),this._render(r,i,s)},Me.prototype._link=function(e,t,n,a,i,s){var r=n,o=r.match(/(@:[\w\-_|.]+)/g);for(var l in o)if(o.hasOwnProperty(l)){var u=o[l],d=u.substr(2),c=this._interpolate(e,t,d,a,"raw"===i?"string":i,"raw"===i?void 0:s);if(this._isFallbackRoot(c)){if(!this._root)throw Error("unexpected error");var m=this._root;c=m._translate(m._getMessages(),m.locale,m.fallbackLocale,d,a,i,s)}r=(c=this._warnDefault(e,d,c,a,Array.isArray(s)?s:[s]))?r.replace(u,c):r}return r},Me.prototype._render=function(e,t,n){var a=this._formatter.interpolate(e,n);return"string"===t?a.join(""):a},Me.prototype._translate=function(e,t,n,a,i,s,r){var o=this._interpolate(t,e[t],a,i,s,r);return A(o)&&A(o=this._interpolate(n,e[n],a,i,s,r))?null:o},Me.prototype._t=function(e,t,n,a){for(var i,s=[],r=arguments.length-4;r-- >0;)s[r]=arguments[r+4];if(!e)return"";var o=F.apply(void 0,s),l=o.locale||t,u=this._translate(n,l,this.fallbackLocale,e,a,"string",o.params);if(this._isFallbackRoot(u)){if(!this._root)throw Error("unexpected error");return(i=this._root).t.apply(i,[e].concat(s))}return this._warnDefault(l,e,u,a,s)},Me.prototype.t=function(e){for(var t,n=[],a=arguments.length-1;a-- >0;)n[a]=arguments[a+1];return(t=this)._t.apply(t,[e,this.locale,this._getMessages(),null].concat(n))},Me.prototype._i=function(e,t,n,a,i){var s=this._translate(n,t,this.fallbackLocale,e,a,"raw",i);if(this._isFallbackRoot(s)){if(!this._root)throw Error("unexpected error");return this._root.i(e,t,i)}return this._warnDefault(t,e,s,a,[i])},Me.prototype.i=function(e,t,n){return e?("string"!=typeof t&&(t=this.locale),this._i(e,t,this._getMessages(),null,n)):""},Me.prototype._tc=function(e,t,n,a,i){for(var s,r=[],o=arguments.length-5;o-- >0;)r[o]=arguments[o+5];return e?(void 0===i&&(i=1),R((s=this)._t.apply(s,[e,t,n,a].concat(r)),i)):""},Me.prototype.tc=function(e,t){for(var n,a=[],i=arguments.length-2;i-- >0;)a[i]=arguments[i+2];return(n=this)._tc.apply(n,[e,this.locale,this._getMessages(),null,t].concat(a))},Me.prototype._te=function(e,t,n){for(var a=[],i=arguments.length-3;i-- >0;)a[i]=arguments[i+3];var s=F.apply(void 0,a).locale||t;return this._exist(n[s],e)},Me.prototype.te=function(e,t){return this._te(e,this.locale,this._getMessages(),t)},Me.prototype.getLocaleMessage=function(e){return z(this._vm.messages[e]||{})},Me.prototype.setLocaleMessage=function(e,t){this._vm.$set(this._vm.messages,e,t)},Me.prototype.mergeLocaleMessage=function(e,t){this._vm.$set(this._vm.messages,e,U.util.extend(this._vm.messages[e]||{},t))},Me.prototype.getDateTimeFormat=function(e){return z(this._vm.dateTimeFormats[e]||{})},Me.prototype.setDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,t)},Me.prototype.mergeDateTimeFormat=function(e,t){this._vm.$set(this._vm.dateTimeFormats,e,U.util.extend(this._vm.dateTimeFormats[e]||{},t))},Me.prototype._localizeDateTime=function(e,t,n,a,i){var s=t,r=a[s];if((A(r)||A(r[i]))&&(r=a[s=n]),A(r)||A(r[i]))return null;var o=r[i],l=s+"__"+i,u=this._dateTimeFormatters[l];return u||(u=this._dateTimeFormatters[l]=new Intl.DateTimeFormat(s,o)),u.format(e)},Me.prototype._d=function(e,t,n){if(!n)return new Intl.DateTimeFormat(t).format(e);var a=this._localizeDateTime(e,t,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(a)){if(!this._root)throw Error("unexpected error");return this._root.d(e,n,t)}return a||""},Me.prototype.d=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];var a=this.locale,i=null;return 1===t.length?"string"==typeof t[0]?i=t[0]:E(t[0])&&(t[0].locale&&(a=t[0].locale),t[0].key&&(i=t[0].key)):2===t.length&&("string"==typeof t[0]&&(i=t[0]),"string"==typeof t[1]&&(a=t[1])),this._d(e,a,i)},Me.prototype.getNumberFormat=function(e){return z(this._vm.numberFormats[e]||{})},Me.prototype.setNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,t)},Me.prototype.mergeNumberFormat=function(e,t){this._vm.$set(this._vm.numberFormats,e,U.util.extend(this._vm.numberFormats[e]||{},t))},Me.prototype._localizeNumber=function(e,t,n,a,i,s){var r=t,o=a[r];if((A(o)||A(o[i]))&&(o=a[r=n]),A(o)||A(o[i]))return null;var l,u=o[i];if(s)l=new Intl.NumberFormat(r,Object.assign({},u,s));else{var d=r+"__"+i;(l=this._numberFormatters[d])||(l=this._numberFormatters[d]=new Intl.NumberFormat(r,u))}return l.format(e)},Me.prototype._n=function(e,t,n,a){if(!n)return(a?new Intl.NumberFormat(t,a):new Intl.NumberFormat(t)).format(e);var i=this._localizeNumber(e,t,this.fallbackLocale,this._getNumberFormats(),n,a);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.n(e,Object.assign({},{key:n,locale:t},a))}return i||""},Me.prototype.n=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];var a=this.locale,i=null,s=null;return 1===t.length?"string"==typeof t[0]?i=t[0]:E(t[0])&&(t[0].locale&&(a=t[0].locale),t[0].key&&(i=t[0].key),s=Object.keys(t[0]).reduce(function(e,n){var a;return be.includes(n)?Object.assign({},e,((a={})[n]=t[0][n],a)):e},null)):2===t.length&&("string"==typeof t[0]&&(i=t[0]),"string"==typeof t[1]&&(a=t[1])),this._n(e,a,i,s)},Object.defineProperties(Me.prototype,we),Me.availabilities={dateTimeFormat:q,numberFormat:B},Me.install=te,Me.version="7.8.1";var ke=Me,Le=n("bOdI"),xe=n.n(Le),Te={global:{name:"雜學校"},pages:{about:"關於雜學校",expo:"歷屆展覽"},footer:{zacourse:"雜選課 ZA COURSE",zarev:"雜學起義 ZA SHARE Revolution",website:"網站製作:墨雨設計 Monoame Design",copywrite:"© 2018 雜學校 Za Share All Rights Reserved."},member:{user:"帳號",password:"密碼",email:"信箱",logout:"登出",setting:"設定",hello:"Hello ! 雜學校學生 ",login_fail:"登入失敗..",logout_success:"已成功登出!",change_password:"修改密碼",expo_handbook_url:"/static/2018雜學校徵件手冊中文版.pdf",form:{login:{title:"登入雜學校",not_logined:"這名學生未登入哦!",user:"帳號",password:"密碼",login:"登入",forget:"忘記密碼",register:"註冊為雜學校學生"},register:{title:"會員註冊",email:"電子郵件(登入帳號)",name:"名字",name_explain:"※若您持有「雜學校學生證」,請務必填寫您的真實姓名,方便核對身分及保障您的權益。",jobcata:"現職產業別",jobcatas:[{label:"政府機關、公部門",value:"政府機關、公部門"},{label:"非營利組織相關",value:"非營利組織相關"},{label:"教育業",value:"教育業"},{label:"學生",value:"學生"},{label:"自由接案",value:"自由接案"},{label:"大眾傳播、出版相關",value:"大眾傳播、出版相關"},{label:"設計與文創相關",value:"設計與文創相關"},{label:"藝術文化相關",value:"藝術文化相關"},{label:"流行與時尚文化相關",value:"流行與時尚文化相關"},{label:"旅遊、休閒、運動產業",value:"旅遊、休閒、運動產業"},{label:"金融投顧、保險相關",value:"金融投顧、保險相關"},{label:"法律相關",value:"法律相關"},{label:"一般服務業",value:"一般服務業"},{label:"一般傳統製造",value:"一般傳統製造"},{label:"運輸物流、倉儲、貿易",value:"運輸物流、倉儲、貿易"},{label:"農、林、漁、牧業",value:"農、林、漁、牧業"},{label:"礦業土石、水電能源",value:"礦業土石、水電能源"},{label:"建築營造、不動產相關",value:"建築營造、不動產相關"},{label:"醫療照護、環境衛生",value:"醫療照護、環境衛生"},{label:"批發零售",value:"批發零售"},{label:"電子科技、資訊、軟體、半導體",value:"電子科技、資訊、軟體、半導體"},{label:"其他",value:"其他"}],job:"職稱",phone:"電話",birthday:"生日",password:"密碼",confirm_password:"再次輸入密碼",regist:"註冊",have_account:"我已經有帳號了!前往登入",register_time:"註冊時間",account_type:"帳號類別",update:"更新會員資料"}},password_reset_email_sent:"重設連結已傳送到您的信箱!",password_reset_email_fail:"找不到對應的會員資料..",password_reset_success:"密碼重設成功!請關閉後重新登入",password_reset_fail:"密碼重設失敗",reset_send_email_title:"雜學校會員密碼重設要求",reset_password_title:"雜學校會員密碼重設",btn_reset:"重設密碼",btn_send_reset_link:"傳送重設連結",notify_not_enter_fullwidth:"請勿輸入全形文字"},nav:xe()({login:"登入",logout:"登出",register:"註冊",about:"關於雜學校",expo:"歷屆展覽",shop:"線上商店",search:"搜尋全站",manage:"會員管理",hello:"Hello 雜學校學生"},"search","搜尋雜學校"),menu:{hello:"Hello ",logout:"登出",profile:"學生資訊",label_id:"會員ID碼",manage:"管理",label_student_card:"學生證資訊",label_card_register_name:"登記名",label_card_id:"學生證卡號",label_card_level:"學生證級別",label_card_date:"會員效期",label_card_level_member:"會員",label_card_level_old:"創校元老",label_occupation:"現職產業別",label_position:"現職職稱",label_email:"聯絡信箱",label_birthday:"生日",label_phone:"聯絡電話",label_status:"申請狀態",label_registexpo:"參展申請",label_registexpospeak:"Zac. 教育新創短講評選",label_registexpoworkshop:"雜工坊",label_expo_regist_end:"2018 年 6 月 15 日 申請截止",status_registered:"已報名",status_not_registered:"未報名",status_open_register:"開放報名",regist_id:"參展編碼",regist_name:"參展單位名稱",regist_expo_first:"需先報名參展",expo_not_paid:"未繳費",expo_paid_confirming:"確認中",expo_paid_confirmed:"已繳費",news_title:"雜學校公布欄",label_coupon:"序號",get_coupon:"點擊以索取兌課序號",coupon_cannot_get:"無法領取(不符合資格)",title_coupon_zacourse:"ZA COURSE",title_coupon_normal:"雜學優惠禮遇",register_mobile_warning:"請改以電腦操作申請,以利完成報名程序。",modify:"修改",update_member_data:"會員資料修改"},page_news:{title:"文章"},page_about:{sub_slogan:"”奇幻繽紛的場景及融入生活的探索, 將教育與文化的多元串聯成亞洲最具影響力的創新會展品牌。”",numberlabels:["博覽會屆數","報名件數","入選團隊","海外城市串聯參與","累計觀展人數","網路社群觸及人次"],content:["雜學,是未來人才的基本能力,多樣多元的聚集混種才能有肥沃的土壤造就人才創新的生態。這是一所以城市為單位,以生活為內容,以人為主體的社會學校。ZA是雜的音譯,也是從Z到A由下而上的概念,SHARE 是各種串連與分享。","雜學校是從台灣民間發起教育文化創新的社會運動,由蘇仰志先生於2015年創立,希望建構一個讓1-99歲能找到生命熱情的各種學習路徑的烏托邦。因此籌備一年一度的創新教育博覽會,公開徵集了華人世界各種非典型教育與文化的創新,透過全新的策展思維創造出一個多元多樣的舞台,打破框架讓人與人在這各種跨域的串連與交流中共好,同時讓更多的探索與驚喜發生,促使教育轉化為多樣生活型態的獨創展現,培養更多人才與機會的可能。持續建構起教育新創加速器,協助更多教育創新理念與新創事業,往創辦的初心一步一步邁進:「如果每一個人都可以在熱情裡面做事,這個社會將會有多強大」!"],themes:["Imagine 打開想像","Explore 探索","Diversify 使其多元"],title_brand:"品牌大事記",expos:[{year:2017,title:"雜學校第二屆",subtitle:"年度精神提倡「有敢擇學 」",features:["包下整個華山園區,創下五萬人次觀展紀錄","首創新創教育DemoDay"],report_cover:"/static/img/ZA EXPO/index/ZAexpo-banner-2017-2.jpg"},{year:2016,title:"雜學校第ㄧ屆",subtitle:"年度精神提倡「學你想學、學你想成為。 」",features:["第一次售票,並創下華山單日售票最高紀錄","成為亞洲最大量體創新教育博覽會"],report_cover:"/static/img/ZA EXPO/index/ZAexpo-banner-2016-2.jpg"},{year:2015,title:"雜學校前身 不太乖教育節",subtitle:"年度精神提倡「乖乖做自己 」",features:["全臺首次發起全公益非典型教育新創展覽","獲選華山本土最佳展覽品牌"],report_cover:"/static/img/ZA EXPO/index/ZAexpo-banner-2015-2.jpg"}]},form:{label_next:"下一步",label_back:"上一步",label_submit:"確認送出",label_upload:"點擊上傳",step_confirm:"確認與送出",step_complete:"報名完成",confirm_dialog_title:"確認送出?送出將無法更改",confirm_dialog_content:"最後確認",confirm_dialog_yes:"確定",confirm_dialog_no:"取消",update_success:"資料更新成功",update_cancel:"已取消",data_not_complete:"資料填寫不完整或格式錯誤,請往前填寫完整後再送出"},regist_expo:{title:"2018 雜學校報名表單",sub_title:"為避免報名失敗,請務必先行詳閱徵展手冊中相關規範、時程與流程。",confirm_title:"恭喜你即將完成參展報名申請!",confirm_text:"請再次確認所有填寫資料後按下「確認送出」,並於三日內繳交報名費,才算完成所有報名手續呦!<br>*海外參展者(含中國、港、澳等地區)享「免報名費」優惠。<br><br>報名費繳款帳戶:<br>銀行名稱-第一銀行永春分行 (007)<br>帳戶名稱-雜學股份有限公司<br>帳號-157-10-029362<br><br>遞交報名申請後,將由主辦單位以E-mail回覆收到線上報名資料,及提供上列報名費繳費資訊。若提交後三日內未收到相關回覆,請主動聯繫主辦單位查詢。<br><br>我確認資料已經正確無誤,送出後將無法修改<br>",complete_text:"謝謝你願意和我們一同為教育而努力!<br>最後甄選入選名單將於2018/07/10公布在官方網站。<br><br>如欲報名「ZA WORKSHOP 雜工坊」及「Zac. 教育新創短講評選」請繼續填寫表單:",sections:[{title:"ㄧ、參展資訊",id:0,required:!0,questions:[{title:"1. 申請攤位類型",type:"select",prop:"type",options:[{label:"基礎單位 (1m*1m 限高2.5m)",value:"基礎單位 (1m*1m 限高2.5m)"},{label:"標準單位 (2m*3m 限高2.5m)",value:"標準單位 (2m*3m 限高2.5m)"},{label:"進階單位 (2m*6m 限高2.5m)",value:"進階單位 (2m*6m 限高2.5m)"}]},{title:"2. 申請類別(主辦方保留最後分配權)",type:"select",prop:"theme",options:[{label:"教育創新",value:"教育創新"},{label:"文化實踐",value:"文化實踐"},{label:"生活探索",value:"生活探索"},{label:"專業培育",value:"專業培育"}]},{title:"3. 是否曾參展雜學校?",type:"select",prop:"attended",explain:"若參展過2屆以上,請填寫「最近一次」的參展年份。",options:[{label:"首次參展",value:"首次參展"},{label:"2015不太乖教育節",value:"2015不太乖教育節"},{label:"2016雜學校",value:"2016雜學校"},{label:"2017雜學校",value:"2017雜學校"}]},{title:"4. 單位/個人所在國家及地區",type:"select",prop:"is_foreign",options:[{label:"台灣",value:0},{label:"海外",value:1}]},{title:"5. 請填寫所在國家/城市",prop:"foreign_country",display:function(e){return 1==e.is_foreign}}]},{title:"二、申請單位資訊",id:1,required:!0,questions:[{title:"1. 申請單位/個人名稱 - 中文",prop:"name_cht"},{title:"1. 申請單位/個人名稱 - 英文",prop:"name_eng"},{title:"2. 申請單位/個人簡介 (請以200-300字讓我們能更認識你)",type:"textarea",prop:"description",settings:{maxlength:300}},{title:"3. 你目前所經營/接觸的目標受眾(取前2個最接近的對話群、消費群)",type:"select",prop:"target_audience",settings:{multiple:!0,"multiple-limit":2},options:["學齡前幼兒","國小生","國中生","高中生","自學生","大專以上學生","職場新鮮人","青壯年","家長","教育工作者","投資人","創業者","學校單位","公部門","其他"]},{title:"4. 最希望在雜學校接觸/開放的目標受眾(取前2個最想開發的對話群、消費群)",type:"select",prop:"want_audience",settings:{multiple:!0,"multiple-limit":2},options:["學齡前幼兒","國小生","國中生","高中生","自學生","大專以上學生","職場新鮮人","青壯年","家長","教育工作者","投資人","創業者","學校單位","公部門","其他"]},{title:"5. 是否在展位進行銷售行為?",type:"select",prop:"have_sell",options:[{label:"是(請於參展規劃簡報中介紹商品與現場售價)",value:1},{label:"否",value:0}]},{title:"6. 請以一份20頁(內)電子簡報檔闡述參展規劃(主辦單位將以此份檔案作為雜星賞評選依據)",type:"file",prop:"file_proposal",explain:"建議內容設定:<br> 一、品牌/團隊/個人介紹\n <br> 二、闡述自身教育觀點理念或與創新教育關聯性(參展雜學校原因)\n <br> 三、本次參展主題或議題設定(如本次展出重點與品牌本身並無直接關聯,可詳加補述)\n <br> 四、參展內容企劃與呈現方式(本次展出的亮點以及會如何執行與呈現)\n <br> 五、展位內互動體驗或活動規劃(須為不影響人流動線的體驗或活動)\n <br> 六、展位規劃示意圖\n <br> 七、過往參展經驗或活動成果\n <br> 八、如會在展位現場進行銷售或名單資料搜集,需提交商品介紹與現場售價或名單搜集方式(例如遊戲互動、傳單、coupon)\n <br> 請務必輸出成pdf格式,並確認檔案大小在20MB限制內。若檔案不符導致系統無法存取,主辦方將不另行確認及通知。"},{title:"7. 請簡述參與雜學校的原因(100字以內)",type:"textarea",prop:"attend_reason",settings:{maxlength:100}},{title:"8. 備註-其他補充事項(200字以內)",type:"textarea",required:!1,prop:"other",settings:{maxlength:200}}]},{title:"三、參展聯絡資料",id:2,required:!0,questions:[{title:"1. 主要聯絡人姓名(請優先填寫執行窗口)",prop:"main_contact_name"},{title:"手機",prop:"main_contact_phone"},{title:"Email",prop:"main_contact_email"},{title:"2. 次要聯絡人",prop:"secondary_contact_name"},{title:"手機",prop:"secondary_contact_phone"},{title:"Email",prop:"secondary_contact_email"}]}]},regist_expoworkshop:{title:"雜工坊申請表",sub_title:"每一工坊場次時限為90 分鐘( 含進、退場時間)、可容納座位數30 人為上限。<br>如成功登記到雜工坊場次,開課單位須支付10, 000 元場次費,並由主辦單位統籌各場次報名、收費(每一參與者收500 元 / 場)事宜,如課堂衍生材料須由開課單位協力提供。( 詳細說明請見徵展手冊 P.18)",confirm_title:"恭喜你即將完成雜工坊申請!",confirm_text:"請再次確認所有填寫資料後按下「確認送出」,主辦單位收到提案申請後將以E-mail回覆確認。若提交後三日內未收到相關回覆,請主動聯繫主辦單位查詢。",complete_text:"謝謝貴團隊的用心籌劃!<br>最後甄選結果與場次安排將於2018/07/10公布在官方網站。",sections:[{id:0,title:"ㄧ、申請基本資訊",required:!0,questions:[{title:"1. 課程類型",type:"select",prop:"class_type",options:["藝術體驗創作","傳統工藝教學","互動式教學","科學動手實驗","創新教案分享與教學","小型分享座談","戶外活動","其他"]},{title:"2. 活動招生族群",prop:"class_audience",required:!1,explain:"請填寫是否有報名身份、年齡等限制資格,如為限定親子參加、指定年齡層等請簡述。",settings:{placeholder:"無限制(一般大眾皆可)"}},{title:"3.\t活動預計招生人數(場地建議容納人數以30人為限)",type:"number",prop:"class_person_count",settings:{max:30}},{title:"4. 登記場次",type:"select",explain:"請複選可配合安排之場次,若確定有登記到工坊場次,主辦單位會以此做為時段安排的參考。 ",prop:"class_time",settings:{multiple:!0},options:["10/5 (五) 13:00-14:30","10/5 (五) 15:00-16:30","10/5 (五) 17:00-18:30","10/6 (六) 10:00-11:30","10/6 (六) 13:00-14:30","10/6 (六) 15:00-16:30","10/6 (六) 17:00-18:30","10/7 (日) 10:00-11:30","10/7 (日) 13:00-14:30","10/7 (日) 15:00-16:30","10/7 (日) 17:00-18:30"]},{title:"5. 檢附一份10頁(內)提案活動企劃書(主辦單位將以此份檔案作為「雜工坊」徵選依據。)",type:"file",prop:"class_proposal",explain:"建議內容設定:\n <br>一、背景介紹(含品牌/團隊/講師介紹)\n <br>二、主題或議題設定(如本次體驗活動重點與品牌本身並無直接關聯,可詳加補述)\n <br>三、活動內容(目標族群、活動企劃、執行方式、人力分工配置等)\n <br>四、過往活動經驗或舉辦成果\n <br> 請務必輸出成pdf格式,並確認檔案大小在20MB限制內。若檔案不符導致系統無法存取,主辦方將不另行確認及通知。"}]},{title:"二、工坊聯絡資料",id:1,required:!0,questions:[{title:"1. 主要聯絡人姓名(請優先填寫執行窗口)",prop:"main_contact_name"},{title:"手機",prop:"main_contact_phone"},{title:"Email",prop:"main_contact_email"},{title:"2. 次要聯絡人",prop:"secondary_contact_name"},{title:"手機",prop:"secondary_contact_phone"},{title:"Email",prop:"secondary_contact_email"}]}]},regist_expospeak:{title:"Zac. 教育新創短講評選申請表",sub_title:"雜學校設法創造一個能提供實質資源的公開平台,透過Zac. 徵選,邀請通過初選之10 組入圍團隊(每一參與者均收21,000 元/ 展位)將移展至「雜學校概念館 」,由雜學校團隊量身訂製策展規劃,不只提供行銷與曝光的舞台,並讓其他參展團隊、記者媒體、貴賓等也有一個很棒的觀摩機會!(詳細參與辦法及相關評選內容請見徵展手冊 P.19)",confirm_title:"恭喜你即將完成「Zac. 教育新創短講評選」申請!",confirm_text:"請再次確認所有填寫資料後按下「確認送出」,主辦單位收到提案申請後將以E-mail回覆確認。若提交後三日內未收到相關回覆,請主動聯繫主辦單位查詢。",complete_text:"謝謝貴團隊的用心籌劃!<br>最後甄選結果與場次安排將於2018/07/10公布在官方網站。",sections:[{title:"ㄧ、申請基本資訊",id:0,required:!0,questions:[{title:"1. 評選入圍之單位,是否同意策展權益交由給主辦單位規劃與設計",type:"select",prop:"agree_plan",options:[{label:"是,移展至雜學校概念館(由雜學校團隊量身規劃展位)",value:1},{label:"否,維持在雜博覽展出(參展團隊自行規劃展位)",value:0}]},{title:"2. 團隊人數",type:"number",prop:"team_person_count"},{title:"3. 是否已有獲得資金挹注",type:"select",prop:"has_money",options:[{label:"是",value:1},{label:"否",value:0}]}]},{title:"二、申請資料填寫",id:1,required:!0,questions:[{title:"1. 請簡述你的具體創業內容(200-300字內)",type:"textarea",prop:"startup_content",settings:{maxlength:300}},{title:"2. 請簡述你的目標族群(200-300字內)",type:"textarea",prop:"startup_audience",settings:{maxlength:300}},{title:"3. 請簡述你目前的創業困境(200-300字內)",type:"textarea",prop:"startup_difficult",settings:{maxlength:300}},{title:"4. 請敘述你想解決的教育問題(200-300字內)",type:"textarea",prop:"startup_problem",settings:{maxlength:300}},{title:"5. 請敘述你認為團隊/產品賦予社會的影響力是(200-300字內)",type:"textarea",prop:"startup_power",settings:{maxlength:300}},{title:"6. 請檢附一份20頁(內)提案計畫書(主辦單位將以此份檔案作為「Zac.新創教育短講評選」初選評比依據。)",type:"file",prop:"startup_proposal",explain:"建議內容設定:<br>一、背景介紹(含品牌/ 團隊介紹)\n <br>二、創業目標\n <br>三、創業內容(目標市場、族群、競爭力分析等)\n <br>四、實施方法(目前發展狀況、商業模式、成果等)\n <br>五、執行期程與規劃\n <br>六、人力配置\n <br>七、預算分配及運用\n <br>八、風險評估\n <br>九、預期效益\n <br>請務必輸出成pdf格式,並確認檔案大小在20MB限制內。若檔案不符導致系統無法存取,主辦方將不另行確認及通知。"}]},{title:"三、申請人聯絡資料",id:2,required:!0,questions:[{title:"1. 主要聯絡人姓名(請優先填寫執行窗口)",prop:"main_contact_name"},{title:"手機",prop:"main_contact_phone"},{title:"Email",prop:"main_contact_email"},{title:"2. 次要聯絡人",prop:"secondary_contact_name"},{title:"手機",prop:"secondary_contact_phone"},{title:"Email",prop:"secondary_contact_email"}]}]}},Ye=n("mvHQ"),De=n.n(Ye),Se=n("pFYg"),Ce=n.n(Se),je=n("fZjL"),Ee=n.n(je),Pe={global:{name:"ZA SHARE"},pages:{about:"About ZASHARE",expo:"Past EXPOs"},footer:{zacourse:"ZA COURSE",zarev:"ZA SHARE Revolution",website:"Website created by Monoame Design Studio",copywrite:"© 2018 ZA SHARE All Rights Reserved."},member:{user:"Account",password:"Password",email:"Email",logout:"Logout",setting:"Settings",hello:"Hello ! ",login_fail:"Login Failed.",logout_success:"Logout successfully!",change_password:"Change Password",expo_handbook_url:"/static/2018-ZA%20SHARE-English%20Manual.pdf",form:{login:{title:"Login ZASHARE",not_logined:"You are not logged in.",user:"Account",password:"Password",login:"Login",forget:"Forget password",register:"Member registration"},register:{title:"Member Registration",email:"Email(Account)",name:"Name",name_explain:'If you had "ZASHARE" student card, please register with your real name to use student features.',jobcata:"Current industry",jobcatas:[{value:"政府機關、公部門",label:"Government, public sector"},{value:"非營利組織相關",label:"NGO, NPO, Religious Organizations"},{value:"教育業",label:"Academic institutions, Education and Related Clerks"},{value:"學生",label:"Student"},{value:"自由接案",label:"Freelancer"},{value:"大眾傳播、出版相關",label:"Marketing Professional, Publishing Activities"},{value:"設計與文創相關",label:"Cultural and Creative Industry"},{value:"藝術文化相關",label:"Creative, Arts and Entertainment Activities"},{value:"流行與時尚文化相關",label:"Fashion, Hairdressing and Other Beauty Treatment"},{value:"旅遊、休閒、運動產業 ",label:" Tourism, Sports Activities and Amusement and Recreation Activities"},{value:"金融投顧、保險相關",label:"Financial Leasing and Insurance"},{value:"法律相關",label:"Legal Professionals"},{value:"一般服務業",label:"Service and Sales Work"},{value:"一般傳統製造",label:"Manufacturing"},{value:"運輸物流、倉儲、貿易",label:"Transportation and Storage"},{value:"農、林、漁、牧業",label:"Agriculture, Forestry, Fishing and Animal Husbandry"},{value:"礦業土石、水電能源",label:"Mining and Quarrying"},{value:"建築營造、不動產相關",label:"Building Frame, Real Estate Activities and Related Trades Work"},{value:"醫療照護、環境衛生",label:"Health service, Social welfare, Environment welfare"},{value:"批發零售",label:"Wholesale and Retail Trade"},{value:"電子科技、資訊、軟體、半導體",label:"Software Developers and Programmers"},{value:"其他",label:"Other"}],job:"Job",phone:"Phone",birthday:"Birthday",password:"Password",confirm_password:"Password Confirmation",regist:"Register",have_account:"I have an account! Go to login.",register_time:"Registration time",account_type:"Account type",update:"Update member information"}},password_reset_email_sent:"Reset link has been sent to your email!",password_reset_email_fail:"Cannot find user record",password_reset_success:"Reset password successfully! Please close and login.",password_reset_fail:"Reset password fail.",reset_send_email_title:"ZA SHARE Reset Password Request",reset_password_title:"ZA SHARE Reset Password",btn_reset:"Reset Password",btn_send_reset_link:"Send Reset Link",notify_not_enter_fullwidth:"Please do not enter full-width char."},nav:xe()({about:"About ZA SHARE",expo:"Past EXPOS",shop:"Online Shop",search:"Search Site",manage:"Manage",hello:"Hi ",login:"Login",logout:"Logout"},"search","Search site"),menu:{hello:"Hi ",logout:"Log out",profile:"Profile",label_id:"ID Number",manage:"Manage",label_student_card:"Student Card Information",label_card_register_name:"Registered name",label_card_id:"Student Card ID",label_card_level:"Student Card type",label_card_date:"Expiry date",label_card_level_member:"Member",label_card_level_old:"Pioneers",label_occupation:"Present Occupation",label_position:"Current Position",label_email:"Email",label_birthday:"Birthday",label_phone:"Phone",label_status:"Status",label_registexpo:"Expo Application",label_registexpospeak:"Zac. (ZA-accelerator) Demo",label_registexpoworkshop:"ZA WORKSHOP",label_expo_regist_end:"Deadline:2018.06.15",status_registered:"Registered",status_not_registered:"Not Registered",status_open_register:"Now accepting",regist_id:"Application Number",regist_name:"Application Name",regist_expo_first:"Please regist EXPO first",expo_not_paid:"Unpaid",expo_paid_confirming:"Confirming by Organizer",expo_paid_confirmed:"Paid",news_title:"ZA SHARE News",label_coupon:"Coupon",get_coupon:"Click to get coupon",coupon_cannot_get:"Not qualified",title_coupon_zacourse:"ZA COURSE",title_coupon_normal:"ZA COUPON",register_mobile_warning:"Please use computer to complete the registration process.",modify:"Modify",update_member_data:"Update member information"},page_news:{title:"Posts"},page_about:{sub_slogan:"” ZA SHARE setup fantastic scenes and explorations into life, connecting the diversity of education and culture to be recognized as Asia’s most influential innovation and exhibition brand.”",numberlabels:["previous expos","participated teams","participated teams","cities oversea took part","expo visitors accumulated","online community reach"],content:["Broad-based learning is a fundamental ability for future talent. Only with diversity and dissimilarity, can fertile ground for talent innovation be created.ZA SHARE is a social school that uses cities as units, everyday life as content and people as core.ZA is the transliteration of the Chinese word for ‘comprehensiveness’ and from Z to A, it implies engagement from the bottom - up, whereas SHARE indicates connection and sharing.","ZA SHARE is a grassroots movement for the innovation of education and culture\n in Taiwan.It was established by Ozzie Su in 2015, who longed to build a utopia with a\nvariety of learning pathways that allowed people aged 1-99 to find their life passion.\n Thus, he recruited non-traditional educational and cultural creativity from Chinese\nsociety and organized a yearly expo for innovative education.Using brand new\n curating practices, ZA SHARE is a unique platform for exhibitors from various\nbackgrounds to work together and exchange ideas without boundaries.This also\nallows exploration and surprises to happen, which is a catalyst for the\ntransformation of education into diverse lifestyles and for talent cultivation.\n Furthermore, ZA SHARE continued to set up an education startup accelerator,\n assisting businesses with innovative educational philosophies to develop their\nstartup step by step.“If everyone could work out of passion, the society would be so\nmuch more powerful.”"],themes:["Imagine","Explore","Diversify"],title_brand:"Past EXPOS",expos:[{year:2017,title:"2nd ZA SHARE EXPO",subtitle:"The attitude of the year promotes <br>“My Braveducation”",features:["Reserved all exhibition spaces in Huashan 1914 Creative Park and set a record-breaking visitor number of fifty thousand people","Originator of Innovative Education DemoDay"],report_cover:"/static/img/ZA EXPO/index/ZAexpo-banner-2017-2.jpg"},{year:2016,title:"1nd ZA SHARE EXPO",subtitle:"The attitude of the year promotes <br>“Learn to be, not taught to fit.”",features:["First ticket sale, setting the record for the highest single day gross in Huashan’s history","Became the largest innovative education expo in Asia"],report_cover:"/static/img/ZA EXPO/index/ZAexpo-banner-2016-2.jpg"},{year:2015,title:"Predecessor of ZA SHARE EXPO - NAUGHTY EDUCATION FEST",subtitle:"The attitude of the year promotes <br>“Behaving yourself by being yourself”",features:["First charitable non-traditional educational innovation expo in Taiwan","Named as Huasan’s Best Local Exposition Brand"],report_cover:"/static/img/ZA EXPO/index/ZAexpo-banner-2015-2.jpg"}]},form:{label_next:"Next",label_back:"Back",label_submit:"Submit",label_upload:"Upload file",step_confirm:"Confirmation",step_complete:"Submit completed",confirm_dialog_title:"Are you sure to submit? You will not be able to edit the data after confirmation.",confirm_dialog_content:"Final confirmation",confirm_dialog_yes:"Confirm",confirm_dialog_no:"Cancel",update_success:"Data uploaded",update_cancel:"Cancel",data_not_complete:"Data not required or wrong format, please check the form again."},regist_expo:{title:"Exhibition Application Form",sub_title:"To make sure of successful registration, refer to the regulations, schedule and process in the exhibition manual.",confirm_title:"It's almost completed!",confirm_text:"Please reconfirm your application, and press the “Submit” button.<br>We will send the application confirmed e-mail within three days. <br>If you do not receive the reply within three days, don’t hesitate to reach out to the organizer.<br><br>I confirmed that the application has been corrected and completed. It will not be modifiable after submit.",complete_text:'Thank you for creating the better education with us.<br>The result will be announced at 07/10(Tue).<br>It will be reveal on the "ZA SHARE" official website.',sections:[{title:"A. Exhibition information",id:0,required:!0,questions:[{title:"1. Booth type",prop:"type",options:[{label:"Basic booth(width 1m x depth 1m x height 2.5m)",value:"基礎單位 (1m*1m 限高2.5m)"},{label:"Standard booth(width 3m x depth 2m x height 2.5m)",value:"標準單位 (2m*3m 限高2.5m)"},{label:"Advanced booth(width 6m x depth 2m x height 2.5m)",value:"進階單位 (2m*6m 限高2.5m)"}]},{title:"2. Exhibitor category (The organizer reserves the ultimate right to assign the exhibitor to specific categories)",prop:"theme",options:[{label:"Education innovation",value:"教育創新"},{label:"Cultural practice",value:"文化實踐"},{label:"Life exploration",value:"生活探索"},{label:"Professional training",value:"專業培育"}]},{title:"3. Have you participated in Za Share’s past exhibitions ?",explain:"",prop:"attended",options:[{label:"First - timer",value:"首次參展"},{label:"2015 Naughty Education Fest",value:"2015不太乖教育節"},{label:"2016 ZA SHARE EXPO",value:"2016雜學校"},{label:"2017 ZA SHARE EXPO",value:"2017雜學校"}]},{title:"4. Which the group or individual is from?",type:"select",prop:"is_foreign",options:[{label:"Taiwan",value:0},{label:"overseas",value:1}]},{title:"5. The country/city you currently lived in or your group located at",prop:"foreign_country",display:function(e){return 1==e.is_foreign}}]},{title:"B. Applicant Information",id:1,required:!0,questions:[{title:"1. Name",prop:"name_eng"},{title:"2. Self-introduction (50-80 words)",type:"textarea",prop:"description",settings:{maxlength:300}},{title:"3. Your current target audience (choose two most relevant groups)",type:"select",prop:"target_audience",settings:{multiple:!0,"multiple-limit":2},options:[{label:"Pre - schoolers",value:"學齡前幼兒"},{label:"elementary students",value:"國小生"},{label:"junior high students",value:"國中生"},{label:"senior high students",value:"高中生"},{label:"homeschoolers",value:"自學生"},{label:"college and above students",value:"大專以上學生"},{label:"fresh graduates",value:"職場新鮮人"},{label:"young adults",value:"青壯年"},{label:"parents",value:"家長"},{label:"educators",value:"教育工作者"},{label:"investors",value:"投資人"},{label:"entrepreneurs",value:"創業者"},{label:"schools",value:"學校單位"},{label:"public sector",value:"公部門"},{label:"others",value:"其他"}]},{title:"4. Target audience you wish to approach at Za Share (choose two most desired groups)",type:"select",prop:"want_audience",settings:{multiple:!0,"multiple-limit":2},options:[{label:"Pre - schoolers",value:"學齡前幼兒"},{label:"elementary students",value:"國小生"},{label:"junior high students",value:"國中生"},{label:"senior high students",value:"高中生"},{label:"homeschoolers",value:"自學生"},{label:"college and above students",value:"大專以上學生"},{label:"fresh graduates",value:"職場新鮮人"},{label:"young adults",value:"青壯年"},{label:"parents",value:"家長"},{label:"educators",value:"教育工作者"},{label:"investors",value:"投資人"},{label:"entrepreneurs",value:"創業者"},{label:"schools",value:"學校單位"},{label:"public sector",value:"公部門"},{label:"others",value:"其他"}]},{title:"5. Selling at the exhibition?",type:"select",prop:"have_sell",options:[{label:"Yes (include your products and prices in the application proposal presentation)",value:1},{label:"No",value:0}]},{title:"6. Talk about your exhibition plan in a presentation with no more than 20 slides. (The organizer will select Za Star Award winners based on the document)",type:"file",prop:"file_proposal",explain:"File size: 20MB / PDF format only\n <br>\n <br>Suggested outline:\n <br>1. Brand/team/individual introduction\n <br>2. Your views on education and relevance to educational innovation (reason for participation in the exhibition)\n <br>3. Your exhibition theme or issue to address (if your theme is not directly related to your brand, you may elaborate on it)\n <br>4. Your exhibition content and presentation (your focal point for the exhibition and how you will present it)\n <br>5. Your interactive experience or activity planning in booth (which shall not affect the flow of foot traffic)\n <br>6. Booth design\n <br>7. Past exhibition experiences or activity results\n <br>8. If you’d like to sell products or collect personal information, please tell us about your products, prices or ways of collecting personal information such as games, flyers and coupons.\n "},{title:"7. Why you want to participate in the exhibition? (50 words)",type:"textarea",prop:"attend_reason",settings:{maxlength:100}},{title:"8. Any other information? (50 words) ",type:"textarea",required:!1,prop:"other",settings:{maxlength:200}}]},{title:"C. Contact Information",id:2,required:!0,questions:[{title:"1. Primary contact person Name(designated individual preferred)",prop:"main_contact_name"},{title:"Mobile number",prop:"main_contact_phone"},{title:"Email",prop:"main_contact_email"},{title:"2. Secondary contact person Name",prop:"secondary_contact_name"},{title:"Mobile number",prop:"secondary_contact_phone"},{title:"Email",prop:"secondary_contact_email"}]}]},regist_expoworkshop:{title:"Za Workshop Application Form",sub_title:"Every workshop session lasts 90 minutes including entering and exiting the venue and accommodates up to 30 people.<br><br>The exhibitors need to pay USD 380 per session and provide relevant course materials if any.The organizer is responsible for session registration and payment collection(TWD 500 per session for each participant.) (For more information, refer to p.18 of the manual)",confirm_title:"It's almost completed!",confirm_text:"Please reconfirm your application, and press the “Submit” button.<br>We will send the application confirmed e-mail within three days. <br>If you do not receive the reply within three days, don’t hesitate to reach out to the organizer.<br><br>I confirmed that the application has been corrected and completed. It will not be modifiable after submit.",complete_text:'Thank you for preparing.<br>The result will be announced at 07/10(Tue).It will be reveal on the " Za Share " official website.',sections:[{id:0,title:"A. Basic Information",questions:[{title:"1.\tSession types",type:"select",prop:"class_type",options:[{label:"Art creation",value:"藝術體驗創作"},{label:"Traditional craft education",value:"傳統工藝教學"},{label:"Interactive teaching",value:"互動式教學"},{label:"Science experiment",value:"科學動手實驗"},{label:"Innovative teaching plan sharing",value:"創新教案分享與教學"},{label:"Small - scale panel discussion",value:"小型分享座談"},{label:"Outdoor course",value:"戶外活動"},{label:"Others",value:"其他 "}]},{title:"2.\tParticipant eligibility",prop:"class_audience",explain:"Any eligibility requirements such as status or age? For family only or for a specific age group, please write down your requirements",required:!1,settings:{placeholder:"No limitations (open to public)"}},{title:"3.\tEstimated number of participants",type:"number",prop:"class_person_count",explain:"The venue can accommodate up to 30 people.",settings:{max:30}},{title:"4.\tPreferred sessions",type:"select",explain:"Select multiple sessions for possible arrangement. The organizer has the right for final review and decision-making, and the exhibitor may not oppose to the decision made.",prop:"class_time",settings:{multiple:!0},options:[{label:"10 / 5(Fri) 13: 00 - 14: 30",value:"10/5 (五) 13:00-14:30"},{label:"10 / 5(Fri) 15: 00 - 16: 30",value:"10/5 (五) 15:00-16:30"},{label:"10 / 5(Fri) 17: 00 - 18: 30",value:"10/5 (五) 17:00-18:30"},{label:"10 / 6(Sat) 10: 00 - 11: 30",value:"10/6 (六) 10:00-11:30"},{label:"10 / 6(Sat) 13: 00 - 14: 30",value:"10/6 (六) 13:00-14:30"},{label:"10 / 6(Sat) 15: 00 - 16: 30",value:"10/6 (六) 15:00-16:30"},{label:"10 / 6(Sat) 17: 00 - 18: 30",value:"10/6 (六) 17:00-18:30"},{label:"10 / 7(Sun) 10: 00 - 11: 30",value:"10/7 (日) 10:00-11:30"},{label:"10 / 7(Sun) 13: 00 - 14: 30",value:"10/7 (日) 13:00-14:30"},{label:"10 / 7(Sun) 15: 00 - 16: 30",value:"10/7 (日) 15:00-16:30"},{label:"10 / 7(Sun) 17: 00 - 18: 30",value:"10/7 (日) 17:00-18:30"}]},{title:"5. Talk about your activity proposal with no more than 10 pages. (The organizer will select Za Workshop winners based on the document)",type:"file",prop:"class_proposal",explain:"File size: 20MB / PDF format only<br>\n<br>\n<br>Suggested outline: \n<br>1. Background introduction including you brand / team / lecturer\n<br>2. Your theme or issue to address (if your theme is not directly related to your brand, you may elaborate on it)\n<br>3. Activity content including target audience, activity planning, execution and division of labor\n<br>4. Past exhibition experiences or activity results\n"}]},{title:"B. Contact Information",id:1,required:!0,questions:[{title:"1. Primary contact person Name(designated individual preferred)",prop:"main_contact_name"},{title:"Mobile number",prop:"main_contact_phone"},{title:"Email",prop:"main_contact_email"},{title:"2. Secondary contact person Name",prop:"secondary_contact_name"},{title:"Mobile number",prop:"secondary_contact_phone"},{title:"Email",prop:"secondary_contact_email"}]}]},regist_expospeak:{title:"Zac. Demo Day Application Form ",sub_title:"Za Share tries to create an open, resource-abundant platform. Ten nominees will exhibit in Za Concept Exhibition and the organizer will specially curate an exhibition for them. Every nominee will be charged USD 750 for customized booth space. This will not only serve as a platform for marketing exposure but also provide an opportunity for them to be observed by other exhibitors, members of the press and our VIPs. (For information about application and selection, refer to p.19 of the manual)",confirm_title:"It's almost completed!",confirm_text:"Please reconfirm your application, and press the “Submit” button.<br>We will send the application confirmed e-mail within three days. <br>If you do not receive the reply within three days, don’t hesitate to reach out to the organizer.<br><br>I confirmed that the application has been corrected and completed. It will not be modifiable after submit.",complete_text:'Thank you for preparing.<br>The result will be announced at 07/10(Tue).It will be reveal on the " Za Share " official website.',sections:[{title:"A. Basic Information",id:0,required:!0,questions:[{title:"1.\tIf nominated, do you agree to have the organizer design for you?",type:"select",prop:"agree_plan",options:[{label:"Yes, I will exhibit in Za Concept Exhibition. (Za Share will specially curate an exhibition for the nominees)",value:1},{label:"No, I wish to stay in ZA EXPO. (Exhibitors design their own booths)",value:0}]},{title:"2.\tNumber of team members",type:"number",prop:"team_person_count"},{title:"3.\tHave you received any investment?",type:"select",prop:"has_money",options:[{label:"No",value:1},{label:"Yes",value:0}]}]},{title:"B. Help us to get to know you more",id:1,required:!0,questions:[{title:"1.\tDescribe the content of your business (50-80 words)",type:"textarea",prop:"startup_content",settings:{maxlength:300}},{title:"2.\tDescribe your target audience (50-80 words)",type:"textarea",prop:"startup_audience",settings:{maxlength:300}},{title:"3.\tDescribe the difficulties you are encountering (50-80 words)",type:"textarea",prop:"startup_difficult",settings:{maxlength:300}},{title:"4.\tDescribe the education issues you wish to address (50-80 words)",type:"textarea",prop:"startup_problem",settings:{maxlength:300}},{title:"5.\tWhat impact will your team/products bring to society? (50-80 words)",type:"textarea",prop:"startup_power",settings:{maxlength:300}},{title:"6. Talk about your pitch proposal in a presentation with no more than 20 slides. (The organizer will select Zac. nominees based on the document)<br><br>File size: 20MB / PDF format only",type:"file",prop:"startup_proposal",explain:"Suggested outline: \n<br>1. Background introduction including your brand/team\n<br>2. Business objectives\n<br>3. Content of your business (target market, segmentation, competitive analysis)\n<br>4. Implementation (current development, business model, achievements)\n<br>5. Implementation milestones and planning\n<br>6. Human resource allocation\n<br>7. Budget allocation and usage\n<br>8. Risk evaluation\n<br>9. Expected results\n"}]},{title:"C. Contact Information",id:2,required:!0,questions:[{title:"1. Primary contact person Name(designated individual preferred)",prop:"main_contact_name"},{title:"Mobile number",prop:"main_contact_phone"},{title:"Email",prop:"main_contact_email"},{title:"2. Secondary contact person Name",prop:"secondary_contact_name"},{title:"Mobile number",prop:"secondary_contact_phone"},{title:"Email",prop:"secondary_contact_email"}]}]}};["regist_expo"].forEach(function(e){function t(e,t){Ee()(e).forEach(function(n){"object"!==Ce()(e[n])&&(t[n]=e[n])})}Te[e].sections.forEach(function(n){var a=Pe[e].sections.find(function(e){return e.id==n.id}),i=Pe[e].sections.find(function(e){return e.id==n.id})||{questions:[]},s=JSON.parse(De()(n));t(i,s),t(s,i),a||Pe[e].sections.push(s),s.questions.forEach(function(e){i.questions.find(function(t){return t.prop==e.prop});var n=i.questions.find(function(t){return t.prop==e.prop})||{};t(n,e),t(e,n)})})});var Oe={zh:Te,en:Pe},He=n("AYPi"),Ae=n.n(He),Fe={render:function(){this.$createElement;this._self._c;return this._m(0)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page page-loading"},[t("img",{staticClass:"animated fadeIn animated",attrs:{src:"https://service.zashare.org/img/2017/index_za_logo_white.svg"}})])}]};var $e=n("VU/8")({},Fe,!1,function(e){n("Zms0")},null,null).exports,Re={computed:Object.assign({},Object(_.e)(["themes","auth"]),{theme:function(){var e=this;return this.themes.find(function(t){return t.title.toLowerCase()==e.$route.path.split("/")[1]})||{}},navbarStyle:function(){var e=this.$route.meta.navWidth||"450px";return{width:e,right:"left"!=this.$route.meta.navPosition?"0px":"calc(100% - "+e+")",display:0==this.$route.path.indexOf("/manage")?"none":"block"}},upCircleTo:function(){return"/"==this.$route.path?"/expo":"theme"==this.$route.meta.type?"/":void 0},mobile_nav_style:function(){var e=0;return 0==this.$route.path.indexOf("/expo")&&(e=-5),0==this.$route.path.indexOf("/base")&&(e=-83),0==this.$route.path.indexOf("/course")&&(e=-160),{"margin-top":e+"px"}},mobileCataStyle:function(){if(this.$route.meta.mobilenav&&this.$route.meta.mobilenav.color)return{"background-color":this.$route.meta.mobilenav.color}},subBack:function(){var e=this,t=this.$route.meta,n=t.subBack.name,a=t.subBack.path;return t.subBack.params&&t.subBack.params.forEach(function(t){n=n.replace("{"+t+"}",e.$route.params[t]),a=a.replace("{"+t+"}",e.$route.params[t])}),{name:n,path:a}}}),methods:Object.assign({},Object(_.d)(["setMenuState","openMenu"]),{loginAjax:function(){D.a.post("/api/spa/login",{email:"[email protected]",password:"@##434frt))"}).then(function(e){console.log(e)})},setLocalLocale:function(e){localStorage.setItem("zashare_locale",e)}})},ze={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"navbar",style:e.navbarStyle},[n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row-logo"},[n("router-link",{staticClass:"logo-part",attrs:{to:"/"}},[n("img",{staticClass:"logo-img",attrs:{src:"/static/img/Home/za-logo.svg"}})]),n("div",{staticClass:"locale-sel"},[n("span",{staticClass:"option",class:{active:"zh"==e.$i18n.locale},on:{click:function(t){e.$i18n.locale="zh",e.setLocalLocale("zh"),e.$ga.event("locale","change","zh")}}},[e._v("繁中")]),n("span",[e._v(" | ")]),n("span",{staticClass:"option",class:{active:"en"==e.$i18n.locale},on:{click:function(t){e.$i18n.locale="en",e.setLocalLocale("en"),e.$ga.event("locale","change","en")}}},[e._v("EN")])])],1),n("div",{staticClass:"row-bottom"},[n("span",{staticClass:"col-login"},[e.auth.user?n("span",[n("div",{staticClass:"mb-2"},[n("span",{staticClass:"main-text"},[e._v(e._s(e.$t("nav.hello")))]),n("span",{staticClass:"main-text",on:{click:function(t){e.openMenu("login")}}},[n("b",[e._v(e._s(e.auth.user.name))])])]),n("span",{staticClass:"sub-text",on:{click:function(t){e.openMenu("login"),e.$ga.event("member","click","manage")}}},[e._v(e._s(e.$t("nav.manage")))])]):n("span",[e._v("\b\b"),n("b",{staticClass:"main-text"},[e._v(e._s(e.$t("global.name"))+" ")]),n("br"),n("span",{staticClass:"sub-text",on:{click:function(t){e.openMenu("login"),e.$ga.event("member","click","login")}}},[e._v(" "+e._s(e.$t("nav.login")))])]),n("span",{staticClass:"sub-text"},[e._v(" | ")]),n("span",{staticClass:"sub-text"},[n("span",{on:{click:function(t){e.openMenu("search"),e.$ga.event("nav","click","search")}}},[e._v(" "+e._s(e.$t("nav.search")))])])]),e._m(0),n("span",{on:{click:function(t){e.$ga.event("nav","click","about")}}},[n("router-link",{staticClass:"col-theme-nav text-center nav-course",attrs:{to:"/about"}},[n("span",[e._v(e._s(e.$t("nav.about")))])])],1),n("span",{on:{click:function(t){e.$ga.event("nav","click","expo")}}},[n("router-link",{staticClass:"col-theme-nav text-center nav-base",attrs:{to:"/expo"}},[n("span",[e._v(e._s(e.$t("nav.expo")))]),n("ul",{staticClass:"years"},[n("router-link",{staticClass:"year-item delay-ani-3",attrs:{to:"/expo/2015"},on:{click:function(t){e.$ga.event("nav","click","expo",2015)}}},[e._v("2015")]),n("router-link",{staticClass:"year-item delay-ani-6",attrs:{to:"/expo/2016"},on:{click:function(t){e.$ga.event("nav","click","expo",2016)}}},[e._v("2016")]),n("router-link",{staticClass:"year-item delay-ani-9",attrs:{to:"/expo/2017"},on:{click:function(t){e.$ga.event("nav","click","expo",2017)}}},[e._v("2017")])],1)])],1),n("a",{staticClass:"col-theme-nav text-center nav-expo",attrs:{href:"https://www.zashare.com.tw",target:"_blank"},on:{click:function(t){e.$ga.event("nav","click","shop")}}},[n("span",[e._v(e._s(e.$t("nav.shop")))])])]),"theme"==e.$route.meta.type||0==e.$route.path.indexOf("/expo")||e.$route.meta.mobilenav?n("div",{staticClass:"row-mobile-cata",style:e.mobileCataStyle},[e.$route.meta.mobilenav?n("div",{staticClass:"ovh"},[e.$route.meta.mobilenav.text?n("div",{key:e.$route.meta.mobilenav.text,staticClass:"page-label animated slideInUp"},[e._v(e._s(e.$t(e.$route.meta.mobilenav.text)))]):e._e(),e.$route.meta.mobilenav.img?n("div",{key:e.$route.meta.mobilenav.img,staticClass:"page-label animated slideInUp"},[n("img",{attrs:{src:e.$route.meta.mobilenav.img}})]):e._e(),n("div",{staticClass:"loginbtn",on:{click:function(t){e.openMenu("login")}}},[e._v(e._s(e.auth.user?e.$t("nav.logout"):e.$t("nav.login")))])]):e._e(),n("div",{staticClass:"wrapper ovh animated slideInUp"},[n("div",{staticClass:"mt",style:e.mobile_nav_style}),e._l(e.themes.slice().reverse(),function(e){return n("img",{attrs:{src:e.nav_image}})})],2)]):e._e()])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"footer_logo"},[t("a",{attrs:{href:"https://www.facebook.com/zashare.expo/",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-fb.svg"}})]),t("a",{attrs:{href:"https://www.flickr.com/photos/140061501@N03/albums",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-fl.svg"}})]),t("a",{attrs:{href:"https://www.instagram.com/za_share/",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-ig.svg"}})]),t("a",{attrs:{href:"https://mp.weixin.qq.com/s/TwpvJg7q7tGnafAJgFdUeA",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-wc.svg"}})]),t("a",{attrs:{href:"https://www.youtube.com/channel/UCiCIqDTmahczFvmg8iNUVow/playlists",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-yt.svg"}})])])}]};var Ne=n("VU/8")(Re,ze,!1,function(e){n("OULK")},null,null).exports,We=n("Avko"),Ie={data:function(){return{tags:"師培、教具、國小、偏鄉、國中、高中、大學、實驗教育、媒體".split("、"),tempSearchKeyword:"",coupontypes:[]}},computed:Object.assign({},Object(_.e)({menuState:function(e){return e.menuState},posts:function(e){return e.post.posts},searchKeyword:function(e){return e.searchKeyword},menuType:function(e){return e.menuType},mobile:function(e){return e.mobile},auth:function(e){return e.auth},token:function(e){return e.auth.token},news:function(e){return e.post.news}}),{filteredPost:function(){var e=this;return this.posts.map(function(e){return Object.assign({},e,{tag:"ZA EXPO"})}).filter(function(t){return-1!=JSON.stringify(t).indexOf(e.searchKeyword)})},latestNews:function(){return this.news.filter(function(e){return"媒體報導"!=e.cata.name}).filter(function(e){return e.stick_top_member}).slice(-1)[0]}},Object(_.c)({getUserPhoto:"auth/getUserPhoto",isAdmin:"auth/isAdmin",canManage:"auth/canManage"}),{coupontypes_zacourse:function(){return(this.coupontypes||[]).filter(function(e){return"single_time_hash"==e.type})},coupontypes_normal:function(){return(this.coupontypes||[]).filter(function(e){return"multi_time_single_hash"==e.type})}}),methods:Object.assign({},Object(_.d)(["setMenuState","setSearchKeyword","openMenu"]),Object(_.b)({register:"auth/register",login:"auth/login",logout:"auth/logout",loginFacebook:"auth/loginFacebook",authInit:"auth/init"}),{getCataTrans:function(e){var t=this.$t("member.form.register.jobcatas").find(function(t){return t.value==e});return t?t.label:e},postTarget:function(e){return"expo"==e.type?"/expo/blog/"+e.id:"news"==e.type?"/news/"+e.id:void 0},hambergurAction:function(){this.menuState?this.setMenuState(!1):this.openMenu("nav")},loadAllCoupon:function(){var e=this;this.axios.post("/api/coupontype/user",{token:this.token}).then(function(t){e.coupontypes=t.data})},getCoupon:function(e){var t=this;this.axios.post("/api/coupontype/userget/"+e.id,{token:this.token}).then(function(e){t.$message({message:"資料更新成功",type:"success"}),t.loadAllCoupon()})}}),created:function(){this.menuState&&"login"==this.menuType&&this.auth.user&&this.loadAllCoupon()},watch:{menuState:function(){this.loadAllCoupon()},user:function(){this.loadAllCoupon()},token:function(){this.loadAllCoupon()}},components:{panel_expo2018:We.a}},qe={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"col-member"},[e.auth.user?n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"row mt-5"},[n("div",{staticClass:"col-sm-7"},[n("div",{staticClass:"photo small"}),n("span",[e._v("Hello! "+e._s(e.auth.user.name)),n("span",{staticClass:"curp",staticStyle:{opacity:"0.5"},on:{click:e.logout}},[e._v(" "+e._s(e.$t("menu.logout")))]),e.canManage?n("span",{staticClass:"ml-5",on:{click:function(t){e.setMenuState(!1)}}},[n("router-link",{staticClass:"curp",staticStyle:{opacity:"0.5"},attrs:{to:"/manage"}},[e._v(" "+e._s(e.$t("menu.manage")))])],1):e._e()]),e.auth.user.studentcard?n("div",[n("h4",[e._v(e._s(e.$t("menu.label_student_card")))]),n("ul",[n("li",[e._v(e._s(e.$t("menu.label_card_id"))+": "+e._s(e.auth.user.studentcard.card_id))]),n("li",[e._v(e._s(e.$t("menu.label_card_level"))+": "+e._s("normal"==e.auth.user.studentcard.type?e.$t("menu.label_card_level_old"):e.$t("menu.label_card_level_member")))]),n("li",[e._v(e._s(e.$t("menu.label_card_date"))+": "+e._s(e.auth.user.studentcard.expiry_datetime))])])]):e._e(),n("div",[n("h4",[e._v(e._s(e.$t("menu.profile"))),n("div",{staticClass:"float-right",on:{click:function(t){e.setMenuState(!1)}}},[n("router-link",{staticClass:"curp btn-menu",attrs:{to:"/member/info"}},[e._v(e._s(e.$t("menu.modify")))])],1)]),n("ul",[n("li",[e._v(e._s(e.$t("menu.label_id"))+": "+e._s("ZA"+("0000000"+e.auth.user.id).slice(-6)))]),n("li",[e._v(e._s(e.$t("menu.label_occupation"))+": "+e._s(e.getCataTrans(e.auth.user.jobcata)))]),n("li",[e._v(e._s(e.$t("menu.label_position"))+": "+e._s(e.auth.user.job)+" ")]),n("li",[e._v(e._s(e.$t("menu.label_phone"))+":"+e._s(e.auth.user.phone))]),n("li",[e._v(e._s(e.$t("menu.label_email"))+":"+e._s(e.auth.user.email))]),n("li",[e._v(e._s(e.$t("menu.label_birthday"))+":"+e._s(e.auth.user.birthday))])])]),n("span")]),n("div",{staticClass:"col-sm-1"}),n("div",{staticClass:"col-sm-4",on:{click:function(t){e.setMenuState(!1),e.$ga.event("member","news","click")}}},[n("h4",[e._v(e._s(e.$t("menu.news_title")))]),n("div",{staticClass:"row"},e._l([e.latestNews],function(t){return e.latestNews?n("newsbox",{key:t.title,attrs:{post:t,target:e.postTarget(t),tag:t.tag}}):e._e()}))])])])]),n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"tag mt-5 mb-3"},[e._v("2018 ZA EXPO")]),n("a",{attrs:{href:e.$t("member.expo_handbook_url"),target:"_blank"}},[n("i",{staticClass:"fa fa-info",on:{click:function(t){e.$ga.event("member","expo_handbook","click")}}})]),e._v(" "+e._s(e.$t("menu.label_expo_regist_end")))]),n("div",{staticClass:"col-sm-12"},[n("panel_expo2018")],1)]),e.coupontypes_normal.length?n("div",{staticClass:"row row-coupon mt-5"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"tag"},[e._v(e._s(e.$t("menu.title_coupon_normal")))]),n("i",{staticClass:"fa fa-info"}),n("br")]),e._l(e.coupontypes_normal,function(t,a){return n("div",{staticClass:"col-sm-6 col-md-4 mt-3"},[n("div",{staticClass:"coupon-box-inner"},[n("div",{staticClass:"cover",style:e.bgcss(t.cover)}),n("div",{staticClass:"info"},[n("h4",[e._v(e._s(t.title))]),n("p",{staticStyle:{"word-break":"break-all"},domProps:{innerHTML:e._s(t.description)}})]),t.can_get?n("div",[t.my?e._e():n("div",{staticClass:"btn btn-primary text-center",on:{click:function(n){e.getCoupon(t)}}},[e._v(e._s(e.$t("menu.get_coupon")))])]):n("div",[n("h4",{staticClass:"text-center"},[e._v(e._s(e.$t("menu.coupon_cannot_get")))])]),t.my?n("h4",{staticClass:"text-center"},[e._v(e._s(e.$t("menu.label_coupon"))+":"+e._s(t.my.coupon))]):e._e()])])})],2):e._e(),e.auth.user.studentcard||e.isAdmin?n("div",{staticClass:"row row-coupon mt-5"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"tag"},[e._v(e._s(e.$t("menu.title_coupon_zacourse")))]),n("i",{staticClass:"fa fa-info"}),n("br")]),e._l(e.coupontypes_zacourse,function(t,a){return n("div",{staticClass:"col-sm-6 col-md-4 mt-3"},[n("div",{staticClass:"coupon-box-inner"},[n("div",{staticClass:"cover",style:e.bgcss(t.cover)}),n("div",{staticClass:"info"},[n("h4",[e._v(e._s(t.title))]),n("p",{domProps:{innerHTML:e._s(t.description)}})]),t.can_get?n("div",[t.my?e._e():n("div",{staticClass:"btn btn-primary text-center",on:{click:function(n){e.getCoupon(t)}}},[e._v(e._s(e.$t("menu.get_coupon")))])]):n("div",[n("h4",{staticClass:"text-center"},[e._v(e._s(e.$t("menu.coupon_cannot_get")))])]),t.my?n("h4",{staticClass:"text-center"},[e._v(e._s(e.$t("menu.label_coupon"))+":"+e._s(t.my.coupon))]):e._e()])])})],2):e._e()]):n("auth_panel")],1)},staticRenderFns:[]};var Be=n("VU/8")(Ie,qe,!1,function(e){n("TnpP")},null,null).exports,Ue={data:function(){return{tags:"師培、教具、國小、偏鄉、國中、高中、大學、實驗教育、媒體".split("、"),tempSearchKeyword:"",coupontypes:[]}},computed:Object.assign({},Object(_.e)({menuState:function(e){return e.menuState},posts:function(e){return e.post.posts},searchKeyword:function(e){return e.searchKeyword},menuType:function(e){return e.menuType},mobile:function(e){return e.mobile},auth:function(e){return e.auth},token:function(e){return e.auth.token},news:function(e){return e.post.news}}),{filteredPost:function(){var e=this;return this.posts.map(function(e){return Object.assign({},e,{tag:"ZA EXPO"})}).filter(function(t){return-1!=JSON.stringify(t).indexOf(e.searchKeyword)}).filter(function(e){return"published"==e.status})},latestNews:function(){return this.news.slice(-1)[0]}},Object(_.c)({getUserPhoto:"auth/getUserPhoto",isAdmin:"auth/isAdmin"})),methods:Object.assign({},Object(_.d)(["setMenuState","setSearchKeyword","openMenu"]),Object(_.b)({register:"auth/register",login:"auth/login",logout:"auth/logout",loginFacebook:"auth/loginFacebook",authInit:"auth/init"}),{postTarget:function(e){return"expo"==e.type?"/expo/blog/"+e.id:"news"==e.type?"/news/"+e.id:void 0},hambergurAction:function(){this.menuState?this.setMenuState(!1):this.openMenu("nav")},loadAllCoupon:function(){var e=this;this.axios.post("/api/coupontype/user",{token:this.token}).then(function(t){e.coupontypes=t.data})},getCoupon:function(e){var t=this;this.axios.post("/api/coupontype/userget/"+e.id,{token:this.token}).then(function(e){t.$message({message:"資料更新成功",type:"success"}),t.loadAllCoupon()})}}),mounted:function(){this.menuState&&"login"==this.menuType&&this.auth.user&&this.loadAllCoupon()},watch:{tempSearchKeyword:function(){this.setSearchKeyword(this.tempSearchKeyword)},searchKeyword:function(){this.tempSearchKeyword!=this.searchKeyword&&(this.tempSearchKeyword=this.searchKeyword)},menuState:function(){this.menuState&&this.auth.user&&this.loadAllCoupon(),setTimeout(function(){_jf.flush()},200)},user:function(){this.menuState&&this.auth.user&&this.loadAllCoupon(),setTimeout(function(){_jf.flush()},200)}},components:{navbar:Ne,panel_member:Be}},Je={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"menu",class:{open:e.menuState}},[n("transition",{attrs:{name:"fade"}},[e.menuState||e.mobile?n("div",{staticClass:"hambergur",on:{click:e.hambergurAction}},[n("div",{staticClass:"icon-bar"}),n("div",{staticClass:"icon-bar"})]):e._e()]),n("transition",{attrs:{name:"fade"}},[e.menuState?n("div",{staticClass:"fullPage"},["search"==e.menuType?n("div",[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"container container-menu"},[n("div",{staticClass:"row row-search"},[n("div",{staticClass:"col-sm-12"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.tempSearchKeyword,expression:"tempSearchKeyword"}],attrs:{placeholder:e.$t("nav.search")},domProps:{value:e.tempSearchKeyword},on:{input:function(t){t.target.composing||(e.tempSearchKeyword=t.target.value)}}}),n("div",{staticClass:"pull-right clearInput",on:{click:function(t){e.setSearchKeyword("")}}},[n("i",{directives:[{name:"show",rawName:"v-show",value:""==e.searchKeyword,expression:"searchKeyword==''"}],staticClass:"fa fa-search"}),n("i",{directives:[{name:"show",rawName:"v-show",value:""!=e.searchKeyword,expression:"searchKeyword!=''"}],staticClass:"fa fa-times"})]),""!=e.searchKeyword?n("h3",{staticClass:"input-text-count pull-right"},[e._v("共有 "+e._s(e.filteredPost.length)+" 項結果")]):e._e()]),n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"tags scrollX"},e._l(e.tags,function(t){return n("div",{staticClass:"tag",on:{click:function(n){e.setSearchKeyword(t)}}},[e._v(e._s(t))])}))])])])]),n("br"),n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"container"},[""!=e.searchKeyword?n("div",{staticClass:"row",on:{click:function(t){e.setMenuState(!1)}}},e._l(e.filteredPost,function(t){return n("newsbox",{key:t.title,staticClass:"col-lg-4 col-md-6 col-sm-12",attrs:{post:t,target:e.postTarget(t),tag:t.tag,hideDetail:!0}})})):e._e()])])]):e._e(),"nav"==e.menuType?n("div",{staticClass:"row row-page h100"},[n("div",{staticClass:"col-mobile-menu col-sm-12"},[n("div",{staticClass:"container container-menu"},[""==e.searchKeyword?n("div",{staticClass:"row"}):e._e(),n("div",{staticClass:"row-logo",on:{click:function(t){e.setMenuState(!1)}}},[n("router-link",{staticClass:"col-sm-12 logo-part",attrs:{to:"/"}},[n("img",{staticClass:"logo-img",attrs:{src:"/static/img/Home/za-logo.svg"}})]),n("div",{staticClass:"locale-sel"},[n("span",{staticClass:"option",class:{active:"zh"==e.$i18n.locale},on:{click:function(t){e.$i18n.locale="zh"}}},[e._v("繁中")]),n("span",{staticClass:"span"},[e._v(" | ")]),n("span",{staticClass:"option",class:{active:"en"==e.$i18n.locale},on:{click:function(t){e.$i18n.locale="en"}}},[e._v("EN")])])],1),n("div",{staticClass:"row-bottom"},[n("span",{staticClass:"col-login mb-3"},[e.auth.user?n("span",[n("div",{staticClass:"mb-2"},[n("span",{staticClass:"main-text"},[e._v("Hello ")]),n("span",{staticClass:"main-text",on:{click:function(t){e.openMenu("login")}}},[n("b",[e._v(e._s(e.auth.user.name))])])])]):n("span",[e._v("\b\b"),n("b",{staticClass:"main-text"},[e._v(e._s(e.$t("global.name"))+" ")]),n("br")]),n("div",[e.auth.user?e._e():n("span",{staticClass:"sub-text",on:{click:function(t){e.openMenu("login")}}},[e._v(" "+e._s(e.$t("nav.login")))]),e.auth.user?n("span",{staticClass:"sub-text",on:{click:function(t){e.openMenu("login")}}},[e._v(e._s(e.$t("nav.manage")))]):e._e(),n("span",{staticClass:"sub-text"},[e._v(" | ")]),n("span",{staticClass:"sub-text"},[n("span",{on:{click:function(t){e.openMenu("search")}}},[e._v(" "+e._s(e.$t("nav.search")))])])])]),n("div",{on:{click:function(t){e.setMenuState(!1)}}},[n("router-link",{staticClass:"col-theme-nav text-center nav-course",attrs:{to:"/about"}},[n("span",[e._v(e._s(e.$t("nav.about")))])]),n("router-link",{staticClass:"col-theme-nav text-center nav-base",attrs:{to:"/expo"}},[n("span",[e._v(e._s(e.$t("nav.expo")))])]),n("a",{staticClass:"col-theme-nav text-center nav-expo",attrs:{href:"https://www.zashare.com.tw",target:"_blank"}},[n("span",[e._v(e._s(e.$t("nav.shop")))])])],1)])])])]):e._e(),"login"==e.menuType?n("div",[n("panel_member",{key:e.token})],1):e._e()]):e._e()])],1)},staticRenderFns:[]};var Xe=n("VU/8")(Ue,Je,!1,function(e){n("lBDn")},null,null).exports,Ve=n("a2/B"),Ze=n.n(Ve),Ge={props:["post","target","tag","hideTag","hideDetail"],computed:{showDate:function(){return Ze()(this.post.established_time).format("YYYY[ 年 ]MM[ 月 ]DD[ 日 ]")},hashtags:function(){return this.post.hashtag?JSON.parse(this.post.hashtag):[]}}},Ke={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(-1!=e.target.indexOf("http")?"a":"router-link",{tag:"div",staticClass:"news_box animated fadeIn",attrs:{to:e.target,href:e.target,target:-1!=e.target.indexOf("http")?"_blank":"_self"}},[e.post?n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12 col-cover"},[n("div",{staticClass:"cover animated fadeIn news_box_cover"},[n("div",{staticClass:"innerCover animated fadeIn delay-ani-3",style:e.bgcss(e.post.cover)}),e.hideTag?e._e():n("div",{staticClass:"tag"},[e._v(e._s(e.tag||"ZA SHARE"))])])]),n("div",{staticClass:"col-sm-12 col-info"},[e.post.company&&!e.hideDetail?n("h4",{staticClass:"company"},[e._v(e._s(e.post.company?e.post.company.name_cht:""))]):e._e(),n("h3",[e._v(e._s(e.post.title))]),e.hideDetail?e._e():n("div",{staticClass:"bottom-info"},[n("div",{staticClass:"hashtags"},e._l(e.hashtags,function(t){return n("div",{staticClass:"hashtag"},[e._v("#"+e._s(t))])})),n("div",{staticClass:"date"},[e._v(e._s(e.showDate))])])])]):e._e()])},staticRenderFns:[]};var Qe=n("VU/8")(Ge,Ke,!1,function(e){n("9+zJ")},null,null).exports,et={props:{layout:{type:String,default:"card"},forceMode:{type:String,default:null}},data:function(){return{registerData:{email:"",name:"",password:"",jobcata:"",job:""},resetSendMailData:{email:""},resetPasswordData:{email:"",password:"",password_confirmation:"",token:""},loginData:{email:localStorage.zashare_auth_user_email||"",password:""},mode:window.queryObject.reset_token?"reset_password":"login"}},computed:Object.assign({},Object(_.e)(["menuState","auth","resetToken"]),{jobInforLabel:function(){return"學生"==this.registerData.jobcata?"學校系所":"職稱"}}),methods:Object.assign({},Object(_.d)({setMenuState:"setMenuState",setResetToken:"auth/setResetToken"}),Object(_.b)({register:"auth/register",login:"auth/login",logout:"auth/logout",loginFacebook:"auth/loginFacebook",authInit:"auth/init",resetSendMail:"auth/resetSendMail",resetPassword:"auth/resetPassword"}),Object(_.c)({getUserPhoto:"auth/getUserPhoto",isAdmin:"auth/isAdmin",isEditor:"auth/isEditor",canManage:"auth/canManage",userGroup:"auth/userGroup"}),{userResetPassword:function(){var e=this;this.resetPassword({data:this.resetPasswordData,successHook:function(){e.$message.success(e.$t("member.password_reset_success")),setTimeout(function(){e.setResetToken(null),e.mode="login",window.location.href=window.location.href.split("?")[0]},1500)},failHook:function(){e.$message.error(e.$t("member.password_reset_fail"))}})},checkMail:function(){/[^\x00-\xff]/g.test(this.registerData.email)&&(this.$message.error("請勿輸入全形文字"),this.$set(this.registerData,"email",""))}}),mounted:function(){var e=this;w()("input.loginPwd").keypress(function(t){"13"==(t.keyCode?t.keyCode:t.which)&&e.login(e.loginData)})}},tt={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"auth-card"},[n("transition",{attrs:{name:"fade"}},["card"==e.layout?n("div",[n("transition",{attrs:{name:"fade"}},[e.auth.processing?n("div",{staticClass:"card-loading"}):e._e()]),n("div",{staticClass:"top"},[n("div",{staticClass:"photo",style:e.bgcss(e.getUserPhoto(e.auth.user))}),n("h3",{staticClass:"name"},[e.auth.user?n("span",[e._v(e._s(e.auth.status&&e.$t(e.auth.status)||e.$t("member.hello")+""+e.auth.user.name))]):n("span",[e._v(e._s(e.auth.status&&e.$t(e.auth.status)||e.$t("member.form.login.not_logined")))])])]),"reset_send_email"==e.mode||"reset"==e.forceMode?n("div",{staticClass:"bottom"},[n("h4",[e._v(e._s(e.$t("member.reset_send_email_title")))]),e.auth.password_reset_success?n("div",[n("h4",[e._v(e._s(e.$t("member.password_reset_email_sent")))])]):n("div",[n("el-input",{attrs:{placeholder:"輸入原帳號信箱(E-Mail)",type:"email",name:"email"},model:{value:e.resetSendMailData.email,callback:function(t){e.$set(e.resetSendMailData,"email",t)},expression:"resetSendMailData.email"}}),n("button",{staticClass:"btn fw black",on:{click:function(t){e.resetSendMail(e.resetSendMailData)},keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key))return null;t.preventDefault(),e.resetSendMail(e.resetSendMailData)}}},[e._v(" "+e._s(e.$t("member.btn_send_reset_link")))])],1)]):"reset_password"==e.mode?n("div",{staticClass:"bottom"},[n("h4",[e._v(e._s(e.$t("member.reset_password_title")))]),n("el-input",{attrs:{placeholder:"輸入原帳號信箱 (E-Mail)",type:"email",name:"email"},model:{value:e.resetPasswordData.email,callback:function(t){e.$set(e.resetPasswordData,"email",t)},expression:"resetPasswordData.email"}}),n("el-input",{attrs:{placeholder:"請輸入新密碼 (New Password)",type:"password",name:"password"},model:{value:e.resetPasswordData.password,callback:function(t){e.$set(e.resetPasswordData,"password",t)},expression:"resetPasswordData.password"}}),n("el-input",{attrs:{placeholder:"再次輸入密碼 (Confirm Password)",type:"password",name:"password_confirmation"},model:{value:e.resetPasswordData.password_confirmation,callback:function(t){e.$set(e.resetPasswordData,"password_confirmation",t)},expression:"resetPasswordData.password_confirmation"}}),n("button",{staticClass:"btn fw black",on:{click:e.userResetPassword}},[e._v(e._s(e.$t("member.btn_reset")))])],1):"login"!=e.mode||e.auth.user?"register"!=e.mode||e.auth.user?e.auth.user?n("div",{staticClass:"bottom"},[n("h4",[e._v(e._s(e.$t("menu.label_student_card")))]),e.auth.user.studentcard?n("div",[n("label",{staticClass:"info-group"},[n("span",[e._v(e._s(e.$t("menu.label_card_id"))+":")]),n("span",[e._v(e._s(e.auth.user.studentcard.card_id))])]),n("label",[n("span",[e._v(e._s(e.$t("menu.label_card_level"))+":")]),n("span",[e._v(e._s(e.auth.user.studentcard.type))])]),n("label",[n("span",[e._v(e._s(e.$t("menu.label_card_date"))+":")]),n("span",[e._v(e._s(e.auth.user.studentcard.expiry_datetime))])])]):n("div"),n("br"),n("div",{staticClass:"btn-group",on:{click:function(t){e.setMenuState(!1)}}},[n("button",{staticClass:"btn fw black",on:{click:e.logout}},[e._v(e._s(e.$t("member.logout")))]),n("router-link",{staticClass:"btn fw",attrs:{to:"/member/info"}},[e._v(e._s(e.$t("member.setting")))])],1),e.canManage()?n("div",{staticClass:"btn-group",on:{click:function(t){e.setMenuState(!1)}}},[n("router-link",{staticClass:"btn fw black",attrs:{to:"/manage"}},[e._v("前往後台("+e._s(e.userGroup())+")")])],1):e._e()]):e._e():n("div",{staticClass:"bottom"},[n("h4",[e._v(e._s(e.$t("member.form.register.title")))]),n("el-input",{attrs:{placeholder:e.$t("member.form.register.email"),type:"email",name:"email"},on:{input:e.checkMail},model:{value:e.registerData.email,callback:function(t){e.$set(e.registerData,"email",t)},expression:"registerData.email"}}),n("el-input",{attrs:{placeholder:e.$t("member.form.register.name"),type:"name",name:"name"},model:{value:e.registerData.name,callback:function(t){e.$set(e.registerData,"name",t)},expression:"registerData.name"}}),n("label",{staticClass:"mention"},[e._v(e._s(e.$t("member.form.register.name_explain")))]),n("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("member.form.register.jobcata"),name:"jobcata"},model:{value:e.registerData.jobcata,callback:function(t){e.$set(e.registerData,"jobcata",t)},expression:"registerData.jobcata"}},e._l(e.$t("member.form.register.jobcatas"),function(t,a){return n("el-option",{attrs:{value:t.value,label:t.label}},[e._v(e._s(t.label))])})),n("el-input",{attrs:{placeholder:e.$t("member.form.register.job"),type:"job",name:"job"},model:{value:e.registerData.job,callback:function(t){e.$set(e.registerData,"job",t)},expression:"registerData.job"}}),n("el-input",{attrs:{placeholder:e.$t("member.form.register.phone"),type:"phone",name:"phone"},model:{value:e.registerData.phone,callback:function(t){e.$set(e.registerData,"phone",t)},expression:"registerData.phone"}}),n("el-date-picker",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("member.form.register.birthday"),type:"date",name:"birthday","value-format":"yyyy-MM-dd"},model:{value:e.registerData.birthday,callback:function(t){e.$set(e.registerData,"birthday",t)},expression:"registerData.birthday"}}),n("el-input",{attrs:{placeholder:e.$t("member.form.register.password"),type:"password"},model:{value:e.registerData.password,callback:function(t){e.$set(e.registerData,"password",t)},expression:"registerData.password"}}),n("el-input",{attrs:{placeholder:e.$t("member.form.register.confirm_password"),type:"password"},model:{value:e.registerData.password_confirmation,callback:function(t){e.$set(e.registerData,"password_confirmation",t)},expression:"registerData.password_confirmation"}}),n("button",{staticClass:"btn fw black",on:{click:function(t){e.register(e.registerData)}}},[e._v(e._s(e.$t("member.form.register.regist")))]),n("button",{staticClass:"btn fw nobg",on:{click:function(t){e.mode="login"}}},[e._v(e._s(e.$t("member.form.register.have_account")))])],1):n("div",{staticClass:"bottom"},[n("h4",{staticClass:"login-title"},[e._v(e._s(e.$t("member.form.login.title")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.loginData.email,expression:"loginData.email"}],attrs:{placeholder:e.$t("member.form.login.user"),type:"email"},domProps:{value:e.loginData.email},on:{input:function(t){t.target.composing||e.$set(e.loginData,"email",t.target.value)}}}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.loginData.password,expression:"loginData.password"}],staticClass:"loginPwd",attrs:{placeholder:e.$t("member.form.login.password"),type:"password"},domProps:{value:e.loginData.password},on:{input:function(t){t.target.composing||e.$set(e.loginData,"password",t.target.value)}}}),n("button",{staticClass:"btn fw black",on:{click:function(t){e.login(e.loginData)}}},[e._v(e._s(e.$t("member.form.login.login")))]),n("button",{staticClass:"btn fw nobg",on:{click:function(t){e.mode="reset_send_email"}}},[e._v(e._s(e.$t("member.form.login.forget")))]),n("button",{staticClass:"btn fw nobg",on:{click:function(t){e.mode="register"}}},[e._v(e._s(e.$t("member.form.login.register")))])])],1):e._e(),"function"==e.layout?n("div",[n("div",{staticClass:"btn-group"},[n("button",{staticClass:"btn fw black",on:{click:e.logout}},[e._v(e._s(e.$t("member.logout")))]),n("router-link",{staticClass:"btn fw",attrs:{to:"/member/info"}},[e._v(e._s(e.$t("member.setting")))])],1),e.canManage()?n("div",{staticClass:"btn-group",on:{click:function(t){e.setMenuState(!1)}}},[n("router-link",{staticClass:"btn fw black",attrs:{to:"/manage"}},[e._v("前往後台("+e._s(e.userGroup())+")")])],1):e._e()]):e._e()])],1)},staticRenderFns:[]};var nt=n("VU/8")(et,tt,!1,function(e){n("j6zY")},null,null).exports,at={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"section_footer"},[n("div",{staticClass:"container"},[e._m(0),n("div",{staticClass:"row"},[e._m(1),n("div",{staticClass:"col-sm-4 footer-text"},[n("h3",[n("a",{attrs:{href:"https://www.yottau.com.tw/partner/344",target:"_blank"},on:{click:function(t){e.$ga.event("footer","zacourse","click")}}},[e._v(e._s(e.$t("footer.zacourse")))]),n("br"),n("a",{attrs:{href:"http://revolution.zashare.org/",target:"_blank"},on:{click:function(t){e.$ga.event("footer","zarevolution","click")}}},[e._v(" "+e._s(e.$t("footer.zarev")))])])]),n("div",{staticClass:"col-sm-4 footer-text"},[n("h3",[e._v(e._s(e.$t("footer.website"))),n("br"),e._v(e._s(e.$t("footer.copywrite"))),n("br")])])])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"row"},[t("div",{staticClass:"col-sm-4"},[t("br")]),t("div",{staticClass:"col-sm-4"},[t("br")]),t("div",{staticClass:"col-sm-4"},[t("div",{staticClass:"footer_logo"},[t("a",{attrs:{href:"https://www.facebook.com/zashare.expo/",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-fb.svg"}})]),t("a",{attrs:{href:"https://www.youtube.com/channel/UCiCIqDTmahczFvmg8iNUVow",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-fl.svg"}})]),t("a",{attrs:{href:"https://www.instagram.com/za_share/",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-ig.svg"}})]),t("a",{attrs:{href:"https://mp.weixin.qq.com/s/TwpvJg7q7tGnafAJgFdUeA",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-wc.svg"}})]),t("a",{attrs:{href:"https://www.youtube.com/channel/UCiCIqDTmahczFvmg8iNUVow/playlists",target:"_blank"}},[t("img",{attrs:{src:"/static/img/social-icon/social-yt.svg"}})])])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"col-sm-4 footer-text"},[t("h3",[this._v("Tel. +886-2-2729-7122"),t("br"),this._v("Mail. [email protected]"),t("br"),this._v("Business hours. 10:00-19:00 Mon. - Fri.")])])}]};var it=n("VU/8")({},at,!1,function(e){n("y9sT")},null,null).exports,st={props:["data","title","trans"],methods:{export_csv:function(){var e={data:this.data,title:this.title,headers:this.headers},t=null,n=e.row_keys||this.default_row_keys;t={},n.forEach(function(e){return t[e]=e});var a=e.title||"資料匯出",i=(new Date).toLocaleDateString().replace(/[\/\s\:]/g,"");!function(e,t,n){e&&t.unshift(e);var a=function(e){for(var t="object"!=typeof e?JSON.parse(e):e,n="",a=0;a<t.length;a++){var i="";for(var s in t[a]){""!=i&&(i+=","),i+='"';var r=t[a][s];i+=r=((null===r?"":r)+"").replace(/\"/g,'""'),i+='"'}n+=i+"\r\n"}return n}(JSON.stringify(t)),i=n+".csv"||"export.csv",s=new Blob(["\ufeff",a],{type:"text/csv;charset=utf-8;"});if(navigator.msSaveBlob)navigator.msSaveBlob(s,i);else{var r=document.createElement("a");if(void 0!==r.download){var o=URL.createObjectURL(s);r.setAttribute("href",o),r.setAttribute("download",i),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r)}}}(t,JSON.parse(JSON.stringify(e.data)),a+i)}},computed:{default_row_keys:function(){var e=Array.from(this.data).concat({}).reduce(function(e,t){return e.concat(Object.keys(t))},[]).filter(function(e,t,n){return n.indexOf(e)==t});return this.conf&&this.conf.show_id&&-1==e.indexOf("id")&&e.unshift("id"),e}}},rt={render:function(){var e=this.$createElement;return(this._self._c||e)("el-button",{staticClass:"float-right",on:{click:this.export_csv}},[this._v("匯出成csv")])},staticRenderFns:[]};var ot=n("VU/8")(st,rt,!1,function(e){n("KyDR")},null,null).exports,lt={props:["show"],methods:{closeFullpage:function(){this.$emit("closeFullpage")}},mounted:function(){window.addEventListener("keydown",function(e){"Escape"==e.key&&this.closeFullpage()})}},ut={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",[t("transition",{attrs:{name:"fade"}},[this.show?t("div",{staticClass:"fullpage"},[this._t("default"),t("div",{staticClass:"closebg",on:{click:this.closeFullpage}}),t("div",{staticClass:"cross",on:{click:this.closeFullpage}},[t("i",{staticClass:"fa fa-times"})])],2):this._e()])],1)},staticRenderFns:[]};var dt=n("VU/8")(lt,ut,!1,function(e){n("0M5F")},null,null).exports,ct=n("//Fk"),mt=n.n(ct),_t=function(e){var t=e.map(function(e){return new mt.a(function(t,n){var a=new Image;a.onload=function(){t("ok"),console.log(e)},a.src=e})});return mt.a.all(t)},pt=n("SPVK");m.default.use(l.a,{locale:d.a}),m.default.use(ke);var ht=new ke({locale:localStorage.zashare_locale||"zh",messages:Oe});"zashare.org"==document.domain&&m.default.use(Ae.a,{id:"UA-52977512-16",router:T}),m.default.use(C.a,D.a),m.default.use(l.a),D.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8",D.a.defaults.baseURL="https://service.zashare.org/",window.queryObject=(window.location.href.split("?")[1]||"").split("&").reduce(function(e,t){return e[t.split("=")[0]]=t.split("=")[1],e},{}),queryObject.reset_token&&b.a.commit("setResetToken",queryObject.reset_token),b.a.dispatch("scroll/init"),b.a.dispatch("auth/init"),b.a.dispatch("post/loadWebsite"),b.a.dispatch("manage/loadWebsite"),b.a.dispatch("loadExpos"),m.default.config.productionTip=!1,m.default.component("page_loading",$e),m.default.component("navbar",Ne),m.default.component("full_menu",Xe),m.default.component("newsbox",Qe),m.default.component("auth_panel",nt),m.default.component("section_footer",it),m.default.component("csv_export",ot),m.default.component("full_page",dt),m.default.mixin({computed:{apiDomain:function(){return"https://service.zashare.org/"}},methods:{replaceBr:function(e){return e.replace(/\n/g,"<br>")},bgcss:function(e){return{"background-image":'url("'+(e||"").replace(/..\/..\//g,"/").replace(/\/dropzone\/uploads/g,"/dropzone/uploads").trim()+'")',"background-position":"center center"}},strip_tags:function(e){return(""+e).replace(/(<([^>]+)>)/gi,"")},handleImageAdded:function(e,t,n){console.log("get picture!");var a=new FormData;a.append("file",e),console.log(e),D()({url:"https://service.zashare.org//api/upload",method:"POST",data:a}).then(function(e){var a=e.data;t.insertEmbed(n,"image",a)}).catch(function(e){console.log(e)})},uploadFile:function(e){console.log(e);var t=new FormData;t.append("file",e.file),t.append("token",b.a.state.auth.token),console.log(t),D()({url:"https://service.zashare.org/api/registexpo/uploadtemp",method:"POST",data:t}).then(function(e){e.data;console.log(e.data)}).catch(function(e){console.log(e)})},cssbg:function(e){return{"background-image":'url("'+e+'")'}},scrollTo:function(e,t){var n=r()({pan:0},t);$("html,body").animate({scrollTop:$(e).password_confirmationoffset().top+n.pan})},getDurationText:function(e,t){console.log(e,t);var n=e.split("-")[1],a=t.split("-")[1],i=e.split("-")[2],s=t.split("-")[2];return n==a?n+"/"+i+"-"+s:n+"/"+i+"-"+a+"/"+s}}}),setTimeout(function(){b.a.commit("setLoading",!1)},3e3),window.preload_all=_t;var ft=[i()(pt.default).map(function(e){return e.cover}),i()(pt.default).map(function(e){return e.slogan_image}),b.a.state.expos.map(function(e){return e.cover}),b.a.state.expos.map(function(e){return e.report_cover}),["https://service.zashare.org/img/2017/index_za_logo_white.svg"]].reduce(function(e,t){return e.concat(t)},[]);preload_all(ft).then(function(){console.log("load all success!")}).catch(function(){console.log("oh no")}),window.onresize=function(){b.a.commit("setMobile",window.innerWidth<1200)},queryObject.reset_token&&(b.a.commit("setResetToken",queryObject.reset_token),b.a.commit("openMenu","login"));new m.default({el:"#app",router:T,store:b.a,i18n:ht,components:{App:f,navbar:Ne,full_menu:Xe,page_loading:$e},template:"<App/>"})},NQix:function(e,t,n){(function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})})(n("a2/B"))},Nof9:function(e,t,n){(function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})})(n("a2/B"))},OULK:function(e,t){},OYzn:function(e,t,n){"use strict";let a=n("juYr"),i=n("TpQl").TweenMax,s=(n("jhqH"),!0);t.a={enable:!0,init:function(){var e=a(window);a(function(){e.on("mousewheel DOMMouseScroll",function(t){if(s){t.preventDefault();var n=t.originalEvent.wheelDelta/40||-t.originalEvent.detail/.5,a=e.scrollTop()-parseInt(50*n);i.to(e,1,{scrollTo:{y:a,autoKill:!0},ease:Power2.easeOut,overwrite:10})}})})},set(e){s=e}}},OvAf:function(e,t,n){"use strict";var a=n("BXyq"),i=n("S1cf"),s=n("rj2i"),r=n("uz6X"),o=n("7/2Y"),l=n("a2Uu");function u(e){this.defaults=e,this.interceptors={request:new s,response:new s}}u.prototype.request=function(e){"string"==typeof e&&(e=i.merge({url:arguments[0]},arguments[1])),(e=i.merge(a,this.defaults,{method:"get"},e)).baseURL&&!o(e.url)&&(e.url=l(e.baseURL,e.url));var t=[r,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},i.forEach(["delete","get","head"],function(e){u.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}))}}),i.forEach(["post","put","patch"],function(e){u.prototype[e]=function(t,n,a){return this.request(i.merge(a||{},{method:e,url:t,data:n}))}}),e.exports=u},P1iN:function(e,t,n){(function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},PWbO:function(e,t,n){"use strict";(function(e,a){n.d(t,"l",function(){return s});const i="undefined"!=typeof window?window:void 0!==e&&e.exports&&void 0!==a?a:this||{};t.k=i;const s=function(e,t){var n={},a=e.document,i=e.GreenSockGlobals=e.GreenSockGlobals||e;if(i.TweenLite)return i.TweenLite;var s,r,o,l,u,d,c,m=function(e){var t,n=e.split("."),a=i;for(t=0;t<n.length;t++)a[n[t]]=a=a[n[t]]||{};return a},_=m("com.greensock"),p=function(e){var t,n=[],a=e.length;for(t=0;t!==a;n.push(e[t++]));return n},h=function(){},f=(d=Object.prototype.toString,c=d.call([]),function(e){return null!=e&&(e instanceof Array||"object"==typeof e&&!!e.push&&d.call(e)===c)}),g={},y=function(e,t,a,s){this.sc=g[e]?g[e].sc:[],g[e]=this,this.gsClass=null,this.func=a;var r=[];this.check=function(o){for(var l,u,d,c,_=t.length,p=_;--_>-1;)(l=g[t[_]]||new y(t[_],[])).gsClass?(r[_]=l.gsClass,p--):o&&l.sc.push(this);if(0===p&&a)for(d=(u=("com.greensock."+e).split(".")).pop(),c=m(u.join("."))[d]=this.gsClass=a.apply(a,r),s&&(i[d]=n[d]=c),_=0;_<this.sc.length;_++)this.sc[_].check()},this.check(!0)},v=e._gsDefine=function(e,t,n,a){return new y(e,t,n,a)},b=_._class=function(e,t,n){return t=t||function(){},v(e,[],function(){return t},n),t};v.globals=i;var M=[0,0,1,1],w=b("easing.Ease",function(e,t,n,a){this._func=e,this._type=n||0,this._power=a||0,this._params=t?M.concat(t):M},!0),k=w.map={},L=w.register=function(e,t,n,a){for(var i,s,r,o,l=t.split(","),u=l.length,d=(n||"easeIn,easeOut,easeInOut").split(",");--u>-1;)for(s=l[u],i=a?b("easing."+s,null,!0):_.easing[s]||{},r=d.length;--r>-1;)o=d[r],k[s+"."+o]=k[o+s]=i[o]=e.getRatio?e:e[o]||new e};for((o=w.prototype)._calcEnd=!1,o.getRatio=function(e){if(this._func)return this._params[0]=e,this._func.apply(null,this._params);var t=this._type,n=this._power,a=1===t?1-e:2===t?e:e<.5?2*e:2*(1-e);return 1===n?a*=a:2===n?a*=a*a:3===n?a*=a*a*a:4===n&&(a*=a*a*a*a),1===t?1-a:2===t?a:e<.5?a/2:1-a/2},r=(s=["Linear","Quad","Cubic","Quart","Quint,Strong"]).length;--r>-1;)o=s[r]+",Power"+r,L(new w(null,null,1,r),o,"easeOut",!0),L(new w(null,null,2,r),o,"easeIn"+(0===r?",easeNone":"")),L(new w(null,null,3,r),o,"easeInOut");k.linear=_.easing.Linear.easeIn,k.swing=_.easing.Quad.easeInOut;var x=b("events.EventDispatcher",function(e){this._listeners={},this._eventTarget=e||this});(o=x.prototype).addEventListener=function(e,t,n,a,i){i=i||0;var s,r,o=this._listeners[e],d=0;for(this!==l||u||l.wake(),null==o&&(this._listeners[e]=o=[]),r=o.length;--r>-1;)(s=o[r]).c===t&&s.s===n?o.splice(r,1):0===d&&s.pr<i&&(d=r+1);o.splice(d,0,{c:t,s:n,up:a,pr:i})},o.removeEventListener=function(e,t){var n,a=this._listeners[e];if(a)for(n=a.length;--n>-1;)if(a[n].c===t)return void a.splice(n,1)},o.dispatchEvent=function(e){var t,n,a,i=this._listeners[e];if(i)for((t=i.length)>1&&(i=i.slice(0)),n=this._eventTarget;--t>-1;)(a=i[t])&&(a.up?a.c.call(a.s||n,{type:e,target:n}):a.c.call(a.s||n))};var T=e.requestAnimationFrame,Y=e.cancelAnimationFrame,D=Date.now||function(){return(new Date).getTime()},S=D();for(r=(s=["ms","moz","webkit","o"]).length;--r>-1&&!T;)T=e[s[r]+"RequestAnimationFrame"],Y=e[s[r]+"CancelAnimationFrame"]||e[s[r]+"CancelRequestAnimationFrame"];b("Ticker",function(e,t){var n,i,s,r,o,d=this,c=D(),m=!(!1===t||!T)&&"auto",_=500,p=33,f=function(e){var t,a,l=D()-S;l>_&&(c+=l-p),S+=l,d.time=(S-c)/1e3,t=d.time-o,(!n||t>0||!0===e)&&(d.frame++,o+=t+(t>=r?.004:r-t),a=!0),!0!==e&&(s=i(f)),a&&d.dispatchEvent("tick")};x.call(d),d.time=d.frame=0,d.tick=function(){f(!0)},d.lagSmoothing=function(e,t){if(!arguments.length)return _<1e10;_=e||1e10,p=Math.min(t,_,0)},d.sleep=function(){null!=s&&(m&&Y?Y(s):clearTimeout(s),i=h,s=null,d===l&&(u=!1))},d.wake=function(e){null!==s?d.sleep():e?c+=-S+(S=D()):d.frame>10&&(S=D()-_+5),i=0===n?h:m&&T?T:function(e){return setTimeout(e,1e3*(o-d.time)+1|0)},d===l&&(u=!0),f(2)},d.fps=function(e){if(!arguments.length)return n;r=1/((n=e)||60),o=this.time+r,d.wake()},d.useRAF=function(e){if(!arguments.length)return m;d.sleep(),m=e,d.fps(n)},d.fps(e),setTimeout(function(){"auto"===m&&d.frame<5&&"hidden"!==(a||{}).visibilityState&&d.useRAF(!1)},1500)}),(o=_.Ticker.prototype=new _.events.EventDispatcher).constructor=_.Ticker;var C=b("core.Animation",function(e,t){if(this.vars=t=t||{},this._duration=this._totalDuration=e||0,this._delay=Number(t.delay)||0,this._timeScale=1,this._active=!0===t.immediateRender,this.data=t.data,this._reversed=!0===t.reversed,V){u||l.wake();var n=this.vars.useFrames?X:V;n.add(this,n._time),this.vars.paused&&this.paused(!0)}});l=C.ticker=new _.Ticker,(o=C.prototype)._dirty=o._gc=o._initted=o._paused=!1,o._totalTime=o._time=0,o._rawPrevTime=-1,o._next=o._last=o._onUpdate=o._timeline=o.timeline=null,o._paused=!1;var j=function(){u&&D()-S>2e3&&("hidden"!==(a||{}).visibilityState||!l.lagSmoothing())&&l.wake();var e=setTimeout(j,2e3);e.unref&&e.unref()};j(),o.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},o.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},o.resume=function(e,t){return null!=e&&this.seek(e,t),this.paused(!1)},o.seek=function(e,t){return this.totalTime(Number(e),!1!==t)},o.restart=function(e,t){return this.reversed(!1).paused(!1).totalTime(e?-this._delay:0,!1!==t,!0)},o.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},o.render=function(e,t,n){},o.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,!this._gc&&this.timeline||this._enabled(!0),this},o.isActive=function(){var e,t=this._timeline,n=this._startTime;return!t||!this._gc&&!this._paused&&t.isActive()&&(e=t.rawTime(!0))>=n&&e<n+this.totalDuration()/this._timeScale-1e-7},o._enabled=function(e,t){return u||l.wake(),this._gc=!e,this._active=this.isActive(),!0!==t&&(e&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!e&&this.timeline&&this._timeline._remove(this,!0)),!1},o._kill=function(e,t){return this._enabled(!1,!1)},o.kill=function(e,t){return this._kill(e,t),this},o._uncache=function(e){for(var t=e?this:this.timeline;t;)t._dirty=!0,t=t.timeline;return this},o._swapSelfInParams=function(e){for(var t=e.length,n=e.concat();--t>-1;)"{self}"===e[t]&&(n[t]=this);return n},o._callback=function(e){var t=this.vars,n=t[e],a=t[e+"Params"],i=t[e+"Scope"]||t.callbackScope||this;switch(a?a.length:0){case 0:n.call(i);break;case 1:n.call(i,a[0]);break;case 2:n.call(i,a[0],a[1]);break;default:n.apply(i,a)}},o.eventCallback=function(e,t,n,a){if("on"===(e||"").substr(0,2)){var i=this.vars;if(1===arguments.length)return i[e];null==t?delete i[e]:(i[e]=t,i[e+"Params"]=f(n)&&-1!==n.join("").indexOf("{self}")?this._swapSelfInParams(n):n,i[e+"Scope"]=a),"onUpdate"===e&&(this._onUpdate=t)}return this},o.delay=function(e){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+e-this._delay),this._delay=e,this):this._delay},o.duration=function(e){return arguments.length?(this._duration=this._totalDuration=e,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._time<this._duration&&0!==e&&this.totalTime(this._totalTime*(e/this._duration),!0),this):(this._dirty=!1,this._duration)},o.totalDuration=function(e){return this._dirty=!1,arguments.length?this.duration(e):this._totalDuration},o.time=function(e,t){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(e>this._duration?this._duration:e,t)):this._time},o.totalTime=function(e,t,n){if(u||l.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!n&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var a=this._totalDuration,i=this._timeline;if(e>a&&!n&&(e=a),this._startTime=(this._paused?this._pauseTime:i._time)-(this._reversed?a-e:e)/this._timeScale,i._dirty||this._uncache(!1),i._timeline)for(;i._timeline;)i._timeline._time!==(i._startTime+i._totalTime)/i._timeScale&&i.totalTime(i._totalTime,!0),i=i._timeline}this._gc&&this._enabled(!0,!1),this._totalTime===e&&0!==this._duration||(H.length&&G(),this.render(e,t,!1),H.length&&G())}return this},o.progress=o.totalProgress=function(e,t){var n=this.duration();return arguments.length?this.totalTime(n*e,t):n?this._time/n:this.ratio},o.startTime=function(e){return arguments.length?(e!==this._startTime&&(this._startTime=e,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,e-this._delay)),this):this._startTime},o.endTime=function(e){return this._startTime+(0!=e?this.totalDuration():this.duration())/this._timeScale},o.timeScale=function(e){if(!arguments.length)return this._timeScale;var t,n;for(e=e||1e-10,this._timeline&&this._timeline.smoothChildTiming&&(n=(t=this._pauseTime)||0===t?t:this._timeline.totalTime(),this._startTime=n-(n-this._startTime)*this._timeScale/e),this._timeScale=e,n=this.timeline;n&&n.timeline;)n._dirty=!0,n.totalDuration(),n=n.timeline;return this},o.reversed=function(e){return arguments.length?(e!=this._reversed&&(this._reversed=e,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},o.paused=function(e){if(!arguments.length)return this._paused;var t,n,a=this._timeline;return e!=this._paused&&a&&(u||e||l.wake(),n=(t=a.rawTime())-this._pauseTime,!e&&a.smoothChildTiming&&(this._startTime+=n,this._uncache(!1)),this._pauseTime=e?t:null,this._paused=e,this._active=this.isActive(),!e&&0!==n&&this._initted&&this.duration()&&(t=a.smoothChildTiming?this._totalTime:(t-this._startTime)/this._timeScale,this.render(t,t===this._totalTime,!0))),this._gc&&!e&&this._enabled(!0,!1),this};var E=b("core.SimpleTimeline",function(e){C.call(this,0,e),this.autoRemoveChildren=this.smoothChildTiming=!0});(o=E.prototype=new C).constructor=E,o.kill()._gc=!1,o._first=o._last=o._recent=null,o._sortChildren=!1,o.add=o.insert=function(e,t,n,a){var i,s;if(e._startTime=Number(t||0)+e._delay,e._paused&&this!==e._timeline&&(e._pauseTime=this.rawTime()-(e._timeline.rawTime()-e._pauseTime)),e.timeline&&e.timeline._remove(e,!0),e.timeline=e._timeline=this,e._gc&&e._enabled(!0,!0),i=this._last,this._sortChildren)for(s=e._startTime;i&&i._startTime>s;)i=i._prev;return i?(e._next=i._next,i._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=i,this._recent=e,this._timeline&&this._uncache(!0),this},o._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},o.render=function(e,t,n){var a,i=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;i;)a=i._next,(i._active||e>=i._startTime&&!i._paused&&!i._gc)&&(i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,n):i.render((e-i._startTime)*i._timeScale,t,n)),i=a},o.rawTime=function(){return u||l.wake(),this._totalTime};var P=b("TweenLite",function(t,n,a){if(C.call(this,n,a),this.render=P.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:P.selector(t)||t;var i,s,r,o=t.jquery||t.length&&t!==e&&t[0]&&(t[0]===e||t[0].nodeType&&t[0].style&&!t.nodeType),l=this.vars.overwrite;if(this._overwrite=l=null==l?J[P.defaultOverwrite]:"number"==typeof l?l>>0:J[l],(o||t instanceof Array||t.push&&f(t))&&"number"!=typeof t[0])for(this._targets=r=p(t),this._propLookup=[],this._siblings=[],i=0;i<r.length;i++)(s=r[i])?"string"!=typeof s?s.length&&s!==e&&s[0]&&(s[0]===e||s[0].nodeType&&s[0].style&&!s.nodeType)?(r.splice(i--,1),this._targets=r=r.concat(p(s))):(this._siblings[i]=K(s,this,!1),1===l&&this._siblings[i].length>1&&ee(s,this,null,1,this._siblings[i])):"string"==typeof(s=r[i--]=P.selector(s))&&r.splice(i+1,1):r.splice(i--,1);else this._propLookup={},this._siblings=K(t,this,!1),1===l&&this._siblings.length>1&&ee(t,this,null,1,this._siblings);(this.vars.immediateRender||0===n&&0===this._delay&&!1!==this.vars.immediateRender)&&(this._time=-1e-10,this.render(Math.min(0,-this._delay)))},!0),O=function(t){return t&&t.length&&t!==e&&t[0]&&(t[0]===e||t[0].nodeType&&t[0].style&&!t.nodeType)};(o=P.prototype=new C).constructor=P,o.kill()._gc=!1,o.ratio=0,o._firstPT=o._targets=o._overwrittenProps=o._startAt=null,o._notifyPluginsOfEnabled=o._lazy=!1,P.version="2.0.1",P.defaultEase=o._ease=new w(null,null,1,1),P.defaultOverwrite="auto",P.ticker=l,P.autoSleep=120,P.lagSmoothing=function(e,t){l.lagSmoothing(e,t)},P.selector=e.$||e.jQuery||function(t){var n=e.$||e.jQuery;return n?(P.selector=n,n(t)):(a||(a=e.document),a?a.querySelectorAll?a.querySelectorAll(t):a.getElementById("#"===t.charAt(0)?t.substr(1):t):t)};var H=[],A={},F=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,$=/[\+-]=-?[\.\d]/,R=function(e){for(var t,n=this._firstPT;n;)t=n.blob?1===e&&null!=this.end?this.end:e?this.join(""):this.start:n.c*e+n.s,n.m?t=n.m.call(this._tween,t,this._target||n.t,this._tween):t<1e-6&&t>-1e-6&&!n.blob&&(t=0),n.f?n.fp?n.t[n.p](n.fp,t):n.t[n.p](t):n.t[n.p]=t,n=n._next},z=function(e,t,n,a){var i,s,r,o,l,u,d,c=[],m=0,_="",p=0;for(c.start=e,c.end=t,e=c[0]=e+"",t=c[1]=t+"",n&&(n(c),e=c[0],t=c[1]),c.length=0,i=e.match(F)||[],s=t.match(F)||[],a&&(a._next=null,a.blob=1,c._firstPT=c._applyPT=a),l=s.length,o=0;o<l;o++)d=s[o],_+=(u=t.substr(m,t.indexOf(d,m)-m))||!o?u:",",m+=u.length,p?p=(p+1)%5:"rgba("===u.substr(-5)&&(p=1),d===i[o]||i.length<=o?_+=d:(_&&(c.push(_),_=""),r=parseFloat(i[o]),c.push(r),c._firstPT={_next:c._firstPT,t:c,p:c.length-1,s:r,c:("="===d.charAt(1)?parseInt(d.charAt(0)+"1",10)*parseFloat(d.substr(2)):parseFloat(d)-r)||0,f:0,m:p&&p<4?Math.round:0}),m+=d.length;return(_+=t.substr(m))&&c.push(_),c.setRatio=R,$.test(t)&&(c.end=null),c},N=function(e,t,n,a,i,s,r,o,l){"function"==typeof a&&(a=a(l||0,e));var u=typeof e[t],d="function"!==u?"":t.indexOf("set")||"function"!=typeof e["get"+t.substr(3)]?t:"get"+t.substr(3),c="get"!==n?n:d?r?e[d](r):e[d]():e[t],m="string"==typeof a&&"="===a.charAt(1),_={t:e,p:t,s:c,f:"function"===u,pg:0,n:i||t,m:s?"function"==typeof s?s:Math.round:0,pr:0,c:m?parseInt(a.charAt(0)+"1",10)*parseFloat(a.substr(2)):parseFloat(a)-c||0};if(("number"!=typeof c||"number"!=typeof a&&!m)&&(r||isNaN(c)||!m&&isNaN(a)||"boolean"==typeof c||"boolean"==typeof a?(_.fp=r,_={t:z(c,m?parseFloat(_.s)+_.c+(_.s+"").replace(/[0-9\-\.]/g,""):a,o||P.defaultStringFilter,_),p:"setRatio",s:0,c:1,f:2,pg:0,n:i||t,pr:0,m:0}):(_.s=parseFloat(c),m||(_.c=parseFloat(a)-_.s||0))),_.c)return(_._next=this._firstPT)&&(_._next._prev=_),this._firstPT=_,_},W=P._internals={isArray:f,isSelector:O,lazyTweens:H,blobDif:z},I=P._plugins={},q=W.tweenLookup={},B=0,U=W.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1,id:1,yoyoEase:1},J={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,true:1,false:0},X=C._rootFramesTimeline=new E,V=C._rootTimeline=new E,Z=30,G=W.lazyRender=function(){var e,t=H.length;for(A={};--t>-1;)(e=H[t])&&!1!==e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0),e._lazy=!1);H.length=0};V._startTime=l.time,X._startTime=l.frame,V._active=X._active=!0,setTimeout(G,1),C._updateRoot=P.render=function(){var e,t,n;if(H.length&&G(),V.render((l.time-V._startTime)*V._timeScale,!1,!1),X.render((l.frame-X._startTime)*X._timeScale,!1,!1),H.length&&G(),l.frame>=Z){for(n in Z=l.frame+(parseInt(P.autoSleep,10)||120),q){for(e=(t=q[n].tweens).length;--e>-1;)t[e]._gc&&t.splice(e,1);0===t.length&&delete q[n]}if((!(n=V._first)||n._paused)&&P.autoSleep&&!X._first&&1===l._listeners.tick.length){for(;n&&n._paused;)n=n._next;n||l.sleep()}}},l.addEventListener("tick",C._updateRoot);var K=function(e,t,n){var a,i,s=e._gsTweenID;if(q[s||(e._gsTweenID=s="t"+B++)]||(q[s]={target:e,tweens:[]}),t&&((a=q[s].tweens)[i=a.length]=t,n))for(;--i>-1;)a[i]===t&&a.splice(i,1);return q[s].tweens},Q=function(e,t,n,a){var i,s,r=e.vars.onOverwrite;return r&&(i=r(e,t,n,a)),(r=P.onOverwrite)&&(s=r(e,t,n,a)),!1!==i&&!1!==s},ee=function(e,t,n,a,i){var s,r,o,l;if(1===a||a>=4){for(l=i.length,s=0;s<l;s++)if((o=i[s])!==t)o._gc||o._kill(null,e,t)&&(r=!0);else if(5===a)break;return r}var u,d=t._startTime+1e-10,c=[],m=0,_=0===t._duration;for(s=i.length;--s>-1;)(o=i[s])===t||o._gc||o._paused||(o._timeline!==t._timeline?(u=u||te(t,0,_),0===te(o,u,_)&&(c[m++]=o)):o._startTime<=d&&o._startTime+o.totalDuration()/o._timeScale>d&&((_||!o._initted)&&d-o._startTime<=2e-10||(c[m++]=o)));for(s=m;--s>-1;)if(o=c[s],2===a&&o._kill(n,e,t)&&(r=!0),2!==a||!o._firstPT&&o._initted){if(2!==a&&!Q(o,t))continue;o._enabled(!1,!1)&&(r=!0)}return r},te=function(e,t,n){for(var a=e._timeline,i=a._timeScale,s=e._startTime;a._timeline;){if(s+=a._startTime,i*=a._timeScale,a._paused)return-100;a=a._timeline}return(s/=i)>t?s-t:n&&s===t||!e._initted&&s-t<2e-10?1e-10:(s+=e.totalDuration()/e._timeScale/i)>t+1e-10?0:s-t-1e-10};o._init=function(){var e,t,n,a,i,s,r=this.vars,o=this._overwrittenProps,l=this._duration,u=!!r.immediateRender,d=r.ease;if(r.startAt){for(a in this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),i={},r.startAt)i[a]=r.startAt[a];if(i.data="isStart",i.overwrite=!1,i.immediateRender=!0,i.lazy=u&&!1!==r.lazy,i.startAt=i.delay=null,i.onUpdate=r.onUpdate,i.onUpdateParams=r.onUpdateParams,i.onUpdateScope=r.onUpdateScope||r.callbackScope||this,this._startAt=P.to(this.target||{},0,i),u)if(this._time>0)this._startAt=null;else if(0!==l)return}else if(r.runBackwards&&0!==l)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{for(a in 0!==this._time&&(u=!1),n={},r)U[a]&&"autoCSS"!==a||(n[a]=r[a]);if(n.overwrite=0,n.data="isFromStart",n.lazy=u&&!1!==r.lazy,n.immediateRender=u,this._startAt=P.to(this.target,0,n),u){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=d=d?d instanceof w?d:"function"==typeof d?new w(d,r.easeParams):k[d]||P.defaultEase:P.defaultEase,r.easeParams instanceof Array&&d.config&&(this._ease=d.config.apply(d,r.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(s=this._targets.length,e=0;e<s;e++)this._initProps(this._targets[e],this._propLookup[e]={},this._siblings[e],o?o[e]:null,e)&&(t=!0);else t=this._initProps(this.target,this._propLookup,this._siblings,o,0);if(t&&P._onPluginEvent("_onInitAllProps",this),o&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),r.runBackwards)for(n=this._firstPT;n;)n.s+=n.c,n.c=-n.c,n=n._next;this._onUpdate=r.onUpdate,this._initted=!0},o._initProps=function(t,n,a,i,s){var r,o,l,u,d,c;if(null==t)return!1;for(r in A[t._gsTweenID]&&G(),this.vars.css||t.style&&t!==e&&t.nodeType&&I.css&&!1!==this.vars.autoCSS&&function(e,t){var n,a={};for(n in e)U[n]||n in t&&"transform"!==n&&"x"!==n&&"y"!==n&&"width"!==n&&"height"!==n&&"className"!==n&&"border"!==n||!(!I[n]||I[n]&&I[n]._autoCSS)||(a[n]=e[n],delete e[n]);e.css=a}(this.vars,t),this.vars)if(c=this.vars[r],U[r])c&&(c instanceof Array||c.push&&f(c))&&-1!==c.join("").indexOf("{self}")&&(this.vars[r]=c=this._swapSelfInParams(c,this));else if(I[r]&&(u=new I[r])._onInitTween(t,this.vars[r],this,s)){for(this._firstPT=d={_next:this._firstPT,t:u,p:"setRatio",s:0,c:1,f:1,n:r,pg:1,pr:u._priority,m:0},o=u._overwriteProps.length;--o>-1;)n[u._overwriteProps[o]]=this._firstPT;(u._priority||u._onInitAllProps)&&(l=!0),(u._onDisable||u._onEnable)&&(this._notifyPluginsOfEnabled=!0),d._next&&(d._next._prev=d)}else n[r]=N.call(this,t,r,"get",c,r,0,null,this.vars.stringFilter,s);return i&&this._kill(i,t)?this._initProps(t,n,a,i,s):this._overwrite>1&&this._firstPT&&a.length>1&&ee(t,this,n,this._overwrite,a)?(this._kill(n,t),this._initProps(t,n,a,i,s)):(this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration)&&(A[t._gsTweenID]=!0),l)},o.render=function(e,t,n){var a,i,s,r,o=this._time,l=this._duration,u=this._rawPrevTime;if(e>=l-1e-7&&e>=0)this._totalTime=this._time=l,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(a=!0,i="onComplete",n=n||this._timeline.autoRemoveChildren),0===l&&(this._initted||!this.vars.lazy||n)&&(this._startTime===this._timeline._duration&&(e=0),(u<0||e<=0&&e>=-1e-7||1e-10===u&&"isPause"!==this.data)&&u!==e&&(n=!0,u>1e-10&&(i="onReverseComplete")),this._rawPrevTime=r=!t||e||u===e?e:1e-10);else if(e<1e-7)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===l&&u>0)&&(i="onReverseComplete",a=this._reversed),e<0&&(this._active=!1,0===l&&(this._initted||!this.vars.lazy||n)&&(u>=0&&(1e-10!==u||"isPause"!==this.data)&&(n=!0),this._rawPrevTime=r=!t||e||u===e?e:1e-10)),(!this._initted||this._startAt&&this._startAt.progress())&&(n=!0);else if(this._totalTime=this._time=e,this._easeType){var d=e/l,c=this._easeType,m=this._easePower;(1===c||3===c&&d>=.5)&&(d=1-d),3===c&&(d*=2),1===m?d*=d:2===m?d*=d*d:3===m?d*=d*d*d:4===m&&(d*=d*d*d*d),this.ratio=1===c?1-d:2===c?d:e/l<.5?d/2:1-d/2}else this.ratio=this._ease.getRatio(e/l);if(this._time!==o||n){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!n&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=u,H.push(this),void(this._lazy=[e,t]);this._time&&!a?this.ratio=this._ease.getRatio(this._time/l):a&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&e>=0&&(this._active=!0),0===o&&(this._startAt&&(e>=0?this._startAt.render(e,!0,n):i||(i="_dummyGS")),this.vars.onStart&&(0===this._time&&0!==l||t||this._callback("onStart"))),s=this._firstPT;s;)s.f?s.t[s.p](s.c*this.ratio+s.s):s.t[s.p]=s.c*this.ratio+s.s,s=s._next;this._onUpdate&&(e<0&&this._startAt&&-1e-4!==e&&this._startAt.render(e,!0,n),t||(this._time!==o||a||n)&&this._callback("onUpdate")),i&&(this._gc&&!n||(e<0&&this._startAt&&!this._onUpdate&&-1e-4!==e&&this._startAt.render(e,!0,n),a&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[i]&&this._callback(i),0===l&&1e-10===this._rawPrevTime&&1e-10!==r&&(this._rawPrevTime=0)))}},o._kill=function(e,t,n){if("all"===e&&(e=null),null==e&&(null==t||t===this.target))return this._lazy=!1,this._enabled(!1,!1);t="string"!=typeof t?t||this._targets||this.target:P.selector(t)||t;var a,i,s,r,o,l,u,d,c,m=n&&this._time&&n._startTime===this._startTime&&this._timeline===n._timeline;if((f(t)||O(t))&&"number"!=typeof t[0])for(a=t.length;--a>-1;)this._kill(e,t[a],n)&&(l=!0);else{if(this._targets){for(a=this._targets.length;--a>-1;)if(t===this._targets[a]){o=this._propLookup[a]||{},this._overwrittenProps=this._overwrittenProps||[],i=this._overwrittenProps[a]=e?this._overwrittenProps[a]||{}:"all";break}}else{if(t!==this.target)return!1;o=this._propLookup,i=this._overwrittenProps=e?this._overwrittenProps||{}:"all"}if(o){if(u=e||o,d=e!==i&&"all"!==i&&e!==o&&("object"!=typeof e||!e._tempKill),n&&(P.onOverwrite||this.vars.onOverwrite)){for(s in u)o[s]&&(c||(c=[]),c.push(s));if((c||!e)&&!Q(this,n,t,c))return!1}for(s in u)(r=o[s])&&(m&&(r.f?r.t[r.p](r.s):r.t[r.p]=r.s,l=!0),r.pg&&r.t._kill(u)&&(l=!0),r.pg&&0!==r.t._overwriteProps.length||(r._prev?r._prev._next=r._next:r===this._firstPT&&(this._firstPT=r._next),r._next&&(r._next._prev=r._prev),r._next=r._prev=null),delete o[s]),d&&(i[s]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return l},o.invalidate=function(){return this._notifyPluginsOfEnabled&&P._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],C.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-1e-10,this.render(Math.min(0,-this._delay))),this},o._enabled=function(e,t){if(u||l.wake(),e&&this._gc){var n,a=this._targets;if(a)for(n=a.length;--n>-1;)this._siblings[n]=K(a[n],this,!0);else this._siblings=K(this.target,this,!0)}return C.prototype._enabled.call(this,e,t),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&P._onPluginEvent(e?"_onEnable":"_onDisable",this)},P.to=function(e,t,n){return new P(e,t,n)},P.from=function(e,t,n){return n.runBackwards=!0,n.immediateRender=0!=n.immediateRender,new P(e,t,n)},P.fromTo=function(e,t,n,a){return a.startAt=n,a.immediateRender=0!=a.immediateRender&&0!=n.immediateRender,new P(e,t,a)},P.delayedCall=function(e,t,n,a,i){return new P(t,0,{delay:e,onComplete:t,onCompleteParams:n,callbackScope:a,onReverseComplete:t,onReverseCompleteParams:n,immediateRender:!1,lazy:!1,useFrames:i,overwrite:0})},P.set=function(e,t){return new P(e,0,t)},P.getTweensOf=function(e,t){if(null==e)return[];var n,a,i,s;if(e="string"!=typeof e?e:P.selector(e)||e,(f(e)||O(e))&&"number"!=typeof e[0]){for(n=e.length,a=[];--n>-1;)a=a.concat(P.getTweensOf(e[n],t));for(n=a.length;--n>-1;)for(s=a[n],i=n;--i>-1;)s===a[i]&&a.splice(n,1)}else if(e._gsTweenID)for(n=(a=K(e).concat()).length;--n>-1;)(a[n]._gc||t&&!a[n].isActive())&&a.splice(n,1);return a||[]},P.killTweensOf=P.killDelayedCallsTo=function(e,t,n){"object"==typeof t&&(n=t,t=!1);for(var a=P.getTweensOf(e,t),i=a.length;--i>-1;)a[i]._kill(n,e)};var ne=b("plugins.TweenPlugin",function(e,t){this._overwriteProps=(e||"").split(","),this._propName=this._overwriteProps[0],this._priority=t||0,this._super=ne.prototype},!0);if(o=ne.prototype,ne.version="1.19.0",ne.API=2,o._firstPT=null,o._addTween=N,o.setRatio=R,o._kill=function(e){var t,n=this._overwriteProps,a=this._firstPT;if(null!=e[this._propName])this._overwriteProps=[];else for(t=n.length;--t>-1;)null!=e[n[t]]&&n.splice(t,1);for(;a;)null!=e[a.n]&&(a._next&&(a._next._prev=a._prev),a._prev?(a._prev._next=a._next,a._prev=null):this._firstPT===a&&(this._firstPT=a._next)),a=a._next;return!1},o._mod=o._roundProps=function(e){for(var t,n=this._firstPT;n;)(t=e[this._propName]||null!=n.n&&e[n.n.split(this._propName+"_").join("")])&&"function"==typeof t&&(2===n.f?n.t._applyPT.m=t:n.m=t),n=n._next},P._onPluginEvent=function(e,t){var n,a,i,s,r,o=t._firstPT;if("_onInitAllProps"===e){for(;o;){for(r=o._next,a=i;a&&a.pr>o.pr;)a=a._next;(o._prev=a?a._prev:s)?o._prev._next=o:i=o,(o._next=a)?a._prev=o:s=o,o=r}o=t._firstPT=i}for(;o;)o.pg&&"function"==typeof o.t[e]&&o.t[e]()&&(n=!0),o=o._next;return n},ne.activate=function(e){for(var t=e.length;--t>-1;)e[t].API===ne.API&&(I[(new e[t])._propName]=e[t]);return!0},v.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,n=e.propName,a=e.priority||0,i=e.overwriteProps,s={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},r=b("plugins."+n.charAt(0).toUpperCase()+n.substr(1)+"Plugin",function(){ne.call(this,n,a),this._overwriteProps=i||[]},!0===e.global),o=r.prototype=new ne(n);for(t in o.constructor=r,r.API=e.API,s)"function"==typeof e[t]&&(o[s[t]]=e[t]);return r.version=e.version,ne.activate([r]),r},s=e._gsQueue){for(r=0;r<s.length;r++)s[r]();for(o in g)g[o].func||e.console.log("GSAP encountered missing dependency: "+o)}return u=!1,P}(i),r=i.com.greensock,o=r.core.SimpleTimeline;t.i=o;const l=r.core.Animation;t.a=l;const u=i.Ease;t.b=u;const d=i.Linear;t.c=d;const c=d;t.d=c;const m=i.Power1;t.e=m;const _=i.Power2;t.f=_;const p=i.Power3;t.g=p;const h=i.Power4;t.h=h;const f=i.TweenPlugin;t.j=f;r.events.EventDispatcher}).call(t,n("f1Eh")(e),n("DuR2"))},Q74p:function(e,t){},QgBj:function(e,t,n){(function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],i=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},Qi2K:function(e,t){},R1TQ:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?i[n][2]?i[n][2]:i[n][1]:a?i[n][0]:i[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},R68T:function(e,t,n){(function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})})(n("a2/B"))},R7ko:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},RV8r:function(e,t,n){(function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬ_ಅಕ್ಟೋಬ_ನವೆಂಬ_ಡಿಸೆಂಬ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})})(n("a2/B"))},RaVB:function(e,t,n){(function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})})(n("a2/B"))},Rum7:function(e,t,n){(function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})})(n("a2/B"))},S0Eq:function(e,t,n){(function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t?e:"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})})(n("a2/B"))},S1cf:function(e,t,n){"use strict";var a=n("ED/T"),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function r(e){return null!==e&&"object"==typeof e}function o(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!==e&&void 0!==e)if("object"==typeof e||s(e)||(e=[e]),s(e))for(var n=0,a=e.length;n<a;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:r,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:o,isStream:function(e){return r(e)&&o(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement},forEach:l,merge:function e(){var t={};function n(n,a){"object"==typeof t[a]&&"object"==typeof n?t[a]=e(t[a],n):t[a]=n}for(var a=0,i=arguments.length;a<i;a++)l(arguments[a],n);return t},extend:function(e,t,n){return l(t,function(t,i){e[i]=n&&"function"==typeof t?a(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},S8eO:function(e,t){},SOHb:function(e,t,n){(function(e){"use strict";e.defineLocale("ar-dz",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"أح_إث_ثلا_أر_خم_جم_سب".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:4}})})(n("a2/B"))},SPVK:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=[{title:"EXPO",slogan_image:"/static/img/ZA EXPO/slogan.svg",slogan_text:"LEARN FOR CHANGE<br>學會改變",cover:"/static/img/ZA EXPO/pic.png",nav_image:"/static/img/Home/za-course.svg",color:"#1161ef",description:"自2015年創辦,雜學校開創台灣第一個針對教育內容為主體的年度大型博覽。開放來自台灣各地原創的多元教育觀點參展,串聯起體制內到外,提供有學習需求的民眾、創新教育者與產官學界一個教育交流的場域,一同對台灣的未來教育提出思考,並攜手創造持續的社會影響力。"},{title:"BASE",slogan_image:"/static/img/ZA BASE/slogan.svg",slogan_text:"LEARN IN REAL<br>學會實現",cover:"/static/img/ZA BASE/pic.png",nav_image:"/static/img/Home/za-base.svg",color:"#8af187",description:"不只是精神理念的號召,我們將在華山文創園區打造Event Base的雜學校實體空間!透過不同的議題策展與場景體驗帶出以學習者為中心的另類學習基地,品牌體驗空間結合展演、講堂、工作坊、議題松實做等,希望以教育為基底,用行動實踐議題的學習主軸建構一個超酷場域。"},{title:"COURSE",slogan_image:"/static/img/ZA COURSE/slogan.svg",slogan_text:"LEARN IN JOY<br>學會上癮",cover:"/static/img/ZA COURSE/pic.png",nav_image:"/static/img/Home/za-expo.svg",color:"#8135f9",description:"2018年起,我們試圖匯聚各個領域的燈塔,建立起教育與時俱進的指標,讓學習的方向更加明確與有邏輯。提供線下至線上、各種多元面向的課程選擇,以脈絡式的課程大綱進行規劃,讓自主學習這件事不是茫然地像在汪洋中學習。"}]},TbSk:function(e,t){},TkXE:function(e,t){},TnpP:function(e,t){},TpQl:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("PWbO");a.k._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(){var e=function(e){a.i.call(this,e),this._labels={},this.autoRemoveChildren=!0===this.vars.autoRemoveChildren,this.smoothChildTiming=!0===this.vars.smoothChildTiming,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var t,n,i=this.vars;for(n in i)t=i[n],s(t)&&-1!==t.join("").indexOf("{self}")&&(i[n]=this._swapSelfInParams(t));s(i.tweens)&&this.add(i.tweens,0,i.align,i.stagger)},t=a.l._internals,n=e._internals={},i=t.isSelector,s=t.isArray,r=t.lazyTweens,o=t.lazyRender,l=a.k._gsDefine.globals,u=function(e){var t,n={};for(t in e)n[t]=e[t];return n},d=function(e,t,n){var a,i,s=e.cycle;for(a in s)i=s[a],e[a]="function"==typeof i?i(n,t[n]):i[n%i.length];delete e.cycle},c=n.pauseCallback=function(){},m=function(e){var t,n=[],a=e.length;for(t=0;t!==a;n.push(e[t++]));return n},_=e.prototype=new a.i;return e.version="2.0.1",_.constructor=e,_.kill()._gc=_._forcingPlayhead=_._hasPause=!1,_.to=function(e,t,n,i){var s=n.repeat&&l.TweenMax||a.l;return t?this.add(new s(e,t,n),i):this.set(e,n,i)},_.from=function(e,t,n,i){return this.add((n.repeat&&l.TweenMax||a.l).from(e,t,n),i)},_.fromTo=function(e,t,n,i,s){var r=i.repeat&&l.TweenMax||a.l;return t?this.add(r.fromTo(e,t,n,i),s):this.set(e,i,s)},_.staggerTo=function(t,n,s,r,o,l,c,_){var p,h,f=new e({onComplete:l,onCompleteParams:c,callbackScope:_,smoothChildTiming:this.smoothChildTiming}),g=s.cycle;for("string"==typeof t&&(t=a.l.selector(t)||t),i(t=t||[])&&(t=m(t)),(r=r||0)<0&&((t=m(t)).reverse(),r*=-1),h=0;h<t.length;h++)(p=u(s)).startAt&&(p.startAt=u(p.startAt),p.startAt.cycle&&d(p.startAt,t,h)),g&&(d(p,t,h),null!=p.duration&&(n=p.duration,delete p.duration)),f.to(t[h],n,p,h*r);return this.add(f,o)},_.staggerFrom=function(e,t,n,a,i,s,r,o){return n.immediateRender=0!=n.immediateRender,n.runBackwards=!0,this.staggerTo(e,t,n,a,i,s,r,o)},_.staggerFromTo=function(e,t,n,a,i,s,r,o,l){return a.startAt=n,a.immediateRender=0!=a.immediateRender&&0!=n.immediateRender,this.staggerTo(e,t,a,i,s,r,o,l)},_.call=function(e,t,n,i){return this.add(a.l.delayedCall(0,e,t,n),i)},_.set=function(e,t,n){return n=this._parseTimeOrLabel(n,0,!0),null==t.immediateRender&&(t.immediateRender=n===this._time&&!this._paused),this.add(new a.l(e,0,t),n)},e.exportRoot=function(t,n){null==(t=t||{}).smoothChildTiming&&(t.smoothChildTiming=!0);var i,s,r,o,l=new e(t),u=l._timeline;for(null==n&&(n=!0),u._remove(l,!0),l._startTime=0,l._rawPrevTime=l._time=l._totalTime=u._time,r=u._first;r;)o=r._next,n&&r instanceof a.l&&r.target===r.vars.onComplete||((s=r._startTime-r._delay)<0&&(i=1),l.add(r,s)),r=o;return u.add(l,0),i&&l.totalDuration(),l},_.add=function(t,n,i,r){var o,l,u,d,c,m;if("number"!=typeof n&&(n=this._parseTimeOrLabel(n,0,!0,t)),!(t instanceof a.a)){if(t instanceof Array||t&&t.push&&s(t)){for(i=i||"normal",r=r||0,o=n,l=t.length,u=0;u<l;u++)s(d=t[u])&&(d=new e({tweens:d})),this.add(d,o),"string"!=typeof d&&"function"!=typeof d&&("sequence"===i?o=d._startTime+d.totalDuration()/d._timeScale:"start"===i&&(d._startTime-=d.delay())),o+=r;return this._uncache(!0)}if("string"==typeof t)return this.addLabel(t,n);if("function"!=typeof t)throw"Cannot add "+t+" into the timeline; it is not a tween, timeline, function, or string.";t=a.l.delayedCall(0,t)}if(a.i.prototype.add.call(this,t,n),t._time&&t.render((this.rawTime()-t._startTime)*t._timeScale,!1,!1),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(m=(c=this).rawTime()>t._startTime;c._timeline;)m&&c._timeline.smoothChildTiming?c.totalTime(c._totalTime,!0):c._gc&&c._enabled(!0,!1),c=c._timeline;return this},_.remove=function(e){if(e instanceof a.a){this._remove(e,!1);var t=e._timeline=e.vars.useFrames?a.a._rootFramesTimeline:a.a._rootTimeline;return e._startTime=(e._paused?e._pauseTime:t._time)-(e._reversed?e.totalDuration()-e._totalTime:e._totalTime)/e._timeScale,this}if(e instanceof Array||e&&e.push&&s(e)){for(var n=e.length;--n>-1;)this.remove(e[n]);return this}return"string"==typeof e?this.removeLabel(e):this.kill(null,e)},_._remove=function(e,t){return a.i.prototype._remove.call(this,e,t),this._last?this._time>this.duration()&&(this._time=this._duration,this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},_.append=function(e,t){return this.add(e,this._parseTimeOrLabel(null,t,!0,e))},_.insert=_.insertMultiple=function(e,t,n,a){return this.add(e,t||0,n,a)},_.appendMultiple=function(e,t,n,a){return this.add(e,this._parseTimeOrLabel(null,t,!0,e),n,a)},_.addLabel=function(e,t){return this._labels[e]=this._parseTimeOrLabel(t),this},_.addPause=function(e,t,n,i){var s=a.l.delayedCall(0,c,n,i||this);return s.vars.onComplete=s.vars.onReverseComplete=t,s.data="isPause",this._hasPause=!0,this.add(s,e)},_.removeLabel=function(e){return delete this._labels[e],this},_.getLabelTime=function(e){return null!=this._labels[e]?this._labels[e]:-1},_._parseTimeOrLabel=function(e,t,n,i){var r,o;if(i instanceof a.a&&i.timeline===this)this.remove(i);else if(i&&(i instanceof Array||i.push&&s(i)))for(o=i.length;--o>-1;)i[o]instanceof a.a&&i[o].timeline===this&&this.remove(i[o]);if(r="number"!=typeof e||t?this.duration()>99999999999?this.recent().endTime(!1):this._duration:0,"string"==typeof t)return this._parseTimeOrLabel(t,n&&"number"==typeof e&&null==this._labels[t]?e-r:0,n);if(t=t||0,"string"!=typeof e||!isNaN(e)&&null==this._labels[e])null==e&&(e=r);else{if(-1===(o=e.indexOf("=")))return null==this._labels[e]?n?this._labels[e]=r+t:t:this._labels[e]+t;t=parseInt(e.charAt(o-1)+"1",10)*Number(e.substr(o+1)),e=o>1?this._parseTimeOrLabel(e.substr(0,o-1),0,n):r}return Number(e)+t},_.seek=function(e,t){return this.totalTime("number"==typeof e?e:this._parseTimeOrLabel(e),!1!==t)},_.stop=function(){return this.paused(!0)},_.gotoAndPlay=function(e,t){return this.play(e,t)},_.gotoAndStop=function(e,t){return this.pause(e,t)},_.render=function(e,t,n){this._gc&&this._enabled(!0,!1);var a,i,s,l,u,d,c,m=this._time,_=this._dirty?this.totalDuration():this._totalDuration,p=this._startTime,h=this._timeScale,f=this._paused;if(m!==this._time&&(e+=this._time-m),e>=_-1e-7&&e>=0)this._totalTime=this._time=_,this._reversed||this._hasPausedChild()||(i=!0,l="onComplete",u=!!this._timeline.autoRemoveChildren,0===this._duration&&(e<=0&&e>=-1e-7||this._rawPrevTime<0||1e-10===this._rawPrevTime)&&this._rawPrevTime!==e&&this._first&&(u=!0,this._rawPrevTime>1e-10&&(l="onReverseComplete"))),this._rawPrevTime=this._duration||!t||e||this._rawPrevTime===e?e:1e-10,e=_+1e-4;else if(e<1e-7)if(this._totalTime=this._time=0,(0!==m||0===this._duration&&1e-10!==this._rawPrevTime&&(this._rawPrevTime>0||e<0&&this._rawPrevTime>=0))&&(l="onReverseComplete",i=this._reversed),e<0)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(u=i=!0,l="onReverseComplete"):this._rawPrevTime>=0&&this._first&&(u=!0),this._rawPrevTime=e;else{if(this._rawPrevTime=this._duration||!t||e||this._rawPrevTime===e?e:1e-10,0===e&&i)for(a=this._first;a&&0===a._startTime;)a._duration||(i=!1),a=a._next;e=0,this._initted||(u=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!t){if(e>=m)for(a=this._first;a&&a._startTime<=e&&!d;)a._duration||"isPause"!==a.data||a.ratio||0===a._startTime&&0===this._rawPrevTime||(d=a),a=a._next;else for(a=this._last;a&&a._startTime>=e&&!d;)a._duration||"isPause"===a.data&&a._rawPrevTime>0&&(d=a),a=a._prev;d&&(this._time=e=d._startTime,this._totalTime=e+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=e}if(this._time!==m&&this._first||n||u||d){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==m&&e>0&&(this._active=!0),0===m&&this.vars.onStart&&(0===this._time&&this._duration||t||this._callback("onStart")),(c=this._time)>=m)for(a=this._first;a&&(s=a._next,c===this._time&&(!this._paused||f));)(a._active||a._startTime<=c&&!a._paused&&!a._gc)&&(d===a&&this.pause(),a._reversed?a.render((a._dirty?a.totalDuration():a._totalDuration)-(e-a._startTime)*a._timeScale,t,n):a.render((e-a._startTime)*a._timeScale,t,n)),a=s;else for(a=this._last;a&&(s=a._prev,c===this._time&&(!this._paused||f));){if(a._active||a._startTime<=m&&!a._paused&&!a._gc){if(d===a){for(d=a._prev;d&&d.endTime()>this._time;)d.render(d._reversed?d.totalDuration()-(e-d._startTime)*d._timeScale:(e-d._startTime)*d._timeScale,t,n),d=d._prev;d=null,this.pause()}a._reversed?a.render((a._dirty?a.totalDuration():a._totalDuration)-(e-a._startTime)*a._timeScale,t,n):a.render((e-a._startTime)*a._timeScale,t,n)}a=s}this._onUpdate&&(t||(r.length&&o(),this._callback("onUpdate"))),l&&(this._gc||p!==this._startTime&&h===this._timeScale||(0===this._time||_>=this.totalDuration())&&(i&&(r.length&&o(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[l]&&this._callback(l)))}},_._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof e&&t._hasPausedChild())return!0;t=t._next}return!1},_.getChildren=function(e,t,n,i){i=i||-9999999999;for(var s=[],r=this._first,o=0;r;)r._startTime<i||(r instanceof a.l?!1!==t&&(s[o++]=r):(!1!==n&&(s[o++]=r),!1!==e&&(o=(s=s.concat(r.getChildren(!0,t,n))).length))),r=r._next;return s},_.getTweensOf=function(e,t){var n,i,s=this._gc,r=[],o=0;for(s&&this._enabled(!0,!0),i=(n=a.l.getTweensOf(e)).length;--i>-1;)(n[i].timeline===this||t&&this._contains(n[i]))&&(r[o++]=n[i]);return s&&this._enabled(!1,!0),r},_.recent=function(){return this._recent},_._contains=function(e){for(var t=e.timeline;t;){if(t===this)return!0;t=t.timeline}return!1},_.shiftChildren=function(e,t,n){n=n||0;for(var a,i=this._first,s=this._labels;i;)i._startTime>=n&&(i._startTime+=e),i=i._next;if(t)for(a in s)s[a]>=n&&(s[a]+=e);return this._uncache(!0)},_._kill=function(e,t){if(!e&&!t)return this._enabled(!1,!1);for(var n=t?this.getTweensOf(t):this.getChildren(!0,!0,!1),a=n.length,i=!1;--a>-1;)n[a]._kill(e,t)&&(i=!0);return i},_.clear=function(e){var t=this.getChildren(!1,!0,!0),n=t.length;for(this._time=this._totalTime=0;--n>-1;)t[n]._enabled(!1,!1);return!1!==e&&(this._labels={}),this._uncache(!0)},_.invalidate=function(){for(var e=this._first;e;)e.invalidate(),e=e._next;return a.a.prototype.invalidate.call(this)},_._enabled=function(e,t){if(e===this._gc)for(var n=this._first;n;)n._enabled(e,!0),n=n._next;return a.i.prototype._enabled.call(this,e,t)},_.totalTime=function(e,t,n){this._forcingPlayhead=!0;var i=a.a.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,i},_.duration=function(e){return arguments.length?(0!==this.duration()&&0!==e&&this.timeScale(this._duration/e),this):(this._dirty&&this.totalDuration(),this._duration)},_.totalDuration=function(e){if(!arguments.length){if(this._dirty){for(var t,n,a=0,i=this._last,s=999999999999;i;)t=i._prev,i._dirty&&i.totalDuration(),i._startTime>s&&this._sortChildren&&!i._paused&&!this._calculatingDuration?(this._calculatingDuration=1,this.add(i,i._startTime-i._delay),this._calculatingDuration=0):s=i._startTime,i._startTime<0&&!i._paused&&(a-=i._startTime,this._timeline.smoothChildTiming&&(this._startTime+=i._startTime/this._timeScale,this._time-=i._startTime,this._totalTime-=i._startTime,this._rawPrevTime-=i._startTime),this.shiftChildren(-i._startTime,!1,-9999999999),s=0),(n=i._startTime+i._totalDuration/i._timeScale)>a&&(a=n),i=t;this._duration=this._totalDuration=a,this._dirty=!1}return this._totalDuration}return e&&this.totalDuration()?this.timeScale(this._totalDuration/e):this},_.paused=function(e){if(!e)for(var t=this._first,n=this._time;t;)t._startTime===n&&"isPause"===t.data&&(t._rawPrevTime=0),t=t._next;return a.a.prototype.paused.apply(this,arguments)},_.usesFrames=function(){for(var e=this._timeline;e._timeline;)e=e._timeline;return e===a.a._rootFramesTimeline},_.rawTime=function(e){return e&&(this._paused||this._repeat&&this.time()>0&&this.totalProgress()<1)?this._totalTime%(this._duration+this._repeatDelay):this._paused?this._totalTime:(this._timeline.rawTime(e)-this._startTime)*this._timeScale},e},!0);const i=a.k.TimelineLite;a.k._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(){var e=function(e){i.call(this,e),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=!0===this.vars.yoyo,this._dirty=!0},t=a.l._internals,n=t.lazyTweens,s=t.lazyRender,r=a.k._gsDefine.globals,o=new a.b(null,null,1,0),l=e.prototype=new i;return l.constructor=e,l.kill()._gc=!1,e.version="2.0.1",l.invalidate=function(){return this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),i.prototype.invalidate.call(this)},l.addCallback=function(e,t,n,i){return this.add(a.l.delayedCall(0,e,n,i),t)},l.removeCallback=function(e,t){if(e)if(null==t)this._kill(null,e);else for(var n=this.getTweensOf(e,!1),a=n.length,i=this._parseTimeOrLabel(t);--a>-1;)n[a]._startTime===i&&n[a]._enabled(!1,!1);return this},l.removePause=function(e){return this.removeCallback(i._internals.pauseCallback,e)},l.tweenTo=function(e,t){t=t||{};var n,i,s,l={ease:o,useFrames:this.usesFrames(),immediateRender:!1,lazy:!1},u=t.repeat&&r.TweenMax||a.l;for(i in t)l[i]=t[i];return l.time=this._parseTimeOrLabel(e),n=Math.abs(Number(l.time)-this._time)/this._timeScale||.001,s=new u(this,n,l),l.onStart=function(){s.target.paused(!0),s.vars.time===s.target.time()||n!==s.duration()||s.isFromTo||s.duration(Math.abs(s.vars.time-s.target.time())/s.target._timeScale).render(s.time(),!0,!0),t.onStart&&t.onStart.apply(t.onStartScope||t.callbackScope||s,t.onStartParams||[])},s},l.tweenFromTo=function(e,t,n){n=n||{},e=this._parseTimeOrLabel(e),n.startAt={onComplete:this.seek,onCompleteParams:[e],callbackScope:this},n.immediateRender=!1!==n.immediateRender;var a=this.tweenTo(t,n);return a.isFromTo=1,a.duration(Math.abs(a.vars.time-e)/this._timeScale||.001)},l.render=function(e,t,a){this._gc&&this._enabled(!0,!1);var i,r,o,l,u,d,c,m,_=this._time,p=this._dirty?this.totalDuration():this._totalDuration,h=this._duration,f=this._totalTime,g=this._startTime,y=this._timeScale,v=this._rawPrevTime,b=this._paused,M=this._cycle;if(_!==this._time&&(e+=this._time-_),e>=p-1e-7&&e>=0)this._locked||(this._totalTime=p,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(r=!0,l="onComplete",u=!!this._timeline.autoRemoveChildren,0===this._duration&&(e<=0&&e>=-1e-7||v<0||1e-10===v)&&v!==e&&this._first&&(u=!0,v>1e-10&&(l="onReverseComplete"))),this._rawPrevTime=this._duration||!t||e||this._rawPrevTime===e?e:1e-10,this._yoyo&&0!=(1&this._cycle)?this._time=e=0:(this._time=h,e=h+1e-4);else if(e<1e-7)if(this._locked||(this._totalTime=this._cycle=0),this._time=0,(0!==_||0===h&&1e-10!==v&&(v>0||e<0&&v>=0)&&!this._locked)&&(l="onReverseComplete",r=this._reversed),e<0)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(u=r=!0,l="onReverseComplete"):v>=0&&this._first&&(u=!0),this._rawPrevTime=e;else{if(this._rawPrevTime=h||!t||e||this._rawPrevTime===e?e:1e-10,0===e&&r)for(i=this._first;i&&0===i._startTime;)i._duration||(r=!1),i=i._next;e=0,this._initted||(u=!0)}else if(0===h&&v<0&&(u=!0),this._time=this._rawPrevTime=e,this._locked||(this._totalTime=e,0!==this._repeat&&(d=h+this._repeatDelay,this._cycle=this._totalTime/d>>0,0!==this._cycle&&this._cycle===this._totalTime/d&&f<=e&&this._cycle--,this._time=this._totalTime-this._cycle*d,this._yoyo&&0!=(1&this._cycle)&&(this._time=h-this._time),this._time>h?(this._time=h,e=h+1e-4):this._time<0?this._time=e=0:e=this._time)),this._hasPause&&!this._forcingPlayhead&&!t){if((e=this._time)>=_||this._repeat&&M!==this._cycle)for(i=this._first;i&&i._startTime<=e&&!c;)i._duration||"isPause"!==i.data||i.ratio||0===i._startTime&&0===this._rawPrevTime||(c=i),i=i._next;else for(i=this._last;i&&i._startTime>=e&&!c;)i._duration||"isPause"===i.data&&i._rawPrevTime>0&&(c=i),i=i._prev;c&&c._startTime<h&&(this._time=e=c._startTime,this._totalTime=e+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==M&&!this._locked){var w=this._yoyo&&0!=(1&M),k=w===(this._yoyo&&0!=(1&this._cycle)),L=this._totalTime,x=this._cycle,T=this._rawPrevTime,Y=this._time;if(this._totalTime=M*h,this._cycle<M?w=!w:this._totalTime+=h,this._time=_,this._rawPrevTime=0===h?v-1e-4:v,this._cycle=M,this._locked=!0,_=w?0:h,this.render(_,t,0===h),t||this._gc||this.vars.onRepeat&&(this._cycle=x,this._locked=!1,this._callback("onRepeat")),_!==this._time)return;if(k&&(this._cycle=M,this._locked=!0,_=w?h+1e-4:-1e-4,this.render(_,!0,!1)),this._locked=!1,this._paused&&!b)return;this._time=Y,this._totalTime=L,this._cycle=x,this._rawPrevTime=T}if(this._time!==_&&this._first||a||u||c){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==f&&e>0&&(this._active=!0),0===f&&this.vars.onStart&&(0===this._totalTime&&this._totalDuration||t||this._callback("onStart")),(m=this._time)>=_)for(i=this._first;i&&(o=i._next,m===this._time&&(!this._paused||b));)(i._active||i._startTime<=this._time&&!i._paused&&!i._gc)&&(c===i&&this.pause(),i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,a):i.render((e-i._startTime)*i._timeScale,t,a)),i=o;else for(i=this._last;i&&(o=i._prev,m===this._time&&(!this._paused||b));){if(i._active||i._startTime<=_&&!i._paused&&!i._gc){if(c===i){for(c=i._prev;c&&c.endTime()>this._time;)c.render(c._reversed?c.totalDuration()-(e-c._startTime)*c._timeScale:(e-c._startTime)*c._timeScale,t,a),c=c._prev;c=null,this.pause()}i._reversed?i.render((i._dirty?i.totalDuration():i._totalDuration)-(e-i._startTime)*i._timeScale,t,a):i.render((e-i._startTime)*i._timeScale,t,a)}i=o}this._onUpdate&&(t||(n.length&&s(),this._callback("onUpdate"))),l&&(this._locked||this._gc||g!==this._startTime&&y===this._timeScale||(0===this._time||p>=this.totalDuration())&&(r&&(n.length&&s(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[l]&&this._callback(l)))}else f!==this._totalTime&&this._onUpdate&&(t||this._callback("onUpdate"))},l.getActive=function(e,t,n){null==e&&(e=!0),null==t&&(t=!0),null==n&&(n=!1);var a,i,s=[],r=this.getChildren(e,t,n),o=0,l=r.length;for(a=0;a<l;a++)(i=r[a]).isActive()&&(s[o++]=i);return s},l.getLabelAfter=function(e){e||0!==e&&(e=this._time);var t,n=this.getLabelsArray(),a=n.length;for(t=0;t<a;t++)if(n[t].time>e)return n[t].name;return null},l.getLabelBefore=function(e){null==e&&(e=this._time);for(var t=this.getLabelsArray(),n=t.length;--n>-1;)if(t[n].time<e)return t[n].name;return null},l.getLabelsArray=function(){var e,t=[],n=0;for(e in this._labels)t[n++]={time:this._labels[e],name:e};return t.sort(function(e,t){return e.time-t.time}),t},l.invalidate=function(){return this._locked=!1,i.prototype.invalidate.call(this)},l.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-e:e)+this._cycle*(this._duration+this._repeatDelay),t):this._time/this.duration()||0},l.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this._totalTime/this.totalDuration()||0},l.totalDuration=function(e){return arguments.length?-1!==this._repeat&&e?this.timeScale(this.totalDuration()/e):this:(this._dirty&&(i.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},l.time=function(e,t){return arguments.length?(this._dirty&&this.totalDuration(),e>this._duration&&(e=this._duration),this._yoyo&&0!=(1&this._cycle)?e=this._duration-e+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(e+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(e,t)):this._time},l.repeat=function(e){return arguments.length?(this._repeat=e,this._uncache(!0)):this._repeat},l.repeatDelay=function(e){return arguments.length?(this._repeatDelay=e,this._uncache(!0)):this._repeatDelay},l.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},l.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.getLabelBefore(this._time+1e-8)},e},!0);const s=a.k.TimelineMax;a.k._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(){var e=function(e){var t,n=[],a=e.length;for(t=0;t!==a;n.push(e[t++]));return n},t=function(e,t,n){var a,i,s=e.cycle;for(a in s)i=s[a],e[a]="function"==typeof i?i(n,t[n]):i[n%i.length];delete e.cycle},n=function(e,t,i){a.l.call(this,e,t,i),this._cycle=0,this._yoyo=!0===this.vars.yoyo||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._repeat&&this._uncache(!0),this.render=n.prototype.render},i=a.l._internals,s=i.isSelector,r=i.isArray,o=n.prototype=a.l.to({},.1,{}),l=[];n.version="2.0.1",o.constructor=n,o.kill()._gc=!1,n.killTweensOf=n.killDelayedCallsTo=a.l.killTweensOf,n.getTweensOf=a.l.getTweensOf,n.lagSmoothing=a.l.lagSmoothing,n.ticker=a.l.ticker,n.render=a.l.render,o.invalidate=function(){return this._yoyo=!0===this.vars.yoyo||!!this.vars.yoyoEase,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._yoyoEase=null,this._uncache(!0),a.l.prototype.invalidate.call(this)},o.updateTo=function(e,t){var n,i=this.ratio,s=this.vars.immediateRender||e.immediateRender;for(n in t&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay)),e)this.vars[n]=e[n];if(this._initted||s)if(t)this._initted=!1,s&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&a.l._onPluginEvent("_onDisable",this),this._time/this._duration>.998){var r=this._totalTime;this.render(0,!0,!1),this._initted=!1,this.render(r,!0,!1)}else if(this._initted=!1,this._init(),this._time>0||s)for(var o,l=1/(1-i),u=this._firstPT;u;)o=u.s+u.c,u.c*=l,u.s=o-u.c,u=u._next;return this},o.render=function(e,t,n){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,o,l,u,d,c,m,_,p=this._dirty?this.totalDuration():this._totalDuration,h=this._time,f=this._totalTime,g=this._cycle,y=this._duration,v=this._rawPrevTime;if(e>=p-1e-7&&e>=0?(this._totalTime=p,this._cycle=this._repeat,this._yoyo&&0!=(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=y,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(s=!0,r="onComplete",n=n||this._timeline.autoRemoveChildren),0===y&&(this._initted||!this.vars.lazy||n)&&(this._startTime===this._timeline._duration&&(e=0),(v<0||e<=0&&e>=-1e-7||1e-10===v&&"isPause"!==this.data)&&v!==e&&(n=!0,v>1e-10&&(r="onReverseComplete")),this._rawPrevTime=m=!t||e||v===e?e:1e-10)):e<1e-7?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==f||0===y&&v>0)&&(r="onReverseComplete",s=this._reversed),e<0&&(this._active=!1,0===y&&(this._initted||!this.vars.lazy||n)&&(v>=0&&(n=!0),this._rawPrevTime=m=!t||e||v===e?e:1e-10)),this._initted||(n=!0)):(this._totalTime=this._time=e,0!==this._repeat&&(l=y+this._repeatDelay,this._cycle=this._totalTime/l>>0,0!==this._cycle&&this._cycle===this._totalTime/l&&f<=e&&this._cycle--,this._time=this._totalTime-this._cycle*l,this._yoyo&&0!=(1&this._cycle)&&(this._time=y-this._time,(_=this._yoyoEase||this.vars.yoyoEase)&&(this._yoyoEase||(!0!==_||this._initted?this._yoyoEase=_=!0===_?this._ease:_ instanceof a.b?_:a.b.map[_]:(_=this.vars.ease,this._yoyoEase=_=_?_ instanceof a.b?_:"function"==typeof _?new a.b(_,this.vars.easeParams):a.b.map[_]||a.l.defaultEase:a.l.defaultEase)),this.ratio=_?1-_.getRatio((y-this._time)/y):0)),this._time>y?this._time=y:this._time<0&&(this._time=0)),this._easeType&&!_?(u=this._time/y,d=this._easeType,c=this._easePower,(1===d||3===d&&u>=.5)&&(u=1-u),3===d&&(u*=2),1===c?u*=u:2===c?u*=u*u:3===c?u*=u*u*u:4===c&&(u*=u*u*u*u),1===d?this.ratio=1-u:2===d?this.ratio=u:this._time/y<.5?this.ratio=u/2:this.ratio=1-u/2):_||(this.ratio=this._ease.getRatio(this._time/y))),h!==this._time||n||g!==this._cycle){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!n&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=h,this._totalTime=f,this._rawPrevTime=v,this._cycle=g,i.lazyTweens.push(this),void(this._lazy=[e,t]);!this._time||s||_?s&&this._ease._calcEnd&&!_&&(this.ratio=this._ease.getRatio(0===this._time?0:1)):this.ratio=this._ease.getRatio(this._time/y)}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==h&&e>=0&&(this._active=!0),0===f&&(2===this._initted&&e>0&&this._init(),this._startAt&&(e>=0?this._startAt.render(e,!0,n):r||(r="_dummyGS")),this.vars.onStart&&(0===this._totalTime&&0!==y||t||this._callback("onStart"))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(e<0&&this._startAt&&this._startTime&&this._startAt.render(e,!0,n),t||(this._totalTime!==f||r)&&this._callback("onUpdate")),this._cycle!==g&&(t||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),r&&(this._gc&&!n||(e<0&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(e,!0,n),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[r]&&this._callback(r),0===y&&1e-10===this._rawPrevTime&&1e-10!==m&&(this._rawPrevTime=0)))}else f!==this._totalTime&&this._onUpdate&&(t||this._callback("onUpdate"))},n.to=function(e,t,a){return new n(e,t,a)},n.from=function(e,t,a){return a.runBackwards=!0,a.immediateRender=0!=a.immediateRender,new n(e,t,a)},n.fromTo=function(e,t,a,i){return i.startAt=a,i.immediateRender=0!=i.immediateRender&&0!=a.immediateRender,new n(e,t,i)},n.staggerTo=n.allTo=function(i,o,u,d,c,m,_){d=d||0;var p,h,f,g,y=0,v=[],b=function(){u.onComplete&&u.onComplete.apply(u.onCompleteScope||this,arguments),c.apply(_||u.callbackScope||this,m||l)},M=u.cycle,w=u.startAt&&u.startAt.cycle;for(r(i)||("string"==typeof i&&(i=a.l.selector(i)||i),s(i)&&(i=e(i))),i=i||[],d<0&&((i=e(i)).reverse(),d*=-1),p=i.length-1,f=0;f<=p;f++){for(g in h={},u)h[g]=u[g];if(M&&(t(h,i,f),null!=h.duration&&(o=h.duration,delete h.duration)),w){for(g in w=h.startAt={},u.startAt)w[g]=u.startAt[g];t(h.startAt,i,f)}h.delay=y+(h.delay||0),f===p&&c&&(h.onComplete=b),v[f]=new n(i[f],o,h),y+=d}return v},n.staggerFrom=n.allFrom=function(e,t,a,i,s,r,o){return a.runBackwards=!0,a.immediateRender=0!=a.immediateRender,n.staggerTo(e,t,a,i,s,r,o)},n.staggerFromTo=n.allFromTo=function(e,t,a,i,s,r,o,l){return i.startAt=a,i.immediateRender=0!=i.immediateRender&&0!=a.immediateRender,n.staggerTo(e,t,i,s,r,o,l)},n.delayedCall=function(e,t,a,i,s){return new n(t,0,{delay:e,onComplete:t,onCompleteParams:a,callbackScope:i,onReverseComplete:t,onReverseCompleteParams:a,immediateRender:!1,useFrames:s,overwrite:0})},n.set=function(e,t){return new n(e,0,t)},n.isTweening=function(e){return a.l.getTweensOf(e,!0).length>0};var u=function(e,t){for(var n=[],i=0,s=e._first;s;)s instanceof a.l?n[i++]=s:(t&&(n[i++]=s),i=(n=n.concat(u(s,t))).length),s=s._next;return n},d=n.getAllTweens=function(e){return u(a.a._rootTimeline,e).concat(u(a.a._rootFramesTimeline,e))};n.killAll=function(e,t,n,i){null==t&&(t=!0),null==n&&(n=!0);var s,r,o,l=d(0!=i),u=l.length,c=t&&n&&i;for(o=0;o<u;o++)r=l[o],(c||r instanceof a.i||(s=r.target===r.vars.onComplete)&&n||t&&!s)&&(e?r.totalTime(r._reversed?0:r.totalDuration()):r._enabled(!1,!1))},n.killChildTweensOf=function(t,o){if(null!=t){var l,u,d,c,m,_=i.tweenLookup;if("string"==typeof t&&(t=a.l.selector(t)||t),s(t)&&(t=e(t)),r(t))for(c=t.length;--c>-1;)n.killChildTweensOf(t[c],o);else{for(d in l=[],_)for(u=_[d].target.parentNode;u;)u===t&&(l=l.concat(_[d].tweens)),u=u.parentNode;for(m=l.length,c=0;c<m;c++)o&&l[c].totalTime(l[c].totalDuration()),l[c]._enabled(!1,!1)}}};var c=function(e,t,n,i){t=!1!==t,n=!1!==n;for(var s,r,o=d(i=!1!==i),l=t&&n&&i,u=o.length;--u>-1;)r=o[u],(l||r instanceof a.i||(s=r.target===r.vars.onComplete)&&n||t&&!s)&&r.paused(e)};return n.pauseAll=function(e,t,n){c(!0,e,t,n)},n.resumeAll=function(e,t,n){c(!1,e,t,n)},n.globalTimeScale=function(e){var t=a.a._rootTimeline,n=a.l.ticker.time;return arguments.length?(e=e||1e-10,t._startTime=n-(n-t._startTime)*t._timeScale/e,t=a.a._rootFramesTimeline,n=a.l.ticker.frame,t._startTime=n-(n-t._startTime)*t._timeScale/e,t._timeScale=a.a._rootTimeline._timeScale=e,e):t._timeScale},o.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-e:e)+this._cycle*(this._duration+this._repeatDelay),t):this._time/this.duration()},o.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this._totalTime/this.totalDuration()},o.time=function(e,t){return arguments.length?(this._dirty&&this.totalDuration(),e>this._duration&&(e=this._duration),this._yoyo&&0!=(1&this._cycle)?e=this._duration-e+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(e+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(e,t)):this._time},o.duration=function(e){return arguments.length?a.a.prototype.duration.call(this,e):this._duration},o.totalDuration=function(e){return arguments.length?-1===this._repeat?this:this.duration((e-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},o.repeat=function(e){return arguments.length?(this._repeat=e,this._uncache(!0)):this._repeat},o.repeatDelay=function(e){return arguments.length?(this._repeatDelay=e,this._uncache(!0)):this._repeatDelay},o.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},n},!0);const r=a.k.TweenMax;a.k._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(){var e,t,n,i,s=function(){a.j.call(this,"css"),this._overwriteProps.length=0,this.setRatio=s.prototype.setRatio},r=a.k._gsDefine.globals,o={},l=s.prototype=new a.j("css");l.constructor=s,s.version="1.20.5",s.API=2,s.defaultTransformPerspective=0,s.defaultSkewType="compensated",s.defaultSmoothOrigin=!0,l="px",s.suffixMap={top:l,right:l,bottom:l,left:l,width:l,height:l,fontSize:l,padding:l,margin:l,perspective:l,lineHeight:""};var u,d,c,m,_,p,h,f,g=/(?:\-|\.|\b)(\d|\.|e\-)+/g,y=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,v=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,b=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,M=/(?:\d|\-|\+|=|#|\.)*/g,w=/opacity *= *([^)]*)/i,k=/opacity:([^;]*)/i,L=/alpha\(opacity *=.+?\)/i,x=/^(rgb|hsl)/,T=/([A-Z])/g,Y=/-([a-z])/gi,D=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,S=function(e,t){return t.toUpperCase()},C=/(?:Left|Right|Width)/i,j=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,E=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,P=/,(?=[^\)]*(?:\(|$))/gi,O=/[\s,\(]/i,H=Math.PI/180,A=180/Math.PI,F={},$={style:{}},R=a.k.document||{createElement:function(){return $}},z=function(e,t){return R.createElementNS?R.createElementNS(t||"http://www.w3.org/1999/xhtml",e):R.createElement(e)},N=z("div"),W=z("img"),I=s._internals={_specialProps:o},q=(a.k.navigator||{}).userAgent||"",B=function(){var e=q.indexOf("Android"),t=z("a");return c=-1!==q.indexOf("Safari")&&-1===q.indexOf("Chrome")&&(-1===e||parseFloat(q.substr(e+8,2))>3),_=c&&parseFloat(q.substr(q.indexOf("Version/")+8,2))<6,m=-1!==q.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(q)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(q))&&(p=parseFloat(RegExp.$1)),!!t&&(t.style.cssText="top:1px;opacity:.55;",/^0.55/.test(t.style.opacity))}(),U=function(e){return w.test("string"==typeof e?e:(e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?parseFloat(RegExp.$1)/100:1},J=function(e){a.k.console&&console.log(e)},X="",V="",Z=function(e,t){var n,a,i=(t=t||N).style;if(void 0!==i[e])return e;for(e=e.charAt(0).toUpperCase()+e.substr(1),n=["O","Moz","ms","Ms","Webkit"],a=5;--a>-1&&void 0===i[n[a]+e];);return a>=0?(X="-"+(V=3===a?"ms":n[a]).toLowerCase()+"-",V+e):null},G=("undefined"!=typeof window?window:R.defaultView||{getComputedStyle:function(){}}).getComputedStyle,K=s.getStyle=function(e,t,n,a,i){var s;return B||"opacity"!==t?(!a&&e.style[t]?s=e.style[t]:(n=n||G(e))?s=n[t]||n.getPropertyValue(t)||n.getPropertyValue(t.replace(T,"-$1").toLowerCase()):e.currentStyle&&(s=e.currentStyle[t]),null==i||s&&"none"!==s&&"auto"!==s&&"auto auto"!==s?s:i):U(e)},Q=I.convertToPixels=function(e,t,n,i,r){if("px"===i||!i&&"lineHeight"!==t)return n;if("auto"===i||!n)return 0;var o,l,u,d=C.test(t),c=e,m=N.style,_=n<0,p=1===n;if(_&&(n=-n),p&&(n*=100),"lineHeight"!==t||i)if("%"===i&&-1!==t.indexOf("border"))o=n/100*(d?e.clientWidth:e.clientHeight);else{if(m.cssText="border:0 solid red;position:"+K(e,"position")+";line-height:0;","%"!==i&&c.appendChild&&"v"!==i.charAt(0)&&"rem"!==i)m[d?"borderLeftWidth":"borderTopWidth"]=n+i;else{if(c=e.parentNode||R.body,-1!==K(c,"display").indexOf("flex")&&(m.position="absolute"),l=c._gsCache,u=a.l.ticker.frame,l&&d&&l.time===u)return l.width*n/100;m[d?"width":"height"]=n+i}c.appendChild(N),o=parseFloat(N[d?"offsetWidth":"offsetHeight"]),c.removeChild(N),d&&"%"===i&&!1!==s.cacheWidths&&((l=c._gsCache=c._gsCache||{}).time=u,l.width=o/n*100),0!==o||r||(o=Q(e,t,n,i,!0))}else l=G(e).lineHeight,e.style.lineHeight=n,o=parseFloat(G(e).lineHeight),e.style.lineHeight=l;return p&&(o/=100),_?-o:o},ee=I.calculateOffset=function(e,t,n){if("absolute"!==K(e,"position",n))return 0;var a="left"===t?"Left":"Top",i=K(e,"margin"+a,n);return e["offset"+a]-(Q(e,t,parseFloat(i),i.replace(M,""))||0)},te=function(e,t){var n,a,i,s={};if(t=t||G(e,null))if(n=t.length)for(;--n>-1;)-1!==(i=t[n]).indexOf("-transform")&&Ee!==i||(s[i.replace(Y,S)]=t.getPropertyValue(i));else for(n in t)-1!==n.indexOf("Transform")&&je!==n||(s[n]=t[n]);else if(t=e.currentStyle||e.style)for(n in t)"string"==typeof n&&void 0===s[n]&&(s[n.replace(Y,S)]=t[n]);return B||(s.opacity=U(e)),a=Be(e,t,!1),s.rotation=a.rotation,s.skewX=a.skewX,s.scaleX=a.scaleX,s.scaleY=a.scaleY,s.x=a.x,s.y=a.y,Oe&&(s.z=a.z,s.rotationX=a.rotationX,s.rotationY=a.rotationY,s.scaleZ=a.scaleZ),s.filters&&delete s.filters,s},ne=function(e,t,n,a,i){var s,r,o,l={},u=e.style;for(r in n)"cssText"!==r&&"length"!==r&&isNaN(r)&&(t[r]!==(s=n[r])||i&&i[r])&&-1===r.indexOf("Origin")&&("number"!=typeof s&&"string"!=typeof s||(l[r]="auto"!==s||"left"!==r&&"top"!==r?""!==s&&"auto"!==s&&"none"!==s||"string"!=typeof t[r]||""===t[r].replace(b,"")?s:0:ee(e,r),void 0!==u[r]&&(o=new ge(u,r,u[r],o))));if(a)for(r in a)"className"!==r&&(l[r]=a[r]);return{difs:l,firstMPT:o}},ae={width:["Left","Right"],height:["Top","Bottom"]},ie=["marginLeft","marginRight","marginTop","marginBottom"],se=function(e,t,n){if("svg"===(e.nodeName+"").toLowerCase())return(n||G(e))[t]||0;if(e.getCTM&&We(e))return e.getBBox()[t]||0;var a=parseFloat("width"===t?e.offsetWidth:e.offsetHeight),i=ae[t],s=i.length;for(n=n||G(e,null);--s>-1;)a-=parseFloat(K(e,"padding"+i[s],n,!0))||0,a-=parseFloat(K(e,"border"+i[s]+"Width",n,!0))||0;return a},re=function(e,t){if("contain"===e||"auto"===e||"auto auto"===e)return e+" ";null!=e&&""!==e||(e="0 0");var n,a=e.split(" "),i=-1!==e.indexOf("left")?"0%":-1!==e.indexOf("right")?"100%":a[0],s=-1!==e.indexOf("top")?"0%":-1!==e.indexOf("bottom")?"100%":a[1];if(a.length>3&&!t){for(a=e.split(", ").join(",").split(","),e=[],n=0;n<a.length;n++)e.push(re(a[n]));return e.join(",")}return null==s?s="center"===i?"50%":"0":"center"===s&&(s="50%"),("center"===i||isNaN(parseFloat(i))&&-1===(i+"").indexOf("="))&&(i="50%"),e=i+" "+s+(a.length>2?" "+a[2]:""),t&&(t.oxp=-1!==i.indexOf("%"),t.oyp=-1!==s.indexOf("%"),t.oxr="="===i.charAt(1),t.oyr="="===s.charAt(1),t.ox=parseFloat(i.replace(b,"")),t.oy=parseFloat(s.replace(b,"")),t.v=e),t||e},oe=function(e,t){return"function"==typeof e&&(e=e(f,h)),"string"==typeof e&&"="===e.charAt(1)?parseInt(e.charAt(0)+"1",10)*parseFloat(e.substr(2)):parseFloat(e)-parseFloat(t)||0},le=function(e,t){return"function"==typeof e&&(e=e(f,h)),null==e?t:"string"==typeof e&&"="===e.charAt(1)?parseInt(e.charAt(0)+"1",10)*parseFloat(e.substr(2))+t:parseFloat(e)||0},ue=function(e,t,n,a){var i,s,r,o,l;return"function"==typeof e&&(e=e(f,h)),null==e?o=t:"number"==typeof e?o=e:(i=360,s=e.split("_"),r=((l="="===e.charAt(1))?parseInt(e.charAt(0)+"1",10)*parseFloat(s[0].substr(2)):parseFloat(s[0]))*(-1===e.indexOf("rad")?1:A)-(l?0:t),s.length&&(a&&(a[n]=t+r),-1!==e.indexOf("short")&&(r%=i)!==r%(i/2)&&(r=r<0?r+i:r-i),-1!==e.indexOf("_cw")&&r<0?r=(r+9999999999*i)%i-(r/i|0)*i:-1!==e.indexOf("ccw")&&r>0&&(r=(r-9999999999*i)%i-(r/i|0)*i)),o=t+r),o<1e-6&&o>-1e-6&&(o=0),o},de={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ce=function(e,t,n){return 255*(6*(e=e<0?e+1:e>1?e-1:e)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)+.5|0},me=s.parseColor=function(e,t){var n,a,i,s,r,o,l,u,d,c,m;if(e)if("number"==typeof e)n=[e>>16,e>>8&255,255&e];else{if(","===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1)),de[e])n=de[e];else if("#"===e.charAt(0))4===e.length&&(e="#"+(a=e.charAt(1))+a+(i=e.charAt(2))+i+(s=e.charAt(3))+s),n=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e];else if("hsl"===e.substr(0,3))if(n=m=e.match(g),t){if(-1!==e.indexOf("="))return e.match(y)}else r=Number(n[0])%360/360,o=Number(n[1])/100,a=2*(l=Number(n[2])/100)-(i=l<=.5?l*(o+1):l+o-l*o),n.length>3&&(n[3]=Number(n[3])),n[0]=ce(r+1/3,a,i),n[1]=ce(r,a,i),n[2]=ce(r-1/3,a,i);else n=e.match(g)||de.transparent;n[0]=Number(n[0]),n[1]=Number(n[1]),n[2]=Number(n[2]),n.length>3&&(n[3]=Number(n[3]))}else n=de.black;return t&&!m&&(a=n[0]/255,i=n[1]/255,s=n[2]/255,l=((u=Math.max(a,i,s))+(d=Math.min(a,i,s)))/2,u===d?r=o=0:(c=u-d,o=l>.5?c/(2-u-d):c/(u+d),r=u===a?(i-s)/c+(i<s?6:0):u===i?(s-a)/c+2:(a-i)/c+4,r*=60),n[0]=r+.5|0,n[1]=100*o+.5|0,n[2]=100*l+.5|0),n},_e=function(e,t){var n,a,i,s=e.match(pe)||[],r=0,o="";if(!s.length)return e;for(n=0;n<s.length;n++)a=s[n],r+=(i=e.substr(r,e.indexOf(a,r)-r)).length+a.length,3===(a=me(a,t)).length&&a.push(1),o+=i+(t?"hsla("+a[0]+","+a[1]+"%,"+a[2]+"%,"+a[3]:"rgba("+a.join(","))+")";return o+e.substr(r)},pe="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b";for(l in de)pe+="|"+l+"\\b";pe=new RegExp(pe+")","gi"),s.colorStringFilter=function(e){var t,n=e[0]+" "+e[1];pe.test(n)&&(t=-1!==n.indexOf("hsl(")||-1!==n.indexOf("hsla("),e[0]=_e(e[0],t),e[1]=_e(e[1],t)),pe.lastIndex=0},a.l.defaultStringFilter||(a.l.defaultStringFilter=s.colorStringFilter);var he=function(e,t,n,a){if(null==e)return function(e){return e};var i,s=t?(e.match(pe)||[""])[0]:"",r=e.split(s).join("").match(v)||[],o=e.substr(0,e.indexOf(r[0])),l=")"===e.charAt(e.length-1)?")":"",u=-1!==e.indexOf(" ")?" ":",",d=r.length,c=d>0?r[0].replace(g,""):"";return d?i=t?function(e){var t,m,_,p;if("number"==typeof e)e+=c;else if(a&&P.test(e)){for(p=e.replace(P,"|").split("|"),_=0;_<p.length;_++)p[_]=i(p[_]);return p.join(",")}if(t=(e.match(pe)||[s])[0],_=(m=e.split(t).join("").match(v)||[]).length,d>_--)for(;++_<d;)m[_]=n?m[(_-1)/2|0]:r[_];return o+m.join(u)+u+t+l+(-1!==e.indexOf("inset")?" inset":"")}:function(e){var t,s,m;if("number"==typeof e)e+=c;else if(a&&P.test(e)){for(s=e.replace(P,"|").split("|"),m=0;m<s.length;m++)s[m]=i(s[m]);return s.join(",")}if(m=(t=e.match(v)||[]).length,d>m--)for(;++m<d;)t[m]=n?t[(m-1)/2|0]:r[m];return o+t.join(u)+l}:function(e){return e}},fe=function(e){return e=e.split(","),function(t,n,a,i,s,r,o){var l,u=(n+"").split(" ");for(o={},l=0;l<4;l++)o[e[l]]=u[l]=u[l]||u[(l-1)/2>>0];return i.parse(t,o,s,r)}},ge=(I._setPluginRatio=function(e){this.plugin.setRatio(e);for(var t,n,a,i,s,r=this.data,o=r.proxy,l=r.firstMPT;l;)t=o[l.v],l.r?t=l.r(t):t<1e-6&&t>-1e-6&&(t=0),l.t[l.p]=t,l=l._next;if(r.autoRotate&&(r.autoRotate.rotation=r.mod?r.mod.call(this._tween,o.rotation,this.t,this._tween):o.rotation),1===e||0===e)for(l=r.firstMPT,s=1===e?"e":"b";l;){if((n=l.t).type){if(1===n.type){for(i=n.xs0+n.s+n.xs1,a=1;a<n.l;a++)i+=n["xn"+a]+n["xs"+(a+1)];n[s]=i}}else n[s]=n.s+n.xs0;l=l._next}},function(e,t,n,a,i){this.t=e,this.p=t,this.v=n,this.r=i,a&&(a._prev=this,this._next=a)}),ye=(I._parseToProxy=function(e,t,n,a,i,s){var r,o,l,u,d,c=a,m={},_={},p=n._transform,h=F;for(n._transform=null,F=t,a=d=n.parse(e,t,a,i),F=h,s&&(n._transform=p,c&&(c._prev=null,c._prev&&(c._prev._next=null)));a&&a!==c;){if(a.type<=1&&(_[o=a.p]=a.s+a.c,m[o]=a.s,s||(u=new ge(a,"s",o,u,a.r),a.c=0),1===a.type))for(r=a.l;--r>0;)l="xn"+r,_[o=a.p+"_"+l]=a.data[l],m[o]=a[l],s||(u=new ge(a,l,o,u,a.rxp[l]));a=a._next}return{proxy:m,end:_,firstMPT:u,pt:d}},I.CSSPropTween=function(t,n,a,s,r,o,l,u,d,c,m){this.t=t,this.p=n,this.s=a,this.c=s,this.n=l||n,t instanceof ye||i.push(this.n),this.r=u?"function"==typeof u?u:Math.round:u,this.type=o||0,d&&(this.pr=d,e=!0),this.b=void 0===c?a:c,this.e=void 0===m?a+s:m,r&&(this._next=r,r._prev=this)}),ve=function(e,t,n,a,i,s){var r=new ye(e,t,n,a-n,i,-1,s);return r.b=n,r.e=r.xs0=a,r},be=s.parseComplex=function(e,t,n,a,i,r,o,l,d,c){n=n||r||"","function"==typeof a&&(a=a(f,h)),o=new ye(e,t,0,0,o,c?2:1,null,!1,l,n,a),a+="",i&&pe.test(a+n)&&(a=[n,a],s.colorStringFilter(a),n=a[0],a=a[1]);var m,_,p,v,b,M,w,k,L,x,T,Y,D,S=n.split(", ").join(",").split(" "),C=a.split(", ").join(",").split(" "),j=S.length,E=!1!==u;for(-1===a.indexOf(",")&&-1===n.indexOf(",")||(-1!==(a+n).indexOf("rgb")||-1!==(a+n).indexOf("hsl")?(S=S.join(" ").replace(P,", ").split(" "),C=C.join(" ").replace(P,", ").split(" ")):(S=S.join(" ").split(",").join(", ").split(" "),C=C.join(" ").split(",").join(", ").split(" ")),j=S.length),j!==C.length&&(j=(S=(r||"").split(" ")).length),o.plugin=d,o.setRatio=c,pe.lastIndex=0,m=0;m<j;m++)if(v=S[m],b=C[m]+"",(k=parseFloat(v))||0===k)o.appendXtra("",k,oe(b,k),b.replace(y,""),!(!E||-1===b.indexOf("px"))&&Math.round,!0);else if(i&&pe.test(v))Y=")"+((Y=b.indexOf(")")+1)?b.substr(Y):""),D=-1!==b.indexOf("hsl")&&B,x=b,v=me(v,D),b=me(b,D),(L=v.length+b.length>6)&&!B&&0===b[3]?(o["xs"+o.l]+=o.l?" transparent":"transparent",o.e=o.e.split(C[m]).join("transparent")):(B||(L=!1),D?o.appendXtra(x.substr(0,x.indexOf("hsl"))+(L?"hsla(":"hsl("),v[0],oe(b[0],v[0]),",",!1,!0).appendXtra("",v[1],oe(b[1],v[1]),"%,",!1).appendXtra("",v[2],oe(b[2],v[2]),L?"%,":"%"+Y,!1):o.appendXtra(x.substr(0,x.indexOf("rgb"))+(L?"rgba(":"rgb("),v[0],b[0]-v[0],",",Math.round,!0).appendXtra("",v[1],b[1]-v[1],",",Math.round).appendXtra("",v[2],b[2]-v[2],L?",":Y,Math.round),L&&(v=v.length<4?1:v[3],o.appendXtra("",v,(b.length<4?1:b[3])-v,Y,!1))),pe.lastIndex=0;else if(M=v.match(g)){if(!(w=b.match(y))||w.length!==M.length)return o;for(p=0,_=0;_<M.length;_++)T=M[_],x=v.indexOf(T,p),o.appendXtra(v.substr(p,x-p),Number(T),oe(w[_],T),"",!(!E||"px"!==v.substr(x+T.length,2))&&Math.round,0===_),p=x+T.length;o["xs"+o.l]+=v.substr(p)}else o["xs"+o.l]+=o.l||o["xs"+o.l]?" "+b:b;if(-1!==a.indexOf("=")&&o.data){for(Y=o.xs0+o.data.s,m=1;m<o.l;m++)Y+=o["xs"+m]+o.data["xn"+m];o.e=Y+o["xs"+m]}return o.l||(o.type=-1,o.xs0=o.e),o.xfirst||o},Me=9;for((l=ye.prototype).l=l.pr=0;--Me>0;)l["xn"+Me]=0,l["xs"+Me]="";l.xs0="",l._next=l._prev=l.xfirst=l.data=l.plugin=l.setRatio=l.rxp=null,l.appendXtra=function(e,t,n,a,i,s){var r=this,o=r.l;return r["xs"+o]+=s&&(o||r["xs"+o])?" "+e:e||"",n||0===o||r.plugin?(r.l++,r.type=r.setRatio?2:1,r["xs"+r.l]=a||"",o>0?(r.data["xn"+o]=t+n,r.rxp["xn"+o]=i,r["xn"+o]=t,r.plugin||(r.xfirst=new ye(r,"xn"+o,t,n,r.xfirst||r,0,r.n,i,r.pr),r.xfirst.xs0=0),r):(r.data={s:t+n},r.rxp={},r.s=t,r.c=n,r.r=i,r)):(r["xs"+o]+=t+(a||""),r)};var we=function(e,t){t=t||{},this.p=t.prefix&&Z(e)||e,o[e]=o[this.p]=this,this.format=t.formatter||he(t.defaultValue,t.color,t.collapsible,t.multi),t.parser&&(this.parse=t.parser),this.clrs=t.color,this.multi=t.multi,this.keyword=t.keyword,this.dflt=t.defaultValue,this.pr=t.priority||0},ke=I._registerComplexSpecialProp=function(e,t,n){"object"!=typeof t&&(t={parser:n});var a,i=e.split(","),s=t.defaultValue;for(n=n||[s],a=0;a<i.length;a++)t.prefix=0===a&&t.prefix,t.defaultValue=n[a]||s,new we(i[a],t)},Le=I._registerPluginProp=function(e){if(!o[e]){var t=e.charAt(0).toUpperCase()+e.substr(1)+"Plugin";ke(e,{parser:function(e,n,a,i,s,l,u){var d=r.com.greensock.plugins[t];return d?(d._cssRegister(),o[a].parse(e,n,a,i,s,l,u)):(J("Error: "+t+" js file not loaded."),s)}})}};(l=we.prototype).parseComplex=function(e,t,n,a,i,s){var r,o,l,u,d,c,m=this.keyword;if(this.multi&&(P.test(n)||P.test(t)?(o=t.replace(P,"|").split("|"),l=n.replace(P,"|").split("|")):m&&(o=[t],l=[n])),l){for(u=l.length>o.length?l.length:o.length,r=0;r<u;r++)t=o[r]=o[r]||this.dflt,n=l[r]=l[r]||this.dflt,m&&(d=t.indexOf(m))!==(c=n.indexOf(m))&&(-1===c?o[r]=o[r].split(m).join(""):-1===d&&(o[r]+=" "+m));t=o.join(", "),n=l.join(", ")}return be(e,this.p,t,n,this.clrs,this.dflt,a,this.pr,i,s)},l.parse=function(e,t,a,i,s,r,o){return this.parseComplex(e.style,this.format(K(e,this.p,n,!1,this.dflt)),this.format(t),s,r)},s.registerSpecialProp=function(e,t,n){ke(e,{parser:function(e,a,i,s,r,o,l){var u=new ye(e,i,0,0,r,2,i,!1,n);return u.plugin=o,u.setRatio=t(e,a,s._tween,i),u},priority:n})},s.useSVGTransformAttr=!0;var xe,Te,Ye,De,Se,Ce="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),je=Z("transform"),Ee=X+"transform",Pe=Z("transformOrigin"),Oe=null!==Z("perspective"),He=I.Transform=function(){this.perspective=parseFloat(s.defaultTransformPerspective)||0,this.force3D=!(!1===s.defaultForce3D||!Oe)&&(s.defaultForce3D||"auto")},Ae=a.k.SVGElement,Fe=function(e,t,n){var a,i=R.createElementNS("http://www.w3.org/2000/svg",e),s=/([a-z])([A-Z])/g;for(a in n)i.setAttributeNS(null,a.replace(s,"$1-$2").toLowerCase(),n[a]);return t.appendChild(i),i},$e=R.documentElement||{},Re=(Se=p||/Android/i.test(q)&&!a.k.chrome,R.createElementNS&&!Se&&(Te=Fe("svg",$e),De=(Ye=Fe("rect",Te,{width:100,height:50,x:100})).getBoundingClientRect().width,Ye.style[Pe]="50% 50%",Ye.style[je]="scaleX(0.5)",Se=De===Ye.getBoundingClientRect().width&&!(m&&Oe),$e.removeChild(Te)),Se),ze=function(e,t,n,a,i,r){var o,l,u,d,c,m,_,p,h,f,g,y,v,b,M=e._gsTransform,w=qe(e,!0);M&&(v=M.xOrigin,b=M.yOrigin),(!a||(o=a.split(" ")).length<2)&&(0===(_=e.getBBox()).x&&0===_.y&&_.width+_.height===0&&(_={x:parseFloat(e.hasAttribute("x")?e.getAttribute("x"):e.hasAttribute("cx")?e.getAttribute("cx"):0)||0,y:parseFloat(e.hasAttribute("y")?e.getAttribute("y"):e.hasAttribute("cy")?e.getAttribute("cy"):0)||0,width:0,height:0}),o=[(-1!==(t=re(t).split(" "))[0].indexOf("%")?parseFloat(t[0])/100*_.width:parseFloat(t[0]))+_.x,(-1!==t[1].indexOf("%")?parseFloat(t[1])/100*_.height:parseFloat(t[1]))+_.y]),n.xOrigin=d=parseFloat(o[0]),n.yOrigin=c=parseFloat(o[1]),a&&w!==Ie&&(m=w[0],_=w[1],p=w[2],h=w[3],f=w[4],g=w[5],(y=m*h-_*p)&&(l=d*(h/y)+c*(-p/y)+(p*g-h*f)/y,u=d*(-_/y)+c*(m/y)-(m*g-_*f)/y,d=n.xOrigin=o[0]=l,c=n.yOrigin=o[1]=u)),M&&(r&&(n.xOffset=M.xOffset,n.yOffset=M.yOffset,M=n),i||!1!==i&&!1!==s.defaultSmoothOrigin?(l=d-v,u=c-b,M.xOffset+=l*w[0]+u*w[2]-l,M.yOffset+=l*w[1]+u*w[3]-u):M.xOffset=M.yOffset=0),r||e.setAttribute("data-svg-origin",o.join(" "))},Ne=function(e){var t,n=z("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),a=this.parentNode,i=this.nextSibling,s=this.style.cssText;if($e.appendChild(n),n.appendChild(this),this.style.display="block",e)try{t=this.getBBox(),this._originalGetBBox=this.getBBox,this.getBBox=Ne}catch(e){}else this._originalGetBBox&&(t=this._originalGetBBox());return i?a.insertBefore(this,i):a.appendChild(this),$e.removeChild(n),this.style.cssText=s,t},We=function(e){return!(!Ae||!e.getCTM||e.parentNode&&!e.ownerSVGElement||!function(e){try{return e.getBBox()}catch(t){return Ne.call(e,!0)}}(e))},Ie=[1,0,0,1,0,0],qe=function(e,t){var n,a,i,s,r,o,l=e._gsTransform||new He,u=e.style;if(je?a=K(e,Ee,null,!0):e.currentStyle&&(a=(a=e.currentStyle.filter.match(j))&&4===a.length?[a[0].substr(4),Number(a[2].substr(4)),Number(a[1].substr(4)),a[3].substr(4),l.x||0,l.y||0].join(","):""),n=!a||"none"===a||"matrix(1, 0, 0, 1, 0, 0)"===a,!je||!(o=!G(e)||"none"===G(e).display)&&e.parentNode||(o&&(s=u.display,u.display="block"),e.parentNode||(r=1,$e.appendChild(e)),n=!(a=K(e,Ee,null,!0))||"none"===a||"matrix(1, 0, 0, 1, 0, 0)"===a,s?u.display=s:o&&Ve(u,"display"),r&&$e.removeChild(e)),(l.svg||e.getCTM&&We(e))&&(n&&-1!==(u[je]+"").indexOf("matrix")&&(a=u[je],n=0),i=e.getAttribute("transform"),n&&i&&(a="matrix("+(i=e.transform.baseVal.consolidate().matrix).a+","+i.b+","+i.c+","+i.d+","+i.e+","+i.f+")",n=0)),n)return Ie;for(i=(a||"").match(g)||[],Me=i.length;--Me>-1;)s=Number(i[Me]),i[Me]=(r=s-(s|=0))?(1e5*r+(r<0?-.5:.5)|0)/1e5+s:s;return t&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i},Be=I.getTransform=function(e,t,n,i){if(e._gsTransform&&n&&!i)return e._gsTransform;var r,o,l,u,d,c,m=n&&e._gsTransform||new He,_=m.scaleX<0,p=Oe&&(parseFloat(K(e,Pe,t,!1,"0 0 0").split(" ")[2])||m.zOrigin)||0,h=parseFloat(s.defaultTransformPerspective)||0;if(m.svg=!(!e.getCTM||!We(e)),m.svg&&(ze(e,K(e,Pe,t,!1,"50% 50%")+"",m,e.getAttribute("data-svg-origin")),xe=s.useSVGTransformAttr||Re),(r=qe(e))!==Ie){if(16===r.length){var f,g,y,v,b,M=r[0],w=r[1],k=r[2],L=r[3],x=r[4],T=r[5],Y=r[6],D=r[7],S=r[8],C=r[9],j=r[10],E=r[12],P=r[13],O=r[14],H=r[11],F=Math.atan2(Y,j);m.zOrigin&&(E=S*(O=-m.zOrigin)-r[12],P=C*O-r[13],O=j*O+m.zOrigin-r[14]),m.rotationX=F*A,F&&(f=x*(v=Math.cos(-F))+S*(b=Math.sin(-F)),g=T*v+C*b,y=Y*v+j*b,S=x*-b+S*v,C=T*-b+C*v,j=Y*-b+j*v,H=D*-b+H*v,x=f,T=g,Y=y),F=Math.atan2(-k,j),m.rotationY=F*A,F&&(g=w*(v=Math.cos(-F))-C*(b=Math.sin(-F)),y=k*v-j*b,C=w*b+C*v,j=k*b+j*v,H=L*b+H*v,M=f=M*v-S*b,w=g,k=y),F=Math.atan2(w,M),m.rotation=F*A,F&&(f=M*(v=Math.cos(F))+w*(b=Math.sin(F)),g=x*v+T*b,y=S*v+C*b,w=w*v-M*b,T=T*v-x*b,C=C*v-S*b,M=f,x=g,S=y),m.rotationX&&Math.abs(m.rotationX)+Math.abs(m.rotation)>359.9&&(m.rotationX=m.rotation=0,m.rotationY=180-m.rotationY),F=Math.atan2(x,T),m.scaleX=(1e5*Math.sqrt(M*M+w*w+k*k)+.5|0)/1e5,m.scaleY=(1e5*Math.sqrt(T*T+Y*Y)+.5|0)/1e5,m.scaleZ=(1e5*Math.sqrt(S*S+C*C+j*j)+.5|0)/1e5,M/=m.scaleX,x/=m.scaleY,w/=m.scaleX,T/=m.scaleY,Math.abs(F)>2e-5?(m.skewX=F*A,x=0,"simple"!==m.skewType&&(m.scaleY*=1/Math.cos(F))):m.skewX=0,m.perspective=H?1/(H<0?-H:H):0,m.x=E,m.y=P,m.z=O,m.svg&&(m.x-=m.xOrigin-(m.xOrigin*M-m.yOrigin*x),m.y-=m.yOrigin-(m.yOrigin*w-m.xOrigin*T))}else if(!Oe||i||!r.length||m.x!==r[4]||m.y!==r[5]||!m.rotationX&&!m.rotationY){var $=r.length>=6,R=$?r[0]:1,z=r[1]||0,N=r[2]||0,W=$?r[3]:1;m.x=r[4]||0,m.y=r[5]||0,l=Math.sqrt(R*R+z*z),u=Math.sqrt(W*W+N*N),d=R||z?Math.atan2(z,R)*A:m.rotation||0,c=N||W?Math.atan2(N,W)*A+d:m.skewX||0,m.scaleX=l,m.scaleY=u,m.rotation=d,m.skewX=c,Oe&&(m.rotationX=m.rotationY=m.z=0,m.perspective=h,m.scaleZ=1),m.svg&&(m.x-=m.xOrigin-(m.xOrigin*R+m.yOrigin*N),m.y-=m.yOrigin-(m.xOrigin*z+m.yOrigin*W))}for(o in Math.abs(m.skewX)>90&&Math.abs(m.skewX)<270&&(_?(m.scaleX*=-1,m.skewX+=m.rotation<=0?180:-180,m.rotation+=m.rotation<=0?180:-180):(m.scaleY*=-1,m.skewX+=m.skewX<=0?180:-180)),m.zOrigin=p,m)m[o]<2e-5&&m[o]>-2e-5&&(m[o]=0)}return n&&(e._gsTransform=m,m.svg&&(xe&&e.style[je]?a.l.delayedCall(.001,function(){Ve(e.style,je)}):!xe&&e.getAttribute("transform")&&a.l.delayedCall(.001,function(){e.removeAttribute("transform")}))),m},Ue=function(e){var t,n,a=this.data,i=-a.rotation*H,s=i+a.skewX*H,r=(Math.cos(i)*a.scaleX*1e5|0)/1e5,o=(Math.sin(i)*a.scaleX*1e5|0)/1e5,l=(Math.sin(s)*-a.scaleY*1e5|0)/1e5,u=(Math.cos(s)*a.scaleY*1e5|0)/1e5,d=this.t.style,c=this.t.currentStyle;if(c){n=o,o=-l,l=-n,t=c.filter,d.filter="";var m,_,h=this.t.offsetWidth,f=this.t.offsetHeight,g="absolute"!==c.position,y="progid:DXImageTransform.Microsoft.Matrix(M11="+r+", M12="+o+", M21="+l+", M22="+u,v=a.x+h*a.xPercent/100,b=a.y+f*a.yPercent/100;if(null!=a.ox&&(v+=(m=(a.oxp?h*a.ox*.01:a.ox)-h/2)-(m*r+(_=(a.oyp?f*a.oy*.01:a.oy)-f/2)*o),b+=_-(m*l+_*u)),y+=g?", Dx="+((m=h/2)-(m*r+(_=f/2)*o)+v)+", Dy="+(_-(m*l+_*u)+b)+")":", sizingMethod='auto expand')",-1!==t.indexOf("DXImageTransform.Microsoft.Matrix(")?d.filter=t.replace(E,y):d.filter=y+" "+t,0!==e&&1!==e||1===r&&0===o&&0===l&&1===u&&(g&&-1===y.indexOf("Dx=0, Dy=0")||w.test(t)&&100!==parseFloat(RegExp.$1)||-1===t.indexOf(t.indexOf("Alpha"))&&d.removeAttribute("filter")),!g){var k,L,x,T=p<8?1:-1;for(m=a.ieOffsetX||0,_=a.ieOffsetY||0,a.ieOffsetX=Math.round((h-((r<0?-r:r)*h+(o<0?-o:o)*f))/2+v),a.ieOffsetY=Math.round((f-((u<0?-u:u)*f+(l<0?-l:l)*h))/2+b),Me=0;Me<4;Me++)x=(n=-1!==(k=c[L=ie[Me]]).indexOf("px")?parseFloat(k):Q(this.t,L,parseFloat(k),k.replace(M,""))||0)!==a[L]?Me<2?-a.ieOffsetX:-a.ieOffsetY:Me<2?m-a.ieOffsetX:_-a.ieOffsetY,d[L]=(a[L]=Math.round(n-x*(0===Me||2===Me?1:T)))+"px"}}},Je=I.set3DTransformRatio=I.setTransformRatio=function(e){var t,n,a,i,s,r,o,l,u,d,c,_,p,h,f,g,y,v,b,M,w,k=this.data,L=this.t.style,x=k.rotation,T=k.rotationX,Y=k.rotationY,D=k.scaleX,S=k.scaleY,C=k.scaleZ,j=k.x,E=k.y,P=k.z,O=k.svg,A=k.perspective,F=k.force3D,$=k.skewY,R=k.skewX;if($&&(R+=$,x+=$),!((1!==e&&0!==e||"auto"!==F||this.tween._totalTime!==this.tween._totalDuration&&this.tween._totalTime)&&F||P||A||Y||T||1!==C)||xe&&O||!Oe)x||R||O?(x*=H,M=R*H,w=1e5,n=Math.cos(x)*D,s=Math.sin(x)*D,a=Math.sin(x-M)*-S,r=Math.cos(x-M)*S,M&&"simple"===k.skewType&&(t=Math.tan(M-$*H),a*=t=Math.sqrt(1+t*t),r*=t,$&&(t=Math.tan($*H),n*=t=Math.sqrt(1+t*t),s*=t)),O&&(j+=k.xOrigin-(k.xOrigin*n+k.yOrigin*a)+k.xOffset,E+=k.yOrigin-(k.xOrigin*s+k.yOrigin*r)+k.yOffset,xe&&(k.xPercent||k.yPercent)&&(f=this.t.getBBox(),j+=.01*k.xPercent*f.width,E+=.01*k.yPercent*f.height),j<(f=1e-6)&&j>-f&&(j=0),E<f&&E>-f&&(E=0)),b=(n*w|0)/w+","+(s*w|0)/w+","+(a*w|0)/w+","+(r*w|0)/w+","+j+","+E+")",O&&xe?this.t.setAttribute("transform","matrix("+b):L[je]=(k.xPercent||k.yPercent?"translate("+k.xPercent+"%,"+k.yPercent+"%) matrix(":"matrix(")+b):L[je]=(k.xPercent||k.yPercent?"translate("+k.xPercent+"%,"+k.yPercent+"%) matrix(":"matrix(")+D+",0,0,"+S+","+j+","+E+")";else{if(m&&(D<(f=1e-4)&&D>-f&&(D=C=2e-5),S<f&&S>-f&&(S=C=2e-5),!A||k.z||k.rotationX||k.rotationY||(A=0)),x||R)x*=H,g=n=Math.cos(x),y=s=Math.sin(x),R&&(x-=R*H,g=Math.cos(x),y=Math.sin(x),"simple"===k.skewType&&(t=Math.tan((R-$)*H),g*=t=Math.sqrt(1+t*t),y*=t,k.skewY&&(t=Math.tan($*H),n*=t=Math.sqrt(1+t*t),s*=t))),a=-y,r=g;else{if(!(Y||T||1!==C||A||O))return void(L[je]=(k.xPercent||k.yPercent?"translate("+k.xPercent+"%,"+k.yPercent+"%) translate3d(":"translate3d(")+j+"px,"+E+"px,"+P+"px)"+(1!==D||1!==S?" scale("+D+","+S+")":""));n=r=1,a=s=0}d=1,i=o=l=u=c=_=0,p=A?-1/A:0,h=k.zOrigin,f=1e-6,",","0",(x=Y*H)&&(g=Math.cos(x),l=-(y=Math.sin(x)),c=p*-y,i=n*y,o=s*y,d=g,p*=g,n*=g,s*=g),(x=T*H)&&(t=a*(g=Math.cos(x))+i*(y=Math.sin(x)),v=r*g+o*y,u=d*y,_=p*y,i=a*-y+i*g,o=r*-y+o*g,d*=g,p*=g,a=t,r=v),1!==C&&(i*=C,o*=C,d*=C,p*=C),1!==S&&(a*=S,r*=S,u*=S,_*=S),1!==D&&(n*=D,s*=D,l*=D,c*=D),(h||O)&&(h&&(j+=i*-h,E+=o*-h,P+=d*-h+h),O&&(j+=k.xOrigin-(k.xOrigin*n+k.yOrigin*a)+k.xOffset,E+=k.yOrigin-(k.xOrigin*s+k.yOrigin*r)+k.yOffset),j<f&&j>-f&&(j="0"),E<f&&E>-f&&(E="0"),P<f&&P>-f&&(P=0)),b=k.xPercent||k.yPercent?"translate("+k.xPercent+"%,"+k.yPercent+"%) matrix3d(":"matrix3d(",b+=(n<f&&n>-f?"0":n)+","+(s<f&&s>-f?"0":s)+","+(l<f&&l>-f?"0":l),b+=","+(c<f&&c>-f?"0":c)+","+(a<f&&a>-f?"0":a)+","+(r<f&&r>-f?"0":r),T||Y||1!==C?(b+=","+(u<f&&u>-f?"0":u)+","+(_<f&&_>-f?"0":_)+","+(i<f&&i>-f?"0":i),b+=","+(o<f&&o>-f?"0":o)+","+(d<f&&d>-f?"0":d)+","+(p<f&&p>-f?"0":p)+","):b+=",0,0,0,0,1,0,",b+=j+","+E+","+P+","+(A?1+-P/A:1)+")",L[je]=b}};(l=He.prototype).x=l.y=l.z=l.skewX=l.skewY=l.rotation=l.rotationX=l.rotationY=l.zOrigin=l.xPercent=l.yPercent=l.xOffset=l.yOffset=0,l.scaleX=l.scaleY=l.scaleZ=1,ke("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(e,t,a,i,r,o,l){if(i._lastParsedTransform===l)return r;i._lastParsedTransform=l;var u,d=l.scale&&"function"==typeof l.scale?l.scale:0;"function"==typeof l[a]&&(u=l[a],l[a]=t),d&&(l.scale=d(f,e));var c,m,_,p,g,y,v,b,M,w=e._gsTransform,k=e.style,L=Ce.length,x=l,T={},Y=Be(e,n,!0,x.parseTransform),D=x.transform&&("function"==typeof x.transform?x.transform(f,h):x.transform);if(Y.skewType=x.skewType||Y.skewType||s.defaultSkewType,i._transform=Y,D&&"string"==typeof D&&je)(m=N.style)[je]=D,m.display="block",m.position="absolute",-1!==D.indexOf("%")&&(m.width=K(e,"width"),m.height=K(e,"height")),R.body.appendChild(N),c=Be(N,null,!1),"simple"===Y.skewType&&(c.scaleY*=Math.cos(c.skewX*H)),Y.svg&&(y=Y.xOrigin,v=Y.yOrigin,c.x-=Y.xOffset,c.y-=Y.yOffset,(x.transformOrigin||x.svgOrigin)&&(D={},ze(e,re(x.transformOrigin),D,x.svgOrigin,x.smoothOrigin,!0),y=D.xOrigin,v=D.yOrigin,c.x-=D.xOffset-Y.xOffset,c.y-=D.yOffset-Y.yOffset),(y||v)&&(b=qe(N,!0),c.x-=y-(y*b[0]+v*b[2]),c.y-=v-(y*b[1]+v*b[3]))),R.body.removeChild(N),c.perspective||(c.perspective=Y.perspective),null!=x.xPercent&&(c.xPercent=le(x.xPercent,Y.xPercent)),null!=x.yPercent&&(c.yPercent=le(x.yPercent,Y.yPercent));else if("object"==typeof x){if(c={scaleX:le(null!=x.scaleX?x.scaleX:x.scale,Y.scaleX),scaleY:le(null!=x.scaleY?x.scaleY:x.scale,Y.scaleY),scaleZ:le(x.scaleZ,Y.scaleZ),x:le(x.x,Y.x),y:le(x.y,Y.y),z:le(x.z,Y.z),xPercent:le(x.xPercent,Y.xPercent),yPercent:le(x.yPercent,Y.yPercent),perspective:le(x.transformPerspective,Y.perspective)},null!=(g=x.directionalRotation))if("object"==typeof g)for(m in g)x[m]=g[m];else x.rotation=g;"string"==typeof x.x&&-1!==x.x.indexOf("%")&&(c.x=0,c.xPercent=le(x.x,Y.xPercent)),"string"==typeof x.y&&-1!==x.y.indexOf("%")&&(c.y=0,c.yPercent=le(x.y,Y.yPercent)),c.rotation=ue("rotation"in x?x.rotation:"shortRotation"in x?x.shortRotation+"_short":"rotationZ"in x?x.rotationZ:Y.rotation,Y.rotation,"rotation",T),Oe&&(c.rotationX=ue("rotationX"in x?x.rotationX:"shortRotationX"in x?x.shortRotationX+"_short":Y.rotationX||0,Y.rotationX,"rotationX",T),c.rotationY=ue("rotationY"in x?x.rotationY:"shortRotationY"in x?x.shortRotationY+"_short":Y.rotationY||0,Y.rotationY,"rotationY",T)),c.skewX=ue(x.skewX,Y.skewX),c.skewY=ue(x.skewY,Y.skewY)}for(Oe&&null!=x.force3D&&(Y.force3D=x.force3D,p=!0),(_=Y.force3D||Y.z||Y.rotationX||Y.rotationY||c.z||c.rotationX||c.rotationY||c.perspective)||null==x.scale||(c.scaleZ=1);--L>-1;)((D=c[M=Ce[L]]-Y[M])>1e-6||D<-1e-6||null!=x[M]||null!=F[M])&&(p=!0,r=new ye(Y,M,Y[M],D,r),M in T&&(r.e=T[M]),r.xs0=0,r.plugin=o,i._overwriteProps.push(r.n));return D=x.transformOrigin,Y.svg&&(D||x.svgOrigin)&&(y=Y.xOffset,v=Y.yOffset,ze(e,re(D),c,x.svgOrigin,x.smoothOrigin),r=ve(Y,"xOrigin",(w?Y:c).xOrigin,c.xOrigin,r,"transformOrigin"),r=ve(Y,"yOrigin",(w?Y:c).yOrigin,c.yOrigin,r,"transformOrigin"),y===Y.xOffset&&v===Y.yOffset||(r=ve(Y,"xOffset",w?y:Y.xOffset,Y.xOffset,r,"transformOrigin"),r=ve(Y,"yOffset",w?v:Y.yOffset,Y.yOffset,r,"transformOrigin")),D="0px 0px"),(D||Oe&&_&&Y.zOrigin)&&(je?(p=!0,M=Pe,D=(D||K(e,M,n,!1,"50% 50%"))+"",(r=new ye(k,M,0,0,r,-1,"transformOrigin")).b=k[M],r.plugin=o,Oe?(m=Y.zOrigin,D=D.split(" "),Y.zOrigin=(D.length>2&&(0===m||"0px"!==D[2])?parseFloat(D[2]):m)||0,r.xs0=r.e=D[0]+" "+(D[1]||"50%")+" 0px",(r=new ye(Y,"zOrigin",0,0,r,-1,r.n)).b=m,r.xs0=r.e=Y.zOrigin):r.xs0=r.e=D):re(D+"",Y)),p&&(i._transformType=Y.svg&&xe||!_&&3!==this._transformType?2:3),u&&(l[a]=u),d&&(l.scale=d),r},prefix:!0}),ke("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),ke("borderRadius",{defaultValue:"0px",parser:function(e,a,i,s,r,o){a=this.format(a);var l,u,d,c,m,_,p,h,f,g,y,v,b,M,w,k,L=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],x=e.style;for(f=parseFloat(e.offsetWidth),g=parseFloat(e.offsetHeight),l=a.split(" "),u=0;u<L.length;u++)this.p.indexOf("border")&&(L[u]=Z(L[u])),-1!==(m=c=K(e,L[u],n,!1,"0px")).indexOf(" ")&&(m=(c=m.split(" "))[0],c=c[1]),_=d=l[u],p=parseFloat(m),v=m.substr((p+"").length),(b="="===_.charAt(1))?(h=parseInt(_.charAt(0)+"1",10),_=_.substr(2),h*=parseFloat(_),y=_.substr((h+"").length-(h<0?1:0))||""):(h=parseFloat(_),y=_.substr((h+"").length)),""===y&&(y=t[i]||v),y!==v&&(M=Q(e,"borderLeft",p,v),w=Q(e,"borderTop",p,v),"%"===y?(m=M/f*100+"%",c=w/g*100+"%"):"em"===y?(m=M/(k=Q(e,"borderLeft",1,"em"))+"em",c=w/k+"em"):(m=M+"px",c=w+"px"),b&&(_=parseFloat(m)+h+y,d=parseFloat(c)+h+y)),r=be(x,L[u],m+" "+c,_+" "+d,!1,"0px",r);return r},prefix:!0,formatter:he("0px 0px 0px 0px",!1,!0)}),ke("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius",{defaultValue:"0px",parser:function(e,t,a,i,s,r){return be(e.style,a,this.format(K(e,a,n,!1,"0px 0px")),this.format(t),!1,"0px",s)},prefix:!0,formatter:he("0px 0px",!1,!0)}),ke("backgroundPosition",{defaultValue:"0 0",parser:function(e,t,a,i,s,r){var o,l,u,d,c,m,_="background-position",h=n||G(e,null),f=this.format((h?p?h.getPropertyValue(_+"-x")+" "+h.getPropertyValue(_+"-y"):h.getPropertyValue(_):e.currentStyle.backgroundPositionX+" "+e.currentStyle.backgroundPositionY)||"0 0"),g=this.format(t);if(-1!==f.indexOf("%")!=(-1!==g.indexOf("%"))&&g.split(",").length<2&&(m=K(e,"backgroundImage").replace(D,""))&&"none"!==m){for(o=f.split(" "),l=g.split(" "),W.setAttribute("src",m),u=2;--u>-1;)(d=-1!==(f=o[u]).indexOf("%"))!==(-1!==l[u].indexOf("%"))&&(c=0===u?e.offsetWidth-W.width:e.offsetHeight-W.height,o[u]=d?parseFloat(f)/100*c+"px":parseFloat(f)/c*100+"%");f=o.join(" ")}return this.parseComplex(e.style,f,g,s,r)},formatter:re}),ke("backgroundSize",{defaultValue:"0 0",formatter:function(e){return"co"===(e+="").substr(0,2)?e:re(-1===e.indexOf(" ")?e+" "+e:e)}}),ke("perspective",{defaultValue:"0px",prefix:!0}),ke("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),ke("transformStyle",{prefix:!0}),ke("backfaceVisibility",{prefix:!0}),ke("userSelect",{prefix:!0}),ke("margin",{parser:fe("marginTop,marginRight,marginBottom,marginLeft")}),ke("padding",{parser:fe("paddingTop,paddingRight,paddingBottom,paddingLeft")}),ke("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(e,t,a,i,s,r){var o,l,u;return p<9?(l=e.currentStyle,u=p<8?" ":",",o="rect("+l.clipTop+u+l.clipRight+u+l.clipBottom+u+l.clipLeft+")",t=this.format(t).split(",").join(u)):(o=this.format(K(e,this.p,n,!1,this.dflt)),t=this.format(t)),this.parseComplex(e.style,o,t,s,r)}}),ke("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),ke("autoRound,strictUnits",{parser:function(e,t,n,a,i){return i}}),ke("border",{defaultValue:"0px solid #000",parser:function(e,t,a,i,s,r){var o=K(e,"borderTopWidth",n,!1,"0px"),l=this.format(t).split(" "),u=l[0].replace(M,"");return"px"!==u&&(o=parseFloat(o)/Q(e,"borderTopWidth",1,u)+u),this.parseComplex(e.style,this.format(o+" "+K(e,"borderTopStyle",n,!1,"solid")+" "+K(e,"borderTopColor",n,!1,"#000")),l.join(" "),s,r)},color:!0,formatter:function(e){var t=e.split(" ");return t[0]+" "+(t[1]||"solid")+" "+(e.match(pe)||["#000"])[0]}}),ke("borderWidth",{parser:fe("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),ke("float,cssFloat,styleFloat",{parser:function(e,t,n,a,i,s){var r=e.style,o="cssFloat"in r?"cssFloat":"styleFloat";return new ye(r,o,0,0,i,-1,n,!1,0,r[o],t)}});var Xe=function(e){var t,n=this.t,a=n.filter||K(this.data,"filter")||"",i=this.s+this.c*e|0;100===i&&(-1===a.indexOf("atrix(")&&-1===a.indexOf("radient(")&&-1===a.indexOf("oader(")?(n.removeAttribute("filter"),t=!K(this.data,"filter")):(n.filter=a.replace(L,""),t=!0)),t||(this.xn1&&(n.filter=a=a||"alpha(opacity="+i+")"),-1===a.indexOf("pacity")?0===i&&this.xn1||(n.filter=a+" alpha(opacity="+i+")"):n.filter=a.replace(w,"opacity="+i))};ke("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(e,t,a,i,s,r){var o=parseFloat(K(e,"opacity",n,!1,"1")),l=e.style,u="autoAlpha"===a;return"string"==typeof t&&"="===t.charAt(1)&&(t=("-"===t.charAt(0)?-1:1)*parseFloat(t.substr(2))+o),u&&1===o&&"hidden"===K(e,"visibility",n)&&0!==t&&(o=0),B?s=new ye(l,"opacity",o,t-o,s):((s=new ye(l,"opacity",100*o,100*(t-o),s)).xn1=u?1:0,l.zoom=1,s.type=2,s.b="alpha(opacity="+s.s+")",s.e="alpha(opacity="+(s.s+s.c)+")",s.data=e,s.plugin=r,s.setRatio=Xe),u&&((s=new ye(l,"visibility",0,0,s,-1,null,!1,0,0!==o?"inherit":"hidden",0===t?"hidden":"inherit")).xs0="inherit",i._overwriteProps.push(s.n),i._overwriteProps.push(a)),s}});var Ve=function(e,t){t&&(e.removeProperty?("ms"!==t.substr(0,2)&&"webkit"!==t.substr(0,6)||(t="-"+t),e.removeProperty(t.replace(T,"-$1").toLowerCase())):e.removeAttribute(t))},Ze=function(e){if(this.t._gsClassPT=this,1===e||0===e){this.t.setAttribute("class",0===e?this.b:this.e);for(var t=this.data,n=this.t.style;t;)t.v?n[t.p]=t.v:Ve(n,t.p),t=t._next;1===e&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};ke("className",{parser:function(t,a,i,s,r,o,l){var u,d,c,m,_,p=t.getAttribute("class")||"",h=t.style.cssText;if((r=s._classNamePT=new ye(t,i,0,0,r,2)).setRatio=Ze,r.pr=-11,e=!0,r.b=p,d=te(t,n),c=t._gsClassPT){for(m={},_=c.data;_;)m[_.p]=1,_=_._next;c.setRatio(1)}return t._gsClassPT=r,r.e="="!==a.charAt(1)?a:p.replace(new RegExp("(?:\\s|^)"+a.substr(2)+"(?![\\w-])"),"")+("+"===a.charAt(0)?" "+a.substr(2):""),t.setAttribute("class",r.e),u=ne(t,d,te(t),l,m),t.setAttribute("class",p),r.data=u.firstMPT,t.style.cssText=h,r=r.xfirst=s.parse(t,u.difs,r,o)}});var Ge=function(e){if((1===e||0===e)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var t,n,a,i,s,r=this.t.style,l=o.transform.parse;if("all"===this.e)r.cssText="",i=!0;else for(a=(t=this.e.split(" ").join("").split(",")).length;--a>-1;)n=t[a],o[n]&&(o[n].parse===l?i=!0:n="transformOrigin"===n?Pe:o[n].p),Ve(r,n);i&&(Ve(r,je),(s=this.t._gsTransform)&&(s.svg&&(this.t.removeAttribute("data-svg-origin"),this.t.removeAttribute("transform")),delete this.t._gsTransform))}};for(ke("clearProps",{parser:function(t,n,a,i,s){return(s=new ye(t,a,0,0,s,2)).setRatio=Ge,s.e=n,s.pr=-10,s.data=i._tween,e=!0,s}}),l="bezier,throwProps,physicsProps,physics2D".split(","),Me=l.length;Me--;)Le(l[Me]);(l=s.prototype)._firstPT=l._lastParsedTransform=l._transform=null,l._onInitTween=function(a,r,l,m){if(!a.nodeType)return!1;this._target=h=a,this._tween=l,this._vars=r,f=m,u=r.autoRound,e=!1,t=r.suffixMap||s.suffixMap,n=G(a,""),i=this._overwriteProps;var p,g,y,v,b,M,w,L,x,T=a.style;if(d&&""===T.zIndex&&("auto"!==(p=K(a,"zIndex",n))&&""!==p||this._addLazySet(T,"zIndex",0)),"string"==typeof r&&(v=T.cssText,p=te(a,n),T.cssText=v+";"+r,p=ne(a,p,te(a)).difs,!B&&k.test(r)&&(p.opacity=parseFloat(RegExp.$1)),r=p,T.cssText=v),r.className?this._firstPT=g=o.className.parse(a,r.className,"className",this,null,null,r):this._firstPT=g=this.parse(a,r,null),this._transformType){for(x=3===this._transformType,je?c&&(d=!0,""===T.zIndex&&("auto"!==(w=K(a,"zIndex",n))&&""!==w||this._addLazySet(T,"zIndex",0)),_&&this._addLazySet(T,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(x?"visible":"hidden"))):T.zoom=1,y=g;y&&y._next;)y=y._next;L=new ye(a,"transform",0,0,null,2),this._linkCSSP(L,null,y),L.setRatio=je?Je:Ue,L.data=this._transform||Be(a,n,!0),L.tween=l,L.pr=-1,i.pop()}if(e){for(;g;){for(M=g._next,y=v;y&&y.pr>g.pr;)y=y._next;(g._prev=y?y._prev:b)?g._prev._next=g:v=g,(g._next=y)?y._prev=g:b=g,g=M}this._firstPT=v}return!0},l.parse=function(e,a,i,s){var r,l,d,c,m,_,p,g,y,v,b=e.style;for(r in a){if("function"==typeof(_=a[r])&&(_=_(f,h)),l=o[r])i=l.parse(e,_,r,this,i,s,a);else{if("--"===r.substr(0,2)){this._tween._propLookup[r]=this._addTween.call(this._tween,e.style,"setProperty",G(e).getPropertyValue(r)+"",_+"",r,!1,r);continue}m=K(e,r,n)+"",y="string"==typeof _,"color"===r||"fill"===r||"stroke"===r||-1!==r.indexOf("Color")||y&&x.test(_)?(y||(_=((_=me(_)).length>3?"rgba(":"rgb(")+_.join(",")+")"),i=be(b,r,m,_,!0,"transparent",i,0,s)):y&&O.test(_)?i=be(b,r,m,_,!0,null,i,0,s):(p=(d=parseFloat(m))||0===d?m.substr((d+"").length):"",""!==m&&"auto"!==m||("width"===r||"height"===r?(d=se(e,r,n),p="px"):"left"===r||"top"===r?(d=ee(e,r,n),p="px"):(d="opacity"!==r?0:1,p="")),(v=y&&"="===_.charAt(1))?(c=parseInt(_.charAt(0)+"1",10),_=_.substr(2),c*=parseFloat(_),g=_.replace(M,"")):(c=parseFloat(_),g=y?_.replace(M,""):""),""===g&&(g=r in t?t[r]:p),_=c||0===c?(v?c+d:c)+g:a[r],p!==g&&(""===g&&"lineHeight"!==r||(c||0===c)&&d&&(d=Q(e,r,d,p),"%"===g?(d/=Q(e,r,100,"%")/100,!0!==a.strictUnits&&(m=d+"%")):"em"===g||"rem"===g||"vw"===g||"vh"===g?d/=Q(e,r,1,g):"px"!==g&&(c=Q(e,r,c,g),g="px"),v&&(c||0===c)&&(_=c+d+g))),v&&(c+=d),!d&&0!==d||!c&&0!==c?void 0!==b[r]&&(_||_+""!="NaN"&&null!=_)?(i=new ye(b,r,c||d||0,0,i,-1,r,!1,0,m,_)).xs0="none"!==_||"display"!==r&&-1===r.indexOf("Style")?_:m:J("invalid "+r+" tween value: "+a[r]):(i=new ye(b,r,d,c-d,i,0,r,!1!==u&&("px"===g||"zIndex"===r),0,m,_)).xs0=g)}s&&i&&!i.plugin&&(i.plugin=s)}return i},l.setRatio=function(e){var t,n,a,i=this._firstPT;if(1!==e||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(e||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;i;){if(t=i.c*e+i.s,i.r?t=i.r(t):t<1e-6&&t>-1e-6&&(t=0),i.type)if(1===i.type)if(2===(a=i.l))i.t[i.p]=i.xs0+t+i.xs1+i.xn1+i.xs2;else if(3===a)i.t[i.p]=i.xs0+t+i.xs1+i.xn1+i.xs2+i.xn2+i.xs3;else if(4===a)i.t[i.p]=i.xs0+t+i.xs1+i.xn1+i.xs2+i.xn2+i.xs3+i.xn3+i.xs4;else if(5===a)i.t[i.p]=i.xs0+t+i.xs1+i.xn1+i.xs2+i.xn2+i.xs3+i.xn3+i.xs4+i.xn4+i.xs5;else{for(n=i.xs0+t+i.xs1,a=1;a<i.l;a++)n+=i["xn"+a]+i["xs"+(a+1)];i.t[i.p]=n}else-1===i.type?i.t[i.p]=i.xs0:i.setRatio&&i.setRatio(e);else i.t[i.p]=t+i.xs0;i=i._next}else for(;i;)2!==i.type?i.t[i.p]=i.b:i.setRatio(e),i=i._next;else for(;i;){if(2!==i.type)if(i.r&&-1!==i.type)if(t=i.r(i.s+i.c),i.type){if(1===i.type){for(a=i.l,n=i.xs0+t+i.xs1,a=1;a<i.l;a++)n+=i["xn"+a]+i["xs"+(a+1)];i.t[i.p]=n}}else i.t[i.p]=t+i.xs0;else i.t[i.p]=i.e;else i.setRatio(e);i=i._next}},l._enableTransforms=function(e){this._transform=this._transform||Be(this._target,n,!0),this._transformType=this._transform.svg&&xe||!e&&3!==this._transformType?2:3};var Ke=function(e){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};l._addLazySet=function(e,t,n){var a=this._firstPT=new ye(e,t,0,0,this._firstPT,2);a.e=n,a.setRatio=Ke,a.data=this},l._linkCSSP=function(e,t,n,a){return e&&(t&&(t._prev=e),e._next&&(e._next._prev=e._prev),e._prev?e._prev._next=e._next:this._firstPT===e&&(this._firstPT=e._next,a=!0),n?n._next=e:a||null!==this._firstPT||(this._firstPT=e),e._next=t,e._prev=n),e},l._mod=function(e){for(var t=this._firstPT;t;)"function"==typeof e[t.p]&&(t.r=e[t.p]),t=t._next},l._kill=function(e){var t,n,i,s=e;if(e.autoAlpha||e.alpha){for(n in s={},e)s[n]=e[n];s.opacity=1,s.autoAlpha&&(s.visibility=1)}for(e.className&&(t=this._classNamePT)&&((i=t.xfirst)&&i._prev?this._linkCSSP(i._prev,t._next,i._prev._prev):i===this._firstPT&&(this._firstPT=t._next),t._next&&this._linkCSSP(t._next,t._next._next,i._prev),this._classNamePT=null),t=this._firstPT;t;)t.plugin&&t.plugin!==n&&t.plugin._kill&&(t.plugin._kill(e),n=t.plugin),t=t._next;return a.j.prototype._kill.call(this,s)};var Qe=function(e,t,n){var a,i,s,r;if(e.slice)for(i=e.length;--i>-1;)Qe(e[i],t,n);else for(i=(a=e.childNodes).length;--i>-1;)r=(s=a[i]).type,s.style&&(t.push(te(s)),n&&n.push(s)),1!==r&&9!==r&&11!==r||!s.childNodes.length||Qe(s,t,n)};return s.cascadeTo=function(e,t,n){var i,s,r,o,l=a.l.to(e,t,n),u=[l],d=[],c=[],m=[],_=a.l._internals.reservedProps;for(e=l._targets||l.target,Qe(e,d,m),l.render(t,!0,!0),Qe(e,c),l.render(0,!0,!0),l._enabled(!0),i=m.length;--i>-1;)if((s=ne(m[i],d[i],c[i])).firstMPT){for(r in s=s.difs,n)_[r]&&(s[r]=n[r]);for(r in o={},s)o[r]=d[i][r];u.push(a.l.fromTo(m[i],t,o,s))}return u},a.j.activate([s]),s},!0);const o=a.k.CSSPlugin,l=a.k._gsDefine.plugin({propName:"attr",API:2,version:"0.6.1",init:function(e,t,n,a){var i,s;if("function"!=typeof e.setAttribute)return!1;for(i in t)"function"==typeof(s=t[i])&&(s=s(a,e)),this._addTween(e,"setAttribute",e.getAttribute(i)+"",s+"",i,!1,i),this._overwriteProps.push(i);return!0}}),u=a.k._gsDefine.plugin({propName:"roundProps",version:"1.7.0",priority:-1,API:2,init:function(e,t,n){return this._tween=n,!0}}),d=function(e){var t=e<1?Math.pow(10,(e+"").length-2):1;return function(n){return(Math.round(n/e)*e*t|0)/t}},c=function(e,t){for(;e;)e.f||e.blob||(e.m=t||Math.round),e=e._next},m=u.prototype;m._onInitAllProps=function(){var e,t,n,a,i=this._tween,s=i.vars.roundProps,r={},o=i._propLookup.roundProps;if("object"!=typeof s||s.push)for("string"==typeof s&&(s=s.split(",")),n=s.length;--n>-1;)r[s[n]]=Math.round;else for(a in s)r[a]=d(s[a]);for(a in r)for(e=i._firstPT;e;)t=e._next,e.pg?e.t._mod(r):e.n===a&&(2===e.f&&e.t?c(e.t._firstPT,r[a]):(this._add(e.t,a,e.s,e.c,r[a]),t&&(t._prev=e._prev),e._prev?e._prev._next=t:i._firstPT===e&&(i._firstPT=t),e._next=e._prev=null,i._propLookup[a]=o)),e=t;return!1},m._add=function(e,t,n,a,i){this._addTween(e,t,n,n+a,t,i||Math.round),this._overwriteProps.push(t)};const _=a.k._gsDefine.plugin({propName:"directionalRotation",version:"0.3.1",API:2,init:function(e,t,n,a){"object"!=typeof t&&(t={rotation:t}),this.finals={};var i,s,r,o,l,u,d=!0===t.useRadians?2*Math.PI:360;for(i in t)"useRadians"!==i&&("function"==typeof(o=t[i])&&(o=o(a,e)),s=(u=(o+"").split("_"))[0],r=parseFloat("function"!=typeof e[i]?e[i]:e[i.indexOf("set")||"function"!=typeof e["get"+i.substr(3)]?i:"get"+i.substr(3)]()),l=(o=this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0)-r,u.length&&(-1!==(s=u.join("_")).indexOf("short")&&(l%=d)!==l%(d/2)&&(l=l<0?l+d:l-d),-1!==s.indexOf("_cw")&&l<0?l=(l+9999999999*d)%d-(l/d|0)*d:-1!==s.indexOf("ccw")&&l>0&&(l=(l-9999999999*d)%d-(l/d|0)*d)),(l>1e-6||l<-1e-6)&&(this._addTween(e,i,r,r+l,i),this._overwriteProps.push(i)));return!0},set:function(e){var t;if(1!==e)this._super.setRatio.call(this,e);else for(t=this._firstPT;t;)t.f?t.t[t.p](this.finals[t.p]):t.t[t.p]=this.finals[t.p],t=t._next}});_._autoCSS=!0;var p=180/Math.PI,h=[],f=[],g=[],y={},v=a.k._gsDefine.globals,b=function(e,t,n,a){n===a&&(n=a-(a-t)/1e6),e===t&&(t=e+(n-e)/1e6),this.a=e,this.b=t,this.c=n,this.d=a,this.da=a-e,this.ca=n-e,this.ba=t-e},M=function(e,t,n,a){var i={a:e},s={},r={},o={c:a},l=(e+t)/2,u=(t+n)/2,d=(n+a)/2,c=(l+u)/2,m=(u+d)/2,_=(m-c)/8;return i.b=l+(e-l)/4,s.b=c+_,i.c=s.a=(i.b+s.b)/2,s.c=r.a=(c+m)/2,r.b=m-_,o.b=d+(a-d)/4,r.c=o.a=(r.b+o.b)/2,[i,s,r,o]},w=function(e,t,n,a,i){var s,r,o,l,u,d,c,m,_,p,y,v,b,w=e.length-1,k=0,L=e[0].a;for(s=0;s<w;s++)r=(u=e[k]).a,o=u.d,l=e[k+1].d,i?(y=h[s],b=((v=f[s])+y)*t*.25/(a?.5:g[s]||.5),m=o-((d=o-(o-r)*(a?.5*t:0!==y?b/y:0))+(((c=o+(l-o)*(a?.5*t:0!==v?b/v:0))-d)*(3*y/(y+v)+.5)/4||0))):m=o-((d=o-(o-r)*t*.5)+(c=o+(l-o)*t*.5))/2,d+=m,c+=m,u.c=_=d,u.b=0!==s?L:L=u.a+.6*(u.c-u.a),u.da=o-r,u.ca=_-r,u.ba=L-r,n?(p=M(r,L,_,o),e.splice(k,1,p[0],p[1],p[2],p[3]),k+=4):k++,L=c;(u=e[k]).b=L,u.c=L+.4*(u.d-L),u.da=u.d-u.a,u.ca=u.c-u.a,u.ba=L-u.a,n&&(p=M(u.a,L,u.c,u.d),e.splice(k,1,p[0],p[1],p[2],p[3]))},k=function(e,t,n,a){var i,s,r,o,l,u,d=[];if(a)for(s=(e=[a].concat(e)).length;--s>-1;)"string"==typeof(u=e[s][t])&&"="===u.charAt(1)&&(e[s][t]=a[t]+Number(u.charAt(0)+u.substr(2)));if((i=e.length-2)<0)return d[0]=new b(e[0][t],0,0,e[0][t]),d;for(s=0;s<i;s++)r=e[s][t],o=e[s+1][t],d[s]=new b(r,0,0,o),n&&(l=e[s+2][t],h[s]=(h[s]||0)+(o-r)*(o-r),f[s]=(f[s]||0)+(l-o)*(l-o));return d[s]=new b(e[s][t],0,0,e[s+1][t]),d},L=function(e,t,n,a,i,s){var r,o,l,u,d,c,m,_,p={},v=[],b=s||e[0];for(o in i="string"==typeof i?","+i+",":",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",null==t&&(t=1),e[0])v.push(o);if(e.length>1){for(_=e[e.length-1],m=!0,r=v.length;--r>-1;)if(o=v[r],Math.abs(b[o]-_[o])>.05){m=!1;break}m&&(e=e.concat(),s&&e.unshift(s),e.push(e[1]),s=e[e.length-3])}for(h.length=f.length=g.length=0,r=v.length;--r>-1;)o=v[r],y[o]=-1!==i.indexOf(","+o+","),p[o]=k(e,o,y[o],s);for(r=h.length;--r>-1;)h[r]=Math.sqrt(h[r]),f[r]=Math.sqrt(f[r]);if(!a){for(r=v.length;--r>-1;)if(y[o])for(c=(l=p[v[r]]).length-1,u=0;u<c;u++)d=l[u+1].da/f[u]+l[u].da/h[u]||0,g[u]=(g[u]||0)+d*d;for(r=g.length;--r>-1;)g[r]=Math.sqrt(g[r])}for(r=v.length,u=n?4:1;--r>-1;)l=p[o=v[r]],w(l,t,n,a,y[o]),m&&(l.splice(0,u),l.splice(l.length-u,u));return p},x=function(e,t,n){for(var a,i,s,r,o,l,u,d,c,m,_,p=1/n,h=e.length;--h>-1;)for(s=(m=e[h]).a,r=m.d-s,o=m.c-s,l=m.b-s,a=i=0,d=1;d<=n;d++)a=i-(i=((u=p*d)*u*r+3*(c=1-u)*(u*o+c*l))*u),t[_=h*n+d-1]=(t[_]||0)+a*a},T=a.k._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.8",API:2,global:!0,init:function(e,t,n){this._target=e,t instanceof Array&&(t={values:t}),this._func={},this._mod={},this._props=[],this._timeRes=null==t.timeResolution?6:parseInt(t.timeResolution,10);var a,i,s,r,o,l=t.values||[],u={},d=l[0],c=t.autoRotate||n.vars.orientToBezier;for(a in this._autoRotate=c?c instanceof Array?c:[["x","y","rotation",!0===c?0:Number(c)||0]]:null,d)this._props.push(a);for(s=this._props.length;--s>-1;)a=this._props[s],this._overwriteProps.push(a),i=this._func[a]="function"==typeof e[a],u[a]=i?e[a.indexOf("set")||"function"!=typeof e["get"+a.substr(3)]?a:"get"+a.substr(3)]():parseFloat(e[a]),o||u[a]!==l[0][a]&&(o=u);if(this._beziers="cubic"!==t.type&&"quadratic"!==t.type&&"soft"!==t.type?L(l,isNaN(t.curviness)?1:t.curviness,!1,"thruBasic"===t.type,t.correlate,o):function(e,t,n){var a,i,s,r,o,l,u,d,c,m,_,p={},h="cubic"===(t=t||"soft")?3:2,f="soft"===t,g=[];if(f&&n&&(e=[n].concat(e)),null==e||e.length<h+1)throw"invalid Bezier data";for(c in e[0])g.push(c);for(l=g.length;--l>-1;){for(p[c=g[l]]=o=[],m=0,d=e.length,u=0;u<d;u++)a=null==n?e[u][c]:"string"==typeof(_=e[u][c])&&"="===_.charAt(1)?n[c]+Number(_.charAt(0)+_.substr(2)):Number(_),f&&u>1&&u<d-1&&(o[m++]=(a+o[m-2])/2),o[m++]=a;for(d=m-h+1,m=0,u=0;u<d;u+=h)a=o[u],i=o[u+1],s=o[u+2],r=2===h?0:o[u+3],o[m++]=_=3===h?new b(a,i,s,r):new b(a,(2*i+a)/3,(2*i+s)/3,s);o.length=m}return p}(l,t.type,u),this._segCount=this._beziers[a].length,this._timeRes){var m=function(e,t){var n,a,i,s,r=[],o=[],l=0,u=0,d=(t=t>>0||6)-1,c=[],m=[];for(n in e)x(e[n],r,t);for(i=r.length,a=0;a<i;a++)l+=Math.sqrt(r[a]),m[s=a%t]=l,s===d&&(u+=l,c[s=a/t>>0]=m,o[s]=u,l=0,m=[]);return{length:u,lengths:o,segments:c}}(this._beziers,this._timeRes);this._length=m.length,this._lengths=m.lengths,this._segments=m.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(c=this._autoRotate)for(this._initialRotations=[],c[0]instanceof Array||(this._autoRotate=c=[c]),s=c.length;--s>-1;){for(r=0;r<3;r++)a=c[s][r],this._func[a]="function"==typeof e[a]&&e[a.indexOf("set")||"function"!=typeof e["get"+a.substr(3)]?a:"get"+a.substr(3)];a=c[s][2],this._initialRotations[s]=(this._func[a]?this._func[a].call(this._target):this._target[a])||0,this._overwriteProps.push(a)}return this._startRatio=n.vars.runBackwards?1:0,!0},set:function(e){var t,n,a,i,s,r,o,l,u,d,c=this._segCount,m=this._func,_=this._target,h=e!==this._startRatio;if(this._timeRes){if(u=this._lengths,d=this._curSeg,e*=this._length,a=this._li,e>this._l2&&a<c-1){for(l=c-1;a<l&&(this._l2=u[++a])<=e;);this._l1=u[a-1],this._li=a,this._curSeg=d=this._segments[a],this._s2=d[this._s1=this._si=0]}else if(e<this._l1&&a>0){for(;a>0&&(this._l1=u[--a])>=e;);0===a&&e<this._l1?this._l1=0:a++,this._l2=u[a],this._li=a,this._curSeg=d=this._segments[a],this._s1=d[(this._si=d.length-1)-1]||0,this._s2=d[this._si]}if(t=a,e-=this._l1,a=this._si,e>this._s2&&a<d.length-1){for(l=d.length-1;a<l&&(this._s2=d[++a])<=e;);this._s1=d[a-1],this._si=a}else if(e<this._s1&&a>0){for(;a>0&&(this._s1=d[--a])>=e;);0===a&&e<this._s1?this._s1=0:a++,this._s2=d[a],this._si=a}r=(a+(e-this._s1)/(this._s2-this._s1))*this._prec||0}else r=(e-(t=e<0?0:e>=1?c-1:c*e>>0)*(1/c))*c;for(n=1-r,a=this._props.length;--a>-1;)i=this._props[a],o=(r*r*(s=this._beziers[i][t]).da+3*n*(r*s.ca+n*s.ba))*r+s.a,this._mod[i]&&(o=this._mod[i](o,_)),m[i]?_[i](o):_[i]=o;if(this._autoRotate){var f,g,y,v,b,M,w,k=this._autoRotate;for(a=k.length;--a>-1;)i=k[a][2],M=k[a][3]||0,w=!0===k[a][4]?1:p,s=this._beziers[k[a][0]],f=this._beziers[k[a][1]],s&&f&&(s=s[t],f=f[t],g=s.a+(s.b-s.a)*r,g+=((v=s.b+(s.c-s.b)*r)-g)*r,v+=(s.c+(s.d-s.c)*r-v)*r,y=f.a+(f.b-f.a)*r,y+=((b=f.b+(f.c-f.b)*r)-y)*r,b+=(f.c+(f.d-f.c)*r-b)*r,o=h?Math.atan2(b-y,v-g)*w+M:this._initialRotations[a],this._mod[i]&&(o=this._mod[i](o,_)),m[i]?_[i](o):_[i]=o)}}}),Y=T.prototype;T.bezierThrough=L,T.cubicToQuadratic=M,T._autoCSS=!0,T.quadraticToCubic=function(e,t,n){return new b(e,(2*t+e)/3,(2*t+n)/3,n)},T._cssRegister=function(){var e=v.CSSPlugin;if(e){var t=e._internals,n=t._parseToProxy,a=t._setPluginRatio,i=t.CSSPropTween;t._registerComplexSpecialProp("bezier",{parser:function(e,t,s,r,o,l){t instanceof Array&&(t={values:t}),l=new T;var u,d,c,m=t.values,_=m.length-1,p=[],h={};if(_<0)return o;for(u=0;u<=_;u++)c=n(e,m[u],r,o,l,_!==u),p[u]=c.end;for(d in t)h[d]=t[d];return h.values=p,(o=new i(e,"bezier",0,0,c.pt,2)).data=c,o.plugin=l,o.setRatio=a,0===h.autoRotate&&(h.autoRotate=!0),!h.autoRotate||h.autoRotate instanceof Array||(u=!0===h.autoRotate?0:Number(h.autoRotate),h.autoRotate=null!=c.end.left?[["left","top","rotation",u,!1]]:null!=c.end.x&&[["x","y","rotation",u,!1]]),h.autoRotate&&(r._transform||r._enableTransforms(!1),c.autoRotate=r._target._gsTransform,c.proxy.rotation=c.autoRotate.rotation||0,r._overwriteProps.push("rotation")),l._onInitTween(c.proxy,h,r._tween),o}})}},Y._mod=function(e){for(var t,n=this._overwriteProps,a=n.length;--a>-1;)(t=e[n[a]])&&"function"==typeof t&&(this._mod[n[a]]=t)},Y._kill=function(e){var t,n,a=this._props;for(t in this._beziers)if(t in e)for(delete this._beziers[t],delete this._func[t],n=a.length;--n>-1;)a[n]===t&&a.splice(n,1);if(a=this._autoRotate)for(n=a.length;--n>-1;)e[a[n][2]]&&a.splice(n,1);return this._super._kill.call(this,e)},a.k._gsDefine("easing.Back",["easing.Ease"],function(){var e,t,n,i,s=a.k.GreenSockGlobals||a.k,r=s.com.greensock,o=2*Math.PI,l=Math.PI/2,u=r._class,d=function(e,t){var n=u("easing."+e,function(){},!0),i=n.prototype=new a.b;return i.constructor=n,i.getRatio=t,n},c=a.b.register||function(){},m=function(e,t,n,a,i){var s=u("easing."+e,{easeOut:new t,easeIn:new n,easeInOut:new a},!0);return c(s,e),s},_=function(e,t,n){this.t=e,this.v=t,n&&(this.next=n,n.prev=this,this.c=n.v-t,this.gap=n.t-e)},p=function(e,t){var n=u("easing."+e,function(e){this._p1=e||0===e?e:1.70158,this._p2=1.525*this._p1},!0),i=n.prototype=new a.b;return i.constructor=n,i.getRatio=t,i.config=function(e){return new n(e)},n},h=m("Back",p("BackOut",function(e){return(e-=1)*e*((this._p1+1)*e+this._p1)+1}),p("BackIn",function(e){return e*e*((this._p1+1)*e-this._p1)}),p("BackInOut",function(e){return(e*=2)<1?.5*e*e*((this._p2+1)*e-this._p2):.5*((e-=2)*e*((this._p2+1)*e+this._p2)+2)})),f=u("easing.SlowMo",function(e,t,n){t=t||0===t?t:.7,null==e?e=.7:e>1&&(e=1),this._p=1!==e?t:0,this._p1=(1-e)/2,this._p2=e,this._p3=this._p1+this._p2,this._calcEnd=!0===n},!0),g=f.prototype=new a.b;return g.constructor=f,g.getRatio=function(e){var t=e+(.5-e)*this._p;return e<this._p1?this._calcEnd?1-(e=1-e/this._p1)*e:t-(e=1-e/this._p1)*e*e*e*t:e>this._p3?this._calcEnd?1===e?0:1-(e=(e-this._p3)/this._p1)*e:t+(e-t)*(e=(e-this._p3)/this._p1)*e*e*e:this._calcEnd?1:t},f.ease=new f(.7,.7),g.config=f.config=function(e,t,n){return new f(e,t,n)},(g=(e=u("easing.SteppedEase",function(e,t){e=e||1,this._p1=1/e,this._p2=e+(t?0:1),this._p3=t?1:0},!0)).prototype=new a.b).constructor=e,g.getRatio=function(e){return e<0?e=0:e>=1&&(e=.999999999),((this._p2*e|0)+this._p3)*this._p1},g.config=e.config=function(t,n){return new e(t,n)},(g=(t=u("easing.ExpoScaleEase",function(e,t,n){this._p1=Math.log(t/e),this._p2=t-e,this._p3=e,this._ease=n},!0)).prototype=new a.b).constructor=t,g.getRatio=function(e){return this._ease&&(e=this._ease.getRatio(e)),(this._p3*Math.exp(this._p1*e)-this._p3)/this._p2},g.config=t.config=function(e,n,a){return new t(e,n,a)},(g=(n=u("easing.RoughEase",function(e){for(var t,n,i,s,r,o,l=(e=e||{}).taper||"none",u=[],d=0,c=0|(e.points||20),m=c,p=!1!==e.randomize,h=!0===e.clamp,f=e.template instanceof a.b?e.template:null,g="number"==typeof e.strength?.4*e.strength:.4;--m>-1;)t=p?Math.random():1/c*m,n=f?f.getRatio(t):t,i="none"===l?g:"out"===l?(s=1-t)*s*g:"in"===l?t*t*g:t<.5?(s=2*t)*s*.5*g:(s=2*(1-t))*s*.5*g,p?n+=Math.random()*i-.5*i:m%2?n+=.5*i:n-=.5*i,h&&(n>1?n=1:n<0&&(n=0)),u[d++]={x:t,y:n};for(u.sort(function(e,t){return e.x-t.x}),o=new _(1,1,null),m=c;--m>-1;)r=u[m],o=new _(r.x,r.y,o);this._prev=new _(0,0,0!==o.t?o:o.next)},!0)).prototype=new a.b).constructor=n,g.getRatio=function(e){var t=this._prev;if(e>t.t){for(;t.next&&e>=t.t;)t=t.next;t=t.prev}else for(;t.prev&&e<=t.t;)t=t.prev;return this._prev=t,t.v+(e-t.t)/t.gap*t.c},g.config=function(e){return new n(e)},n.ease=new n,m("Bounce",d("BounceOut",function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}),d("BounceIn",function(e){return(e=1-e)<1/2.75?1-7.5625*e*e:e<2/2.75?1-(7.5625*(e-=1.5/2.75)*e+.75):e<2.5/2.75?1-(7.5625*(e-=2.25/2.75)*e+.9375):1-(7.5625*(e-=2.625/2.75)*e+.984375)}),d("BounceInOut",function(e){var t=e<.5;return(e=t?1-2*e:2*e-1)<1/2.75?e*=7.5625*e:e=e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,t?.5*(1-e):.5*e+.5})),m("Circ",d("CircOut",function(e){return Math.sqrt(1-(e-=1)*e)}),d("CircIn",function(e){return-(Math.sqrt(1-e*e)-1)}),d("CircInOut",function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)})),m("Elastic",(i=function(e,t,n){var i=u("easing."+e,function(e,t){this._p1=e>=1?e:1,this._p2=(t||n)/(e<1?e:1),this._p3=this._p2/o*(Math.asin(1/this._p1)||0),this._p2=o/this._p2},!0),s=i.prototype=new a.b;return s.constructor=i,s.getRatio=t,s.config=function(e,t){return new i(e,t)},i})("ElasticOut",function(e){return this._p1*Math.pow(2,-10*e)*Math.sin((e-this._p3)*this._p2)+1},.3),i("ElasticIn",function(e){return-this._p1*Math.pow(2,10*(e-=1))*Math.sin((e-this._p3)*this._p2)},.3),i("ElasticInOut",function(e){return(e*=2)<1?this._p1*Math.pow(2,10*(e-=1))*Math.sin((e-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(e-=1))*Math.sin((e-this._p3)*this._p2)*.5+1},.45)),m("Expo",d("ExpoOut",function(e){return 1-Math.pow(2,-10*e)}),d("ExpoIn",function(e){return Math.pow(2,10*(e-1))-.001}),d("ExpoInOut",function(e){return(e*=2)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*(e-1)))})),m("Sine",d("SineOut",function(e){return Math.sin(e*l)}),d("SineIn",function(e){return 1-Math.cos(e*l)}),d("SineInOut",function(e){return-.5*(Math.cos(Math.PI*e)-1)})),u("easing.EaseLookup",{find:function(e){return a.b.map[e]}},!0),c(s.SlowMo,"SlowMo","ease,"),c(n,"RoughEase","ease,"),c(e,"SteppedEase","ease,"),h},!0);const D=a.k.Back,S=a.k.Elastic,C=a.k.Bounce,j=a.k.RoughEase,E=a.k.SlowMo,P=a.k.SteppedEase,O=a.k.Circ,H=a.k.Expo,A=a.k.Sine,F=a.k.ExpoScaleEase,$=r;$._autoActivated=[i,s,o,l,T,u,_,D,S,C,j,E,P,O,H,A,F],n.d(t,"default",function(){return $}),n.d(t,"TweenLite",function(){return a.l}),n.d(t,"TweenMax",function(){return $}),n.d(t,"TimelineLite",function(){return i}),n.d(t,"TimelineMax",function(){return s}),n.d(t,"CSSPlugin",function(){return o}),n.d(t,"AttrPlugin",function(){return l}),n.d(t,"BezierPlugin",function(){return T}),n.d(t,"RoundPropsPlugin",function(){return u}),n.d(t,"DirectionalRotationPlugin",function(){return _}),n.d(t,"TweenPlugin",function(){return a.j}),n.d(t,"Ease",function(){return a.b}),n.d(t,"Power0",function(){return a.d}),n.d(t,"Power1",function(){return a.e}),n.d(t,"Power2",function(){return a.f}),n.d(t,"Power3",function(){return a.g}),n.d(t,"Power4",function(){return a.h}),n.d(t,"Linear",function(){return a.c}),n.d(t,"Back",function(){return D}),n.d(t,"Elastic",function(){return S}),n.d(t,"Bounce",function(){return C}),n.d(t,"RoughEase",function(){return j}),n.d(t,"SlowMo",function(){return E}),n.d(t,"SteppedEase",function(){return P}),n.d(t,"Circ",function(){return O}),n.d(t,"Expo",function(){return H}),n.d(t,"Sine",function(){return A}),n.d(t,"ExpoScaleEase",function(){return F}),n.d(t,"_gsScope",function(){return a.k})},U8JX:function(e,t,n){(function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},UBL4:function(e,t){},"UEE/":function(e,t){},"UL+2":function(e,t,n){(function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})})(n("a2/B"))},ULyk:function(e,t,n){(function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})})(n("a2/B"))},"V3+0":function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},W90N:function(e,t,n){(function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,a){var i=t.words[a];return 1===a.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},WCPy:function(e,t,n){(function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})})(n("a2/B"))},WlHu:function(e,t,n){(function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n("a2/B"))},X5QB:function(e,t,n){(function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[В изминалата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[В изминалия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дни",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})})(n("a2/B"))},X8jb:function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"XH/e":function(e,t){},XJth:function(e,t,n){(function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})})(n("a2/B"))},XWPg:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},YdsM:function(e,t,n){"use strict";e.exports=function(e,t,n,a){return e.config=t,n&&(e.code=n),e.response=a,e}},YpzF:function(e,t){},YqHU:function(e,t,n){(function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})})(n("a2/B"))},ZLbk:function(e,t,n){(function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juniu_Juliu_Augustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Aug_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sexta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sext_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Sex_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",ss:"minutu %d",m:"minutu ida",mm:"minutus %d",h:"horas ida",hh:"horas %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})})(n("a2/B"))},ZeD7:function(e,t,n){"use strict";var a=n("S1cf");e.exports=function(e){var t,n,i,s={};return e?(a.forEach(e.split("\n"),function(e){i=e.indexOf(":"),t=a.trim(e.substr(0,i)).toLowerCase(),n=a.trim(e.substr(i+1)),t&&(s[t]=s[t]?s[t]+", "+n:n)}),s):s}},Zms0:function(e,t){},"a2/B":function(e,t,n){(function(e){var t;t=function(){"use strict";var t,a;function i(){return t.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function r(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){var n,a=[];for(n=0;n<e.length;++n)a.push(t(e[n],n));return a}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _(e,t,n,a){return St(e,t,n,a,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function h(e){if(null==e._isValid){var t=p(e),n=a.call(t.parsedDateParts,function(e){return null!=e}),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function f(e){var t=_(NaN);return null!=e?m(p(t),e):p(t).userInvalidated=!0,t}a=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,a=0;a<n;a++)if(a in t&&e.call(this,t[a],a,t))return!0;return!1};var g=i.momentProperties=[];function y(e,t){var n,a,i;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=p(t)),o(t._locale)||(e._locale=t._locale),g.length>0)for(n=0;n<g.length;n++)o(i=t[a=g[n]])||(e[a]=i);return e}var v=!1;function b(e){y(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,i.updateOffset(this),v=!1)}function M(e){return e instanceof b||null!=e&&null!=e._isAMomentObject}function w(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=w(t)),n}function L(e,t,n){var a,i=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),r=0;for(a=0;a<i;a++)(n&&e[a]!==t[a]||!n&&k(e[a])!==k(t[a]))&&r++;return r+s}function x(e){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function T(e,t){var n=!0;return m(function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,e),n){for(var a,s=[],r=0;r<arguments.length;r++){if(a="","object"==typeof arguments[r]){for(var o in a+="\n["+r+"] ",arguments[0])a+=o+": "+arguments[0][o]+", ";a=a.slice(0,-2)}else a=arguments[r];s.push(a)}x(e+"\nArguments: "+Array.prototype.slice.call(s).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var Y,D={};function S(e,t){null!=i.deprecationHandler&&i.deprecationHandler(e,t),D[e]||(x(t),D[e]=!0)}function C(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function j(e,t){var n,a=m({},e);for(n in t)c(t,n)&&(r(e[n])&&r(t[n])?(a[n]={},m(a[n],e[n]),m(a[n],t[n])):null!=t[n]?a[n]=t[n]:delete a[n]);for(n in e)c(e,n)&&!c(t,n)&&r(e[n])&&(a[n]=m({},a[n]));return a}function E(e){null!=e&&this.set(e)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,Y=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};var P={};function O(e,t){var n=e.toLowerCase();P[n]=P[n+"s"]=P[t]=e}function H(e){return"string"==typeof e?P[e]||P[e.toLowerCase()]:void 0}function A(e){var t,n,a={};for(n in e)c(e,n)&&(t=H(n))&&(a[t]=e[n]);return a}var F={};function $(e,t){F[e]=t}function R(e,t,n){var a=""+Math.abs(e),i=t-a.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+a}var z=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,N=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,W={},I={};function q(e,t,n,a){var i=a;"string"==typeof a&&(i=function(){return this[a]()}),e&&(I[e]=i),t&&(I[t[0]]=function(){return R(i.apply(this,arguments),t[1],t[2])}),n&&(I[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function B(e,t){return e.isValid()?(t=U(t,e.localeData()),W[t]=W[t]||function(e){var t,n,a,i=e.match(z);for(t=0,n=i.length;t<n;t++)I[i[t]]?i[t]=I[i[t]]:i[t]=(a=i[t]).match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"");return function(t){var a,s="";for(a=0;a<n;a++)s+=C(i[a])?i[a].call(t,e):i[a];return s}}(t),W[t](e)):e.localeData().invalidDate()}function U(e,t){var n=5;function a(e){return t.longDateFormat(e)||e}for(N.lastIndex=0;n>=0&&N.test(e);)e=e.replace(N,a),N.lastIndex=0,n-=1;return e}var J=/\d/,X=/\d\d/,V=/\d{3}/,Z=/\d{4}/,G=/[+-]?\d{6}/,K=/\d\d?/,Q=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,ae=/[+-]?\d{1,6}/,ie=/\d+/,se=/[+-]?\d+/,re=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,le=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ue={};function de(e,t,n){ue[e]=C(t)?t:function(e,a){return e&&n?n:t}}function ce(e,t){return c(ue,e)?ue[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,a,i){return t||n||a||i})))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var _e={};function pe(e,t){var n,a=t;for("string"==typeof e&&(e=[e]),l(t)&&(a=function(e,n){n[t]=k(e)}),n=0;n<e.length;n++)_e[e[n]]=a}function he(e,t){pe(e,function(e,n,a,i){a._w=a._w||{},t(e,a._w,a,i)})}function fe(e,t,n){null!=t&&c(_e,e)&&_e[e](t,n._a,n,e)}var ge=0,ye=1,ve=2,be=3,Me=4,we=5,ke=6,Le=7,xe=8;function Te(e){return Ye(e)?366:365}function Ye(e){return e%4==0&&e%100!=0||e%400==0}q("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),O("year","y"),$("year",1),de("Y",se),de("YY",K,X),de("YYYY",ne,Z),de("YYYYY",ae,G),de("YYYYYY",ae,G),pe(["YYYYY","YYYYYY"],ge),pe("YYYY",function(e,t){t[ge]=2===e.length?i.parseTwoDigitYear(e):k(e)}),pe("YY",function(e,t){t[ge]=i.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[ge]=parseInt(e,10)}),i.parseTwoDigitYear=function(e){return k(e)+(k(e)>68?1900:2e3)};var De,Se=Ce("FullYear",!0);function Ce(e,t){return function(n){return null!=n?(Ee(this,e,n),i.updateOffset(this,t),this):je(this,e)}}function je(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ee(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Ye(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,a=(t%(n=12)+n)%n;return e+=(t-a)/12,1===a?Ye(e)?29:28:31-a%7%2}De=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),q("MMMM",0,0,function(e){return this.localeData().months(this,e)}),O("month","M"),$("month",8),de("M",K),de("MM",K,X),de("MMM",function(e,t){return t.monthsShortRegex(e)}),de("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[ye]=k(e)-1}),pe(["MMM","MMMM"],function(e,t,n,a){var i=n._locale.monthsParse(e,a,n._strict);null!=i?t[ye]=i:p(n).invalidMonth=e});var Oe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Ae="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Fe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!l(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function $e(e){return null!=e?(Fe(this,e),i.updateOffset(this,!0),this):je(this,"Month")}var Re=le;var ze=le;function Ne(){function e(e,t){return t.length-e.length}var t,n,a=[],i=[],s=[];for(t=0;t<12;t++)n=_([2e3,t]),a.push(this.monthsShort(n,"")),i.push(this.months(n,"")),s.push(this.months(n,"")),s.push(this.monthsShort(n,""));for(a.sort(e),i.sort(e),s.sort(e),t=0;t<12;t++)a[t]=me(a[t]),i[t]=me(i[t]);for(t=0;t<24;t++)s[t]=me(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+a.join("|")+")","i")}function We(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ie(e,t,n){var a=7+t-n;return-((7+We(e,0,a).getUTCDay()-t)%7)+a-1}function qe(e,t,n,a,i){var s,r,o=1+7*(t-1)+(7+n-a)%7+Ie(e,a,i);return o<=0?r=Te(s=e-1)+o:o>Te(e)?(s=e+1,r=o-Te(e)):(s=e,r=o),{year:s,dayOfYear:r}}function Be(e,t,n){var a,i,s=Ie(e.year(),t,n),r=Math.floor((e.dayOfYear()-s-1)/7)+1;return r<1?a=r+Ue(i=e.year()-1,t,n):r>Ue(e.year(),t,n)?(a=r-Ue(e.year(),t,n),i=e.year()+1):(i=e.year(),a=r),{week:a,year:i}}function Ue(e,t,n){var a=Ie(e,t,n),i=Ie(e+1,t,n);return(Te(e)-a+i)/7}q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),$("week",5),$("isoWeek",5),de("w",K),de("ww",K,X),de("W",K),de("WW",K,X),he(["w","ww","W","WW"],function(e,t,n,a){t[a.substr(0,1)]=k(e)});q("d",0,"do","day"),q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),$("day",11),$("weekday",11),$("isoWeekday",11),de("d",K),de("e",K),de("E",K),de("dd",function(e,t){return t.weekdaysMinRegex(e)}),de("ddd",function(e,t){return t.weekdaysShortRegex(e)}),de("dddd",function(e,t){return t.weekdaysRegex(e)}),he(["dd","ddd","dddd"],function(e,t,n,a){var i=n._locale.weekdaysParse(e,a,n._strict);null!=i?t.d=i:p(n).invalidWeekday=e}),he(["d","e","E"],function(e,t,n,a){t[a]=k(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Ve="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var Ze=le;var Ge=le;var Ke=le;function Qe(){function e(e,t){return t.length-e.length}var t,n,a,i,s,r=[],o=[],l=[],u=[];for(t=0;t<7;t++)n=_([2e3,1]).day(t),a=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),s=this.weekdays(n,""),r.push(a),o.push(i),l.push(s),u.push(a),u.push(i),u.push(s);for(r.sort(e),o.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)o[t]=me(o[t]),l[t]=me(l[t]),u[t]=me(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function et(){return this.hours()%12||12}function tt(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function nt(e,t){return t._meridiemParse}q("H",["HH",2],0,"hour"),q("h",["hh",2],0,et),q("k",["kk",2],0,function(){return this.hours()||24}),q("hmm",0,0,function(){return""+et.apply(this)+R(this.minutes(),2)}),q("hmmss",0,0,function(){return""+et.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),tt("a",!0),tt("A",!1),O("hour","h"),$("hour",13),de("a",nt),de("A",nt),de("H",K),de("h",K),de("k",K),de("HH",K,X),de("hh",K,X),de("kk",K,X),de("hmm",Q),de("hmmss",ee),de("Hmm",Q),de("Hmmss",ee),pe(["H","HH"],be),pe(["k","kk"],function(e,t,n){var a=k(e);t[be]=24===a?0:a}),pe(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),pe(["h","hh"],function(e,t,n){t[be]=k(e),p(n).bigHour=!0}),pe("hmm",function(e,t,n){var a=e.length-2;t[be]=k(e.substr(0,a)),t[Me]=k(e.substr(a)),p(n).bigHour=!0}),pe("hmmss",function(e,t,n){var a=e.length-4,i=e.length-2;t[be]=k(e.substr(0,a)),t[Me]=k(e.substr(a,2)),t[we]=k(e.substr(i)),p(n).bigHour=!0}),pe("Hmm",function(e,t,n){var a=e.length-2;t[be]=k(e.substr(0,a)),t[Me]=k(e.substr(a))}),pe("Hmmss",function(e,t,n){var a=e.length-4,i=e.length-2;t[be]=k(e.substr(0,a)),t[Me]=k(e.substr(a,2)),t[we]=k(e.substr(i))});var at,it=Ce("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Ae,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Ve,weekdaysShort:Xe,meridiemParse:/[ap]\.?m?\.?/i},rt={},ot={};function lt(e){return e?e.toLowerCase().replace("_","-"):e}function ut(t){var a=null;if(!rt[t]&&void 0!==e&&e&&e.exports)try{a=at._abbr;n("gh3w")("./"+t),dt(a)}catch(e){}return rt[t]}function dt(e,t){var n;return e&&(n=o(t)?mt(e):ct(e,t))&&(at=n),at._abbr}function ct(e,t){if(null!==t){var n=st;if(t.abbr=e,null!=rt[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=rt[e]._config;else if(null!=t.parentLocale){if(null==rt[t.parentLocale])return ot[t.parentLocale]||(ot[t.parentLocale]=[]),ot[t.parentLocale].push({name:e,config:t}),null;n=rt[t.parentLocale]._config}return rt[e]=new E(j(n,t)),ot[e]&&ot[e].forEach(function(e){ct(e.name,e.config)}),dt(e),rt[e]}return delete rt[e],null}function mt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return at;if(!s(e)){if(t=ut(e))return t;e=[e]}return function(e){for(var t,n,a,i,s=0;s<e.length;){for(t=(i=lt(e[s]).split("-")).length,n=(n=lt(e[s+1]))?n.split("-"):null;t>0;){if(a=ut(i.slice(0,t).join("-")))return a;if(n&&n.length>=t&&L(i,n,!0)>=t-1)break;t--}s++}return null}(e)}function _t(e){var t,n=e._a;return n&&-2===p(e).overflow&&(t=n[ye]<0||n[ye]>11?ye:n[ve]<1||n[ve]>Pe(n[ge],n[ye])?ve:n[be]<0||n[be]>24||24===n[be]&&(0!==n[Me]||0!==n[we]||0!==n[ke])?be:n[Me]<0||n[Me]>59?Me:n[we]<0||n[we]>59?we:n[ke]<0||n[ke]>999?ke:-1,p(e)._overflowDayOfYear&&(t<ge||t>ve)&&(t=ve),p(e)._overflowWeeks&&-1===t&&(t=Le),p(e)._overflowWeekday&&-1===t&&(t=xe),p(e).overflow=t),e}function pt(e,t,n){return null!=e?e:null!=t?t:n}function ht(e){var t,n,a,s,r,o=[];if(!e._d){for(a=function(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ve]&&null==e._a[ye]&&function(e){var t,n,a,i,s,r,o,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)s=1,r=4,n=pt(t.GG,e._a[ge],Be(Ct(),1,4).year),a=pt(t.W,1),((i=pt(t.E,1))<1||i>7)&&(l=!0);else{s=e._locale._week.dow,r=e._locale._week.doy;var u=Be(Ct(),s,r);n=pt(t.gg,e._a[ge],u.year),a=pt(t.w,u.week),null!=t.d?((i=t.d)<0||i>6)&&(l=!0):null!=t.e?(i=t.e+s,(t.e<0||t.e>6)&&(l=!0)):i=s}a<1||a>Ue(n,s,r)?p(e)._overflowWeeks=!0:null!=l?p(e)._overflowWeekday=!0:(o=qe(n,a,i,s,r),e._a[ge]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=pt(e._a[ge],a[ge]),(e._dayOfYear>Te(r)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),n=We(r,0,e._dayOfYear),e._a[ye]=n.getUTCMonth(),e._a[ve]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=a[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[be]&&0===e._a[Me]&&0===e._a[we]&&0===e._a[ke]&&(e._nextDay=!0,e._a[be]=0),e._d=(e._useUTC?We:function(e,t,n,a,i,s,r){var o=new Date(e,t,n,a,i,s,r);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,o),s=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[be]=24),e._w&&void 0!==e._w.d&&e._w.d!==s&&(p(e).weekdayMismatch=!0)}}var ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,vt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],bt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,a,i,s,r,o=e._i,l=ft.exec(o)||gt.exec(o);if(l){for(p(e).iso=!0,t=0,n=vt.length;t<n;t++)if(vt[t][1].exec(l[1])){i=vt[t][0],a=!1!==vt[t][2];break}if(null==i)return void(e._isValid=!1);if(l[3]){for(t=0,n=bt.length;t<n;t++)if(bt[t][1].exec(l[3])){s=(l[2]||" ")+bt[t][0];break}if(null==s)return void(e._isValid=!1)}if(!a&&null!=s)return void(e._isValid=!1);if(l[4]){if(!yt.exec(l[4]))return void(e._isValid=!1);r="Z"}e._f=i+(s||"")+(r||""),Yt(e)}else e._isValid=!1}var kt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Lt(e,t,n,a,i,s){var r=[function(e){var t=parseInt(e,10);if(t<=49)return 2e3+t;if(t<=999)return 1900+t;return t}(e),Ae.indexOf(t),parseInt(n,10),parseInt(a,10),parseInt(i,10)];return s&&r.push(parseInt(s,10)),r}var xt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Tt(e){var t=kt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(t){var n=Lt(t[4],t[3],t[2],t[5],t[6],t[7]);if(!function(e,t,n){return!e||Xe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(p(n).weekdayMismatch=!0,n._isValid=!1,!1)}(t[1],n,e))return;e._a=n,e._tzm=function(e,t,n){if(e)return xt[e];if(t)return 0;var a=parseInt(n,10),i=a%100;return(a-i)/100*60+i}(t[8],t[9],t[10]),e._d=We.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0}else e._isValid=!1}function Yt(e){if(e._f!==i.ISO_8601)if(e._f!==i.RFC_2822){e._a=[],p(e).empty=!0;var t,n,a,s,r,o=""+e._i,l=o.length,u=0;for(a=U(e._f,e._locale).match(z)||[],t=0;t<a.length;t++)s=a[t],(n=(o.match(ce(s,e))||[])[0])&&((r=o.substr(0,o.indexOf(n))).length>0&&p(e).unusedInput.push(r),o=o.slice(o.indexOf(n)+n.length),u+=n.length),I[s]?(n?p(e).empty=!1:p(e).unusedTokens.push(s),fe(s,n,e)):e._strict&&!n&&p(e).unusedTokens.push(s);p(e).charsLeftOver=l-u,o.length>0&&p(e).unusedInput.push(o),e._a[be]<=12&&!0===p(e).bigHour&&e._a[be]>0&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[be]=function(e,t,n){var a;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((a=e.isPM(n))&&t<12&&(t+=12),a||12!==t||(t=0),t):t}(e._locale,e._a[be],e._meridiem),ht(e),_t(e)}else Tt(e);else wt(e)}function Dt(e){var t=e._i,n=e._f;return e._locale=e._locale||mt(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),M(t)?new b(_t(t)):(u(t)?e._d=t:s(n)?function(e){var t,n,a,i,s;if(0===e._f.length)return p(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;i<e._f.length;i++)s=0,t=y({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Yt(t),h(t)&&(s+=p(t).charsLeftOver,s+=10*p(t).unusedTokens.length,p(t).score=s,(null==a||s<a)&&(a=s,n=t));m(e,n||t)}(e):n?Yt(e):function(e){var t=e._i;o(t)?e._d=new Date(i.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=Mt.exec(e._i);null===t?(wt(e),!1===e._isValid&&(delete e._isValid,Tt(e),!1===e._isValid&&(delete e._isValid,i.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):s(t)?(e._a=d(t.slice(0),function(e){return parseInt(e,10)}),ht(e)):r(t)?function(e){if(!e._d){var t=A(e._i);e._a=d([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ht(e)}}(e):l(t)?e._d=new Date(t):i.createFromInputFallback(e)}(e),h(e)||(e._d=null),e))}function St(e,t,n,a,i){var o,l={};return!0!==n&&!1!==n||(a=n,n=void 0),(r(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||s(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=i,l._l=n,l._i=e,l._f=t,l._strict=a,(o=new b(_t(Dt(l))))._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function Ct(e,t,n,a){return St(e,t,n,a,!1)}i.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),i.ISO_8601=function(){},i.RFC_2822=function(){};var jt=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:f()}),Et=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()});function Pt(e,t){var n,a;if(1===t.length&&s(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],a=1;a<t.length;++a)t[a].isValid()&&!t[a][e](n)||(n=t[a]);return n}var Ot=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=A(e),n=t.year||0,a=t.quarter||0,i=t.month||0,s=t.week||0,r=t.day||0,o=t.hour||0,l=t.minute||0,u=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===De.call(Ot,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,a=0;a<Ot.length;++a)if(e[Ot[a]]){if(n)return!1;parseFloat(e[Ot[a]])!==k(e[Ot[a]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*u+6e4*l+1e3*o*60*60,this._days=+r+7*s,this._months=+i+3*a+12*n,this._data={},this._locale=mt(),this._bubble()}function At(e){return e instanceof Ht}function Ft(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function $t(e,t){q(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+R(~~(e/60),2)+t+R(~~e%60,2)})}$t("Z",":"),$t("ZZ",""),de("Z",oe),de("ZZ",oe),pe(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=zt(oe,e)});var Rt=/([\+\-]|\d\d)/gi;function zt(e,t){var n=(t||"").match(e);if(null===n)return null;var a=((n[n.length-1]||[])+"").match(Rt)||["-",0,0],i=60*a[1]+k(a[2]);return 0===i?0:"+"===a[0]?i:-i}function Nt(e,t){var n,a;return t._isUTC?(n=t.clone(),a=(M(e)||u(e)?e.valueOf():Ct(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),i.updateOffset(n,!1),n):Ct(e).local()}function Wt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function It(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}i.updateOffset=function(){};var qt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Bt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ut(e,t){var n,a,i,s=e,r=null;return At(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:l(e)?(s={},t?s[t]=e:s.milliseconds=e):(r=qt.exec(e))?(n="-"===r[1]?-1:1,s={y:0,d:k(r[ve])*n,h:k(r[be])*n,m:k(r[Me])*n,s:k(r[we])*n,ms:k(Ft(1e3*r[ke]))*n}):(r=Bt.exec(e))?(n="-"===r[1]?-1:(r[1],1),s={y:Jt(r[2],n),M:Jt(r[3],n),w:Jt(r[4],n),d:Jt(r[5],n),h:Jt(r[6],n),m:Jt(r[7],n),s:Jt(r[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Xt(e,t):((n=Xt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Ct(s.from),Ct(s.to)),(s={}).ms=i.milliseconds,s.M=i.months),a=new Ht(s),At(e)&&c(e,"_locale")&&(a._locale=e._locale),a}function Jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Xt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Vt(e,t){return function(n,a){var i;return null===a||isNaN(+a)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=a,a=i),Zt(this,Ut(n="string"==typeof n?+n:n,a),e),this}}function Zt(e,t,n,a){var s=t._milliseconds,r=Ft(t._days),o=Ft(t._months);e.isValid()&&(a=null==a||a,o&&Fe(e,je(e,"Month")+o*n),r&&Ee(e,"Date",je(e,"Date")+r*n),s&&e._d.setTime(e._d.valueOf()+s*n),a&&i.updateOffset(e,r||o))}Ut.fn=Ht.prototype,Ut.invalid=function(){return Ut(NaN)};var Gt=Vt(1,"add"),Kt=Vt(-1,"subtract");function Qt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),a=e.clone().add(n,"months");return-(n+(t-a<0?(t-a)/(a-e.clone().add(n-1,"months")):(t-a)/(e.clone().add(n+1,"months")-a)))||0}function en(e){var t;return void 0===e?this._locale._abbr:(null!=(t=mt(e))&&(this._locale=t),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var tn=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function nn(){return this._locale}function an(e,t){q(0,[e,e.length],0,t)}function sn(e,t,n,a,i){var s;return null==e?Be(this,a,i).year:(t>(s=Ue(e,a,i))&&(t=s),function(e,t,n,a,i){var s=qe(e,t,n,a,i),r=We(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}.call(this,e,t,n,a,i))}q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),an("gggg","weekYear"),an("ggggg","weekYear"),an("GGGG","isoWeekYear"),an("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),$("weekYear",1),$("isoWeekYear",1),de("G",se),de("g",se),de("GG",K,X),de("gg",K,X),de("GGGG",ne,Z),de("gggg",ne,Z),de("GGGGG",ae,G),de("ggggg",ae,G),he(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,a){t[a.substr(0,2)]=k(e)}),he(["gg","GG"],function(e,t,n,a){t[a]=i.parseTwoDigitYear(e)}),q("Q",0,"Qo","quarter"),O("quarter","Q"),$("quarter",7),de("Q",J),pe("Q",function(e,t){t[ye]=3*(k(e)-1)}),q("D",["DD",2],"Do","date"),O("date","D"),$("date",9),de("D",K),de("DD",K,X),de("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],ve),pe("Do",function(e,t){t[ve]=k(e.match(K)[0])});var rn=Ce("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),$("dayOfYear",4),de("DDD",te),de("DDDD",V),pe(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),q("m",["mm",2],0,"minute"),O("minute","m"),$("minute",14),de("m",K),de("mm",K,X),pe(["m","mm"],Me);var on=Ce("Minutes",!1);q("s",["ss",2],0,"second"),O("second","s"),$("second",15),de("s",K),de("ss",K,X),pe(["s","ss"],we);var ln,un=Ce("Seconds",!1);for(q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),$("millisecond",16),de("S",te,J),de("SS",te,X),de("SSS",te,V),ln="SSSS";ln.length<=9;ln+="S")de(ln,ie);function dn(e,t){t[ke]=k(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")pe(ln,dn);var cn=Ce("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var mn=b.prototype;function _n(e){return e}mn.add=Gt,mn.calendar=function(e,t){var n=e||Ct(),a=Nt(n,this).startOf("day"),s=i.calendarFormat(this,a)||"sameElse",r=t&&(C(t[s])?t[s].call(this,n):t[s]);return this.format(r||this.localeData().calendar(s,this,Ct(n)))},mn.clone=function(){return new b(this)},mn.diff=function(e,t,n){var a,i,s;if(!this.isValid())return NaN;if(!(a=Nt(e,this)).isValid())return NaN;switch(i=6e4*(a.utcOffset()-this.utcOffset()),t=H(t)){case"year":s=Qt(this,a)/12;break;case"month":s=Qt(this,a);break;case"quarter":s=Qt(this,a)/3;break;case"second":s=(this-a)/1e3;break;case"minute":s=(this-a)/6e4;break;case"hour":s=(this-a)/36e5;break;case"day":s=(this-a-i)/864e5;break;case"week":s=(this-a-i)/6048e5;break;default:s=this-a}return n?s:w(s)},mn.endOf=function(e){return void 0===(e=H(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},mn.format=function(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=B(this,e);return this.localeData().postformat(t)},mn.from=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Ct(e).isValid())?Ut({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.fromNow=function(e){return this.from(Ct(),e)},mn.to=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Ct(e).isValid())?Ut({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},mn.toNow=function(e){return this.to(Ct(),e)},mn.get=function(e){return C(this[e=H(e)])?this[e]():this},mn.invalidAt=function(){return p(this).overflow},mn.isAfter=function(e,t){var n=M(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(o(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},mn.isBefore=function(e,t){var n=M(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(o(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},mn.isBetween=function(e,t,n,a){return("("===(a=a||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===a[1]?this.isBefore(t,n):!this.isAfter(t,n))},mn.isSame=function(e,t){var n,a=M(e)?e:Ct(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=H(t||"millisecond"))?this.valueOf()===a.valueOf():(n=a.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},mn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},mn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},mn.isValid=function(){return h(this)},mn.lang=tn,mn.locale=en,mn.localeData=nn,mn.max=Et,mn.min=jt,mn.parsingFlags=function(){return m({},p(this))},mn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=A(e)),a=0;a<n.length;a++)this[n[a].unit](e[n[a].unit]);else if(C(this[e=H(e)]))return this[e](t);return this},mn.startOf=function(e){switch(e=H(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},mn.subtract=Kt,mn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},mn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},mn.toDate=function(){return new Date(this.valueOf())},mn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?B(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",B(n,"Z")):B(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',a=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+a+"-MM-DD[T]HH:mm:ss.SSS"+i)},mn.toJSON=function(){return this.isValid()?this.toISOString():null},mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},mn.unix=function(){return Math.floor(this.valueOf()/1e3)},mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},mn.year=Se,mn.isLeapYear=function(){return Ye(this.year())},mn.weekYear=function(e){return sn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},mn.isoWeekYear=function(e){return sn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},mn.quarter=mn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},mn.month=$e,mn.daysInMonth=function(){return Pe(this.year(),this.month())},mn.week=mn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},mn.isoWeek=mn.isoWeeks=function(e){var t=Be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},mn.weeksInYear=function(){var e=this.localeData()._week;return Ue(this.year(),e.dow,e.doy)},mn.isoWeeksInYear=function(){return Ue(this.year(),1,4)},mn.date=rn,mn.day=mn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},mn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},mn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},mn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},mn.hour=mn.hours=it,mn.minute=mn.minutes=on,mn.second=mn.seconds=un,mn.millisecond=mn.milliseconds=cn,mn.utcOffset=function(e,t,n){var a,s=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=zt(oe,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(a=Wt(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),s!==e&&(!t||this._changeInProgress?Zt(this,Ut(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:Wt(this)},mn.utc=function(e){return this.utcOffset(0,e)},mn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Wt(this),"m")),this},mn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=zt(re,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},mn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)},mn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mn.isUtc=It,mn.isUTC=It,mn.zoneAbbr=function(){return this._isUTC?"UTC":""},mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mn.dates=T("dates accessor is deprecated. Use date instead.",rn),mn.months=T("months accessor is deprecated. Use month instead",$e),mn.years=T("years accessor is deprecated. Use year instead",Se),mn.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),mn.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e={};if(y(e,this),(e=Dt(e))._a){var t=e._isUTC?_(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&L(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var pn=E.prototype;function hn(e,t,n,a){var i=mt(),s=_().set(a,t);return i[n](s,e)}function fn(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return hn(e,t,n,"month");var a,i=[];for(a=0;a<12;a++)i[a]=hn(e,a,n,"month");return i}function gn(e,t,n,a){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var i,s=mt(),r=e?s._week.dow:0;if(null!=n)return hn(t,(n+r)%7,a,"day");var o=[];for(i=0;i<7;i++)o[i]=hn(t,(i+r)%7,a,"day");return o}pn.calendar=function(e,t,n){var a=this._calendar[e]||this._calendar.sameElse;return C(a)?a.call(t,n):a},pn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},pn.invalidDate=function(){return this._invalidDate},pn.ordinal=function(e){return this._ordinal.replace("%d",e)},pn.preparse=_n,pn.postformat=_n,pn.relativeTime=function(e,t,n,a){var i=this._relativeTime[n];return C(i)?i(e,t,n,a):i.replace(/%d/i,e)},pn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return C(n)?n(t):n.replace(/%s/i,t)},pn.set=function(e){var t,n;for(n in e)C(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},pn.months=function(e,t){return e?s(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Oe).test(t)?"format":"standalone"][e.month()]:s(this._months)?this._months:this._months.standalone},pn.monthsShort=function(e,t){return e?s(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Oe.test(t)?"format":"standalone"][e.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},pn.monthsParse=function(e,t,n){var a,i,s;if(this._monthsParseExact)return function(e,t,n){var a,i,s,r=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;a<12;++a)s=_([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=De.call(this._shortMonthsParse,r))?i:null:-1!==(i=De.call(this._longMonthsParse,r))?i:null:"MMM"===t?-1!==(i=De.call(this._shortMonthsParse,r))?i:-1!==(i=De.call(this._longMonthsParse,r))?i:null:-1!==(i=De.call(this._longMonthsParse,r))?i:-1!==(i=De.call(this._shortMonthsParse,r))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),a=0;a<12;a++){if(i=_([2e3,a]),n&&!this._longMonthsParse[a]&&(this._longMonthsParse[a]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[a]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[a]||(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[a]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[a].test(e))return a;if(n&&"MMM"===t&&this._shortMonthsParse[a].test(e))return a;if(!n&&this._monthsParse[a].test(e))return a}},pn.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=ze),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},pn.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},pn.week=function(e){return Be(e,this._week.dow,this._week.doy).week},pn.firstDayOfYear=function(){return this._week.doy},pn.firstDayOfWeek=function(){return this._week.dow},pn.weekdays=function(e,t){return e?s(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:s(this._weekdays)?this._weekdays:this._weekdays.standalone},pn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},pn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},pn.weekdaysParse=function(e,t,n){var a,i,s;if(this._weekdaysParseExact)return function(e,t,n){var a,i,s,r=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)s=_([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=De.call(this._weekdaysParse,r))?i:null:"ddd"===t?-1!==(i=De.call(this._shortWeekdaysParse,r))?i:null:-1!==(i=De.call(this._minWeekdaysParse,r))?i:null:"dddd"===t?-1!==(i=De.call(this._weekdaysParse,r))?i:-1!==(i=De.call(this._shortWeekdaysParse,r))?i:-1!==(i=De.call(this._minWeekdaysParse,r))?i:null:"ddd"===t?-1!==(i=De.call(this._shortWeekdaysParse,r))?i:-1!==(i=De.call(this._weekdaysParse,r))?i:-1!==(i=De.call(this._minWeekdaysParse,r))?i:null:-1!==(i=De.call(this._minWeekdaysParse,r))?i:-1!==(i=De.call(this._weekdaysParse,r))?i:-1!==(i=De.call(this._shortWeekdaysParse,r))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(i=_([2e3,1]).day(a),n&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[a]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[a]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[a].test(e))return a;if(n&&"ddd"===t&&this._shortWeekdaysParse[a].test(e))return a;if(n&&"dd"===t&&this._minWeekdaysParse[a].test(e))return a;if(!n&&this._weekdaysParse[a].test(e))return a}},pn.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=Ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},pn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ge),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},pn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||Qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ke),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},pn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},pn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},dt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),i.lang=T("moment.lang is deprecated. Use moment.locale instead.",dt),i.langData=T("moment.langData is deprecated. Use moment.localeData instead.",mt);var yn=Math.abs;function vn(e,t,n,a){var i=Ut(t,n);return e._milliseconds+=a*i._milliseconds,e._days+=a*i._days,e._months+=a*i._months,e._bubble()}function bn(e){return e<0?Math.floor(e):Math.ceil(e)}function Mn(e){return 4800*e/146097}function wn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}var Ln=kn("ms"),xn=kn("s"),Tn=kn("m"),Yn=kn("h"),Dn=kn("d"),Sn=kn("w"),Cn=kn("M"),jn=kn("y");function En(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=En("milliseconds"),On=En("seconds"),Hn=En("minutes"),An=En("hours"),Fn=En("days"),$n=En("months"),Rn=En("years");var zn=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Wn=Math.abs;function In(e){return(e>0)-(e<0)||+e}function qn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Wn(this._milliseconds)/1e3,a=Wn(this._days),i=Wn(this._months);t=w((e=w(n/60))/60),n%=60,e%=60;var s=w(i/12),r=i%=12,o=a,l=t,u=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",c=this.asSeconds();if(!c)return"P0D";var m=c<0?"-":"",_=In(this._months)!==In(c)?"-":"",p=In(this._days)!==In(c)?"-":"",h=In(this._milliseconds)!==In(c)?"-":"";return m+"P"+(s?_+s+"Y":"")+(r?_+r+"M":"")+(o?p+o+"D":"")+(l||u||d?"T":"")+(l?h+l+"H":"")+(u?h+u+"M":"")+(d?h+d+"S":"")}var Bn=Ht.prototype;return Bn.isValid=function(){return this._isValid},Bn.abs=function(){var e=this._data;return this._milliseconds=yn(this._milliseconds),this._days=yn(this._days),this._months=yn(this._months),e.milliseconds=yn(e.milliseconds),e.seconds=yn(e.seconds),e.minutes=yn(e.minutes),e.hours=yn(e.hours),e.months=yn(e.months),e.years=yn(e.years),this},Bn.add=function(e,t){return vn(this,e,t,1)},Bn.subtract=function(e,t){return vn(this,e,t,-1)},Bn.as=function(e){if(!this.isValid())return NaN;var t,n,a=this._milliseconds;if("month"===(e=H(e))||"year"===e)return t=this._days+a/864e5,n=this._months+Mn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(wn(this._months)),e){case"week":return t/7+a/6048e5;case"day":return t+a/864e5;case"hour":return 24*t+a/36e5;case"minute":return 1440*t+a/6e4;case"second":return 86400*t+a/1e3;case"millisecond":return Math.floor(864e5*t)+a;default:throw new Error("Unknown unit "+e)}},Bn.asMilliseconds=Ln,Bn.asSeconds=xn,Bn.asMinutes=Tn,Bn.asHours=Yn,Bn.asDays=Dn,Bn.asWeeks=Sn,Bn.asMonths=Cn,Bn.asYears=jn,Bn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Bn._bubble=function(){var e,t,n,a,i,s=this._milliseconds,r=this._days,o=this._months,l=this._data;return s>=0&&r>=0&&o>=0||s<=0&&r<=0&&o<=0||(s+=864e5*bn(wn(o)+r),r=0,o=0),l.milliseconds=s%1e3,e=w(s/1e3),l.seconds=e%60,t=w(e/60),l.minutes=t%60,n=w(t/60),l.hours=n%24,o+=i=w(Mn(r+=w(n/24))),r-=bn(wn(i)),a=w(o/12),o%=12,l.days=r,l.months=o,l.years=a,this},Bn.clone=function(){return Ut(this)},Bn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},Bn.milliseconds=Pn,Bn.seconds=On,Bn.minutes=Hn,Bn.hours=An,Bn.days=Fn,Bn.weeks=function(){return w(this.days()/7)},Bn.months=$n,Bn.years=Rn,Bn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var a=Ut(e).abs(),i=zn(a.as("s")),s=zn(a.as("m")),r=zn(a.as("h")),o=zn(a.as("d")),l=zn(a.as("M")),u=zn(a.as("y")),d=i<=Nn.ss&&["s",i]||i<Nn.s&&["ss",i]||s<=1&&["m"]||s<Nn.m&&["mm",s]||r<=1&&["h"]||r<Nn.h&&["hh",r]||o<=1&&["d"]||o<Nn.d&&["dd",o]||l<=1&&["M"]||l<Nn.M&&["MM",l]||u<=1&&["y"]||["yy",u];return d[2]=t,d[3]=+e>0,d[4]=n,function(e,t,n,a,i){return i.relativeTime(t||1,!!n,e,a)}.apply(null,d)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Bn.toISOString=qn,Bn.toString=qn,Bn.toJSON=qn,Bn.locale=en,Bn.localeData=nn,Bn.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",qn),Bn.lang=tn,q("X",0,0,"unix"),q("x",0,0,"valueOf"),de("x",se),de("X",/[+-]?\d+(\.\d{1,3})?/),pe("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),pe("x",function(e,t,n){n._d=new Date(k(e))}),i.version="2.20.1",t=Ct,i.fn=mn,i.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},i.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=_,i.unix=function(e){return Ct(1e3*e)},i.months=function(e,t){return fn(e,t,"months")},i.isDate=u,i.locale=dt,i.invalid=f,i.duration=Ut,i.isMoment=M,i.weekdays=function(e,t,n){return gn(e,t,n,"weekdays")},i.parseZone=function(){return Ct.apply(null,arguments).parseZone()},i.localeData=mt,i.isDuration=At,i.monthsShort=function(e,t){return fn(e,t,"monthsShort")},i.weekdaysMin=function(e,t,n){return gn(e,t,n,"weekdaysMin")},i.defineLocale=ct,i.updateLocale=function(e,t){if(null!=t){var n,a,i=st;null!=(a=ut(e))&&(i=a._config),(n=new E(t=j(i,t))).parentLocale=rt[e],rt[e]=n,dt(e)}else null!=rt[e]&&(null!=rt[e].parentLocale?rt[e]=rt[e].parentLocale:null!=rt[e]&&delete rt[e]);return rt[e]},i.locales=function(){return Y(rt)},i.weekdaysShort=function(e,t,n){return gn(e,t,n,"weekdaysShort")},i.normalizeUnits=H,i.relativeTimeRounding=function(e){return void 0===e?zn:"function"==typeof e&&(zn=e,!0)},i.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,"s"===e&&(Nn.ss=t-1),!0))},i.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},i.prototype=mn,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},i},e.exports=t()}).call(t,n("3IRH")(e))},a2Uu:function(e,t,n){"use strict";e.exports=function(e,t){return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")}},aKwh:function(e,t,n){"use strict";n.d(t,"e",function(){return y}),n.d(t,"d",function(){return v}),n.d(t,"c",function(){return b}),n.d(t,"b",function(){return M});var a=function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:n});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[n].concat(e.init):n,t.call(this,e)}}function n(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}},i="undefined"!=typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function s(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}var r=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"==typeof n?n():n)||{}},o={namespaced:{configurable:!0}};o.namespaced.get=function(){return!!this._rawModule.namespaced},r.prototype.addChild=function(e,t){this._children[e]=t},r.prototype.removeChild=function(e){delete this._children[e]},r.prototype.getChild=function(e){return this._children[e]},r.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},r.prototype.forEachChild=function(e){s(this._children,e)},r.prototype.forEachGetter=function(e){this._rawModule.getters&&s(this._rawModule.getters,e)},r.prototype.forEachAction=function(e){this._rawModule.actions&&s(this._rawModule.actions,e)},r.prototype.forEachMutation=function(e){this._rawModule.mutations&&s(this._rawModule.mutations,e)},Object.defineProperties(r.prototype,o);var l,u=function(e){this.register([],e,!1)};u.prototype.get=function(e){return e.reduce(function(e,t){return e.getChild(t)},this.root)},u.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")},"")},u.prototype.update=function(e){!function e(t,n,a){0;n.update(a);if(a.modules)for(var i in a.modules){if(!n.getChild(i))return void 0;e(t.concat(i),n.getChild(i),a.modules[i])}}([],this.root,e)},u.prototype.register=function(e,t,n){var a=this;void 0===n&&(n=!0);var i=new r(t,n);0===e.length?this.root=i:this.get(e.slice(0,-1)).addChild(e[e.length-1],i);t.modules&&s(t.modules,function(t,i){a.register(e.concat(i),t,n)})},u.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];t.getChild(n).runtime&&t.removeChild(n)};var d=function(e){var t=this;void 0===e&&(e={}),!l&&"undefined"!=typeof window&&window.Vue&&g(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var a=e.strict;void 0===a&&(a=!1);var s=e.state;void 0===s&&(s={}),"function"==typeof s&&(s=s()),this._committing=!1,this._actions=Object.create(null),this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new u(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new l;var r=this,o=this.dispatch,d=this.commit;this.dispatch=function(e,t){return o.call(r,e,t)},this.commit=function(e,t,n){return d.call(r,e,t,n)},this.strict=a,p(this,s,[],this._modules.root),_(this,s),n.forEach(function(e){return e(t)}),l.config.devtools&&function(e){i&&(e._devtoolHook=i,i.emit("vuex:init",e),i.on("vuex:travel-to-state",function(t){e.replaceState(t)}),e.subscribe(function(e,t){i.emit("vuex:mutation",e,t)}))}(this)},c={state:{configurable:!0}};function m(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;p(e,n,[],e._modules.root,!0),_(e,n,t)}function _(e,t,n){var a=e._vm;e.getters={};var i={};s(e._wrappedGetters,function(t,n){i[n]=function(){return t(e)},Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})});var r=l.config.silent;l.config.silent=!0,e._vm=new l({data:{$$state:t},computed:i}),l.config.silent=r,e.strict&&function(e){e._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}(e),a&&(n&&e._withCommit(function(){a._data.$$state=null}),l.nextTick(function(){return a.$destroy()}))}function p(e,t,n,a,i){var s=!n.length,r=e._modules.getNamespace(n);if(a.namespaced&&(e._modulesNamespaceMap[r]=a),!s&&!i){var o=h(t,n.slice(0,-1)),u=n[n.length-1];e._withCommit(function(){l.set(o,u,a.state)})}var d=a.context=function(e,t,n){var a=""===t,i={dispatch:a?e.dispatch:function(n,a,i){var s=f(n,a,i),r=s.payload,o=s.options,l=s.type;return o&&o.root||(l=t+l),e.dispatch(l,r)},commit:a?e.commit:function(n,a,i){var s=f(n,a,i),r=s.payload,o=s.options,l=s.type;o&&o.root||(l=t+l),e.commit(l,r,o)}};return Object.defineProperties(i,{getters:{get:a?function(){return e.getters}:function(){return function(e,t){var n={},a=t.length;return Object.keys(e.getters).forEach(function(i){if(i.slice(0,a)===t){var s=i.slice(a);Object.defineProperty(n,s,{get:function(){return e.getters[i]},enumerable:!0})}}),n}(e,t)}},state:{get:function(){return h(e.state,n)}}}),i}(e,r,n);a.forEachMutation(function(t,n){!function(e,t,n,a){(e._mutations[t]||(e._mutations[t]=[])).push(function(t){n.call(e,a.state,t)})}(e,r+n,t,d)}),a.forEachAction(function(t,n){!function(e,t,n,a){(e._actions[t]||(e._actions[t]=[])).push(function(t,i){var s,r=n.call(e,{dispatch:a.dispatch,commit:a.commit,getters:a.getters,state:a.state,rootGetters:e.getters,rootState:e.state},t,i);return(s=r)&&"function"==typeof s.then||(r=Promise.resolve(r)),e._devtoolHook?r.catch(function(t){throw e._devtoolHook.emit("vuex:error",t),t}):r})}(e,r+n,t,d)}),a.forEachGetter(function(t,n){!function(e,t,n,a){if(e._wrappedGetters[t])return void 0;e._wrappedGetters[t]=function(e){return n(a.state,a.getters,e.state,e.getters)}}(e,r+n,t,d)}),a.forEachChild(function(a,s){p(e,t,n.concat(s),a,i)})}function h(e,t){return t.length?t.reduce(function(e,t){return e[t]},e):e}function f(e,t,n){var a;return null!==(a=e)&&"object"==typeof a&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function g(e){l&&e===l||a(l=e)}c.state.get=function(){return this._vm._data.$$state},c.state.set=function(e){0},d.prototype.commit=function(e,t,n){var a=this,i=f(e,t,n),s=i.type,r=i.payload,o=(i.options,{type:s,payload:r}),l=this._mutations[s];l&&(this._withCommit(function(){l.forEach(function(e){e(r)})}),this._subscribers.forEach(function(e){return e(o,a.state)}))},d.prototype.dispatch=function(e,t){var n=f(e,t),a=n.type,i=n.payload,s=this._actions[a];if(s)return s.length>1?Promise.all(s.map(function(e){return e(i)})):s[0](i)},d.prototype.subscribe=function(e){var t=this._subscribers;return t.indexOf(e)<0&&t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}},d.prototype.watch=function(e,t,n){var a=this;return this._watcherVM.$watch(function(){return e(a.state,a.getters)},t,n)},d.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._vm._data.$$state=e})},d.prototype.registerModule=function(e,t){"string"==typeof e&&(e=[e]),this._modules.register(e,t),p(this,this.state,e,this._modules.get(e)),_(this,this.state)},d.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit(function(){var n=h(t.state,e.slice(0,-1));l.delete(n,e[e.length-1])}),m(this)},d.prototype.hotUpdate=function(e){this._modules.update(e),m(this,!0)},d.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(d.prototype,c);var y=k(function(e,t){var n={};return w(t).forEach(function(t){var a=t.key,i=t.val;n[a]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var a=L(this.$store,"mapState",e);if(!a)return;t=a.context.state,n=a.context.getters}return"function"==typeof i?i.call(this,t,n):t[i]},n[a].vuex=!0}),n}),v=k(function(e,t){var n={};return w(t).forEach(function(t){var a=t.key,i=t.val;n[a]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var a=this.$store.commit;if(e){var s=L(this.$store,"mapMutations",e);if(!s)return;a=s.context.commit}return"function"==typeof i?i.apply(this,[a].concat(t)):a.apply(this.$store,[i].concat(t))}}),n}),b=k(function(e,t){var n={};return w(t).forEach(function(t){var a=t.key,i=t.val;i=e+i,n[a]=function(){if(!e||L(this.$store,"mapGetters",e))return this.$store.getters[i]},n[a].vuex=!0}),n}),M=k(function(e,t){var n={};return w(t).forEach(function(t){var a=t.key,i=t.val;n[a]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var a=this.$store.dispatch;if(e){var s=L(this.$store,"mapActions",e);if(!s)return;a=s.context.dispatch}return"function"==typeof i?i.apply(this,[a].concat(t)):a.apply(this.$store,[i].concat(t))}}),n});function w(e){return Array.isArray(e)?e.map(function(e){return{key:e,val:e}}):Object.keys(e).map(function(t){return{key:t,val:e[t]}})}function k(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function L(e,t,n){return e._modulesNamespaceMap[n]}var x={Store:d,install:g,version:"2.4.1",mapState:y,mapMutations:v,mapGetters:b,mapActions:M,createNamespacedHelpers:function(e){return{mapState:y.bind(null,e),mapGetters:b.bind(null,e),mapMutations:v.bind(null,e),mapActions:M.bind(null,e)}}};t.a=x},aS8y:function(e,t,n){"use strict";var a=n("3bIi");e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(a("Request failed with status code "+n.status,n.config,null,n)):e(n)}},adRA:function(e,t,n){(function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){if(2===t)return function(e){var t={m:"v",b:"v",d:"z"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}e.defineLocale("br",{months:"Genver_C'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc'her_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc'hoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec'h da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s 'zo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(function e(t){return t>9?e(t%10):t}(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4}})})(n("a2/B"))},anXx:function(e,t,n){(function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n("a2/B"))},"bM/P":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("dZBD"),i=n.n(a),s={namespaced:!0,state:{posts:[],catas:[],news:[],companies:[]},mutations:{setPosts:function(e,t){e.posts=t},setNews:function(e,t){e.news=t},setCatas:function(e,t){e.catas=t},setCompanies:function(e,t){e.companies=t}},actions:{loadWebsite:function(e){e.dispatch("loadPosts")},loadPosts:function(e){i.a.get("/api/post").then(function(t){e.commit("setPosts",t.data)}),i.a.get("/api/news").then(function(t){e.commit("setNews",t.data)}),i.a.get("/api/cata").then(function(t){e.commit("setCatas",t.data)}),i.a.get("/api/company").then(function(t){e.commit("setCompanies",t.data)})}},getters:{availblePosts:function(e){return e.posts.filter(function(e){return"published"==e.status})}}};t.default=s},c0b4:function(e,t){},cKXs:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page page-login"},[t("div",{staticClass:"container"},[t("auth_panel")],1)])},staticRenderFns:[]};var i=n("VU/8")({},a,!1,function(e){n("3f83")},null,null).exports,s=n("aKwh"),r=n("7t+N"),o=n.n(r),l=(n("gqkz"),{data:function(){return{slickOptions:{slidesToShow:1,arrows:!1,autoplay:!0,dots:!0},currentSlideId:0,slickEl:null}},methods:{next:function(){o()(".slick").slick("next")},prev:function(){o()(".slick").slick("prev")}},mounted:function(){var e=this;this.slides.length>0?setTimeout(function(){e.$nextTick(function(){e.slickEl=o()(".slick").slick(e.slickOptions);var t=e;o()(".slick").on("beforeChange",function(e,n,a,i){console.log(i),t.currentSlideId=i})})},0):setTimeout(function(){e.$nextTick(function(){e.slickEl=o()(".slick").slick(e.slickOptions);var t=e;o()(".slick").on("beforeChange",function(e,n,a,i){console.log(i),t.currentSlideId=i})})},1500)},computed:Object.assign({},Object(s.e)({news:function(e){return e.post.news},scrollTop:function(e){return e.scroll.position},mobile:function(e){return e.mobile}}),{slides:function(){return this.news},currentSlide:function(){return this.slides[this.currentSlideId]}}),watch:{scrollTop:function(){this.scrollTop>window.innerHeight-o()(".page-index").height()+50&&this.$router.push("/expo")},slides:function(){}}}),u={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page right page-index animated fadeIn"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row-cover animated fadeIn"},[n("div",{staticClass:"slick"},e._l(e.slides,function(t){return n("router-link",{staticClass:"slide",attrs:{to:"/news/"+e.currentSlide.id}},[n("div",{staticClass:"cover",style:e.bgcss(t.cover)})])}))]),n("div",{staticClass:"row-news"},["theme"==e.$route.meta.type||"/"==e.$route.path?n("router-link",{staticClass:"upCircle animated zoomIn",class:{downCircle:"/"==e.$route.path},attrs:{to:"/expo"}}):e._e(),n("div",{staticClass:"row"},[n("router-link",{staticClass:"btn-news nostyle col-sm-3 col-left",attrs:{to:"/news"}},[n("h2",[e._v("News")]),n("h4",[e._v("最新消息")]),n("div",{staticClass:"btn-more"},[n("span",[e._v("more")]),n("span",{staticClass:"arrowRight"})])]),n("div",{key:e.currentSlideId,staticClass:"col-sm-9 col-right"},[n("h3",{staticClass:"ovh"},[n("div",{staticClass:"animated slideInUp"},[e._v(e._s(e.currentSlide.title))])]),n("div",{staticClass:"ovh content-container"},[n("p",{staticClass:"animated slideInUp content-slide",domProps:{innerHTML:e._s(e.mobile?e.currentSlide.description.slice(0,70)+"...":e.currentSlide.description)}})]),n("br"),n("router-link",{staticClass:"nostyle btn-more fadeIn animated",attrs:{to:"/news/"+e.currentSlide.id}},[e._v("閱讀更多")]),n("div",{staticClass:"btns"},[n("div",{staticClass:"prev",on:{click:e.prev}},[n("i",{staticClass:"fa fa-chevron-left"})]),n("div",{staticClass:"next",on:{click:e.next}},[n("i",{staticClass:"fa fa-chevron-right"})])])],1),n("div",{staticClass:"black_area"})],1)],1)])])},staticRenderFns:[]};n("VU/8")(l,u,!1,function(e){n("4dCI")},null,null).exports;var d={data:function(){return{features:[{img:"/static/img/About/icon-1.svg",num:"3",title:"博覽會屆數"},{img:"/static/img/About/icon-2.svg",num:"1062",title:"報名件數"},{img:"/static/img/About/icon-3.svg",num:"386",title:"入選團隊"},{img:"/static/img/About/icon-4.svg",num:"31",title:"海外城市串聯參與"},{img:"/static/img/About/icon-5.svg",num:"102683",title:"累計觀展人數"},{img:"/static/img/About/icon-6.svg",num:"40000000",title:"網路社群觸及人次"}]}},computed:Object.assign({},Object(s.e)({expos:function(e){return e.expos},scrollY:function(e){return e.scroll.position}}),{styleBgOffset:function(){return{background:"url(/static/img/About/about-banner.png)","background-position":"center center","background-size":"cover"}}}),mounted:function(){(new WOW).init(),o()(".running-number").each(function(e,t){var n=parseInt(o()(t).text()),a=0;a<0&&(a=0);var i=setInterval(function(){a+=.2*(n-a);var e=Math.ceil(a);o()(t).text(e<0?0:e),a>=n&&(a=n,clearInterval(i))},30)})}},c={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page right page-about"},[n("section",{staticClass:"section-hero"},[n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row row-cover",style:e.styleBgOffset},[n("div",{staticClass:"col-sm-10 animated fadeInUp"},[n("h1",[e._v("Make Education Different")]),n("h3",[e._v(e._s(this.$t("page_about.sub_slogan")))])])])]),n("div",{staticClass:"container-fluid container-feature"},[n("div",{staticClass:"row"},e._l(e.features,function(t,a){return n("div",{staticClass:"col-6 col-xs-6 col-sm-6 col-md-3 col-lg-2 'delay-ani-'+(fid*2+2)"},[n("img",{staticClass:"animated fadeIn",attrs:{src:t.img}}),n("br"),n("br"),n("h2",{staticClass:"running-number animated fadeIn"},[e._v(e._s(t.num))]),n("h5",{staticClass:"animated fadeIn"},[e._v(e._s(e.$t("page_about.numberlabels["+a+"]")))]),n("br")])}))])]),n("section",{staticClass:"section-description"},[n("div",{staticClass:"container"},[n("div",{staticClass:"col-sm-12"},[n("p",{staticClass:"wow fadeIn",domProps:{innerHTML:e._s(e.$t("page_about.content[0]"))}}),n("img",{staticClass:"wow fadeIn",attrs:{src:"/static/img/About/about-pic.png"}}),n("p",{staticClass:"wow fadeIn",domProps:{innerHTML:e._s(e.$t("page_about.content[1]"))}})])])]),n("section",{staticClass:"section-theme"},[n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-4 col-explore wow fadeInUp",attrs:{"data-wow-delay":"0s"}},[n("div",{staticClass:"fimg",style:e.bgcss("/static/img/About/about-spirit-explore.png")}),n("h3",{staticClass:"wow fadeIn"},[e._v(e._s(e.$t("page_about.themes[0]")))])]),n("div",{staticClass:"col-sm-4 col-diverse wow fadeInUp",attrs:{"data-wow-delay":"0.2s"}},[n("div",{staticClass:"fimg",style:e.bgcss("/static/img/About/about-spirit-diverse.png")}),n("h3",{staticClass:"wow fadeIn"},[e._v(e._s(e.$t("page_about.themes[1]")))])]),n("div",{staticClass:"col-sm-4 col-unique wow fadeInUp",attrs:{"data-wow-delay":"0.4s"}},[n("div",{staticClass:"fimg",style:e.bgcss("/static/img/About/about-spirit-unique.png")}),n("h3",{staticClass:"wow fadeIn"},[e._v(e._s(e.$t("page_about.themes[2]")))])])])])]),n("section",{staticClass:"section-log"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h2",[e._v(e._s(e.$t("page_about.title_brand")))]),n("br")]),n("div",{staticClass:"col-sm-12"},e._l(e.$t("page_about.expos"),function(t){return n("router-link",{staticClass:"row row-expo wow fadeInUp",attrs:{to:"/expo/"+t.year}},[n("div",{staticClass:"col-cover",style:e.bgcss(t.report_cover)}),n("div",{staticClass:"col-content text-left"},[n("h3",[e._v(e._s(t.year))]),n("h4",[e._v(e._s(t.title))]),n("h5",{domProps:{innerHTML:e._s(t.subtitle)}}),n("ul",{staticClass:"feature-list"},e._l(t.features,function(t){return n("li",[e._v(e._s(t))])}))])])}))])])])])},staticRenderFns:[]};var m=n("VU/8")(d,c,!1,function(e){n("c0b4")},null,null).exports,_=n("dZBD"),p=n.n(_),h=n("a2/B"),f=n.n(h),g={data:function(){return{nowCata:this.$route.params.year||"",slickOptions:{slidesToShow:1,arrows:!1,autoplay:!0,dots:!0},currentSlideId:0,showCount:12,newsCatas:[{label:"全部",label_eng:"ALL",value:""},{label:"展覽公告",label_eng:"Expos",value:"展覽公告"},{label:"活動公告",label_eng:"Activities",value:"活動公告"},{label:"一般公告",label_eng:"Others",value:"一般公告"},{label:"媒體報導",label_eng:"Report",value:"媒體報導"}]}},computed:Object.assign({},Object(s.e)({posts:function(e){return e.post.posts},scrollY:function(e){return e.scroll.position},news:function(e){return e.post.news},expos:function(e){return e.expos}}),{useCatas:function(){if("expo"==this.$route.meta.type){var e=this.posts.map(function(e){return parseInt(e.year)}).sort(function(e,t){return-(e-t)}).filter(function(e,t,n){return n.indexOf(e)==t}).map(function(e){return{label:e,value:e}});return e.unshift({label:"全部",label_eng:"ALL",value:""}),e}if("news"==this.$route.meta.type)return this.newsCatas},use_source:function(){var e=this.posts;return e=e.filter(function(e){return"published"==e.status}),"expo"==this.$route.meta.type?(e=e.slice().sort(function(e,t){return(f()(e.established_time).isAfter(t.established_time)?-1:1)+100*(parseInt(t.year)-parseInt(e.year))}),e):("news"==this.$route.meta.type&&(e=this.news.filter(function(e){return"published"==e.status}).slice().sort(function(e,t){return f()(e.established_time).isAfter(t.established_time)?-1:1})),e)},filtered_posts:function(){var e=this;return this.use_source.filter(function(t){return""==e.nowCata&&"媒體報導"!=(t.cata&&t.cata.name)||t.cata&&t.cata.name==e.nowCata||t.year==e.nowCata})},use_posts:function(){return this.filtered_posts.slice(0,this.showCount)},slides:function(){var e=this;return"expo"==this.$route.meta.type?this.expos.map(function(t){return Object.assign({},t,{targetType:"expoyear",short_description:"時間:"+e.getDurationText(t.start_date,t.end_date)+"<br>地點:"+t.place+"<hr>"})}):this.use_source.filter(function(e){return e.stick_top_index})}}),methods:{postTarget:function(e){return"expoyear"==e.targetType?"/expo/"+e.year:"expo"==this.$route.meta.type?"/expo/"+this.$route.params.year+"/blog/"+e.id:"news"==this.$route.meta.type?e.media_link?e.media_link:"/news/"+e.id:void 0},splitNewline:function(e){return e.split("\n")}},watch:{slides:function(){var e=this,t=this;this.slides.length>0&&setTimeout(function(){t.$nextTick(function(){o()(".slick").slick(e.slickOptions);var t=e;o()(".slick").on("beforeChange",function(e,n,a,i){t.currentSlideId=i})})},100)},scrollY:function(){var e=o()(".lazy-detector").offset().top,t=this.scrollY+1.5*o()(window).height(),n=this.use_posts.length,a=this;e<t&&(this.showCount+=12,a.$nextTick(function(){a.use_posts.length>n&&a.$nextTick(function(){_jf.flush()})}))},nowCata:function(){var e=this;this.$nextTick(function(){_jf.flush(),e.showCount=12})}},mounted:function(){var e=this,t=this;o()("#app").scroll(function(e){o()(".lazy-detector").offset().top<o()("#app").scrollTop()+1.5*o()(window).height()&&(t.showCount+=3)}),setTimeout(function(){t.$nextTick(function(){o()(".slick").slick(e.slickOptions);var t=e;o()(".slick").on("beforeChange",function(e,n,a,i){t.currentSlideId=i})})},50)}},y={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page right page-blog"},[n("section",{staticClass:"container-fluid container-slider"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row",on:{click:function(t){e.$ga.event(e.$route.meta.type,"click","banner")}}},[e.slides.length?n("div",{staticClass:"col-sm-12"},["news"!=e.$route.meta.type?n("div",{staticClass:"nostyle row row-head-news"},[n("div",{staticClass:"col-sm-8 col-cover"},[n("div",{staticClass:"slick"},e._l(e.slides,function(t){return n(-1!=e.postTarget(t).indexOf("http")?"a":"router-link",{tag:"div",staticClass:"slide",attrs:{to:e.postTarget(t),href:e.postTarget(t)}},[n("div",{staticClass:"cover",style:e.bgcss(t.cover)})])}))]),e.slides[e.currentSlideId]?n("div",{key:e.currentSlideId,staticClass:"nostyle col-sm-4 col-info",attrs:{to:e.postTarget(e.slides[e.currentSlideId]),href:e.postTarget(e.slides[e.currentSlideId])}},[n("div",{staticClass:"tagwrap"},["expo"==e.$route.meta.type?n("div",{staticClass:"tag"},[e._v(e._s(e.slides[e.currentSlideId].year))]):e._e()]),e.slides[e.currentSlideId].company?n("div",{staticClass:"ovh"},[n("h3",{staticClass:"slide-company animated slideInUp"},[e._v(e._s(e.slides[e.currentSlideId].company.name_cht))])]):e._e(),n("div",{staticClass:"ovh"},[n("h2",{staticClass:"slide-title"},[e._v(e._s(e.slides[e.currentSlideId].title))])]),"expo"!=e.$route.meta.type?n("p",[e._v(e._s(e.strip_tags(e.slides[e.currentSlideId].short_description).slice(0,60))+"...")]):n("p",{domProps:{innerHTML:e._s(e.slides[e.currentSlideId].short_description)}}),"expo"==e.$route.meta.type?n("ul",{staticClass:"feature-list"},e._l(e.splitNewline(e.slides[e.currentSlideId].features),function(t){return n("li",[e._v(e._s(t))])})):e._e()]):e._e()]):n("div",{staticClass:"nostype row row-index-news"},[n("div",{staticClass:"col-sm-12 col-cover"},[n("div",{staticClass:"slick"},e._l(e.slides,function(t){return n(-1!=e.postTarget(t).indexOf("http")?"a":"router-link",{tag:"div",staticClass:"slide",attrs:{to:e.postTarget(e.slides[e.currentSlideId]),href:e.postTarget(e.slides[e.currentSlideId]),target:-1!=e.postTarget(e.slides[e.currentSlideId]).indexOf("http")?"_blank":""}},[n("div",{staticClass:"cover cover_21",style:e.bgcss(t.cover)})])}))]),n("div",{staticClass:"col-sm-12 col-info-news"},[n("h2",{staticClass:"slide-title"},[e._v(e._s(e.slides[e.currentSlideId].title))])])])]):e._e()])])]),n("section",{staticClass:"container container-posts"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h4",{staticClass:"cata-title"},[e._v(e._s(e.$t("page_news.title")))]),n("ul",{staticClass:"catas"},e._l(e.useCatas,function(t){return n("li",{class:{active:e.nowCata==t.value},on:{click:function(n){e.nowCata=t.value,e.$ga.event(e.$route.meta.type,"cata",t.label)}}},[e._v(e._s("en"==e.$i18n.locale&&t.label_eng||t.label))])}))])]),n("div",{staticClass:"row"},e._l(e.use_posts,function(t,a){return n("div",{staticClass:"col-xl-4 col-lg-6 col-md-6 col-sm-12 col-xs-12 col-news"},[n("newsbox",{key:t.title,class:"delay-ani-"+a%3*2,attrs:{post:t,target:e.postTarget(t),tag:"news"!=(t.cata&&t.cata.year)?t.year:t.cata&&t.cata.name,hideTag:"news"==e.$route.meta.type}})],1)})),n("div",{staticClass:"row lazy-detector"})])])])},staticRenderFns:[]};var v=n("VU/8")(g,y,!1,function(e){n("11Zl")},null,null).exports,b={data:function(){return{post:null,ready:!1}},created:function(){var e="expo"==this.$route.meta.type?"post":"news",t=this;p.a.get("/api/"+e+"/"+this.$route.params.post_id).then(function(e){t.post=e.data,t.ready=!0})},methods:Object.assign({},Object(s.b)(["openSearch"])),computed:Object.assign({},Object(s.e)({posts:function(e){return e.post.posts}}),{postTag:function(){return this.post.cata&&"news"==this.post.cata.year?this.post.cata.name:this.post.year},hashtags:function(){return JSON.parse(this.post.hashtag||"[]")},content:function(){return(this.post.content||"").replace(/\.\.\/\.\.\//g,"/").replace(/\/dropzone\/uploads/g,"http://service.zashare.org/dropzone/uploads").replace(/(\<iframe.*?http.*?\"\><\/iframe>)/g,"<div class='video-wrapper'>$1</div>")},relatedPost:function(){var e=this,t="expo"==this.$route.meta.type?"expo":"news",n=this.posts.filter(function(t){return t.year==e.post.year}).filter(function(e){return e.type==t}).slice().sort(function(e,t){return Math.random()-.5}).slice(0,3);return console.log(n),n}}),watch:{ready:function(){this.$nextTick(function(){_jf.flush()})}}},M={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page right page-post"},[e.post&&e.ready?n("div",{staticClass:"container animated fadeIn"},[n("div",{staticClass:"row row-banner"},[n("div",{staticClass:"col-sm-12 animated fadeIn"},[n("div",{staticClass:"cover cover_21",style:e.bgcss(e.post.cover)})])]),n("div",{staticClass:"row row-header"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"tag"},[e._v(e._s(e.postTag))]),n("h1",[e._v(e._s(e.post.title))]),n("h2",[e._v(e._s(e.post.subtitle))])]),n("div",{staticClass:"col-sm-12"},[n("div",[n("p",[e._v(e._s(e.post.established_time.split(" ")[0])+" ")]),n("span",[e._v(e._s(e.post.author))]),n("div",{staticClass:"tags"},e._l(e.hashtags,function(t){return n("div",{staticClass:"hashtag",on:{click:function(n){e.openSearch(t)}}},[e._v(e._s(t))])}))])])]),e._m(0),n("div",{staticClass:"row row-content"},[n("div",{staticClass:"col-sm-12",domProps:{innerHTML:e._s(e.content)}})]),e.post.company?n("div",{staticClass:"row row-company text-left"},[n("div",{staticClass:"col-sm-12"},[n("a",{staticClass:"row company-box nostyle",attrs:{href:e.post.company.website,target:"_blank"}},[n("div",{staticClass:"col-md-3 col-sm-4 col-xs-12 col-logo"},[n("div",{staticClass:"logo",style:e.bgcss(e.post.company.logo)})]),n("div",{staticClass:"col-md-9 col-sm-8 col-xs-12"},[n("h3",[e._v(e._s(e.post.company.name_cht))]),n("p",[e._v(e._s(e.post.company.discribe_cht))])])])])]):e._e(),e._m(1),n("div",{staticClass:"row"},e._l(e.relatedPost,function(t){return n("div",{staticClass:"col-sm-4"},[n("newsbox",{attrs:{post:t,target:"/expo/"+e.$route.params.year+"/blog/"+t.id,tag:t.cata&&t.cata.name}})],1)}))]):e._e()])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"row"},[t("div",{staticClass:"col-sm-12"},[t("hr")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"row row-related"},[t("div",{staticClass:"col-sm-12"},[t("h3"),t("hr")])])}]};var w=n("VU/8")(b,M,!1,function(e){n("9pW1")},null,null).exports,k={mounted:function(){var e=this,t=null,n=0,a=!1;document.querySelector(".page-theme").addEventListener("touchmove",function(i){if(n=t?i.touches[0].pageY-t:0,Math.abs(n)>20&&!a){a=!0;var s=e.themes.map(function(e){return e.title}).indexOf(e.theme.title),r=-Math.sign(n);console.log(s+r),e.themes[s+r]&&e.$router.push("/"+e.themes[s+r].title.toLowerCase()),s+r==-1&&e.$router.push("/"),setTimeout(function(){a=!1},100)}t=i.touches[0].pageY}),document.querySelector(".page-theme").addEventListener("touchend",function(){t=null})},computed:Object.assign({},Object(s.e)({themes:function(e){return e.themes},scrollTop:function(e){return e.scroll.position},mobile:function(e){return e.mobile}}),{theme:function(){var e=this;return this.themes.find(function(t){return t.title==e.$route.name})}}),watch:{},methods:{getCoverStyle:function(e){return{"background-color":e.color,"background-image":'url("'+e.cover+'")',"background-position":"center center"}}}},L={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page-theme animated"},e._l([e.theme],function(t){return n("div",{key:e.theme.title,staticClass:"container-fluid"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-info"},[n("div",{staticClass:"info"},[n("div",{staticClass:"slogan animated fadeIn"},[n("img",{staticClass:"slogan_image animated slideInLeft",attrs:{src:t.slogan_image}}),n("h1",{staticClass:"slogan_text animated slideInLeft",style:{color:t.color},domProps:{innerHTML:e._s(t.slogan_text)}})]),n("p",{staticClass:"animated fadeIn",domProps:{innerHTML:e._s(t.description)}}),"theme"==e.$route.meta.type?n("router-link",{key:e.$route.path,staticClass:"nostyle btn",attrs:{to:e.$route.meta.next.path}},[e._v("more")]):e._e()],1),"theme"==e.$route.meta.type||"/"==e.$route.path?n("router-link",{staticClass:"upCircle animated zoomIn",class:{downCircle:"/"==e.$route.path},attrs:{to:"/"}}):e._e()],1),n("router-link",{key:e.$route.path,staticClass:"col-image animated fadeIn",style:e.getCoverStyle(t),attrs:{to:e.$route.meta.next.path}})],1)])}))},staticRenderFns:[]};var x=n("VU/8")(k,L,!1,function(e){n("qyFW")},null,null).exports,T={mounted:function(){this.mobile&&(document.location="https://www.zashare.com.tw")},computed:Object.assign({},Object(s.e)(["mobile"]))},Y={render:function(){this.$createElement;this._self._c;return this._m(0)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page right page-base"},[t("iframe",{staticClass:"animated fadeIn",attrs:{src:"https://www.zashare.com.tw"}})])}]};var D=n("VU/8")(T,Y,!1,function(e){n("Q74p")},"data-v-63ea3882",null).exports,S={mounted:function(){this.mobile&&(document.location="https://www.zashare.com.tw/pages/%E9%9B%9C%E9%81%B8%E8%AA%B2")},computed:Object.assign({},Object(s.e)(["mobile"]))},C={render:function(){this.$createElement;this._self._c;return this._m(0)},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page right page-course"},[t("iframe",{staticClass:"animated fadeIn",attrs:{src:"https://www.zashare.com.tw/pages/%E9%9B%9C%E9%81%B8%E8%AA%B2"}})])}]};var j=n("VU/8")(S,C,!1,function(e){n("nCEq")},"data-v-2d2d45d8",null).exports,E={data:function(){return{}},computed:Object.assign({},Object(s.e)(["expos"]))},P={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page right page-expo"},[n("div",{staticClass:"container"},e._l(e.expos,function(t){return n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h2",[e._v(e._s(t.title)),n("span",{staticClass:"title_eng"},[n("span",{staticClass:"dash"},[e._v(" - ")]),n("span",{staticClass:"eng"},[e._v(e._s(t.title_eng))])]),n("div",{staticClass:"year"},[e._v(e._s(t.year))])]),n("hr"),n("div",{staticClass:"row row-content"},[n("router-link",{staticClass:"col-sm-12 col-lg-6",attrs:{to:"/expo/"+t.year}},[n("div",{staticClass:"cover",style:e.bgcss(t.cover),attrs:{"data-cover-tag":"展覽資訊"}})]),n("h3",{staticClass:"text-center visible-md"},[e._v("展覽介紹")]),n("router-link",{staticClass:"col-sm-12 col-lg-6",attrs:{to:"/expo/"+t.year+"/blog"}},[n("div",{staticClass:"cover",style:e.bgcss(t.report_cover),attrs:{"data-cover-tag":"參展單位報導"}})]),n("h3",{staticClass:"text-center visible-md"},[e._v("參展單位報導")])],1)])])}))])},staticRenderFns:[]};n("VU/8")(E,P,!1,function(e){n("UBL4")},null,null).exports;var O={data:function(){return{}},computed:Object.assign({},Object(s.e)({expos:function(e){return e.expos}}),Object(s.c)({posts:"post/availblePosts"}),{expo:function(){var e=this;return this.expos.find(function(t){return t.year==e.$route.params.year})},recommandPosts:function(){var e=this;return this.posts.filter(function(t){return t.year==e.$route.params.year}).slice(0,3)}})},H={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page page-post page-expo-year right"},[n("div",{staticClass:"container text-left"},[n("div",{staticClass:"row row-banner"},[n("div",{staticClass:"col-sm-12"},[n("div",{staticClass:"expo-cover",style:e.bgcss(e.expo.cover)}),n("br"),n("br")])]),n("div",{staticClass:"row"}),n("div",{staticClass:"row row-header"},[n("div",{staticClass:"col-sm-12"},[n("h3",[e._v(e._s(e.expo.year))]),n("h1",[e._v(e._s(e.expo.title))])]),n("div",{staticClass:"col-sm-12"},[n("div",[n("p",[e._v("TIME: "+e._s(e.expo.year)+"/"+e._s(e.getDurationText(e.expo.start_date,e.expo.end_date))),n("br"),e._v("PLACE: "+e._s(e.expo.place))])])]),e._m(0)]),n("div",{staticClass:"row row-content"},[n("div",{staticClass:"col-sm-12"},[n("p",{domProps:{innerHTML:e._s(e.replaceBr(e.expo.content))}})])]),e.recommandPosts.length?n("div",{staticClass:"row row-recommand"},[n("div",{staticClass:"col-sm-12"},[n("h4",[e._v("推薦參展報導"),n("router-link",{staticClass:"float-right more-btn",attrs:{to:"/expo/"+e.expo.year+"/blog"}},[e._v("更多參展報導")])],1),n("hr")])]):e._e(),e.recommandPosts.length?n("div",{staticClass:"row"},e._l(e.recommandPosts,function(t,a){return n("div",{staticClass:"col-xl-4 col-lg-6 col-md-6 col-sm-12 col-xs-12 wow fadeIn",class:"delay-ani-"+a},[n("newsbox",{staticClass:"text-left",attrs:{post:t,target:"/expo/"+e.$route.params.year+"/blog/"+t.id,tag:"ZA EXPO"}})],1)})):e._e()])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"col-sm-12"},[t("hr")])}]};var A=[{path:"/",name:"index",component:v,meta:{type:"news",navWidth:"350px",subBack:{name:"回首頁",path:"/"},mobilenav:{color:"white",img:"/static/img/Home/za-logo.svg"},navPosition:"left"}},{path:"/course",name:"COURSE",component:x,meta:{type:"theme",next:{path:"/course/main"}}},{path:"/news",name:"news",component:v,meta:{type:"news",navWidth:"350px",subBack:{name:"回首頁",path:"/"},mobilenav:{color:"white",img:"/static/img/Home/za-logo.svg"},navPosition:"left"}},{path:"/news/:post_id",component:w,meta:{type:"news",action:"back",navWidth:"350px",no_font_flush:!0,font_flush_delay:400,back:{name:"NEWS",path:"/news"},subBack:{name:"回首頁",path:"/"},mobilenav:{color:"white",text:"NEWS"},navPosition:"left"}},{path:"/base",name:"BASE",component:x,meta:{type:"theme",next:{path:"/base/main"}}},{path:"/about",name:"about",component:m,meta:{navWidth:"350px",action:"back",back:{name:"INDEX",path:"/"},mobilenav:{color:"white",text:"pages.about"},navPosition:"left"}},{path:"/base/main",name:"base_indep",component:D,meta:{navWidth:"350px",action:"back",back:{name:"ZA BASE",path:"/base"},navPosition:"left"}},{path:"/course/main",name:"course_indep",component:j,meta:{navWidth:"350px",action:"back",back:{name:"ZA COURSE",path:"/course"},navPosition:"left"}},{path:"/expo",name:"expo_main",component:v,meta:{type:"expo",navWidth:"350px",action:"back",back:{name:"ZA EXPO",path:"/expo"},mobilenav:{color:"white",text:"pages.expo"},navPosition:"left"}},{path:"/expo/:year",name:"expo_indep",component:n("VU/8")(O,H,!1,function(e){n("hVxZ")},null,null).exports,meta:{navWidth:"350px",action:"back",back:{name:"ZA EXPO",path:"/expo"},subBack:{name:"返回歷屆展覽",path:"/expo/main"},mobilenav:{color:"white",text:"pages.expo"},navPosition:"left"}},{path:"/expo/:year/blog",name:"expo_indep",component:v,meta:{type:"expo",navWidth:"350px",action:"back",back:{name:"ZA EXPO",path:"/expo"},subBack:{name:"返回歷屆展覽",path:"/expo/main",params:["year"]},navPosition:"left",mobilenav:{color:"white",text:"pages.expo"}}},{path:"/expo/:year/blog/:post_id",name:"expo_indep",component:w,meta:{type:"expo",navWidth:"350px",action:"back",no_font_flush:!0,back:{name:"ZA EXPO",path:"/expo"},subBack:{name:"返回{year}展覽報導",path:"/expo/{year}/blog",params:["year"]},navPosition:"left",mobilenav:{color:"white",text:"pages.expo"}}},{path:"/expo/blog/:post_id",name:"expo_indep",component:w,meta:{type:"expo",navWidth:"350px",action:"back",no_font_flush:!0,back:{name:"ZA EXPO",path:"/expo"},subBack:{name:"返回{year}展覽報導",path:"/expo/{year}/blog",params:["year"]},navPosition:"left",mobilenav:{color:"white",text:"pages.expo"}}},{path:"/login",name:"login",component:i,meta:{type:"post",navWidth:"350px",action:"back",back:{name:"ZA EXPO",path:"/expo"},navPosition:"left"}}];t.default=A},cujr:function(e,t,n){(function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº"})})(n("a2/B"))},cwrv:function(e,t,n){(function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})})(n("a2/B"))},dZBD:function(e,t,n){e.exports=n("nUiQ")},ddSu:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("aKwh"),i={name:"manage_app",data:function(){return{activeIndex:"1"}},methods:{handleSelect:function(e,t){console.log(e,t)}},computed:Object.assign({},Object(a.c)({canManage:"auth/canManage",isAdmin:"auth/isAdmin"}),Object(a.e)({auth:"auth",user:function(e){return e.auth.user},mobile:function(e){return e.mobile}}))},s={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"page right pb-5",attrs:{id:"member_app"}},[this.auth.user||"member/reset/password"==this.$route.path?t("div",{staticClass:"container-fluid"},[t("div",{staticClass:"col-sm-12 col-content mb-5"},[t("transition",{attrs:{name:"fade",mode:"out-in"}},[t("router-view",{key:this.$route.path})],1)],1)]):t("div",{staticClass:"container-fluid login"},[t("h3",[this._v("請先登入後再使用會員功能哦!")]),t("auth_panel")],1)])},staticRenderFns:[]};var r=n("VU/8")(i,s,!1,function(e){n("E5Ei")},null,null).exports,o={data:function(){return{userClone:null}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},token:function(e){return e.auth.token}})),mounted:function(){console.log(this.user),this.userClone=JSON.parse(JSON.stringify(this.user))},methods:{updateUserInfo:function(){var e=this;this.axios.post("/api/auth/user/update/info",{token:this.token,user:this.userClone}).then(function(t){e.$message({message:"資料更新成功",type:"success"}),console.log(t.data.user)})}}},l={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page member-info"},[n("div",{staticClass:"container"},[e.userClone&&e.userClone.studentcard?n("div",[n("h4",[e._v("學生證資訊 ")]),n("p",[e._v("學生證卡號:"+e._s(e.userClone.studentcard.card_id)+"會員效期:"+e._s(e.userClone.studentcard.expiry_datetime)+" "),n("br"),e._v("\n會員ID碼: "+e._s(e.userClone.studentcard.card_id)+" "),n("br")])]):e._e(),n("h4",[e._v("學生資訊"),n("router-link",{staticClass:"float-right",attrs:{to:"/member/info"}},[e._v("修改")])],1),n("br"),n("p",[e._v(" 連絡信箱: "+e._s(e.userClone.email)+" "),n("br")]),n("h4",[e._v("雜學校公布欄")]),n("h4",[e._v("ZA COURSE")]),n("br"),n("br")])])},staticRenderFns:[]};var u=n("VU/8")(o,l,!1,function(e){n("YpzF")},null,null).exports,d={data:function(){return{userClone:null}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},token:function(e){return e.auth.token}})),mounted:function(){console.log(this.user),this.userClone=JSON.parse(JSON.stringify(this.user))},methods:Object.assign({},Object(a.d)(["openMenu"]),{updateUserInfo:function(){var e=this;this.axios.post("/api/auth/user/update/info",{token:this.token,user:this.userClone}).then(function(t){e.$message({message:"資料更新成功",type:"success"}),console.log(t.data.user)})}})},c={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page member-info text-left"},[n("div",{staticClass:"container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h2",{staticClass:"mt-5"},[e._v(e._s(e.$t("menu.update_member_data"))+" - "+e._s(e.userClone.name))]),e.userClone?n("el-form",{attrs:{"label-width":"200"}},[n("el-form-item",{attrs:{label:e.$t("member.form.register.name")}},[n("el-input",{model:{value:e.userClone.name,callback:function(t){e.$set(e.userClone,"name",t)},expression:"userClone.name"}})],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.email")}},[n("el-input",{attrs:{disabled:"disabled"},model:{value:e.userClone.email,callback:function(t){e.$set(e.userClone,"email",t)},expression:"userClone.email"}})],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.account_type"),disabled:"disabled"}},[n("el-input",{attrs:{disabled:"disabled"},model:{value:e.userClone.group,callback:function(t){e.$set(e.userClone,"group",t)},expression:"userClone.group"}})],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.phone")}},[n("el-input",{model:{value:e.userClone.phone,callback:function(t){e.$set(e.userClone,"phone",t)},expression:"userClone.phone"}})],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.birthday")}},[n("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",name:"birthday",autocomplete:"on","value-format":"yyyy-MM-dd"},model:{value:e.userClone.birthday,callback:function(t){e.$set(e.userClone,"birthday",t)},expression:"userClone.birthday"}})],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.jobcata"),disabled:"disabled"}},[n("el-select",{attrs:{name:"jobcata",autocomplete:"on"},model:{value:e.userClone.jobcata,callback:function(t){e.$set(e.userClone,"jobcata",t)},expression:"userClone.jobcata"}},e._l(e.$t("member.form.register.jobcatas"),function(t,a){return n("el-option",{attrs:{value:t.value,label:t.label}},[e._v(e._s(t.label))])}))],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.job"),disabled:"disabled"}},[n("el-input",{model:{value:e.userClone.job,callback:function(t){e.$set(e.userClone,"job",t)},expression:"userClone.job"}})],1),n("el-form-item",{attrs:{label:e.$t("member.form.register.register_time")}},[n("el-input",{attrs:{disabled:"disabled"},model:{value:e.userClone.created_at,callback:function(t){e.$set(e.userClone,"created_at",t)},expression:"userClone.created_at"}})],1)],1):e._e(),n("br"),n("el-button",{attrs:{type:"primary"},on:{click:e.updateUserInfo}},[e._v(e._s(e.$t("member.form.register.update")))]),n("router-link",{attrs:{to:"/member/reset/password"}},[n("el-button",[e._v(e._s(e.$t("member.change_password")))])],1),n("br"),e.userClone&&e.userClone.studentcard?n("div",{staticClass:"mt-5"},[n("h3",[e._v(e._s(e.$t("menu.label_student_card")))]),n("el-form",{attrs:{"label-width":"200"}},[n("el-form-item",{attrs:{label:e.$t("menu.label_card_register_name")}},[n("el-input",{attrs:{disabled:"disabled"},model:{value:e.userClone.studentcard.name,callback:function(t){e.$set(e.userClone.studentcard,"name",t)},expression:"userClone.studentcard.name"}})],1),n("el-form-item",{attrs:{label:e.$t("menu.label_card_id")}},[n("el-input",{attrs:{disabled:"disabled"},model:{value:e.userClone.studentcard.card_id,callback:function(t){e.$set(e.userClone.studentcard,"card_id",t)},expression:"userClone.studentcard.card_id"}})],1),n("el-form-item",{attrs:{label:e.$t("menu.label_card_date")}},[n("el-input",{attrs:{disabled:"disabled"},model:{value:e.userClone.studentcard.expiry_datetime,callback:function(t){e.$set(e.userClone.studentcard,"expiry_datetime",t)},expression:"userClone.studentcard.expiry_datetime"}})],1)],1)],1):e._e()],1)])])])},staticRenderFns:[]};var m=n("VU/8")(d,c,!1,function(e){n("UEE/")},null,null).exports,_=(n("dZBD"),{data:function(){return{userClone:null,coupontypes:[]}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},token:function(e){return e.auth.token}})),mounted:function(){console.log(this.user),this.loadAll()},methods:{loadAll:function(){var e=this;this.axios.post("/api/coupontype/user",{token:this.token}).then(function(t){e.coupontypes=t.data})},getCoupon:function(e){var t=this;this.axios.post("/api/coupontype/userget/"+e.id,{token:this.token}).then(function(e){t.$message({message:"資料更新成功",type:"success"}),t.loadAll()})},updateUserInfo:function(){var e=this;this.axios.post("/api/auth/user/update/info",{token:this.token,user:this.userClone}).then(function(t){e.$message({message:"資料更新成功",type:"success"}),console.log(t.data.user)})}}}),p={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page member-coupon"},[n("div",{staticClass:"container"},[n("h2",[e._v("Coupon領取與管理")]),n("ul",{staticClass:"list-group row"},e._l(e.coupontypes,function(t){return n("li",{staticClass:"list-group-item col-sm-4"},[n("div",{staticClass:"coupon-box-inner"},[n("img",{staticClass:"cover",attrs:{src:t.cover}}),n("h3",[e._v("名稱:"+e._s(t.title))]),n("p",{domProps:{innerHTML:e._s(t.description)}}),n("p",[n("span",[e._v("啟用時間:"+e._s(t.active_datetime)),n("br")]),n("span",[e._v("結束時間:"+e._s(t.expiry_datetime)),n("br")])]),n("hr"),t.can_get?n("div",[t.my?e._e():n("div",{staticClass:"btn btn-primary",on:{click:function(n){e.getCoupon(t)}}},[e._v("領取")])]):n("div",[n("h3",[e._v("無法領取(不符合資格)")])]),t.my?n("h3",[e._v("序號:"+e._s(t.my.coupon))]):e._e()])])}))])])},staticRenderFns:[]};var h=n("VU/8")(_,p,!1,function(e){n("3Ivx")},null,null).exports,f={data:function(){return{}},methods:{handleSelect:function(e,t){console.log(e,t)}},computed:Object.assign({},Object(a.c)({canManage:"auth/canManage",isAdmin:"auth/isAdmin"}))},g={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"member-reset-password"},[t("div",{staticClass:"container-fluid login"},[t("auth_panel",{attrs:{forceMode:"reset"}})],1)])},staticRenderFns:[]};var y=n("VU/8")(f,g,!1,function(e){n("S8eO")},null,null).exports,v=n("Avko"),b=(n("7t+N"),{data:function(){return{registExpo:{},active:0,success:!1}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},token:function(e){return e.auth.token},registExpoOriginal:function(e){return e.registExpo}}),{sections:function(){return this.$t("regist_expo.sections")}}),mounted:function(){this.loadRegistData()},methods:Object.assign({},Object(a.b)(["loadRegistData","updateRegistForm"]),{getRules:function(e){var t=this,n={};return e.forEach(function(e){e.questions.forEach(function(a){n[a.prop]={required:!1,message:t.$t("form.data_not_complete")},(e.required&&!1!==a.required||!e.required&&a.required)&&(n[a.prop].required=!0),-1!=(a.prop+"").indexOf("email")&&(n[a.prop].type="email")})}),n},sendRegistForm:function(){var e=this,t=this;"en"==this.$i18n.locale&&(this.registExpo.name_cht=this.registExpo.name_eng),this.$refs.form_registexpo.validate(function(n){n?e.$confirm(t.$t("form.confirm_dialog_title"),t.$t("form.confirm_dialog_content"),{confirmButtonText:t.$t("form.confirm_dialog_yes"),cancelButtonText:t.$t("form.confirm_dialog_no")}).then(function(){e.updateRegistForm({data:e.registExpo,callback:function(){t.$message({message:t.$t("form.update_success"),type:"success"}),t.active=t.sections.length+2}})}).catch(function(){e.$message({message:t.$t("form.update_cancel")})}):e.$message({message:t.$t("form.data_not_complete"),type:"error"})})},prev:function(){this.active--<0&&(this.active=this.sections.length-1),window.scrollTo(0,0)},next:function(){this.active++>this.sections.length-1&&(this.active=0),window.scrollTo(0,0)}}),watch:{registExpoOriginal:function(){this.$set(this,"registExpo",JSON.parse(JSON.stringify(this.registExpoOriginal)))},active:function(){this.$nextTick(function(){_jf.flush()})}},components:{panel_expo2018:v.a}}),M={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{key:e.user||e.user.id,staticClass:"page member-regist-expo text-left"},[n("div",{staticClass:"mobile-block d-lg-none d-xl-none"},[n("img",{staticClass:"animated fadeIn animated",attrs:{src:"https://service.zashare.org/img/2017/index_za_logo_white.svg"}}),n("h4",{staticClass:"animated fadeIn animated"},[e._v(e._s(e.$t("menu.register_mobile_warning")))])]),n("div",{staticClass:"container"},[n("div",{staticClass:"col-sm-12"},[n("h2",{staticClass:"mt-5"},[e._v(e._s(e.$t("regist_expo.title")))]),n("p",{staticClass:"mt-3",domProps:{innerHTML:e._s(e.$t("regist_expo.sub_title"))}})]),n("div",{staticClass:"col-sm-12 text-left mt-3"},[n("el-steps",{attrs:{active:e.active,"finish-status":"success"}},[e._l(e.sections,function(t){return n("el-step",{attrs:{title:-1==t.title.indexOf("、")?t.title:t.title.split("、")[1]},on:{click:function(n){e.active=t.id}}})}),n("el-step",{attrs:{title:e.$t("form.step_confirm")}}),n("el-step",{attrs:{title:e.$t("form.step_complete")}})],2)],1),n("div",{staticClass:"col-sm-12"},[e.registExpo?n("el-form",{ref:"form_registexpo",attrs:{"label-position":"left",rules:e.getRules(e.sections),"validate-on-rule-change":!1,disabled:"number"==typeof e.registExpo.id,model:e.registExpo,"finish-status":e.finishStatus}},[e._l([e.registExpo],function(t){return n("div",e._l(e.sections,function(a,i){return n("div",{directives:[{name:"show",rawName:"v-show",value:e.active==a.id,expression:"active==section.id"}],key:i},[n("h4",{staticClass:"mt-5 mb-3"},[e._v(e._s(a.title))]),e._l(a.questions,function(i,s){return void 0==i.display||"function"==typeof i.display&&i.display(t)?n("el-form-item",{key:s,attrs:{label:i.title,prop:i.prop,required:a.required&&!1!==i.required||!a.required&&i.required}},[i.explain?n("div",[n("br"),n("br"),n("p",{domProps:{innerHTML:e._s(i.explain)}})]):e._e(),"input"==i.type||void 0===i.type?n("el-input",{attrs:{placeholder:i.settings&&i.settings.placeholder},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"textarea"==i.type?n("el-input",{attrs:{placeholder:i.settings&&i.settings.placeholder,maxlength:i.settings&&i.settings.maxlength,type:"textarea",rows:"5"},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"number"==i.type?n("el-input-number",{model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"select"==i.type?n("el-select",{attrs:{placeholder:i.settings&&i.settings.placeholder,multiple:i.settings&&i.settings.multiple,"multiple-limit":i.settings&&i.settings["multiple-limit"]},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}},e._l(i.options,function(e){return n("el-option",{key:"object"==typeof e?e.value:e,attrs:{value:"object"==typeof e?e.value:e,label:"object"==typeof e?e.label:e}})})):e._e(),"file"==i.type?n("el-upload",{ref:"upload",refInFor:!0,attrs:{"auto-upload":"auto-upload",accept:".pdf",limit:1,data:{token:e.auth.token},"on-success":function(e){t[i.prop]=e},action:e.apiDomain+"api/registexpo/uploadtemp"}},[n("el-button",{attrs:{size:"small",type:"primary"}},[e._v(e._s(e.$t("form.label_upload")))])],1):e._e()],1):e._e()})],2)}))}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.active==e.sections.length,expression:"active==sections.length"}]},[n("h4",{staticClass:"mt-5 mb-5",domProps:{innerHTML:e._s(e.$t("regist_expo.confirm_title"))}}),n("p",{staticClass:"mt-5 mb-5",domProps:{innerHTML:e._s(e.$t("regist_expo.confirm_text"))}}),n("p",{attrs:{id:"err_msg"}}),n("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.sendRegistForm}},[e._v(e._s(e.$t("form.label_submit")))])],1),e.active==e.sections.length+2?n("div",[n("p",{staticClass:"mt-5",domProps:{innerHTML:e._s(e.$t("regist_expo.complete_text"))}}),n("panel_expo2018")],1):e._e(),n("hr"),n("div",{staticClass:"mt-5"},[e.active>0&&e.active<4?n("el-button",{staticClass:"float-left",on:{click:e.prev}},[e._v(e._s(e.$t("form.label_back")))]):e._e(),e.active<3?n("el-button",{staticClass:"float-right",on:{click:e.next}},[e._v(e._s(e.$t("form.label_next")))]):e._e()],1)],2):e._e()],1)])])},staticRenderFns:[]};var w=n("VU/8")(b,M,!1,function(e){n("TbSk")},null,null).exports,k={data:function(){return{registExpoPaid:{},audiences:"學齡前幼兒/國小生/國中生/高中生/自學生/大專以上學生/職場新鮮人/青壯年/家長/教育工作者/投資人/創業者/學校單位/公部門/其他".split("/"),active:0,success:!1,rules:{paid_datetime:[{required:!0,message:"請輸入匯款時間"}],paid_direct:[{required:!0,message:"請選擇匯款方式"}],paid_name:[{required:!0,message:"請輸入戶名"}],paid_amount:[{required:!0,message:"請輸入匯款金額"}],paid_last_number:[{required:!0,message:"請輸入匯款後五碼"}],receipt_type:[{required:!0,message:"請選擇發票種類"}],receipt_name:[{required:!0,message:"請輸入收件者姓名"}],receipt_phone:[{required:!0,message:"請輸入收件者電話"}],receipt_address:[{required:!0,message:"請輸入收件者地址"}],receipt_postcode:[{required:!0,message:"請輸入收件者郵遞編號"}]}}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},token:function(e){return e.auth.token},registExpoOriginal:function(e){return e.registExpo}})),mounted:function(){this.loadRegistData()},methods:Object.assign({},Object(a.b)(["loadRegistData","updateRegistForm"]),{sendRegistForm:function(){var e=this,t=this;this.$refs.form_registexpo_paid.validate(function(n){n?e.$confirm("確認送出付款確認?送出將無法更改","最後確認",{confirmButtonText:"確定",cancelButtonText:"取消"}).then(function(){e.updateRegistForm({data:{paid_record:e.registExpoPaid},callback:function(){t.$message({message:"付費紀錄更新成功",type:"success"}),t.active=4}})}):e.$message({message:"資料填寫不完整,請往前填寫完整後再送出",type:"error"})})},prev:function(){this.active--<0&&(this.active=3),window.scrollTo(0,0)},next:function(){this.active++>3&&(this.active=0),window.scrollTo(0,0)}}),watch:{registExpoOriginal:function(){var e=JSON.parse(JSON.stringify(this.registExpoOriginal.paid_record));console.log(e),this.$set(this,"registExpoPaid",e),null==this.registExpoPaid&&(console.log("init paid"),this.registExpoPaid={})},active:function(){this.$nextTick(function(){_jf.flush()})}},components:{panel_expo2018:v.a}},L={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page member-regist-expo text-left"},[n("div",{staticClass:"container"},[e._m(0),n("div",{staticClass:"col-sm-12 text-left"},[n("el-steps",{attrs:{active:e.active,"finish-status":"success"}},[n("el-step",{attrs:{title:"匯款資訊"},on:{click:function(t){e.active=0}}}),n("el-step",{attrs:{title:"發票資訊"},on:{click:function(t){e.active=1}}}),n("el-step",{attrs:{title:"確認送出"},on:{click:function(t){e.active=2}}}),n("el-step",{attrs:{title:"填寫完成"},on:{click:function(t){e.active=3}}})],1)],1),n("div",{staticClass:"col-sm-12"},[e.registExpoPaid?n("el-form",{ref:"form_registexpo_paid",attrs:{disabled:"number"==typeof e.registExpoPaid.id,"label-position":"left",model:e.registExpoPaid,rules:e.rules}},[n("div",{directives:[{name:"show",rawName:"v-show",value:0==e.active,expression:"active==0"}]},[n("h4",{staticClass:"mt-5"},[e._v("ㄧ、匯款資訊")]),n("el-form-item",{attrs:{required:"required",label:"1. 匯款日期/時間",prop:"paid_datetime"}},[n("br"),n("br"),n("p",[e._v("此為協助我們確認款項之作業流程, 請務必填寫正確日期。")]),n("el-date-picker",{attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.registExpoPaid.paid_datetime,callback:function(t){e.$set(e.registExpoPaid,"paid_datetime",t)},expression:"registExpoPaid.paid_datetime"}})],1),n("el-form-item",{attrs:{required:"required",label:"2. 是否使用銀行/郵局臨櫃匯款",prop:"paid_direct"}},[n("br"),n("br"),n("div",[n("el-radio",{attrs:{label:"1"},model:{value:e.registExpoPaid.paid_direct,callback:function(t){e.$set(e.registExpoPaid,"paid_direct",t)},expression:"registExpoPaid.paid_direct"}},[e._v("是")]),n("el-radio",{attrs:{label:"0"},model:{value:e.registExpoPaid.paid_direct,callback:function(t){e.$set(e.registExpoPaid,"paid_direct",t)},expression:"registExpoPaid.paid_direct"}},[e._v("否,使用非臨櫃匯款(如ATM、網路轉帳等)")])],1)]),n("el-form-item",{attrs:{required:"required",label:"3. 請填寫使用匯款之戶名",prop:"paid_name"}},[n("br"),n("br"),n("p",[e._v("舉例:"),n("br"),e._v("個人戶/陳雜兒\n"),n("br"),e._v("公司戶/雜學股份有限公司")]),n("el-input",{model:{value:e.registExpoPaid.paid_name,callback:function(t){e.$set(e.registExpoPaid,"paid_name",t)},expression:"registExpoPaid.paid_name"}})],1),n("el-form-item",{attrs:{required:"required",label:"4. 請輸入匯款金額",prop:"paid_amount"}},[n("el-input",{attrs:{placeholder:"800 / 1200"},model:{value:e.registExpoPaid.paid_amount,callback:function(t){e.$set(e.registExpoPaid,"paid_amount",t)},expression:"registExpoPaid.paid_amount"}})],1),n("el-form-item",{attrs:{required:"required",label:"5. 請輸入匯款帳號後五碼",prop:"paid_last_number"}},[n("el-input",{model:{value:e.registExpoPaid.paid_last_number,callback:function(t){e.$set(e.registExpoPaid,"paid_last_number",t)},expression:"registExpoPaid.paid_last_number"}})],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:1==e.active,expression:"active==1"}]},[n("h4",{staticClass:"mt-5"},[e._v("二、發票資訊")]),n("el-form-item",{attrs:{required:"required",label:"1. 發票種類",prop:"receipt_type"}},[n("br"),n("br"),n("p",[e._v("如需報帳請選擇「三聯式發票」,並繼續填寫統編資訊。")]),n("div",[n("el-radio",{attrs:{label:"二聯式發票"},model:{value:e.registExpoPaid.receipt_type,callback:function(t){e.$set(e.registExpoPaid,"receipt_type",t)},expression:"registExpoPaid.receipt_type"}},[e._v("二聯式發票")]),n("el-radio",{attrs:{label:"三聯式發票"},model:{value:e.registExpoPaid.receipt_type,callback:function(t){e.$set(e.registExpoPaid,"receipt_type",t)},expression:"registExpoPaid.receipt_type"}},[e._v("三聯式發票")])],1)]),n("el-form-item",{attrs:{label:"2. 請輸入統編 (三聯式發票者須填)",required:"三聯式發票"==e.registExpoPaid.receipt_type}},[n("el-input",{model:{value:e.registExpoPaid.receipt_number,callback:function(t){e.$set(e.registExpoPaid,"receipt_number",t)},expression:"registExpoPaid.receipt_number"}})],1),n("el-form-item",{attrs:{label:"3. 請輸入抬頭 (三聯式發票者須填)",required:"三聯式發票"==e.registExpoPaid.receipt_type}},[n("el-input",{model:{value:e.registExpoPaid.receipt_title,callback:function(t){e.$set(e.registExpoPaid,"receipt_title",t)},expression:"registExpoPaid.receipt_title"}})],1),n("el-form-item",{attrs:{required:"required",label:"4. 發票寄送:收件人姓名",prop:"receipt_name"}},[n("br"),n("br"),n("p",[e._v("雜學校團隊會於甄選階段開立發票,若最終無入選參展,發票將於甄選結果釋出後一個月內以掛號寄出;"),n("br"),e._v("入選參選者,則於佈展日現場簽到領取發票。")]),n("el-input",{model:{value:e.registExpoPaid.receipt_name,callback:function(t){e.$set(e.registExpoPaid,"receipt_name",t)},expression:"registExpoPaid.receipt_name"}})],1),n("el-form-item",{attrs:{required:"required",label:"5. 發票寄送:收件人電話",prop:"receipt_phone"}},[n("el-input",{model:{value:e.registExpoPaid.receipt_phone,callback:function(t){e.$set(e.registExpoPaid,"receipt_phone",t)},expression:"registExpoPaid.receipt_phone"}})],1),n("el-form-item",{attrs:{required:"required",label:"6. 發票寄送:收件人地址",prop:"receipt_address"}},[n("el-input",{model:{value:e.registExpoPaid.receipt_address,callback:function(t){e.$set(e.registExpoPaid,"receipt_address",t)},expression:"registExpoPaid.receipt_address"}})],1),n("el-form-item",{attrs:{required:"required",label:"7. 發票寄送:郵遞區號",prop:"receipt_postcode"}},[n("el-input",{model:{value:e.registExpoPaid.receipt_postcode,callback:function(t){e.$set(e.registExpoPaid,"receipt_postcode",t)},expression:"registExpoPaid.receipt_postcode"}})],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:2==e.active,expression:"active==2"}]},[n("p",{staticClass:"mt-5"},[e._v("請再次確認所有填寫資料後按下「確認送出」,主辦單位將於收到表單回填三日內進行款項確認,並以E-mail回覆確認。若提交後三日內未收到相關回覆,請主動聯繫主辦單位查詢。")]),n("el-button",{staticClass:"mt-5",attrs:{type:"primary",size:"medium"},on:{click:e.sendRegistForm}},[e._v("送出繳費紀錄")])],1),4==e.active?n("div",[n("p",{staticClass:"mt-5"},[e._v("非常感謝您的填寫!"),n("br"),e._v("我們會於三日內確認款項,並寄出確認信。")]),n("panel_expo2018")],1):e._e(),n("hr"),n("div",{staticClass:"mt-5"},[e.active>0&&e.active<3?n("el-button",{staticClass:"float-left",on:{click:e.prev}},[e._v("上一步")]):e._e(),e.active<2?n("el-button",{staticClass:"float-right",on:{click:e.next}},[e._v("下一步")]):e._e()],1)]):e._e()],1)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"col-sm-12"},[t("h2",{staticClass:"mt-5"},[this._v("2018 雜學校繳費確認 ")]),t("div",{staticClass:"row"},[t("div",{staticClass:"col-sm-12"},[t("p",{staticClass:"mt-5"},[this._v("提交申請表單後,務必於三日內繳交參展報名費($1,200,早鳥優惠$800),並繼續填寫此份表單,提供匯款資訊協助我們進行款項確認後,才算申請參展成功呦!(報名費為申請參展之審核評選費用,若最終無入選參展,費用將不退還。)"),t("br"),this._v("*海外參展優惠(含中國、香港、澳門等地區)免繳納報名費。")])]),t("div",{staticClass:"col-sm-12"},[t("p",[this._v("繳款帳戶:"),t("br"),this._v(" 銀行名稱-007 第一銀行 永春分行\n"),t("br"),this._v(" 帳戶名稱-雜學股份有限公司\n"),t("br"),this._v(" 帳號-157-10-029362")])])])])}]};var x=n("VU/8")(k,L,!1,function(e){n("XH/e")},null,null).exports,T={data:function(){return{registExpoWorkshop:{},active:0,audience_normal:!0,success:!1,types:["藝術體驗創作","傳統工藝教學","互動式教學","科學動手實驗","創新教案分享與教學","小型分享座談","戶外活動","其他"],timespans:["10/5 (五) 13:00-14:30","10/5 (五) 15:00-16:30","10/5 (五) 17:00-18:30","10/6 (六) 10:00-11:30","10/6 (六) 13:00-14:30","10/6 (六) 15:00-16:30","10/6 (六) 17:00-18:30","10/7 (日) 10:00-11:30","10/7 (日) 13:00-14:30","10/7 (日) 15:00-16:30","10/7 (日) 17:00-18:30"],rules:{class_type:[{required:!0,message:"請輸入課程類型"}],class_audience:[],class_person_count:[{required:!0,message:"請輸入預計人數"}],class_time:[{required:!0,message:"請選擇偏好時段"}],class_proposal:[{required:!0,message:"請上傳企劃書"}],main_contact_name:[{required:!0,message:"請輸入主要聯絡人姓名"}],main_contact_phone:[{required:!0,message:"請輸入主要聯絡人電話"}],main_contact_email:[{required:!0,message:"請輸入有效的主要聯絡人信箱",type:"email"}],secondary_contact_name:[{required:!0,message:"請輸入次要聯絡人姓名"}],secondary_contact_phone:[{required:!0,message:"請輸入次要聯絡人電話"}],secondary_contact_email:[{required:!0,message:"請輸入有效的次要聯絡人信箱",type:"email"}]}}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},registExpoOriginal:function(e){return e.registExpo},token:function(e){return e.auth.token}}),{sections:function(){return this.$t("regist_expoworkshop.sections")}}),mounted:function(){this.loadRegistData()},methods:Object.assign({},Object(a.b)(["loadRegistData","updateRegistForm"]),{getRules:function(e){var t=this,n={};return e.forEach(function(e){e.questions.forEach(function(a){n[a.prop]={required:!1,message:t.$t("form.data_not_complete")},(e.required&&!1!==a.required||!e.required&&a.required)&&(n[a.prop].required=!0),-1!=(a.prop+"").indexOf("email")&&(n[a.prop].type="email")})}),n},sendRegistForm:function(){var e=this,t=this;this.$refs.form_registexpo_workshop.validate(function(n){n?e.$confirm(t.$t("form.confirm_dialog_title"),t.$t("form.confirm_dialog_content"),{confirmButtonText:t.$t("form.confirm_dialog_yes"),cancelButtonText:t.$t("form.confirm_dialog_no")}).then(function(){e.updateRegistForm({data:{regist_workshop:e.registExpoWorkshop},callback:function(){t.$message({message:t.$t("form.update_success"),type:"success"}),t.active=4}})}).catch(function(){e.$message({message:t.$t("form.update_cancel")})}):e.$message({message:t.$t("form.data_not_complete"),type:"error"})})},prev:function(){this.active--<0&&(this.active=3),window.scrollTo(0,0)},next:function(){this.active++>3&&(this.active=0),window.scrollTo(0,0)}}),watch:{registExpoOriginal:function(){var e=JSON.parse(JSON.stringify(this.registExpoOriginal.regist_workshop));console.log(e),this.$set(this,"registExpoWorkshop",e),null==this.registExpoWorkshop&&(console.log("init paid"),this.registExpoWorkshop={class_time:[]})},active:function(){this.$nextTick(function(){_jf.flush()})}},components:{panel_expo2018:v.a}},Y={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page member-regist-expo text-left"},[n("div",{staticClass:"mobile-block d-lg-none d-xl-none"},[n("img",{staticClass:"animated fadeIn animated",attrs:{src:"https://service.zashare.org/img/2017/index_za_logo_white.svg"}}),n("h3",{staticClass:"animated fadeIn animated"},[e._v(e._s(e.$t("menu.register_mobile_warning")))])]),n("div",{staticClass:"container"},[n("div",{staticClass:"col-sm-12"},[n("h2",{staticClass:"mt-5"},[e._v(e._s(e.$t("regist_expoworkshop.title")))]),n("p",{staticClass:"mt-3",domProps:{innerHTML:e._s(e.$t("regist_expoworkshop.sub_title"))}})]),n("div",{staticClass:"col-sm-12 text-left mt-3"},[n("el-steps",{attrs:{active:e.active,"finish-status":"success"}},[e._l(e.sections,function(t){return n("el-step",{attrs:{title:-1==t.title.indexOf("、")?t.title:t.title.split("、")[1]},on:{click:function(n){e.active=t.id}}})}),n("el-step",{attrs:{title:e.$t("form.step_confirm")}}),n("el-step",{attrs:{title:e.$t("form.step_complete")}})],2)],1),n("div",{staticClass:"col-sm-12"},[e.registExpoWorkshop?n("el-form",{ref:"form_registexpo_workshop",attrs:{"label-position":"left",rules:e.getRules(e.sections),"validate-on-rule-change":!1,disabled:"number"==typeof e.registExpoWorkshop.id,model:e.registExpoWorkshop}},[e._l([e.registExpoWorkshop],function(t){return n("div",e._l(e.sections,function(a,i){return n("div",{directives:[{name:"show",rawName:"v-show",value:e.active==a.id,expression:"active==section.id"}],key:i},[n("h4",{staticClass:"mt-5 mb-3"},[e._v(e._s(a.title))]),e._l(a.questions,function(i,s){return n("el-form-item",{key:s,attrs:{required:a.required&&!1!==i.required||!a.required&&i.required,label:i.title,prop:i.prop}},[i.explain||"number"==i.type?n("div",[n("br"),n("br"),n("p",{domProps:{innerHTML:e._s(i.explain)}})]):e._e(),"input"==i.type||void 0===i.type?n("el-input",{attrs:{placeholder:i.settings&&i.settings.placeholder},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"textarea"==i.type?n("el-input",{attrs:{placeholder:i.settings&&i.settings.placeholder,maxlength:i.settings&&i.settings.maxlength,type:"textarea",rows:"5"},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"number"==i.type?n("el-input-number",{attrs:{max:i.settings&&i.settings.max},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"select"==i.type?n("el-select",{attrs:{placeholder:i.settings&&i.settings.placeholder,multiple:i.settings&&i.settings.multiple,"multiple-limit":i.settings&&i.settings["multiple-limit"]},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}},e._l(i.options,function(e){return n("el-option",{key:"object"==typeof e?e.value:e,attrs:{value:"object"==typeof e?e.value:e,label:"object"==typeof e?e.label:e}})})):e._e(),"file"==i.type?n("el-upload",{ref:"upload",refInFor:!0,attrs:{"auto-upload":"auto-upload",accept:".pdf",limit:1,data:{token:e.auth.token},"on-success":function(e){t[i.prop]=e},action:e.apiDomain+"api/registexpo/uploadtemp"}},[n("el-button",{attrs:{size:"small",type:"primary"}},[e._v(e._s(e.$t("form.label_upload")))])],1):e._e()],1)})],2)}))}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.active==e.sections.length,expression:"active==sections.length"}]},[n("h4",{staticClass:"mt-5 mb-5",domProps:{innerHTML:e._s(e.$t("regist_expoworkshop.confirm_title"))}}),n("p",{staticClass:"mt-5 mb-5",domProps:{innerHTML:e._s(e.$t("regist_expoworkshop.confirm_text"))}}),n("p",{attrs:{id:"err_msg"}}),n("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.sendRegistForm}},[e._v(e._s(e.$t("form.label_submit")))])],1),e.active==e.sections.length+2?n("div",[n("p",{staticClass:"mt-5",domProps:{innerHTML:e._s(e.$t("regist_expoworkshop.complete_text"))}}),n("panel_expo2018")],1):e._e(),n("hr"),n("div",{staticClass:"mt-5"},[e.active>0&&e.active<=e.sections.length?n("el-button",{staticClass:"float-left",on:{click:e.prev}},[e._v(e._s(e.$t("form.label_back")))]):e._e(),e.active<e.sections.length?n("el-button",{staticClass:"float-right",on:{click:e.next}},[e._v(e._s(e.$t("form.label_next")))]):e._e()],1)],2):e._e()],1)])])},staticRenderFns:[]};var D=n("VU/8")(T,Y,!1,function(e){n("BnaF")},null,null).exports,S={data:function(){return{registExpoSpeak:{},active:0,success:!1,rules:{agree_plan:[{required:!0,message:"請選擇策展權益"}],team_person_count:[{required:!0,message:"請填寫團隊人數"}],has_money:[{required:!0,message:"請選擇資金挹注"}],startup_content:[{required:!0,message:"請輸入創業內容"}],startup_audience:[{required:!0,message:"請輸入目標族群"}],startup_difficult:[{required:!0,message:"請輸入創業困境"}],startup_problem:[{required:!0,message:"請輸入教育問題"}],startup_power:[{required:!0,message:"請輸入社會影響力"}],startup_proposal:[{required:!0,message:"請上傳企劃書"}],main_contact_name:[{required:!0,message:"請輸入主要聯絡人姓名"}],main_contact_phone:[{required:!0,message:"請輸入主要聯絡人電話"}],main_contact_email:[{required:!0,message:"請輸入有效的主要聯絡人信箱",type:"email"}],secondary_contact_name:[{required:!0,message:"請輸入次要聯絡人姓名"}],secondary_contact_phone:[{required:!0,message:"請輸入次要聯絡人電話"}],secondary_contact_email:[{required:!0,message:"請輸入有效的次要聯絡人信箱",type:"email"}]}}},computed:Object.assign({},Object(a.e)({auth:"auth",user:function(e){return e.auth.user},registExpoOriginal:function(e){return e.registExpo},token:function(e){return e.auth.token}}),{sections:function(){return this.$t("regist_expospeak.sections")}}),mounted:function(){this.loadRegistData()},methods:Object.assign({},Object(a.b)(["loadRegistData","updateRegistForm"]),{getRules:function(e){var t=this,n={};return e.forEach(function(e){e.questions.forEach(function(a){n[a.prop]={required:!1,message:t.$t("form.data_not_complete")},(e.required&&!1!==a.required||!e.required&&a.required)&&(n[a.prop].required=!0),-1!=(a.prop+"").indexOf("email")&&(n[a.prop].type="email")})}),n},sendRegistForm:function(){var e=this,t=this;this.$refs.form_registexpo_speak.validate(function(n){n?e.$confirm(t.$t("form.confirm_dialog_title"),t.$t("form.confirm_dialog_content"),{confirmButtonText:t.$t("form.confirm_dialog_yes"),cancelButtonText:t.$t("form.confirm_dialog_no")}).then(function(){e.updateRegistForm({data:{regist_expo_speak:e.registExpoSpeak},callback:function(){t.$message({message:t.$t("form.update_success"),type:"success"}),t.active=5}})}).catch(function(){e.$message({message:t.$t("form.update_cancel")})}):e.$message({message:t.$t("form.data_not_complete"),type:"error"})})},prev:function(){this.active--<0&&(this.active=3),window.scrollTo(0,0)},next:function(){this.active++>3&&(this.active=0),window.scrollTo(0,0)}}),watch:{registExpoOriginal:function(){var e=JSON.parse(JSON.stringify(this.registExpoOriginal.regist_expo_speak));console.log(e),this.$set(this,"registExpoSpeak",e),null==this.registExpoSpeak&&(console.log("init paid"),this.registExpoSpeak={})},active:function(){this.$nextTick(function(){_jf.flush()})}},components:{panel_expo2018:v.a}},C={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page member-regist-expo text-left"},[n("div",{staticClass:"mobile-block d-lg-none d-xl-none"},[n("img",{staticClass:"animated fadeIn animated",attrs:{src:"https://service.zashare.org/img/2017/index_za_logo_white.svg"}}),n("h3",{staticClass:"animated fadeIn animated"},[e._v(e._s(e.$t("menu.register_mobile_warning")))])]),n("div",{staticClass:"container"},[n("div",{staticClass:"col-sm-12"},[n("h2",{staticClass:"mt-5"},[e._v(e._s(e.$t("regist_expospeak.title")))]),n("p",{staticClass:"mt-3",domProps:{innerHTML:e._s(e.$t("regist_expospeak.sub_title"))}})]),n("div",{staticClass:"col-sm-12 text-left mt-5"},[n("el-steps",{attrs:{active:e.active,"finish-status":"success"}},[e._l(e.sections,function(t){return n("el-step",{attrs:{title:-1==t.title.indexOf("、")?t.title:t.title.split("、")[1]},on:{click:function(n){e.active=t.id}}})}),n("el-step",{attrs:{title:e.$t("form.step_confirm")}}),n("el-step",{attrs:{title:e.$t("form.step_complete")}})],2)],1),n("div",{staticClass:"col-sm-12"},[e.registExpoSpeak?n("el-form",{ref:"form_registexpo_speak",attrs:{"label-position":"left","validate-on-rule-change":!1,disabled:"nuxmber"==typeof e.registExpoSpeak.id,rules:e.getRules(e.sections),model:e.registExpoSpeak}},[e._l([e.registExpoSpeak],function(t){return n("div",e._l(e.sections,function(a,i){return n("div",{directives:[{name:"show",rawName:"v-show",value:e.active==a.id,expression:"active==section.id"}],key:i},[n("h4",{staticClass:"mt-5 mb-3"},[e._v(e._s(a.title))]),e._l(a.questions,function(i,s){return n("el-form-item",{key:s,attrs:{required:a.required&&!1!==i.required||!a.required&&i.required,label:i.title,prop:i.prop}},[i.explain||"number"==i.type?n("div",[n("br"),n("br"),n("p",{domProps:{innerHTML:e._s(i.explain)}})]):e._e(),"input"==i.type||void 0===i.type?n("el-input",{attrs:{placeholder:i.settings&&i.settings.placeholder},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"textarea"==i.type?n("el-input",{attrs:{placeholder:i.settings&&i.settings.placeholder,maxlength:i.settings&&i.settings.maxlength,type:"textarea",rows:"5"},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"number"==i.type?n("el-input-number",{model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}}):e._e(),"select"==i.type?n("el-select",{attrs:{placeholder:i.settings&&i.settings.placeholder,multiple:i.settings&&i.settings.multiple,"multiple-limit":i.settings&&i.settings["multiple-limit"]},model:{value:t[i.prop],callback:function(n){e.$set(t,i.prop,n)},expression:"registFormObj[question.prop]"}},e._l(i.options,function(e){return n("el-option",{key:"object"==typeof e?e.value:e,attrs:{value:"object"==typeof e?e.value:e,label:"object"==typeof e?e.label:e}})})):e._e(),"file"==i.type?n("el-upload",{ref:"upload",refInFor:!0,attrs:{"auto-upload":"auto-upload",accept:".pdf",limit:1,data:{token:e.auth.token},"on-success":function(e){t[i.prop]=e},action:e.apiDomain+"api/registexpo/uploadtemp"}},[n("el-button",{attrs:{size:"small",type:"primary"}},[e._v(e._s(e.$t("form.label_upload")))])],1):e._e()],1)})],2)}))}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.active==e.sections.length,expression:"active==sections.length"}]},[n("h4",{staticClass:"mt-5 mb-5",domProps:{innerHTML:e._s(e.$t("regist_expospeak.confirm_title"))}}),n("p",{staticClass:"mt-5 mb-5",domProps:{innerHTML:e._s(e.$t("regist_expospeak.confirm_text"))}}),n("p",{attrs:{id:"err_msg"}}),n("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.sendRegistForm}},[e._v(e._s(e.$t("form.label_submit")))])],1),e.active==e.sections.length+2?n("div",[n("p",{staticClass:"mt-5",domProps:{innerHTML:e._s(e.$t("regist_expospeak.complete_text"))}}),n("panel_expo2018")],1):e._e(),n("hr"),n("div",{staticClass:"mt-5"},[e.active>0&&e.active<=e.sections.length?n("el-button",{staticClass:"float-left",on:{click:e.prev}},[e._v(e._s(e.$t("form.label_back")))]):e._e(),e.active<e.sections.length?n("el-button",{staticClass:"float-right",on:{click:e.next}},[e._v(e._s(e.$t("form.label_next")))]):e._e()],1)],2):e._e()],1)])])},staticRenderFns:[]};var j=n("VU/8")(S,C,!1,function(e){n("r7m6")},null,null).exports,E={path:"/member",meta:{member:!0,navHide:!0},component:r,children:[{path:"/",component:u,meta:{navPosition:"left",navWidth:"350px"}},{path:"info",component:m,meta:{navPosition:"left",navWidth:"350px"}},{path:"reset/password",component:y,meta:{navPosition:"left",navWidth:"350px"}},{path:"coupon",component:h,meta:{navPosition:"left",navWidth:"350px"}},{path:"registexpo2018",component:v.a,meta:{navPosition:"left",navWidth:"350px"}},{path:"registexpo",component:w,meta:{navPosition:"left",navWidth:"350px"}},{path:"registexpo/paid",component:x,meta:{navPosition:"left",navWidth:"350px"}},{path:"registexpo/workshop",component:D,meta:{navPosition:"left",navWidth:"350px"}},{path:"registexpo/speak",component:j,meta:{navPosition:"left",navWidth:"350px"}}]};t.default=E},dn2M:function(e,t,n){"use strict";var a=n("S1cf");e.exports=a.isStandardBrowserEnv()?{write:function(e,t,n,i,s,r){var o=[];o.push(e+"="+encodeURIComponent(t)),a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(i)&&o.push("path="+i),a.isString(s)&&o.push("domain="+s),!0===r&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},e3g9:function(e,t,n){(function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})})(n("a2/B"))},eI5Z:function(e,t,n){(function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n("a2/B"))},"eLh+":function(e,t,n){(function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,a){var i=t.words[a];return 1===a.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},eftj:function(e,t,n){(function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кече саат] LT",lastWeek:"[Өткен аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})})(n("a2/B"))},eyXp:function(e,t,n){(function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})})(n("a2/B"))},f8Bd:function(e,t,n){(function(e){"use strict";e.defineLocale("ka",{months:{standalone:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),format:"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს".split("_")},monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return/(წამი|წუთი|საათი|წელი)/.test(e)?e.replace(/ი$/,"ში"):e+"ში"},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის უკან"):/წელი/.test(e)?e.replace(/წელი$/,"წლის უკან"):void 0},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})})(n("a2/B"))},fwQ6:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?i[n][0]:i[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},gGLi:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("dZBD"),i=(n.n(a),n("7t+N")),s=n.n(i),r={namespaced:!0,state:{position:0},mutations:{setPosition:function(e,t){e.position=t}},actions:{init:function(e){console.log("Scroll Module init"),s()("#app").scroll(function(t){console.log(e.state.position),e.commit("setPosition",s()("#app").scrollTop())}),s()(window).scroll(function(t){console.log(e.state.position),e.commit("setPosition",s()(window).scrollTop())})}}};t.default=r},gh3w:function(e,t,n){var a={"./af":"J0UG","./af.js":"J0UG","./ar":"45iH","./ar-dz":"SOHb","./ar-dz.js":"SOHb","./ar-kw":"EIlw","./ar-kw.js":"EIlw","./ar-ly":"G/YP","./ar-ly.js":"G/YP","./ar-ma":"j+tz","./ar-ma.js":"j+tz","./ar-sa":"6Ie+","./ar-sa.js":"6Ie+","./ar-tn":"HMIw","./ar-tn.js":"HMIw","./ar.js":"45iH","./az":"HlNk","./az.js":"HlNk","./be":"iBmU","./be.js":"iBmU","./bg":"X5QB","./bg.js":"X5QB","./bm":"XJth","./bm.js":"XJth","./bn":"3IRi","./bn.js":"3IRi","./bo":"zDie","./bo.js":"zDie","./br":"adRA","./br.js":"adRA","./bs":"9s6H","./bs.js":"9s6H","./ca":"ULyk","./ca.js":"ULyk","./cs":"EBDP","./cs.js":"EBDP","./cv":"xC4Z","./cv.js":"xC4Z","./cy":"/7ul","./cy.js":"/7ul","./da":"U8JX","./da.js":"U8JX","./de":"fwQ6","./de-at":"R7ko","./de-at.js":"R7ko","./de-ch":"XWPg","./de-ch.js":"XWPg","./de.js":"fwQ6","./dv":"qToQ","./dv.js":"qToQ","./el":"mn6i","./el.js":"mn6i","./en-au":"RaVB","./en-au.js":"RaVB","./en-ca":"4X90","./en-ca.js":"4X90","./en-gb":"kKHs","./en-gb.js":"kKHs","./en-ie":"8Cm+","./en-ie.js":"8Cm+","./en-nz":"ro+U","./en-nz.js":"ro+U","./eo":"3n5M","./eo.js":"3n5M","./es":"QgBj","./es-do":"ASJ1","./es-do.js":"ASJ1","./es-us":"CYiM","./es-us.js":"CYiM","./es.js":"QgBj","./et":"R1TQ","./et.js":"R1TQ","./eu":"yheM","./eu.js":"yheM","./fa":"of7D","./fa.js":"of7D","./fi":"lomv","./fi.js":"lomv","./fo":"3QCB","./fo.js":"3QCB","./fr":"3N6g","./fr-ca":"UL+2","./fr-ca.js":"UL+2","./fr-ch":"eyXp","./fr-ch.js":"eyXp","./fr.js":"3N6g","./fy":"anXx","./fy.js":"anXx","./gd":"7Tmb","./gd.js":"7Tmb","./gl":"wRWs","./gl.js":"wRWs","./gom-latn":"uCop","./gom-latn.js":"uCop","./gu":"R68T","./gu.js":"R68T","./he":"Dnxv","./he.js":"Dnxv","./hi":"9qw1","./hi.js":"9qw1","./hr":"1YXd","./hr.js":"1YXd","./hu":"6Xgp","./hu.js":"6Xgp","./hy-am":"cwrv","./hy-am.js":"cwrv","./id":"eI5Z","./id.js":"eI5Z","./is":"EhRq","./is.js":"EhRq","./it":"lJ2Y","./it.js":"lJ2Y","./ja":"pUJL","./ja.js":"pUJL","./jv":"pdQq","./jv.js":"pdQq","./ka":"f8Bd","./ka.js":"f8Bd","./kk":"YqHU","./kk.js":"YqHU","./km":"0u/o","./km.js":"0u/o","./kn":"RV8r","./kn.js":"RV8r","./ko":"vnXZ","./ko.js":"vnXZ","./ky":"eftj","./ky.js":"eftj","./lb":"Iumh","./lb.js":"Iumh","./lo":"L6Cd","./lo.js":"L6Cd","./lt":"7DU0","./lt.js":"7DU0","./lv":"8SXr","./lv.js":"8SXr","./me":"rr7+","./me.js":"rr7+","./mi":"Lpvo","./mi.js":"Lpvo","./mk":"e3g9","./mk.js":"e3g9","./ml":"83Hi","./ml.js":"83Hi","./mr":"/DQ9","./mr.js":"/DQ9","./ms":"Jg9m","./ms-my":"tQmj","./ms-my.js":"tQmj","./ms.js":"Jg9m","./mt":"GuU2","./mt.js":"GuU2","./my":"pUp6","./my.js":"pUp6","./nb":"tzrV","./nb.js":"tzrV","./ne":"LRz5","./ne.js":"LRz5","./nl":"6W3o","./nl-be":"qW43","./nl-be.js":"qW43","./nl.js":"6W3o","./nn":"6rrj","./nn.js":"6rrj","./pa-in":"WCPy","./pa-in.js":"WCPy","./pl":"t1oD","./pl.js":"t1oD","./pt":"P1iN","./pt-br":"cujr","./pt-br.js":"cujr","./pt.js":"P1iN","./ro":"jbFW","./ro.js":"jbFW","./ru":"7WWl","./ru.js":"7WWl","./sd":"NQix","./sd.js":"NQix","./se":"zp5f","./se.js":"zp5f","./si":"2OKG","./si.js":"2OKG","./sk":"yDpn","./sk.js":"yDpn","./sl":"EgIa","./sl.js":"EgIa","./sq":"0M7C","./sq.js":"0M7C","./sr":"W90N","./sr-cyrl":"eLh+","./sr-cyrl.js":"eLh+","./sr.js":"W90N","./ss":"73tf","./ss.js":"73tf","./sv":"/Hq7","./sv.js":"/Hq7","./sw":"Rum7","./sw.js":"Rum7","./ta":"S0Eq","./ta.js":"S0Eq","./te":"Hd19","./te.js":"Hd19","./tet":"ZLbk","./tet.js":"ZLbk","./th":"1PI3","./th.js":"1PI3","./tl-ph":"ux7g","./tl-ph.js":"ux7g","./tlh":"DXXw","./tlh.js":"DXXw","./tr":"9MFc","./tr.js":"9MFc","./tzl":"ha01","./tzl.js":"ha01","./tzm":"Nof9","./tzm-latn":"2fG9","./tzm-latn.js":"2fG9","./tzm.js":"Nof9","./uk":"Gz4Y","./uk.js":"Gz4Y","./ur":"120n","./ur.js":"120n","./uz":"2i0N","./uz-latn":"ryJQ","./uz-latn.js":"ryJQ","./uz.js":"2i0N","./vi":"DZlt","./vi.js":"DZlt","./x-pseudo":"Bevg","./x-pseudo.js":"Bevg","./yo":"2HIi","./yo.js":"2HIi","./zh-cn":"10bh","./zh-cn.js":"10bh","./zh-hk":"wLaM","./zh-hk.js":"wLaM","./zh-tw":"WlHu","./zh-tw.js":"WlHu"};function i(e){return n(s(e))}function s(e){var t=a[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}i.keys=function(){return Object.keys(a)},i.resolve=s,e.exports=i,i.id="gh3w"},hVxZ:function(e,t){},ha01:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return a?i[n][0]:t?i[n][0]:i[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},iBmU:function(e,t,n){(function(e){"use strict";function t(e,t,n){var a,i;return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(a=+e,i={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),a%10==1&&a%100!=11?i[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?i[1]:i[2])}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})})(n("a2/B"))},"j+tz":function(e,t,n){(function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:6,doy:12}})})(n("a2/B"))},j6zY:function(e,t){},jbFW:function(e,t,n){(function(e){"use strict";function t(e,t,n){var a=" ";return(e%100>=20||e>=100&&e%100==0)&&(a=" de "),e+a+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})})(n("a2/B"))},jhqH:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"ScrollToPlugin",function(){return d}),n.d(t,"default",function(){return d});var a=n("PWbO"),i=(a.k.document||{}).documentElement,s=a.k,r=function(e,t){var n="x"===t?"Width":"Height",a="scroll"+n,r="client"+n,o=document.body;return e===s||e===i||e===o?Math.max(i[a],o[a])-(s["inner"+n]||i[r]||o[r]):e[a]-e["offset"+n]},o=function(e,t){var n="scroll"+("x"===t?"Left":"Top");return e===s&&(null!=e.pageXOffset?n="page"+t.toUpperCase()+"Offset":e=null!=i[n]?i:document.body),function(){return e[n]}},l=function(e,t){var n,a=(n=e,"string"==typeof n&&(n=TweenLite.selector(n)),n.length&&n!==s&&n[0]&&n[0].style&&!n.nodeType&&(n=n[0]),n===s||n.nodeType&&n.style?n:null).getBoundingClientRect(),r=document.body,l=!t||t===s||t===r,u=l?{top:i.clientTop-(window.pageYOffset||i.scrollTop||r.scrollTop||0),left:i.clientLeft-(window.pageXOffset||i.scrollLeft||r.scrollLeft||0)}:t.getBoundingClientRect(),d={x:a.left-u.left,y:a.top-u.top};return!l&&t&&(d.x+=o(t,"x")(),d.y+=o(t,"y")()),d},u=function(e,t,n){var a=typeof e;return isNaN(e)?"number"===a||"string"===a&&"="===e.charAt(1)?e:"max"===e?r(t,n):Math.min(r(t,n),l(e,t)[n]):parseFloat(e)},d=a.k._gsDefine.plugin({propName:"scrollTo",API:2,global:!0,version:"1.9.1",init:function(e,t,n){return this._wdw=e===s,this._target=e,this._tween=n,"object"!=typeof t?"string"==typeof(t={y:t}).y&&"max"!==t.y&&"="!==t.y.charAt(1)&&(t.x=t.y):t.nodeType&&(t={y:t,x:t}),this.vars=t,this._autoKill=!1!==t.autoKill,this.getX=o(e,"x"),this.getY=o(e,"y"),this.x=this.xPrev=this.getX(),this.y=this.yPrev=this.getY(),null!=t.x?(this._addTween(this,"x",this.x,u(t.x,e,"x")-(t.offsetX||0),"scrollTo_x",!0),this._overwriteProps.push("scrollTo_x")):this.skipX=!0,null!=t.y?(this._addTween(this,"y",this.y,u(t.y,e,"y")-(t.offsetY||0),"scrollTo_y",!0),this._overwriteProps.push("scrollTo_y")):this.skipY=!0,!0},set:function(e){this._super.setRatio.call(this,e);var t=this._wdw||!this.skipX?this.getX():this.xPrev,n=this._wdw||!this.skipY?this.getY():this.yPrev,a=n-this.yPrev,i=t-this.xPrev,o=d.autoKillThreshold;this.x<0&&(this.x=0),this.y<0&&(this.y=0),this._autoKill&&(!this.skipX&&(i>o||i<-o)&&t<r(this._target,"x")&&(this.skipX=!0),!this.skipY&&(a>o||a<-o)&&n<r(this._target,"y")&&(this.skipY=!0),this.skipX&&this.skipY&&(this._tween.kill(),this.vars.onAutoKill&&this.vars.onAutoKill.apply(this.vars.onAutoKillScope||this._tween,this.vars.onAutoKillParams||[]))),this._wdw?s.scrollTo(this.skipX?t:this.x,this.skipY?n:this.y):(this.skipY||(this._target.scrollTop=this.y),this.skipX||(this._target.scrollLeft=this.x)),this.xPrev=this.x,this.yPrev=this.y}}),c=d.prototype;d.max=r,d.getOffset=l,d.buildGetter=o,d.autoKillThreshold=7,c._kill=function(e){return e.scrollTo_x&&(this.skipX=!0),e.scrollTo_y&&(this.skipY=!0),this._super._kill.call(this,e)}},juYr:function(e,t,n){var a;!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var s=[],r=n.document,o=Object.getPrototypeOf,l=s.slice,u=s.concat,d=s.push,c=s.indexOf,m={},_=m.toString,p=m.hasOwnProperty,h=p.toString,f=h.call(Object),g={},y=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},v=function(e){return null!=e&&e===e.window},b={type:!0,src:!0,noModule:!0};function M(e,t,n){var a,i=(t=t||r).createElement("script");if(i.text=e,n)for(a in b)n[a]&&(i[a]=n[a]);t.head.appendChild(i).parentNode.removeChild(i)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?m[_.call(e)]||"object":typeof e}var k=function(e,t){return new k.fn.init(e,t)},L=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function x(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!y(e)&&!v(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}k.fn=k.prototype={jquery:"3.3.1",constructor:k,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(e){return this.pushStack(k.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:d,sort:s.sort,splice:s.splice},k.extend=k.fn.extend=function(){var e,t,n,a,i,s,r=arguments[0]||{},o=1,l=arguments.length,u=!1;for("boolean"==typeof r&&(u=r,r=arguments[o]||{},o++),"object"==typeof r||y(r)||(r={}),o===l&&(r=this,o--);o<l;o++)if(null!=(e=arguments[o]))for(t in e)n=r[t],r!==(a=e[t])&&(u&&a&&(k.isPlainObject(a)||(i=Array.isArray(a)))?(i?(i=!1,s=n&&Array.isArray(n)?n:[]):s=n&&k.isPlainObject(n)?n:{},r[t]=k.extend(u,s,a)):void 0!==a&&(r[t]=a));return r},k.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==_.call(e))&&(!(t=o(e))||"function"==typeof(n=p.call(t,"constructor")&&t.constructor)&&h.call(n)===f)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){M(e)},each:function(e,t){var n,a=0;if(x(e))for(n=e.length;a<n&&!1!==t.call(e[a],a,e[a]);a++);else for(a in e)if(!1===t.call(e[a],a,e[a]))break;return e},trim:function(e){return null==e?"":(e+"").replace(L,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(x(Object(e))?k.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},merge:function(e,t){for(var n=+t.length,a=0,i=e.length;a<n;a++)e[i++]=t[a];return e.length=i,e},grep:function(e,t,n){for(var a=[],i=0,s=e.length,r=!n;i<s;i++)!t(e[i],i)!==r&&a.push(e[i]);return a},map:function(e,t,n){var a,i,s=0,r=[];if(x(e))for(a=e.length;s<a;s++)null!=(i=t(e[s],s,n))&&r.push(i);else for(s in e)null!=(i=t(e[s],s,n))&&r.push(i);return u.apply([],r)},guid:1,support:g}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=s[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){m["[object "+t+"]"]=t.toLowerCase()});var T=function(e){var t,n,a,i,s,r,o,l,u,d,c,m,_,p,h,f,g,y,v,b="sizzle"+1*new Date,M=e.document,w=0,k=0,L=re(),x=re(),T=re(),Y=function(e,t){return e===t&&(c=!0),0},D={}.hasOwnProperty,S=[],C=S.pop,j=S.push,E=S.push,P=S.slice,O=function(e,t){for(var n=0,a=e.length;n<a;n++)if(e[n]===t)return n;return-1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",A="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",$="\\["+A+"*("+F+")(?:"+A+"*([*^$|!~]?=)"+A+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+A+"*\\]",R=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+$+")*)|.*)\\)|)",z=new RegExp(A+"+","g"),N=new RegExp("^"+A+"+|((?:^|[^\\\\])(?:\\\\.)*)"+A+"+$","g"),W=new RegExp("^"+A+"*,"+A+"*"),I=new RegExp("^"+A+"*([>+~]|"+A+")"+A+"*"),q=new RegExp("="+A+"*([^\\]'\"]*?)"+A+"*\\]","g"),B=new RegExp(R),U=new RegExp("^"+F+"$"),J={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+$),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+A+"*(even|odd|(([+-]|)(\\d*)n|)"+A+"*(?:([+-]|)"+A+"*(\\d+)|))"+A+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+A+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+A+"*((?:-\\d)?\\d*)"+A+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,V=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Q=new RegExp("\\\\([\\da-f]{1,6}"+A+"?|("+A+")|.)","ig"),ee=function(e,t,n){var a="0x"+t-65536;return a!=a||n?t:a<0?String.fromCharCode(a+65536):String.fromCharCode(a>>10|55296,1023&a|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){m()},ie=ye(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{E.apply(S=P.call(M.childNodes),M.childNodes),S[M.childNodes.length].nodeType}catch(e){E={apply:S.length?function(e,t){j.apply(e,P.call(t))}:function(e,t){for(var n=e.length,a=0;e[n++]=t[a++];);e.length=n-1}}}function se(e,t,a,i){var s,o,u,d,c,p,g,y=t&&t.ownerDocument,w=t?t.nodeType:9;if(a=a||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return a;if(!i&&((t?t.ownerDocument||t:M)!==_&&m(t),t=t||_,h)){if(11!==w&&(c=G.exec(e)))if(s=c[1]){if(9===w){if(!(u=t.getElementById(s)))return a;if(u.id===s)return a.push(u),a}else if(y&&(u=y.getElementById(s))&&v(t,u)&&u.id===s)return a.push(u),a}else{if(c[2])return E.apply(a,t.getElementsByTagName(e)),a;if((s=c[3])&&n.getElementsByClassName&&t.getElementsByClassName)return E.apply(a,t.getElementsByClassName(s)),a}if(n.qsa&&!T[e+" "]&&(!f||!f.test(e))){if(1!==w)y=t,g=e;else if("object"!==t.nodeName.toLowerCase()){for((d=t.getAttribute("id"))?d=d.replace(te,ne):t.setAttribute("id",d=b),o=(p=r(e)).length;o--;)p[o]="#"+d+" "+ge(p[o]);g=p.join(","),y=K.test(e)&&he(t.parentNode)||t}if(g)try{return E.apply(a,y.querySelectorAll(g)),a}catch(e){}finally{d===b&&t.removeAttribute("id")}}}return l(e.replace(N,"$1"),t,a,i)}function re(){var e=[];return function t(n,i){return e.push(n+" ")>a.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function oe(e){return e[b]=!0,e}function le(e){var t=_.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),i=n.length;i--;)a.attrHandle[n[i]]=t}function de(e,t){var n=t&&e,a=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(a)return a;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ce(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function _e(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function pe(e){return oe(function(t){return t=+t,oe(function(n,a){for(var i,s=e([],n.length,t),r=s.length;r--;)n[i=s[r]]&&(n[i]=!(a[i]=n[i]))})})}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},s=se.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},m=se.setDocument=function(e){var t,i,r=e?e.ownerDocument||e:M;return r!==_&&9===r.nodeType&&r.documentElement?(p=(_=r).documentElement,h=!s(_),M!==_&&(i=_.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ae,!1):i.attachEvent&&i.attachEvent("onunload",ae)),n.attributes=le(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=le(function(e){return e.appendChild(_.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(_.getElementsByClassName),n.getById=le(function(e){return p.appendChild(e).id=b,!_.getElementsByName||!_.getElementsByName(b).length}),n.getById?(a.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){return e.getAttribute("id")===t}},a.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n=t.getElementById(e);return n?[n]:[]}}):(a.filter.ID=function(e){var t=e.replace(Q,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},a.find.ID=function(e,t){if(void 0!==t.getElementById&&h){var n,a,i,s=t.getElementById(e);if(s){if((n=s.getAttributeNode("id"))&&n.value===e)return[s];for(i=t.getElementsByName(e),a=0;s=i[a++];)if((n=s.getAttributeNode("id"))&&n.value===e)return[s]}return[]}}),a.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,a=[],i=0,s=t.getElementsByTagName(e);if("*"===e){for(;n=s[i++];)1===n.nodeType&&a.push(n);return a}return s},a.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&h)return t.getElementsByClassName(e)},g=[],f=[],(n.qsa=Z.test(_.querySelectorAll))&&(le(function(e){p.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&f.push("[*^$]="+A+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||f.push("\\["+A+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+b+"-]").length||f.push("~="),e.querySelectorAll(":checked").length||f.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||f.push(".#.+[+~]")}),le(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=_.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&f.push("name"+A+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&f.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),f.push(",.*:")})),(n.matchesSelector=Z.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&le(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",R)}),f=f.length&&new RegExp(f.join("|")),g=g.length&&new RegExp(g.join("|")),t=Z.test(p.compareDocumentPosition),v=t||Z.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,a=t&&t.parentNode;return e===a||!(!a||1!==a.nodeType||!(n.contains?n.contains(a):e.compareDocumentPosition&&16&e.compareDocumentPosition(a)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Y=t?function(e,t){if(e===t)return c=!0,0;var a=!e.compareDocumentPosition-!t.compareDocumentPosition;return a||(1&(a=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===a?e===_||e.ownerDocument===M&&v(M,e)?-1:t===_||t.ownerDocument===M&&v(M,t)?1:d?O(d,e)-O(d,t):0:4&a?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,a=0,i=e.parentNode,s=t.parentNode,r=[e],o=[t];if(!i||!s)return e===_?-1:t===_?1:i?-1:s?1:d?O(d,e)-O(d,t):0;if(i===s)return de(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)o.unshift(n);for(;r[a]===o[a];)a++;return a?de(r[a],o[a]):r[a]===M?-1:o[a]===M?1:0},_):_},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==_&&m(e),t=t.replace(q,"='$1']"),n.matchesSelector&&h&&!T[t+" "]&&(!g||!g.test(t))&&(!f||!f.test(t)))try{var a=y.call(e,t);if(a||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return a}catch(e){}return se(t,_,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!==_&&m(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==_&&m(e);var i=a.attrHandle[t.toLowerCase()],s=i&&D.call(a.attrHandle,t.toLowerCase())?i(e,t,!h):void 0;return void 0!==s?s:n.attributes||!h?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},se.escape=function(e){return(e+"").replace(te,ne)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,a=[],i=0,s=0;if(c=!n.detectDuplicates,d=!n.sortStable&&e.slice(0),e.sort(Y),c){for(;t=e[s++];)t===e[s]&&(i=a.push(s));for(;i--;)e.splice(a[i],1)}return d=null,e},i=se.getText=function(e){var t,n="",a=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[a++];)n+=i(t);return n},(a=se.selectors={cacheLength:50,createPseudo:oe,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Q,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return J.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Q,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=L[e+" "];return t||(t=new RegExp("(^|"+A+")"+e+"("+A+"|$)"))&&L(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(a){var i=se.attr(a,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,a,i){var s="nth"!==e.slice(0,3),r="last"!==e.slice(-4),o="of-type"===t;return 1===a&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,d,c,m,_,p,h=s!==r?"nextSibling":"previousSibling",f=t.parentNode,g=o&&t.nodeName.toLowerCase(),y=!l&&!o,v=!1;if(f){if(s){for(;h;){for(m=t;m=m[h];)if(o?m.nodeName.toLowerCase()===g:1===m.nodeType)return!1;p=h="only"===e&&!p&&"nextSibling"}return!0}if(p=[r?f.firstChild:f.lastChild],r&&y){for(v=(_=(u=(d=(c=(m=f)[b]||(m[b]={}))[m.uniqueID]||(c[m.uniqueID]={}))[e]||[])[0]===w&&u[1])&&u[2],m=_&&f.childNodes[_];m=++_&&m&&m[h]||(v=_=0)||p.pop();)if(1===m.nodeType&&++v&&m===t){d[e]=[w,_,v];break}}else if(y&&(v=_=(u=(d=(c=(m=t)[b]||(m[b]={}))[m.uniqueID]||(c[m.uniqueID]={}))[e]||[])[0]===w&&u[1]),!1===v)for(;(m=++_&&m&&m[h]||(v=_=0)||p.pop())&&((o?m.nodeName.toLowerCase()!==g:1!==m.nodeType)||!++v||(y&&((d=(c=m[b]||(m[b]={}))[m.uniqueID]||(c[m.uniqueID]={}))[e]=[w,v]),m!==t)););return(v-=i)===a||v%a==0&&v/a>=0}}},PSEUDO:function(e,t){var n,i=a.pseudos[e]||a.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],a.setFilters.hasOwnProperty(e.toLowerCase())?oe(function(e,n){for(var a,s=i(e,t),r=s.length;r--;)e[a=O(e,s[r])]=!(n[a]=s[r])}):function(e){return i(e,0,n)}):i}},pseudos:{not:oe(function(e){var t=[],n=[],a=o(e.replace(N,"$1"));return a[b]?oe(function(e,t,n,i){for(var s,r=a(e,null,i,[]),o=e.length;o--;)(s=r[o])&&(e[o]=!(t[o]=s))}):function(e,i,s){return t[0]=e,a(t,null,s,n),t[0]=null,!n.pop()}}),has:oe(function(e){return function(t){return se(e,t).length>0}}),contains:oe(function(e){return e=e.replace(Q,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:oe(function(e){return U.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(Q,ee).toLowerCase(),function(t){var n;do{if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===_.activeElement&&(!_.hasFocus||_.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:_e(!1),disabled:_e(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!a.pseudos.empty(e)},header:function(e){return V.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe(function(){return[0]}),last:pe(function(e,t){return[t-1]}),eq:pe(function(e,t,n){return[n<0?n+t:n]}),even:pe(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:pe(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:pe(function(e,t,n){for(var a=n<0?n+t:n;--a>=0;)e.push(a);return e}),gt:pe(function(e,t,n){for(var a=n<0?n+t:n;++a<t;)e.push(a);return e})}}).pseudos.nth=a.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})a.pseudos[t]=ce(t);for(t in{submit:!0,reset:!0})a.pseudos[t]=me(t);function fe(){}function ge(e){for(var t=0,n=e.length,a="";t<n;t++)a+=e[t].value;return a}function ye(e,t,n){var a=t.dir,i=t.next,s=i||a,r=n&&"parentNode"===s,o=k++;return t.first?function(t,n,i){for(;t=t[a];)if(1===t.nodeType||r)return e(t,n,i);return!1}:function(t,n,l){var u,d,c,m=[w,o];if(l){for(;t=t[a];)if((1===t.nodeType||r)&&e(t,n,l))return!0}else for(;t=t[a];)if(1===t.nodeType||r)if(d=(c=t[b]||(t[b]={}))[t.uniqueID]||(c[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[a]||t;else{if((u=d[s])&&u[0]===w&&u[1]===o)return m[2]=u[2];if(d[s]=m,m[2]=e(t,n,l))return!0}return!1}}function ve(e){return e.length>1?function(t,n,a){for(var i=e.length;i--;)if(!e[i](t,n,a))return!1;return!0}:e[0]}function be(e,t,n,a,i){for(var s,r=[],o=0,l=e.length,u=null!=t;o<l;o++)(s=e[o])&&(n&&!n(s,a,i)||(r.push(s),u&&t.push(o)));return r}function Me(e,t,n,a,i,s){return a&&!a[b]&&(a=Me(a)),i&&!i[b]&&(i=Me(i,s)),oe(function(s,r,o,l){var u,d,c,m=[],_=[],p=r.length,h=s||function(e,t,n){for(var a=0,i=t.length;a<i;a++)se(e,t[a],n);return n}(t||"*",o.nodeType?[o]:o,[]),f=!e||!s&&t?h:be(h,m,e,o,l),g=n?i||(s?e:p||a)?[]:r:f;if(n&&n(f,g,o,l),a)for(u=be(g,_),a(u,[],o,l),d=u.length;d--;)(c=u[d])&&(g[_[d]]=!(f[_[d]]=c));if(s){if(i||e){if(i){for(u=[],d=g.length;d--;)(c=g[d])&&u.push(f[d]=c);i(null,g=[],u,l)}for(d=g.length;d--;)(c=g[d])&&(u=i?O(s,c):m[d])>-1&&(s[u]=!(r[u]=c))}}else g=be(g===r?g.splice(p,g.length):g),i?i(null,r,g,l):E.apply(r,g)})}function we(e){for(var t,n,i,s=e.length,r=a.relative[e[0].type],o=r||a.relative[" "],l=r?1:0,d=ye(function(e){return e===t},o,!0),c=ye(function(e){return O(t,e)>-1},o,!0),m=[function(e,n,a){var i=!r&&(a||n!==u)||((t=n).nodeType?d(e,n,a):c(e,n,a));return t=null,i}];l<s;l++)if(n=a.relative[e[l].type])m=[ye(ve(m),n)];else{if((n=a.filter[e[l].type].apply(null,e[l].matches))[b]){for(i=++l;i<s&&!a.relative[e[i].type];i++);return Me(l>1&&ve(m),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(N,"$1"),n,l<i&&we(e.slice(l,i)),i<s&&we(e=e.slice(i)),i<s&&ge(e))}m.push(n)}return ve(m)}return fe.prototype=a.filters=a.pseudos,a.setFilters=new fe,r=se.tokenize=function(e,t){var n,i,s,r,o,l,u,d=x[e+" "];if(d)return t?0:d.slice(0);for(o=e,l=[],u=a.preFilter;o;){for(r in n&&!(i=W.exec(o))||(i&&(o=o.slice(i[0].length)||o),l.push(s=[])),n=!1,(i=I.exec(o))&&(n=i.shift(),s.push({value:n,type:i[0].replace(N," ")}),o=o.slice(n.length)),a.filter)!(i=J[r].exec(o))||u[r]&&!(i=u[r](i))||(n=i.shift(),s.push({value:n,type:r,matches:i}),o=o.slice(n.length));if(!n)break}return t?o.length:o?se.error(e):x(e,l).slice(0)},o=se.compile=function(e,t){var n,i=[],s=[],o=T[e+" "];if(!o){for(t||(t=r(e)),n=t.length;n--;)(o=we(t[n]))[b]?i.push(o):s.push(o);(o=T(e,function(e,t){var n=t.length>0,i=e.length>0,s=function(s,r,o,l,d){var c,p,f,g=0,y="0",v=s&&[],b=[],M=u,k=s||i&&a.find.TAG("*",d),L=w+=null==M?1:Math.random()||.1,x=k.length;for(d&&(u=r===_||r||d);y!==x&&null!=(c=k[y]);y++){if(i&&c){for(p=0,r||c.ownerDocument===_||(m(c),o=!h);f=e[p++];)if(f(c,r||_,o)){l.push(c);break}d&&(w=L)}n&&((c=!f&&c)&&g--,s&&v.push(c))}if(g+=y,n&&y!==g){for(p=0;f=t[p++];)f(v,b,r,o);if(s){if(g>0)for(;y--;)v[y]||b[y]||(b[y]=C.call(l));b=be(b)}E.apply(l,b),d&&!s&&b.length>0&&g+t.length>1&&se.uniqueSort(l)}return d&&(w=L,u=M),v};return n?oe(s):s}(s,i))).selector=e}return o},l=se.select=function(e,t,n,i){var s,l,u,d,c,m="function"==typeof e&&e,_=!i&&r(e=m.selector||e);if(n=n||[],1===_.length){if((l=_[0]=_[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&h&&a.relative[l[1].type]){if(!(t=(a.find.ID(u.matches[0].replace(Q,ee),t)||[])[0]))return n;m&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(s=J.needsContext.test(e)?0:l.length;s--&&(u=l[s],!a.relative[d=u.type]);)if((c=a.find[d])&&(i=c(u.matches[0].replace(Q,ee),K.test(l[0].type)&&he(t.parentNode)||t))){if(l.splice(s,1),!(e=i.length&&ge(l)))return E.apply(n,i),n;break}}return(m||o(e,_))(i,t,!h,n,!t||K.test(e)&&he(t.parentNode)||t),n},n.sortStable=b.split("").sort(Y).join("")===b,n.detectDuplicates=!!c,m(),n.sortDetached=le(function(e){return 1&e.compareDocumentPosition(_.createElement("fieldset"))}),le(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&le(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ue("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),le(function(e){return null==e.getAttribute("disabled")})||ue(H,function(e,t,n){var a;if(!n)return!0===e[t]?t.toLowerCase():(a=e.getAttributeNode(t))&&a.specified?a.value:null}),se}(n);k.find=T,k.expr=T.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=T.uniqueSort,k.text=T.getText,k.isXMLDoc=T.isXML,k.contains=T.contains,k.escapeSelector=T.escape;var Y=function(e,t,n){for(var a=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&k(e).is(n))break;a.push(e)}return a},D=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},S=k.expr.match.needsContext;function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var j=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function E(e,t,n){return y(t)?k.grep(e,function(e,a){return!!t.call(e,a,e)!==n}):t.nodeType?k.grep(e,function(e){return e===t!==n}):"string"!=typeof t?k.grep(e,function(e){return c.call(t,e)>-1!==n}):k.filter(t,e,n)}k.filter=function(e,t,n){var a=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===a.nodeType?k.find.matchesSelector(a,e)?[a]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,a=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<a;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<a;t++)k.find(e,i[t],n);return a>1?k.uniqueSort(n):n},filter:function(e){return this.pushStack(E(this,e||[],!1))},not:function(e){return this.pushStack(E(this,e||[],!0))},is:function(e){return!!E(this,"string"==typeof e&&S.test(e)?k(e):e||[],!1).length}});var P,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var a,i;if(!e)return this;if(n=n||P,"string"==typeof e){if(!(a="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:O.exec(e))||!a[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(a[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(a[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),j.test(a[1])&&k.isPlainObject(t))for(a in t)y(this[a])?this[a](t[a]):this.attr(a,t[a]);return this}return(i=r.getElementById(a[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,P=k(r);var H=/^(?:parents|prev(?:Until|All))/,A={children:!0,contents:!0,next:!0,prev:!0};function F(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,a=0,i=this.length,s=[],r="string"!=typeof e&&k(e);if(!S.test(e))for(;a<i;a++)for(n=this[a];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&k.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?k.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?c.call(k(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y(e,"parentNode")},parentsUntil:function(e,t,n){return Y(e,"parentNode",n)},next:function(e){return F(e,"nextSibling")},prev:function(e){return F(e,"previousSibling")},nextAll:function(e){return Y(e,"nextSibling")},prevAll:function(e){return Y(e,"previousSibling")},nextUntil:function(e,t,n){return Y(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y(e,"previousSibling",n)},siblings:function(e){return D((e.parentNode||{}).firstChild,e)},children:function(e){return D(e.firstChild)},contents:function(e){return C(e,"iframe")?e.contentDocument:(C(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(e,t){k.fn[e]=function(n,a){var i=k.map(this,t,n);return"Until"!==e.slice(-5)&&(a=n),a&&"string"==typeof a&&(i=k.filter(a,i)),this.length>1&&(A[e]||k.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var $=/[^\x20\t\r\n\f]+/g;function R(e){return e}function z(e){throw e}function N(e,t,n,a){var i;try{e&&y(i=e.promise)?i.call(e).done(t).fail(n):e&&y(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(a))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return k.each(e.match($)||[],function(e,n){t[n]=!0}),t}(e):k.extend({},e);var t,n,a,i,s=[],r=[],o=-1,l=function(){for(i=i||e.once,a=t=!0;r.length;o=-1)for(n=r.shift();++o<s.length;)!1===s[o].apply(n[0],n[1])&&e.stopOnFalse&&(o=s.length,n=!1);e.memory||(n=!1),t=!1,i&&(s=n?[]:"")},u={add:function(){return s&&(n&&!t&&(o=s.length-1,r.push(n)),function t(n){k.each(n,function(n,a){y(a)?e.unique&&u.has(a)||s.push(a):a&&a.length&&"string"!==w(a)&&t(a)})}(arguments),n&&!t&&l()),this},remove:function(){return k.each(arguments,function(e,t){for(var n;(n=k.inArray(t,s,n))>-1;)s.splice(n,1),n<=o&&o--}),this},has:function(e){return e?k.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=r=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=r=[],n||t||(s=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!a}};return u},k.extend({Deferred:function(e){var t=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],a="pending",i={state:function(){return a},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return k.Deferred(function(n){k.each(t,function(t,a){var i=y(e[a[4]])&&e[a[4]];s[a[1]](function(){var e=i&&i.apply(this,arguments);e&&y(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[a[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,a,i){var s=0;function r(e,t,a,i){return function(){var o=this,l=arguments,u=function(){var n,u;if(!(e<s)){if((n=a.apply(o,l))===t.promise())throw new TypeError("Thenable self-resolution");u=n&&("object"==typeof n||"function"==typeof n)&&n.then,y(u)?i?u.call(n,r(s,t,R,i),r(s,t,z,i)):(s++,u.call(n,r(s,t,R,i),r(s,t,z,i),r(s,t,R,t.notifyWith))):(a!==R&&(o=void 0,l=[n]),(i||t.resolveWith)(o,l))}},d=i?u:function(){try{u()}catch(n){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(n,d.stackTrace),e+1>=s&&(a!==z&&(o=void 0,l=[n]),t.rejectWith(o,l))}};e?d():(k.Deferred.getStackHook&&(d.stackTrace=k.Deferred.getStackHook()),n.setTimeout(d))}}return k.Deferred(function(n){t[0][3].add(r(0,n,y(i)?i:R,n.notifyWith)),t[1][3].add(r(0,n,y(e)?e:R)),t[2][3].add(r(0,n,y(a)?a:z))}).promise()},promise:function(e){return null!=e?k.extend(e,i):i}},s={};return k.each(t,function(e,n){var r=n[2],o=n[5];i[n[1]]=r.add,o&&r.add(function(){a=o},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),r.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=r.fireWith}),i.promise(s),e&&e.call(s,s),s},when:function(e){var t=arguments.length,n=t,a=Array(n),i=l.call(arguments),s=k.Deferred(),r=function(e){return function(n){a[e]=this,i[e]=arguments.length>1?l.call(arguments):n,--t||s.resolveWith(a,i)}};if(t<=1&&(N(e,s.done(r(n)).resolve,s.reject,!t),"pending"===s.state()||y(i[n]&&i[n].then)))return s.then();for(;n--;)N(i[n],r(n),s.reject);return s.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&W.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){n.setTimeout(function(){throw e})};var I=k.Deferred();function q(){r.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),k.ready()}k.fn.ready=function(e){return I.then(e).catch(function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==e&&--k.readyWait>0||I.resolveWith(r,[k]))}}),k.ready.then=I.then,"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?n.setTimeout(k.ready):(r.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var B=function(e,t,n,a,i,s,r){var o=0,l=e.length,u=null==n;if("object"===w(n))for(o in i=!0,n)B(e,t,o,n[o],!0,s,r);else if(void 0!==a&&(i=!0,y(a)||(r=!0),u&&(r?(t.call(e,a),t=null):(u=t,t=function(e,t,n){return u.call(k(e),n)})),t))for(;o<l;o++)t(e[o],n,r?a:a.call(e[o],o,t(e[o],n)));return i?e:u?t.call(e):l?t(e[0],n):s},U=/^-ms-/,J=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(U,"ms-").replace(J,X)}var Z=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=k.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Z(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var a,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(a in t)i[V(a)]=t[a];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,a=e[this.expando];if(void 0!==a){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in a?[t]:t.match($)||[]).length;for(;n--;)delete a[t[n]]}(void 0===t||k.isEmptyObject(a))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var K=new G,Q=new G,ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,te=/[A-Z]/g;function ne(e,t,n){var a;if(void 0===n&&1===e.nodeType)if(a="data-"+t.replace(te,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(a))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ee.test(e)?JSON.parse(e):e)}(n)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return Q.hasData(e)||K.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return K.access(e,t,n)},_removeData:function(e,t){K.remove(e,t)}}),k.fn.extend({data:function(e,t){var n,a,i,s=this[0],r=s&&s.attributes;if(void 0===e){if(this.length&&(i=Q.get(s),1===s.nodeType&&!K.get(s,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&0===(a=r[n].name).indexOf("data-")&&(a=V(a.slice(5)),ne(s,a,i[a]));K.set(s,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){Q.set(this,e)}):B(this,function(t){var n;if(s&&void 0===t)return void 0!==(n=Q.get(s,e))?n:void 0!==(n=ne(s,e))?n:void 0;this.each(function(){Q.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),k.extend({queue:function(e,t,n){var a;if(e)return t=(t||"fx")+"queue",a=K.get(e,t),n&&(!a||Array.isArray(n)?a=K.access(e,t,k.makeArray(n)):a.push(n)),a||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),a=n.length,i=n.shift(),s=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),a--),i&&("fx"===t&&n.unshift("inprogress"),delete s.stop,i.call(e,function(){k.dequeue(e,t)},s)),!a&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:k.Callbacks("once memory").add(function(){K.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?k.queue(this[0],e):void 0===t?this:this.each(function(){var n=k.queue(this,e,t);k._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&k.dequeue(this,e)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,a=1,i=k.Deferred(),s=this,r=this.length,o=function(){--a||i.resolveWith(s,[s])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";r--;)(n=K.get(s[r],e+"queueHooks"))&&n.empty&&(a++,n.empty.add(o));return o(),i.promise(t)}});var ae=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+ae+")([a-z%]*)$","i"),se=["Top","Right","Bottom","Left"],re=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&k.contains(e.ownerDocument,e)&&"none"===k.css(e,"display")},oe=function(e,t,n,a){var i,s,r={};for(s in t)r[s]=e.style[s],e.style[s]=t[s];for(s in i=n.apply(e,a||[]),t)e.style[s]=r[s];return i};function le(e,t,n,a){var i,s,r=20,o=a?function(){return a.cur()}:function(){return k.css(e,t,"")},l=o(),u=n&&n[3]||(k.cssNumber[t]?"":"px"),d=(k.cssNumber[t]||"px"!==u&&+l)&&ie.exec(k.css(e,t));if(d&&d[3]!==u){for(l/=2,u=u||d[3],d=+l||1;r--;)k.style(e,t,d+u),(1-s)*(1-(s=o()/l||.5))<=0&&(r=0),d/=s;d*=2,k.style(e,t,d+u),n=n||[]}return n&&(d=+d||+l||0,i=n[1]?d+(n[1]+1)*n[2]:+n[2],a&&(a.unit=u,a.start=d,a.end=i)),i}var ue={};function de(e){var t,n=e.ownerDocument,a=e.nodeName,i=ue[a];return i||(t=n.body.appendChild(n.createElement(a)),i=k.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ue[a]=i,i)}function ce(e,t){for(var n,a,i=[],s=0,r=e.length;s<r;s++)(a=e[s]).style&&(n=a.style.display,t?("none"===n&&(i[s]=K.get(a,"display")||null,i[s]||(a.style.display="")),""===a.style.display&&re(a)&&(i[s]=de(a))):"none"!==n&&(i[s]="none",K.set(a,"display",n)));for(s=0;s<r;s++)null!=i[s]&&(e[s].style.display=i[s]);return e}k.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){re(this)?k(this).show():k(this).hide()})}});var me=/^(?:checkbox|radio)$/i,_e=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,pe=/^$|^module$|\/(?:java|ecma)script/i,he={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function fe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?k.merge([e],n):n}function ge(e,t){for(var n=0,a=e.length;n<a;n++)K.set(e[n],"globalEval",!t||K.get(t[n],"globalEval"))}he.optgroup=he.option,he.tbody=he.tfoot=he.colgroup=he.caption=he.thead,he.th=he.td;var ye,ve,be=/<|&#?\w+;/;function Me(e,t,n,a,i){for(var s,r,o,l,u,d,c=t.createDocumentFragment(),m=[],_=0,p=e.length;_<p;_++)if((s=e[_])||0===s)if("object"===w(s))k.merge(m,s.nodeType?[s]:s);else if(be.test(s)){for(r=r||c.appendChild(t.createElement("div")),o=(_e.exec(s)||["",""])[1].toLowerCase(),l=he[o]||he._default,r.innerHTML=l[1]+k.htmlPrefilter(s)+l[2],d=l[0];d--;)r=r.lastChild;k.merge(m,r.childNodes),(r=c.firstChild).textContent=""}else m.push(t.createTextNode(s));for(c.textContent="",_=0;s=m[_++];)if(a&&k.inArray(s,a)>-1)i&&i.push(s);else if(u=k.contains(s.ownerDocument,s),r=fe(c.appendChild(s),"script"),u&&ge(r),n)for(d=0;s=r[d++];)pe.test(s.type||"")&&n.push(s);return c}ye=r.createDocumentFragment().appendChild(r.createElement("div")),(ve=r.createElement("input")).setAttribute("type","radio"),ve.setAttribute("checked","checked"),ve.setAttribute("name","t"),ye.appendChild(ve),g.checkClone=ye.cloneNode(!0).cloneNode(!0).lastChild.checked,ye.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!ye.cloneNode(!0).lastChild.defaultValue;var we=r.documentElement,ke=/^key/,Le=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,xe=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Ye(){return!1}function De(){try{return r.activeElement}catch(e){}}function Se(e,t,n,a,i,s){var r,o;if("object"==typeof t){for(o in"string"!=typeof n&&(a=a||n,n=void 0),t)Se(e,o,n,a,t[o],s);return e}if(null==a&&null==i?(i=n,a=n=void 0):null==i&&("string"==typeof n?(i=a,a=void 0):(i=a,a=n,n=void 0)),!1===i)i=Ye;else if(!i)return e;return 1===s&&(r=i,(i=function(e){return k().off(e),r.apply(this,arguments)}).guid=r.guid||(r.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,a,n)})}k.event={global:{},add:function(e,t,n,a,i){var s,r,o,l,u,d,c,m,_,p,h,f=K.get(e);if(f)for(n.handler&&(n=(s=n).handler,i=s.selector),i&&k.find.matchesSelector(we,i),n.guid||(n.guid=k.guid++),(l=f.events)||(l=f.events={}),(r=f.handle)||(r=f.handle=function(t){return void 0!==k&&k.event.triggered!==t.type?k.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match($)||[""]).length;u--;)_=h=(o=xe.exec(t[u])||[])[1],p=(o[2]||"").split(".").sort(),_&&(c=k.event.special[_]||{},_=(i?c.delegateType:c.bindType)||_,c=k.event.special[_]||{},d=k.extend({type:_,origType:h,data:a,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:p.join(".")},s),(m=l[_])||((m=l[_]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,a,p,r)||e.addEventListener&&e.addEventListener(_,r)),c.add&&(c.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),i?m.splice(m.delegateCount++,0,d):m.push(d),k.event.global[_]=!0)},remove:function(e,t,n,a,i){var s,r,o,l,u,d,c,m,_,p,h,f=K.hasData(e)&&K.get(e);if(f&&(l=f.events)){for(u=(t=(t||"").match($)||[""]).length;u--;)if(_=h=(o=xe.exec(t[u])||[])[1],p=(o[2]||"").split(".").sort(),_){for(c=k.event.special[_]||{},m=l[_=(a?c.delegateType:c.bindType)||_]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=s=m.length;s--;)d=m[s],!i&&h!==d.origType||n&&n.guid!==d.guid||o&&!o.test(d.namespace)||a&&a!==d.selector&&("**"!==a||!d.selector)||(m.splice(s,1),d.selector&&m.delegateCount--,c.remove&&c.remove.call(e,d));r&&!m.length&&(c.teardown&&!1!==c.teardown.call(e,p,f.handle)||k.removeEvent(e,_,f.handle),delete l[_])}else for(_ in l)k.event.remove(e,_+t[u],n,a,!0);k.isEmptyObject(l)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,a,i,s,r,o=k.event.fix(e),l=new Array(arguments.length),u=(K.get(this,"events")||{})[o.type]||[],d=k.event.special[o.type]||{};for(l[0]=o,t=1;t<arguments.length;t++)l[t]=arguments[t];if(o.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,o)){for(r=k.event.handlers.call(this,o,u),t=0;(i=r[t++])&&!o.isPropagationStopped();)for(o.currentTarget=i.elem,n=0;(s=i.handlers[n++])&&!o.isImmediatePropagationStopped();)o.rnamespace&&!o.rnamespace.test(s.namespace)||(o.handleObj=s,o.data=s.data,void 0!==(a=((k.event.special[s.origType]||{}).handle||s.handler).apply(i.elem,l))&&!1===(o.result=a)&&(o.preventDefault(),o.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,o),o.result}},handlers:function(e,t){var n,a,i,s,r,o=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(s=[],r={},n=0;n<l;n++)void 0===r[i=(a=t[n]).selector+" "]&&(r[i]=a.needsContext?k(i,this).index(u)>-1:k.find(i,this,null,[u]).length),r[i]&&s.push(a);s.length&&o.push({elem:u,handlers:s})}return u=this,l<t.length&&o.push({elem:u,handlers:t.slice(l)}),o},addProp:function(e,t){Object.defineProperty(k.Event.prototype,e,{enumerable:!0,configurable:!0,get:y(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==De()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===De()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&C(this,"input"))return this.click(),!1},_default:function(e){return C(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Te:Ye,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Ye,isPropagationStopped:Ye,isImmediatePropagationStopped:Ye,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Te,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Te,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Te,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&ke.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Le.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){k.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,a=e.relatedTarget,i=e.handleObj;return a&&(a===this||k.contains(this,a))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),k.fn.extend({on:function(e,t,n,a){return Se(this,e,t,n,a)},one:function(e,t,n,a){return Se(this,e,t,n,a,1)},off:function(e,t,n){var a,i;if(e&&e.preventDefault&&e.handleObj)return a=e.handleObj,k(e.delegateTarget).off(a.namespace?a.origType+"."+a.namespace:a.origType,a.selector,a.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ye),this.each(function(){k.event.remove(this,e,n,t)})}});var Ce=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,je=/<script|<style|<link/i,Ee=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ae(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,a,i,s,r,o,l,u;if(1===t.nodeType){if(K.hasData(e)&&(s=K.access(e),r=K.set(t,s),u=s.events))for(i in delete r.handle,r.events={},u)for(n=0,a=u[i].length;n<a;n++)k.event.add(t,i,u[i][n]);Q.hasData(e)&&(o=Q.access(e),l=k.extend({},o),Q.set(t,l))}}function $e(e,t,n,a){t=u.apply([],t);var i,s,r,o,l,d,c=0,m=e.length,_=m-1,p=t[0],h=y(p);if(h||m>1&&"string"==typeof p&&!g.checkClone&&Ee.test(p))return e.each(function(i){var s=e.eq(i);h&&(t[0]=p.call(this,i,s.html())),$e(s,t,n,a)});if(m&&(s=(i=Me(t,e[0].ownerDocument,!1,e,a)).firstChild,1===i.childNodes.length&&(i=s),s||a)){for(o=(r=k.map(fe(i,"script"),He)).length;c<m;c++)l=i,c!==_&&(l=k.clone(l,!0,!0),o&&k.merge(r,fe(l,"script"))),n.call(e[c],l,c);if(o)for(d=r[r.length-1].ownerDocument,k.map(r,Ae),c=0;c<o;c++)l=r[c],pe.test(l.type||"")&&!K.access(l,"globalEval")&&k.contains(d,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?k._evalUrl&&k._evalUrl(l.src):M(l.textContent.replace(Pe,""),d,l))}return e}function Re(e,t,n){for(var a,i=t?k.filter(t,e):e,s=0;null!=(a=i[s]);s++)n||1!==a.nodeType||k.cleanData(fe(a)),a.parentNode&&(n&&k.contains(a.ownerDocument,a)&&ge(fe(a,"script")),a.parentNode.removeChild(a));return e}k.extend({htmlPrefilter:function(e){return e.replace(Ce,"<$1></$2>")},clone:function(e,t,n){var a,i,s,r,o,l,u,d=e.cloneNode(!0),c=k.contains(e.ownerDocument,e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(r=fe(d),a=0,i=(s=fe(e)).length;a<i;a++)o=s[a],l=r[a],void 0,"input"===(u=l.nodeName.toLowerCase())&&me.test(o.type)?l.checked=o.checked:"input"!==u&&"textarea"!==u||(l.defaultValue=o.defaultValue);if(t)if(n)for(s=s||fe(e),r=r||fe(d),a=0,i=s.length;a<i;a++)Fe(s[a],r[a]);else Fe(e,d);return(r=fe(d,"script")).length>0&&ge(r,!c&&fe(e,"script")),d},cleanData:function(e){for(var t,n,a,i=k.event.special,s=0;void 0!==(n=e[s]);s++)if(Z(n)){if(t=n[K.expando]){if(t.events)for(a in t.events)i[a]?k.event.remove(n,a):k.removeEvent(n,a,t.handle);n[K.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),k.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return B(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(fe(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,a=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!je.test(e)&&!he[(_e.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<a;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(fe(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return $e(this,arguments,function(t){var n=this.parentNode;k.inArray(this,e)<0&&(k.cleanData(fe(this)),n&&n.replaceChild(t,this))},e)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){k.fn[e]=function(e){for(var n,a=[],i=k(e),s=i.length-1,r=0;r<=s;r++)n=r===s?this:this.clone(!0),k(i[r])[t](n),d.apply(a,n.get());return this.pushStack(a)}});var ze=new RegExp("^("+ae+")(?!px)[a-z%]+$","i"),Ne=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},We=new RegExp(se.join("|"),"i");function Ie(e,t,n){var a,i,s,r,o=e.style;return(n=n||Ne(e))&&(""!==(r=n.getPropertyValue(t)||n[t])||k.contains(e.ownerDocument,e)||(r=k.style(e,t)),!g.pixelBoxStyles()&&ze.test(r)&&We.test(t)&&(a=o.width,i=o.minWidth,s=o.maxWidth,o.minWidth=o.maxWidth=o.width=r,r=n.width,o.width=a,o.minWidth=i,o.maxWidth=s)),void 0!==r?r+"":r}function qe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(d){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",we.appendChild(u).appendChild(d);var e=n.getComputedStyle(d);a="1%"!==e.top,l=12===t(e.marginLeft),d.style.right="60%",o=36===t(e.right),i=36===t(e.width),d.style.position="absolute",s=36===d.offsetWidth||"absolute",we.removeChild(u),d=null}}function t(e){return Math.round(parseFloat(e))}var a,i,s,o,l,u=r.createElement("div"),d=r.createElement("div");d.style&&(d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===d.style.backgroundClip,k.extend(g,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),a},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),s}}))}();var Be=/^(none|table(?!-c[ea]).+)/,Ue=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"},Ve=["Webkit","Moz","ms"],Ze=r.createElement("div").style;function Ge(e){var t=k.cssProps[e];return t||(t=k.cssProps[e]=function(e){if(e in Ze)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Ve.length;n--;)if((e=Ve[n]+t)in Ze)return e}(e)||e),t}function Ke(e,t,n){var a=ie.exec(t);return a?Math.max(0,a[2]-(n||0))+(a[3]||"px"):t}function Qe(e,t,n,a,i,s){var r="width"===t?1:0,o=0,l=0;if(n===(a?"border":"content"))return 0;for(;r<4;r+=2)"margin"===n&&(l+=k.css(e,n+se[r],!0,i)),a?("content"===n&&(l-=k.css(e,"padding"+se[r],!0,i)),"margin"!==n&&(l-=k.css(e,"border"+se[r]+"Width",!0,i))):(l+=k.css(e,"padding"+se[r],!0,i),"padding"!==n?l+=k.css(e,"border"+se[r]+"Width",!0,i):o+=k.css(e,"border"+se[r]+"Width",!0,i));return!a&&s>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-s-l-o-.5))),l}function et(e,t,n){var a=Ne(e),i=Ie(e,t,a),s="border-box"===k.css(e,"boxSizing",!1,a),r=s;if(ze.test(i)){if(!n)return i;i="auto"}return r=r&&(g.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===k.css(e,"display",!1,a))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],r=!0),(i=parseFloat(i)||0)+Qe(e,t,n||(s?"border":"content"),r,a,i)+"px"}function tt(e,t,n,a,i){return new tt.prototype.init(e,t,n,a,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ie(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,a){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,s,r,o=V(t),l=Ue.test(t),u=e.style;if(l||(t=Ge(o)),r=k.cssHooks[t]||k.cssHooks[o],void 0===n)return r&&"get"in r&&void 0!==(i=r.get(e,!1,a))?i:u[t];"string"===(s=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=le(e,t,i),s="number"),null!=n&&n==n&&("number"===s&&(n+=i&&i[3]||(k.cssNumber[o]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),r&&"set"in r&&void 0===(n=r.set(e,n,a))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,a){var i,s,r,o=V(t);return Ue.test(t)||(t=Ge(o)),(r=k.cssHooks[t]||k.cssHooks[o])&&"get"in r&&(i=r.get(e,!0,n)),void 0===i&&(i=Ie(e,t,a)),"normal"===i&&t in Xe&&(i=Xe[t]),""===n||n?(s=parseFloat(i),!0===n||isFinite(s)?s||0:i):i}}),k.each(["height","width"],function(e,t){k.cssHooks[t]={get:function(e,n,a){if(n)return!Be.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,a):oe(e,Je,function(){return et(e,t,a)})},set:function(e,n,a){var i,s=Ne(e),r="border-box"===k.css(e,"boxSizing",!1,s),o=a&&Qe(e,t,a,r,s);return r&&g.scrollboxSize()===s.position&&(o-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(s[t])-Qe(e,t,"border",!1,s)-.5)),o&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=k.css(e,t)),Ke(0,n,o)}}}),k.cssHooks.marginLeft=qe(g.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ie(e,"marginLeft"))||e.getBoundingClientRect().left-oe(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(e,t){k.cssHooks[e+t]={expand:function(n){for(var a=0,i={},s="string"==typeof n?n.split(" "):[n];a<4;a++)i[e+se[a]+t]=s[a]||s[a-2]||s[0];return i}},"margin"!==e&&(k.cssHooks[e+t].set=Ke)}),k.fn.extend({css:function(e,t){return B(this,function(e,t,n){var a,i,s={},r=0;if(Array.isArray(t)){for(a=Ne(e),i=t.length;r<i;r++)s[t[r]]=k.css(e,t[r],!1,a);return s}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,arguments.length>1)}}),k.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,a,i,s){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=a,this.unit=s||(k.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[k.cssProps[e.prop]]&&!k.cssHooks[e.prop]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=tt.prototype.init,k.fx.step={};var nt,at,it=/^(?:toggle|show|hide)$/,st=/queueHooks$/;function rt(){at&&(!1===r.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(rt):n.setTimeout(rt,k.fx.interval),k.fx.tick())}function ot(){return n.setTimeout(function(){nt=void 0}),nt=Date.now()}function lt(e,t){var n,a=0,i={height:e};for(t=t?1:0;a<4;a+=2-t)i["margin"+(n=se[a])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var a,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),s=0,r=i.length;s<r;s++)if(a=i[s].call(n,t,e))return a}function dt(e,t,n){var a,i,s=0,r=dt.prefilters.length,o=k.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=nt||ot(),n=Math.max(0,u.startTime+u.duration-t),a=1-(n/u.duration||0),s=0,r=u.tweens.length;s<r;s++)u.tweens[s].run(a);return o.notifyWith(e,[u,a,n]),a<1&&r?n:(r||o.notifyWith(e,[u,1,0]),o.resolveWith(e,[u]),!1)},u=o.promise({elem:e,props:k.extend({},t),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||ot(),duration:n.duration,tweens:[],createTween:function(t,n){var a=k.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(a),a},stop:function(t){var n=0,a=t?u.tweens.length:0;if(i)return this;for(i=!0;n<a;n++)u.tweens[n].run(1);return t?(o.notifyWith(e,[u,1,0]),o.resolveWith(e,[u,t])):o.rejectWith(e,[u,t]),this}}),d=u.props;for(!function(e,t){var n,a,i,s,r;for(n in e)if(i=t[a=V(n)],s=e[n],Array.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==a&&(e[a]=s,delete e[n]),(r=k.cssHooks[a])&&"expand"in r)for(n in s=r.expand(s),delete e[a],s)n in e||(e[n]=s[n],t[n]=i);else t[a]=i}(d,u.opts.specialEasing);s<r;s++)if(a=dt.prefilters[s].call(u,e,d,u.opts))return y(a.stop)&&(k._queueHooks(u.elem,u.opts.queue).stop=a.stop.bind(a)),a;return k.map(d,ut,u),y(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),k.fx.timer(k.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){y(e)?(t=e,e=["*"]):e=e.match($);for(var n,a=0,i=e.length;a<i;a++)n=e[a],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var a,i,s,r,o,l,u,d,c="width"in t||"height"in t,m=this,_={},p=e.style,h=e.nodeType&&re(e),f=K.get(e,"fxshow");for(a in n.queue||(null==(r=k._queueHooks(e,"fx")).unqueued&&(r.unqueued=0,o=r.empty.fire,r.empty.fire=function(){r.unqueued||o()}),r.unqueued++,m.always(function(){m.always(function(){r.unqueued--,k.queue(e,"fx").length||r.empty.fire()})})),t)if(i=t[a],it.test(i)){if(delete t[a],s=s||"toggle"===i,i===(h?"hide":"show")){if("show"!==i||!f||void 0===f[a])continue;h=!0}_[a]=f&&f[a]||k.style(e,a)}if((l=!k.isEmptyObject(t))||!k.isEmptyObject(_))for(a in c&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(u=f&&f.display)&&(u=K.get(e,"display")),"none"===(d=k.css(e,"display"))&&(u?d=u:(ce([e],!0),u=e.style.display||u,d=k.css(e,"display"),ce([e]))),("inline"===d||"inline-block"===d&&null!=u)&&"none"===k.css(e,"float")&&(l||(m.done(function(){p.display=u}),null==u&&(d=p.display,u="none"===d?"":d)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",m.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),l=!1,_)l||(f?"hidden"in f&&(h=f.hidden):f=K.access(e,"fxshow",{display:u}),s&&(f.hidden=!h),h&&ce([e],!0),m.done(function(){for(a in h||ce([e]),K.remove(e,"fxshow"),_)k.style(e,a,_[a])})),l=ut(h?f[a]:0,a,m),a in f||(f[a]=l.start,h&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var a=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||y(e)&&e,duration:e,easing:n&&t||t&&!y(t)&&t};return k.fx.off?a.duration=0:"number"!=typeof a.duration&&(a.duration in k.fx.speeds?a.duration=k.fx.speeds[a.duration]:a.duration=k.fx.speeds._default),null!=a.queue&&!0!==a.queue||(a.queue="fx"),a.old=a.complete,a.complete=function(){y(a.old)&&a.old.call(this),a.queue&&k.dequeue(this,a.queue)},a},k.fn.extend({fadeTo:function(e,t,n,a){return this.filter(re).css("opacity",0).show().end().animate({opacity:t},e,n,a)},animate:function(e,t,n,a){var i=k.isEmptyObject(e),s=k.speed(t,n,a),r=function(){var t=dt(this,k.extend({},e),s);(i||K.get(this,"finish"))&&t.stop(!0)};return r.finish=r,i||!1===s.queue?this.each(r):this.queue(s.queue,r)},stop:function(e,t,n){var a=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",s=k.timers,r=K.get(this);if(i)r[i]&&r[i].stop&&a(r[i]);else for(i in r)r[i]&&r[i].stop&&st.test(i)&&a(r[i]);for(i=s.length;i--;)s[i].elem!==this||null!=e&&s[i].queue!==e||(s[i].anim.stop(n),t=!1,s.splice(i,1));!t&&n||k.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=K.get(this),a=n[e+"queue"],i=n[e+"queueHooks"],s=k.timers,r=a?a.length:0;for(n.finish=!0,k.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<r;t++)a[t]&&a[t].finish&&a[t].finish.call(this);delete n.finish})}}),k.each(["toggle","show","hide"],function(e,t){var n=k.fn[t];k.fn[t]=function(e,a,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(lt(t,!0),e,a,i)}}),k.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){k.fn[e]=function(e,n,a){return this.animate(t,e,n,a)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),nt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){at||(at=!0,rt())},k.fx.stop=function(){at=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(e,t){return e=k.fx&&k.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,a){var i=n.setTimeout(t,e);a.stop=function(){n.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",g.checkOn=""!==e.value,g.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",g.radioValue="t"===e.value}();var ct,mt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return B(this,k.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var a,i,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?k.prop(e,t,n):(1===s&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(a=i.set(e,n,t))?a:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(a=i.get(e,t))?a:null==(a=k.find.attr(e,t))?void 0:a)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,a=0,i=t&&t.match($);if(i&&1===e.nodeType)for(;n=i[a++];)e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var n=mt[t]||k.find.attr;mt[t]=function(e,t,a){var i,s,r=t.toLowerCase();return a||(s=mt[r],mt[r]=i,i=null!=n(e,t,a)?r:null,mt[r]=s),i}});var _t=/^(?:input|select|textarea|button)$/i,pt=/^(?:a|area)$/i;function ht(e){return(e.match($)||[]).join(" ")}function ft(e){return e.getAttribute&&e.getAttribute("class")||""}function gt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match($)||[]}k.fn.extend({prop:function(e,t){return B(this,k.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var a,i,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(a=i.set(e,n,t))?a:e[t]=n:i&&"get"in i&&null!==(a=i.get(e,t))?a:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):_t.test(e.nodeName)||pt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(e){var t,n,a,i,s,r,o,l=0;if(y(e))return this.each(function(t){k(this).addClass(e.call(this,t,ft(this)))});if((t=gt(e)).length)for(;n=this[l++];)if(i=ft(n),a=1===n.nodeType&&" "+ht(i)+" "){for(r=0;s=t[r++];)a.indexOf(" "+s+" ")<0&&(a+=s+" ");i!==(o=ht(a))&&n.setAttribute("class",o)}return this},removeClass:function(e){var t,n,a,i,s,r,o,l=0;if(y(e))return this.each(function(t){k(this).removeClass(e.call(this,t,ft(this)))});if(!arguments.length)return this.attr("class","");if((t=gt(e)).length)for(;n=this[l++];)if(i=ft(n),a=1===n.nodeType&&" "+ht(i)+" "){for(r=0;s=t[r++];)for(;a.indexOf(" "+s+" ")>-1;)a=a.replace(" "+s+" "," ");i!==(o=ht(a))&&n.setAttribute("class",o)}return this},toggleClass:function(e,t){var n=typeof e,a="string"===n||Array.isArray(e);return"boolean"==typeof t&&a?t?this.addClass(e):this.removeClass(e):y(e)?this.each(function(n){k(this).toggleClass(e.call(this,n,ft(this),t),t)}):this.each(function(){var t,i,s,r;if(a)for(i=0,s=k(this),r=gt(e);t=r[i++];)s.hasClass(t)?s.removeClass(t):s.addClass(t);else void 0!==e&&"boolean"!==n||((t=ft(this))&&K.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":K.get(this,"__className__")||""))})},hasClass:function(e){var t,n,a=0;for(t=" "+e+" ";n=this[a++];)if(1===n.nodeType&&(" "+ht(ft(n))+" ").indexOf(t)>-1)return!0;return!1}});var yt=/\r/g;k.fn.extend({val:function(e){var t,n,a,i=this[0];return arguments.length?(a=y(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=a?e.call(this,n,k(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=k.map(i,function(e){return null==e?"":e+""})),(t=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=k.valHooks[i.type]||k.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(yt,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:ht(k.text(e))}},select:{get:function(e){var t,n,a,i=e.options,s=e.selectedIndex,r="select-one"===e.type,o=r?null:[],l=r?s+1:i.length;for(a=s<0?l:r?s:0;a<l;a++)if(((n=i[a]).selected||a===s)&&!n.disabled&&(!n.parentNode.disabled||!C(n.parentNode,"optgroup"))){if(t=k(n).val(),r)return t;o.push(t)}return o},set:function(e,t){for(var n,a,i=e.options,s=k.makeArray(t),r=i.length;r--;)((a=i[r]).selected=k.inArray(k.valHooks.option.get(a),s)>-1)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=k.inArray(k(e).val(),t)>-1}},g.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),g.focusin="onfocusin"in n;var vt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,a,i){var s,o,l,u,d,c,m,_,h=[a||r],f=p.call(e,"type")?e.type:e,g=p.call(e,"namespace")?e.namespace.split("."):[];if(o=_=l=a=a||r,3!==a.nodeType&&8!==a.nodeType&&!vt.test(f+k.event.triggered)&&(f.indexOf(".")>-1&&(f=(g=f.split(".")).shift(),g.sort()),d=f.indexOf(":")<0&&"on"+f,(e=e[k.expando]?e:new k.Event(f,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=a),t=null==t?[e]:k.makeArray(t,[e]),m=k.event.special[f]||{},i||!m.trigger||!1!==m.trigger.apply(a,t))){if(!i&&!m.noBubble&&!v(a)){for(u=m.delegateType||f,vt.test(u+f)||(o=o.parentNode);o;o=o.parentNode)h.push(o),l=o;l===(a.ownerDocument||r)&&h.push(l.defaultView||l.parentWindow||n)}for(s=0;(o=h[s++])&&!e.isPropagationStopped();)_=o,e.type=s>1?u:m.bindType||f,(c=(K.get(o,"events")||{})[e.type]&&K.get(o,"handle"))&&c.apply(o,t),(c=d&&o[d])&&c.apply&&Z(o)&&(e.result=c.apply(o,t),!1===e.result&&e.preventDefault());return e.type=f,i||e.isDefaultPrevented()||m._default&&!1!==m._default.apply(h.pop(),t)||!Z(a)||d&&y(a[f])&&!v(a)&&((l=a[d])&&(a[d]=null),k.event.triggered=f,e.isPropagationStopped()&&_.addEventListener(f,bt),a[f](),e.isPropagationStopped()&&_.removeEventListener(f,bt),k.event.triggered=void 0,l&&(a[d]=l)),e.result}},simulate:function(e,t,n){var a=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(a,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),g.focusin||k.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){k.event.simulate(t,e.target,k.event.fix(e))};k.event.special[t]={setup:function(){var a=this.ownerDocument||this,i=K.access(a,t);i||a.addEventListener(e,n,!0),K.access(a,t,(i||0)+1)},teardown:function(){var a=this.ownerDocument||this,i=K.access(a,t)-1;i?K.access(a,t,i):(a.removeEventListener(e,n,!0),K.remove(a,t))}}});var Mt=n.location,wt=Date.now(),kt=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Lt=/\[\]$/,xt=/\r?\n/g,Tt=/^(?:submit|button|image|reset|file)$/i,Yt=/^(?:input|select|textarea|keygen)/i;function Dt(e,t,n,a){var i;if(Array.isArray(t))k.each(t,function(t,i){n||Lt.test(e)?a(e,i):Dt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,a)});else if(n||"object"!==w(t))a(e,t);else for(i in t)Dt(e+"["+i+"]",t[i],n,a)}k.param=function(e,t){var n,a=[],i=function(e,t){var n=y(t)?t():t;a[a.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return a.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&Yt.test(this.nodeName)&&!Tt.test(e)&&(this.checked||!me.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(xt,"\r\n")}}):{name:t.name,value:n.replace(xt,"\r\n")}}).get()}});var St=/%20/g,Ct=/#.*$/,jt=/([?&])_=[^&]*/,Et=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:GET|HEAD)$/,Ot=/^\/\//,Ht={},At={},Ft="*/".concat("*"),$t=r.createElement("a");function Rt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var a,i=0,s=t.toLowerCase().match($)||[];if(y(n))for(;a=s[i++];)"+"===a[0]?(a=a.slice(1)||"*",(e[a]=e[a]||[]).unshift(n)):(e[a]=e[a]||[]).push(n)}}function zt(e,t,n,a){var i={},s=e===At;function r(o){var l;return i[o]=!0,k.each(e[o]||[],function(e,o){var u=o(t,n,a);return"string"!=typeof u||s||i[u]?s?!(l=u):void 0:(t.dataTypes.unshift(u),r(u),!1)}),l}return r(t.dataTypes[0])||!i["*"]&&r("*")}function Nt(e,t){var n,a,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:a||(a={}))[n]=t[n]);return a&&k.extend(!0,e,a),e}$t.href=Mt.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ft,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Nt(Nt(e,k.ajaxSettings),t):Nt(k.ajaxSettings,e)},ajaxPrefilter:Rt(Ht),ajaxTransport:Rt(At),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var a,i,s,o,l,u,d,c,m,_,p=k.ajaxSetup({},t),h=p.context||p,f=p.context&&(h.nodeType||h.jquery)?k(h):k.event,g=k.Deferred(),y=k.Callbacks("once memory"),v=p.statusCode||{},b={},M={},w="canceled",L={readyState:0,getResponseHeader:function(e){var t;if(d){if(!o)for(o={};t=Et.exec(s);)o[t[1].toLowerCase()]=t[2];t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return d?s:null},setRequestHeader:function(e,t){return null==d&&(e=M[e.toLowerCase()]=M[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==d&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(d)L.always(e[L.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||w;return a&&a.abort(t),x(0,t),this}};if(g.promise(L),p.url=((e||p.url||Mt.href)+"").replace(Ot,Mt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match($)||[""],null==p.crossDomain){u=r.createElement("a");try{u.href=p.url,u.href=u.href,p.crossDomain=$t.protocol+"//"+$t.host!=u.protocol+"//"+u.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=k.param(p.data,p.traditional)),zt(Ht,p,t,L),d)return L;for(m in(c=k.event&&p.global)&&0==k.active++&&k.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pt.test(p.type),i=p.url.replace(Ct,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(St,"+")):(_=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(kt.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(jt,"$1"),_=(kt.test(i)?"&":"?")+"_="+wt+++_),p.url=i+_),p.ifModified&&(k.lastModified[i]&&L.setRequestHeader("If-Modified-Since",k.lastModified[i]),k.etag[i]&&L.setRequestHeader("If-None-Match",k.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&L.setRequestHeader("Content-Type",p.contentType),L.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ft+"; q=0.01":""):p.accepts["*"]),p.headers)L.setRequestHeader(m,p.headers[m]);if(p.beforeSend&&(!1===p.beforeSend.call(h,L,p)||d))return L.abort();if(w="abort",y.add(p.complete),L.done(p.success),L.fail(p.error),a=zt(At,p,t,L)){if(L.readyState=1,c&&f.trigger("ajaxSend",[L,p]),d)return L;p.async&&p.timeout>0&&(l=n.setTimeout(function(){L.abort("timeout")},p.timeout));try{d=!1,a.send(b,x)}catch(e){if(d)throw e;x(-1,e)}}else x(-1,"No Transport");function x(e,t,r,o){var u,m,_,b,M,w=t;d||(d=!0,l&&n.clearTimeout(l),a=void 0,s=o||"",L.readyState=e>0?4:0,u=e>=200&&e<300||304===e,r&&(b=function(e,t,n){for(var a,i,s,r,o=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===a&&(a=e.mimeType||t.getResponseHeader("Content-Type"));if(a)for(i in o)if(o[i]&&o[i].test(a)){l.unshift(i);break}if(l[0]in n)s=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){s=i;break}r||(r=i)}s=s||r}if(s)return s!==l[0]&&l.unshift(s),n[s]}(p,L,r)),b=function(e,t,n,a){var i,s,r,o,l,u={},d=e.dataTypes.slice();if(d[1])for(r in e.converters)u[r.toLowerCase()]=e.converters[r];for(s=d.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!l&&a&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=d.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(r=u[l+" "+s]||u["* "+s]))for(i in u)if((o=i.split(" "))[1]===s&&(r=u[l+" "+o[0]]||u["* "+o[0]])){!0===r?r=u[i]:!0!==u[i]&&(s=o[0],d.unshift(o[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}(p,b,L,u),u?(p.ifModified&&((M=L.getResponseHeader("Last-Modified"))&&(k.lastModified[i]=M),(M=L.getResponseHeader("etag"))&&(k.etag[i]=M)),204===e||"HEAD"===p.type?w="nocontent":304===e?w="notmodified":(w=b.state,m=b.data,u=!(_=b.error))):(_=w,!e&&w||(w="error",e<0&&(e=0))),L.status=e,L.statusText=(t||w)+"",u?g.resolveWith(h,[m,w,L]):g.rejectWith(h,[L,w,_]),L.statusCode(v),v=void 0,c&&f.trigger(u?"ajaxSuccess":"ajaxError",[L,p,u?m:_]),y.fireWith(h,[L,w]),c&&(f.trigger("ajaxComplete",[L,p]),--k.active||k.event.trigger("ajaxStop")))}return L},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,t){k[t]=function(e,n,a,i){return y(n)&&(i=i||a,a=n,n=void 0),k.ajax(k.extend({url:e,type:t,dataType:i,data:n,success:a},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return y(e)?this.each(function(t){k(this).wrapInner(e.call(this,t))}):this.each(function(){var t=k(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=y(e);return this.each(function(n){k(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},It=k.ajaxSettings.xhr();g.cors=!!It&&"withCredentials"in It,g.ajax=It=!!It,k.ajaxTransport(function(e){var t,a;if(g.cors||It&&!e.crossDomain)return{send:function(i,s){var r,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)o[r]=e.xhrFields[r];for(r in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)o.setRequestHeader(r,i[r]);t=function(e){return function(){t&&(t=a=o.onload=o.onerror=o.onabort=o.ontimeout=o.onreadystatechange=null,"abort"===e?o.abort():"error"===e?"number"!=typeof o.status?s(0,"error"):s(o.status,o.statusText):s(Wt[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),a=o.onerror=o.ontimeout=t("error"),void 0!==o.onabort?o.onabort=a:o.onreadystatechange=function(){4===o.readyState&&n.setTimeout(function(){t&&a()})},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(a,i){t=k("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}});var qt,Bt=[],Ut=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Bt.pop()||k.expando+"_"+wt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,a){var i,s,r,o=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=y(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(Ut,"$1"+i):!1!==e.jsonp&&(e.url+=(kt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return r||k.error(i+" was not called"),r[0]},e.dataTypes[0]="json",s=n[i],n[i]=function(){r=arguments},a.always(function(){void 0===s?k(n).removeProp(i):n[i]=s,e[i]&&(e.jsonpCallback=t.jsonpCallback,Bt.push(i)),r&&y(s)&&s(r[0]),r=s=void 0}),"script"}),g.createHTMLDocument=((qt=r.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===qt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((a=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(a)):t=r),i=j.exec(e),s=!n&&[],i?[t.createElement(i[1])]:(i=Me([e],t,s),s&&s.length&&k(s).remove(),k.merge([],i.childNodes)));var a,i,s},k.fn.load=function(e,t,n){var a,i,s,r=this,o=e.indexOf(" ");return o>-1&&(a=ht(e.slice(o)),e=e.slice(0,o)),y(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),r.length>0&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){s=arguments,r.html(a?k("<div>").append(k.parseHTML(e)).find(a):e)}).always(n&&function(e,t){r.each(function(){n.apply(this,s||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(e){return k.grep(k.timers,function(t){return e===t.elem}).length},k.offset={setOffset:function(e,t,n){var a,i,s,r,o,l,u=k.css(e,"position"),d=k(e),c={};"static"===u&&(e.style.position="relative"),o=d.offset(),s=k.css(e,"top"),l=k.css(e,"left"),("absolute"===u||"fixed"===u)&&(s+l).indexOf("auto")>-1?(r=(a=d.position()).top,i=a.left):(r=parseFloat(s)||0,i=parseFloat(l)||0),y(t)&&(t=t.call(e,n,k.extend({},o))),null!=t.top&&(c.top=t | op-o.top+r),null!=t.left&&(c.left=t.left-o.left+i),"using"in t?t.using.call(e,c):d.css(c)}},k.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){k.offset.setOffset(this,e,t)});var t,n,a=this[0];return a?a.getClientRects().length?(t=a.getBoundingClientRect(),n=a.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,a=this[0],i={top:0,left:0};if("fixed"===k.css(a,"position"))t=a.getBoundingClientRect();else{for(t=this.offset(),n=a.ownerDocument,e=a.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position");)e=e.parentNode;e&&e!==a&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(a,"marginTop",!0),left:t.left-i.left-k.css(a,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===k.css(e,"position");)e=e.offsetParent;return e||we})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;k.fn[e]=function(a){return B(this,function(e,a,i){var s;if(v(e)?s=e:9===e.nodeType&&(s=e.defaultView),void 0===i)return s?s[t]:e[a];s?s.scrollTo(n?s.pageXOffset:i,n?i:s.pageYOffset):e[a]=i},e,a,arguments.length)}}),k.each(["top","left"],function(e,t){k.cssHooks[t]=qe(g.pixelPosition,function(e,n){if(n)return n=Ie(e,t),ze.test(n)?k(e).position()[t]+"px":n})}),k.each({Height:"height",Width:"width"},function(e,t){k.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,a){k.fn[a]=function(i,s){var r=arguments.length&&(n||"boolean"!=typeof i),o=n||(!0===i||!0===s?"margin":"border");return B(this,function(t,n,i){var s;return v(t)?0===a.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===i?k.css(t,n,o):k.style(t,n,i,o)},t,r?i:void 0,r)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){k.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,a){return this.on(t,e,n,a)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,a,i;if("string"==typeof t&&(n=e[t],t=e,e=n),y(e))return a=l.call(arguments,2),(i=function(){return e.apply(t||this,a.concat(l.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=C,k.isFunction=y,k.isWindow=v,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},void 0===(a=function(){return k}.apply(t,[]))||(e.exports=a);var Jt=n.jQuery,Xt=n.$;return k.noConflict=function(e){return n.$===k&&(n.$=Xt),e&&n.jQuery===k&&(n.jQuery=Jt),k},i||(n.jQuery=n.$=k),k})},kKHs:function(e,t,n){(function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})})(n("a2/B"))},lBDn:function(e,t){},lJ2Y:function(e,t,n){(function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},lomv:function(e,t,n){(function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function a(e,a,i,s){var r="";switch(i){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":return s?"sekunnin":"sekuntia";case"m":return s?"minuutin":"minuutti";case"mm":r=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":r=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":r=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":r=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":r=s?"vuoden":"vuotta"}return r=function(e,a){return e<10?a?n[e]:t[e]:e}(e,s)+" "+r}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},"mI+K":function(e,t,n){"use strict";function a(e){this.message=e}a.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},a.prototype.__CANCEL__=!0,e.exports=a},mmkS:function(e,t,n){"use strict";var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(){this.message="String contains an invalid character"}i.prototype=new Error,i.prototype.code=5,i.prototype.name="InvalidCharacterError",e.exports=function(e){for(var t,n,s=String(e),r="",o=0,l=a;s.charAt(0|o)||(l="=",o%1);r+=l.charAt(63&t>>8-o%1*8)){if((n=s.charCodeAt(o+=.75))>255)throw new i;t=t<<8|n}return r}},mn6i:function(e,t,n){(function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,a=this._calendarEl[e],i=t&&t.hours();return((n=a)instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(a=a.apply(t)),a.replace("{}",i%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})})(n("a2/B"))},nCEq:function(e,t){},nUiQ:function(e,t,n){"use strict";var a=n("S1cf"),i=n("ED/T"),s=n("OvAf"),r=n("BXyq");function o(e){var t=new s(e),n=i(s.prototype.request,t);return a.extend(n,s.prototype,t),a.extend(n,t),n}var l=o(r);l.Axios=s,l.create=function(e){return o(a.merge(r,e))},l.Cancel=n("mI+K"),l.CancelToken=n("tsWd"),l.isCancel=n("V3+0"),l.all=function(e){return Promise.all(e)},l.spread=n("X8jb"),e.exports=l,e.exports.default=l},of7D:function(e,t,n){(function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"ثانیه d%",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})})(n("a2/B"))},p9jn:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n("aKwh"),i={name:"manage_app",data:function(){return{activeIndex:"1"}},methods:{handleSelect:function(e,t){console.log(e,t)}},computed:Object.assign({},Object(a.c)({canManage:"auth/canManage",isAdmin:"auth/isAdmin"}))},s={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"manage_app"}},[e.canManage?n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-2 col-nav"},[n("el-menu",{staticClass:"el-menu-demo",attrs:{"default-active":e.activeIndex,router:!0},on:{select:e.handleSelect}},[n("el-menu-item",{attrs:{index:"/manage/news"}},[e._v("新聞管理 ")]),n("el-menu-item",{attrs:{index:"/manage/post"}},[e._v("文章管理 ")]),n("el-menu-item",{attrs:{index:"/manage/company"}},[e._v("攤位管理 ")]),n("el-menu-item",{attrs:{index:"/manage/expo"}},[e._v("展覽管理 ")]),n("el-menu-item",{attrs:{index:"/manage/cata"}},[e._v("類別管理")]),e.isAdmin?n("el-menu-item",{attrs:{index:"/manage/coupon"}},[e._v("Coupon管理 ")]):e._e(),e.isAdmin?n("el-menu-item",{attrs:{index:"/manage/regist"}},[e._v("參展報名")]):e._e(),e.isAdmin?n("el-menu-item",{attrs:{index:"/manage/user"}},[e._v("使用者管理")]):e._e()],1),e.isAdmin?e._e():n("p",{staticClass:"mt-4"},[e._v("(編輯帳號僅能管理文章與新聞)")]),n("auth_panel",{staticClass:"mt-4",attrs:{layout:"function"}}),n("router-link",{staticClass:"btn",attrs:{to:"/"}},[e._v("返回首頁")])],1),n("div",{staticClass:"col-sm-10 offset-2 col-content"},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n("router-view",{key:e.$route.path})],1)],1),n("div",{staticClass:"col-sm-12"},[n("el-footer")],1)])]):n("div",{staticClass:"container-fluid login"},[n("h1",[e._v("抱歉,你好像沒有管理權限 :(")]),n("auth_panel")],1)])},staticRenderFns:[]};var r=n("VU/8")(i,s,!1,function(e){n("uj4r")},null,null).exports,o=n("dZBD"),l=n.n(o),u=n("IcnI"),d=n("M4fF"),c=n.n(d),m={data:function(){return{currentPage:1,keyword:"",now_year:""}},created:function(){u.a.dispatch("manage/loadWebsite")},methods:{handleEdit:function(e){this.$router.push("/manage/post/"+e.id)},handleDelete:function(e,t){var n=this;this.$confirm("你確定要刪除嗎?").then(function(){l.a.post("/api/post/"+t.id,{_method:"DELETE",dataType:"JSON"}).then(function(e){n.$message.success("刪除完成"),n.$store.dispatch("loadWebsite")})})},filterYear:function(e,t){return t.year===e},filterStatus:function(e,t){return t.status===e},filterStickIndex:function(e,t){return t.stick_top_index==e},filterStickCata:function(e,t){return t.stick_top_cata==e},set_admin_lock:function(e){var t=this;this.isAdmin&&this.axios.patch("/api/post/"+e.id,{admin_lock:e.admin_lock}).then(function(){t.$message.success("文章"+(e.admin_lock?"鎖定":"解鎖")+"成功!")})}},computed:Object.assign({},Object(a.e)({posts:function(e){return e.manage.posts}}),Object(a.c)({isAdmin:"auth/isAdmin"}),{filteredPosts:function(){var e=this;return this.posts.filter(function(t){return""==e.keyword||-1!=JSON.stringify([t.title,t.company,t.hashtag,t.cata]).indexOf(e.keyword)}).filter(function(t){return""==e.now_year||t.year==e.now_year}).map(function(e){return Object.assign({},e,{status:"draft"==e.status?"草稿":"已發佈",cata:e.cata&&e.cata.name||"-",updated_at:e.updated_at||"-",admin_lock:!!e.admin_lock,hashtag:JSON.parse(e.hashtag||"[]").join(" , "),company:e.company&&e.company.name_cht||"-",stick_top_index:e.stick_top_index?"是":"",stick_top_cata:e.stick_top_cata?"是":""})}).slice().reverse()},chunkedPosts:function(){return c.a.chunk(this.filteredPosts,10)}}),watch:{}},_={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("h3",{staticClass:"mt-5"},[e._v("管理文章")]),n("el-input",{attrs:{placeholder:"輸入關鍵字"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),n("br"),n("router-link",{attrs:{to:"/manage/post/new"}},[n("el-button",{staticClass:"btn btn-primary",attrs:{type:"primary"}},[e._v("+ 新增文章")])],1),n("el-select",{model:{value:e.now_year,callback:function(t){e.now_year=t},expression:"now_year"}},[n("el-option",{attrs:{value:"",label:"所有文章"}}),n("el-option",{attrs:{value:"2020",label:"2020"}}),n("el-option",{attrs:{value:"2019",label:"2019"}}),n("el-option",{attrs:{value:"2018",label:"2018"}}),n("el-option",{attrs:{value:"2017",label:"2017"}}),n("el-option",{attrs:{value:"2016",label:"2016"}}),n("el-option",{attrs:{value:"2015",label:"2015"}})],1),n("br"),n("el-pagination",{attrs:{layout:"prev, pager, next","page-count":e.chunkedPosts.length,"current-page":e.currentPage,"pager-count":10},on:{"update:currentPage":function(t){e.currentPage=t}}}),n("el-table",{staticClass:"table",attrs:{data:e.chunkedPosts[e.currentPage-1],border:"border","max-height":"800","default-sort":{prop:"id",order:"descending"}}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))]),t.row.admin_lock?n("span",[n("span",[e._v(" ")]),n("i",{staticClass:"fa fa-lock",attrs:{title:"總編輯已鎖定"}})]):e._e()]}}])}),e.isAdmin?n("el-table-column",{attrs:{prop:"admin_lock",label:"鎖定",width:"60",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-switch",{on:{change:function(n){e.set_admin_lock(t.row)}},model:{value:t.row.admin_lock,callback:function(n){e.$set(t.row,"admin_lock",n)},expression:"scope.row.admin_lock"}})]}}])}):e._e(),n("el-table-column",{attrs:{prop:"status",label:"狀態",width:"70",filters:[{text:"草稿",value:"草稿"},{text:"已發佈",value:"已發佈"}],"filter-method":e.filterStatus,sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",{staticClass:"post_status",attrs:{"data-status":t.row.status}},[e._v(e._s(t.row.status))])]}}])}),n("el-table-column",{attrs:{prop:"company",label:"單位",width:"160",sortable:!0}}),n("el-table-column",{attrs:{prop:"title",label:"標題",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"cover",label:"封面",width:"120"},scopedSlots:e._u([{key:"default",fn:function(e){return[n("img",{staticClass:"cover",attrs:{src:e.row.cover}})]}}])}),n("el-table-column",{attrs:{prop:"cata",label:"類別",width:"80",sortable:!0}}),n("el-table-column",{attrs:{prop:"year",label:"年度",width:"60",filters:[{text:"2015",value:"2015"},{text:"2016",value:"2016"},{text:"2017",value:"2017"}],"filter-method":e.filterYear,sortable:!0}}),n("el-table-column",{attrs:{prop:"hashtag",label:"#Hash",sortable:!0}}),n("el-table-column",{attrs:{prop:"stick_top_index",label:"置頂",width:"70",sortable:!0}}),n("el-table-column",{attrs:{prop:"updated_at",label:"更新時間",width:"100",sortable:!0}}),n("el-table-column",{attrs:{label:"操作",width:"150",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[!t.row.admin_lock||e.isAdmin?n("span",[n("el-button",{attrs:{type:"secondary",size:"small"},on:{click:function(n){e.handleEdit(t.row)}}},[e._v("編輯")]),n("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(n){e.handleDelete(t.$index,t.row)}}},[e._v("刪除")])],1):n("div",[e._v("文章已鎖定 "),n("i",{staticClass:"fa fa-lock",attrs:{title:"總編輯已鎖定"}})])]}}])})],1)],1)},staticRenderFns:[]};var p=n("VU/8")(m,_,!1,function(e){n("CuaM")},null,null).exports,h={data:function(){return{keyword:"",now_year:""}},created:function(){u.a.dispatch("manage/loadWebsite")},methods:{handleEdit:function(e){this.$router.push("/manage/news/"+e.id)},handleDelete:function(e,t){var n=this;this.$confirm("你確定要刪除嗎?").then(function(){l.a.post("/api/news/"+t.id,{_method:"DELETE",dataType:"JSON"}).then(function(e){n.$message.success("刪除完成"),n.$store.dispatch("loadWebsite")})})},filterYear:function(e,t){return t.year===e},filterStatus:function(e,t){return t.status===e},filterStickIndex:function(e,t){return t.stick_top_index==e},filterStickCata:function(e,t){return t.stick_top_cata==e}},computed:Object.assign({},Object(a.e)({posts:function(e){return e.manage.news}}),{filteredPosts:function(){var e=this;return this.posts.filter(function(t){return""==e.keyword||-1!=JSON.stringify(t).indexOf(e.keyword)}).filter(function(t){return""==e.now_year||t.year==e.now_year}).map(function(e){return Object.assign({},e,{status:"draft"==e.status?"草稿":"已發佈",cata:e.cata&&e.cata.name||"-",updated_at:e.updated_at||"-",company:e.company&&e.company.name_cht||"-",stick_top_index:e.stick_top_index?"是":"",stick_top_cata:e.stick_top_cata?"是":"",stick_top_member:e.stick_top_member?"是":""})})}})},f={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("h3",{staticClass:"mt-5"},[e._v("管理新聞")]),n("el-input",{attrs:{placeholder:"輸入關鍵字"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),n("br"),n("router-link",{attrs:{to:"/manage/news/new"}},[n("el-button",{staticClass:"btn btn-primary",attrs:{type:"primary"}},[e._v("+ 新增新聞")])],1),n("br"),n("el-table",{attrs:{data:e.filteredPosts,border:"border","max-height":"800","default-sort":{prop:"id",order:"descending"}}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:!0}}),n("el-table-column",{attrs:{prop:"status",label:"狀態",width:"100",filters:[{text:"草稿",value:"草稿"},{text:"已發布",value:"已發布"}],"filter-method":e.filterStatus,sortable:!0}}),n("el-table-column",{attrs:{prop:"cata",label:"類別",width:"80",sortable:!0}}),n("el-table-column",{attrs:{prop:"cover",label:"封面",width:"120"},scopedSlots:e._u([{key:"default",fn:function(e){return[n("img",{staticClass:"cover",attrs:{src:e.row.cover}})]}}])}),n("el-table-column",{attrs:{prop:"title",label:"標題",sortable:!0}}),n("el-table-column",{attrs:{prop:"stick_top_index",label:"置頂",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"stick_top_member",label:"會員置頂",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"updated_at",label:"更新時間",width:"100",sortable:!0}}),n("el-table-column",{attrs:{label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){e.handleEdit(t.row)}}},[e._v("編輯")]),n("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(n){e.handleDelete(t.$index,t.row)}}},[e._v("刪除")])]}}])})],1)],1)},staticRenderFns:[]};var g=n("VU/8")(h,f,!1,function(e){n("9ZXp")},null,null).exports,y={data:function(){return{currentPage:1,keyword:"",now_year:""}},created:function(){u.a.dispatch("manage/loadWebsite")},methods:{handleEdit:function(e,t){console.log(t),this.$router.push("/manage/company/"+t.id)},filterYear:function(e,t){return t.year===e},handleDelete:function(e,t){var n=this;this.$confirm("你確定要刪除嗎?").then(function(){n.axios.post("/api/company/"+t.id,{_method:"DELETE",dataType:"JSON"}).then(function(e){n.$message.success("刪除完成"),n.$store.dispatch("loadWebsite")})})}},computed:Object.assign({},Object(a.e)({companies:function(e){return e.manage.companies}}),{filteredCompany:function(){var e=this;return this.companies.filter(function(t){return""==e.keyword||-1!=JSON.stringify(t).indexOf(e.keyword)}).filter(function(t){return""==e.now_year||t.year==e.now_year}).map(function(e){return Object.assign({},e)})},chunkedCompanies:function(){return c.a.chunk(this.filteredCompany,10)}})},v={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("h3",{staticClass:"mt-5"},[e._v("管理參展單位")]),n("el-input",{attrs:{placeholder:"輸入關鍵字"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),n("br"),n("router-link",{attrs:{to:"/manage/company/new"}},[n("el-button",{staticClass:"btn btn-primary",attrs:{type:"primary"}},[e._v("+ 新增單位")])],1),n("br"),n("el-pagination",{attrs:{layout:"prev, pager, next","page-count":e.chunkedCompanies.length,"current-page":e.currentPage,"pager-count":10},on:{"update:currentPage":function(t){e.currentPage=t}}}),n("el-table",{attrs:{data:e.chunkedCompanies[e.currentPage],border:"border","max-height":"800"}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:!0}}),n("el-table-column",{attrs:{prop:"name_cht",label:"名字",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"cover",label:"Logo",width:"120"},scopedSlots:e._u([{key:"default",fn:function(e){return[n("img",{staticClass:"cover",attrs:{src:e.row.logo}})]}}])}),n("el-table-column",{attrs:{prop:"year",label:"年度",width:"100",sortable:!0,filters:[{text:"2016",value:"2016"},{text:"2017",value:"2017"}],"filter-method":e.filterYear}}),n("el-table-column",{attrs:{prop:"discribe_cht",label:"中文敘述"}}),n("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{size:"mini"},on:{click:function(n){e.handleEdit(t.$index,t.row)}}},[e._v("編輯")]),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){e.handleDelete(t.$index,t.row)}}},[e._v("刪除")])]}}])})],1)],1)},staticRenderFns:[]};var b=n("VU/8")(y,v,!1,function(e){n("udNU")},null,null).exports,M={data:function(){return{keyword:"",now_year:"2016"}},mounted:function(){},methods:{handleEdit:function(e){this.$router.push("/company/"+e.id)},filterYear:function(e,t){return t.year===e}},computed:Object.assign({},Object(a.e)({catas:function(e){return e.manage.catas}}))},w={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("h3",{staticClass:"mt-5"},[e._v("管理類別")]),n("el-input",{attrs:{placeholder:"輸入關鍵字"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),n("br"),n("br"),n("el-table",{attrs:{data:e.catas,border:"border"}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:"sortable"}}),n("el-table-column",{attrs:{prop:"name",label:"名字",width:"200",sortable:"sortable"}}),n("el-table-column",{attrs:{prop:"year",label:"年份",width:"60",sortable:"sortable"}})],1)],1)},staticRenderFns:[]};var k=n("VU/8")(M,w,!1,function(e){n("TkXE")},null,null).exports,L=n("ujpI"),x=n.n(L),T={props:["output","update_obj","set_pic","ar_id"],name:"default_pic_selector",data:function(){return{default_set:["siteimage1.jpg","siteimage10.jpg","siteimage11.jpg","siteimage12.jpg","siteimage13.jpg","siteimage14.jpg","siteimage15.jpg","siteimage16.jpg","siteimage2.jpg","siteimage3.jpg","siteimage4.jpg","siteimage5.jpg","siteimage6.jpg","siteimage7.jpg","siteimage8.jpg","siteimage9.jpg"],status:{open:!1},now_index:0,hash:parseInt(1e6*Math.random())}},mounted:function(){var e=this;console.log("picture picker mounted."),function(e,t){console.log(e);var n=new x.a(e,{headers:{},url:"https://service.zashare.org/api/upload",maxFiles:1,sending:function(){},success:function(e,n){t(e,n)}});n.on("complete",function(e){n.removeFile(e)})}(".btn-dropzone[data-hash='"+this.hash+"']",function(t,n){var a=n;console.log(a),e.$emit("select_pic",{url:a}),e.update_obj&&(console.log(e.update_obj),e.update_obj.obj[e.update_obj.tagkey]=a)})},methods:{css_default_block:function(e){return{"background-image":"url("+e+")","background-size":"cover",width:"100px",height:"100px",margin:"5px",display:"inline-block",cursor:"pointer"}},delta:function(e){e>0&&this.now_index<1?this.now_index+=e:e<0&&this.now_index>0&&(this.now_index+=e)}}},Y={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"default_pic_selector"},[n("div",{staticClass:"btn-groups"},[n("div",{staticClass:"btn-dropzone",staticStyle:{cursor:"pointer"},attrs:{"data-hash":e.hash}},[e._v("上傳")])]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.status.open,expression:"status.open"}],staticClass:"panel"},[n("div",{staticClass:"panel_body"},[e._l(e.default_set.slice(16*e.now_index,16*(e.now_index+1)),function(t){return n("div",{style:e.css_default_block("/img/default/icon/"+t)})}),n("div",[n("div",{staticClass:"btn pull_left",on:{click:function(t){e.delta(-1)}}},[e._v("<")]),n("div",{staticClass:"btn pull_right",on:{click:function(t){e.delta(1)}}},[e._v(">")])])],2)])])},staticRenderFns:[]},D=n("VU/8")(T,Y,!1,null,null,null).exports,S={data:function(){return{keyword:"",now_year:"2016",coupontypes:[],showUsersFullpage:!1,newCoupon:{user_can_get:["studentcard"],resuable:!1},default_usergroup:[{value:"studentcard",label:"有學生證會員"},{value:"admin",label:"管理員"},{value:"all",label:"所有會員"}],users:[]}},created:function(){this.loadAll()},methods:{showUsers:function(e){var t=this;l.a.post("/api/coupontype/getusers/"+e.id,{token:this.token}).then(function(n){console.log(n.data),t.users=n.data,"single_time_hash"==e.type?t.users.forEach(function(t){t.coupon=e.coupons.find(function(e){return e.user_id==t.id}).coupon}):t.users.forEach(function(t){t.coupon=e.coupons[0].coupon}),t.showUsersFullpage=!0})},getUserLength:function(e){return e?JSON.parse(e).length:0},select_pic:function(e){console.log(e),this.$set(this.newCoupon,"cover",e.url)},getCouponTotal:function(e){return{got:e.coupons.filter(function(e){return e.user_id}).length,total:e.coupons.length}},addCouponType:function(){var e=this;l.a.post("/api/coupontype",Object.assign({},{token:this.token},this.newCoupon,{user_can_get:JSON.stringify(this.newCoupon.user_can_get)})).then(function(t){console.log(t.data),e.loadAll()})},loadAll:function(){var e=this;l.a.get("/api/coupontype",{params:{token:this.token}}).then(function(t){e.coupontypes=t.data,e.$message.success("新增成功")})},handleDelete:function(e){var t=this;this.$confirm("你確定要刪除嗎?").then(function(){t.axios.post("/api/coupontype/"+e,{_method:"DELETE",token:t.token,dataType:"JSON"}).then(function(e){t.$message.success("刪除完成"),t.loadAll()})})}},computed:Object.assign({},Object(a.e)({catas:function(e){return e.manage.catas},token:function(e){return e.auth.token}})),components:{default_pic_selector:D}},C={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h3",{staticClass:"mt-5"},[e._v("管理Coupon")]),n("br"),n("full_page",{attrs:{show:e.showUsersFullpage},on:{closeFullpage:function(t){e.showUsersFullpage=!1}}},[n("el-table",{attrs:{data:e.users,"max-height":"600"}},[n("el-table-column",{attrs:{prop:"id",label:"#"}}),n("el-table-column",{attrs:{prop:"name",label:"名字"}}),n("el-table-column",{attrs:{prop:"birthday",label:"生日"}}),n("el-table-column",{attrs:{prop:"email",label:"信箱"}}),n("el-table-column",{attrs:{prop:"phone",label:"電話"}}),n("el-table-column",{attrs:{prop:"coupon",label:"Coupon"}})],1)],1)],1)]),n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("h4",[e._v("Coupon清單")]),n("el-table",{attrs:{data:e.coupontypes}},[n("el-table-column",{attrs:{prop:"title",label:"名稱"}}),n("el-table-column",{attrs:{prop:"user_can_get",label:"領取資格"}}),n("el-table-column",{attrs:{prop:"type",label:"類型"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s("single_time_hash"==t.row.type?"批次序號 / 單次使用":"單一序號 / 多次領取")),n("br")])]}}])}),n("el-table-column",{attrs:{prop:"type",label:"已領取",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return["single_time_hash"==t.row.type?n("span",[e._v(e._s(e.getCouponTotal(t.row).got)+" / "+e._s(t.row.coupons.length))]):n("span",[e._v(e._s(e.getUserLength(t.row.users))+" / -")])]}}])}),n("el-table-column",{attrs:{prop:"active_datetime",label:"啟用時間"}}),n("el-table-column",{attrs:{prop:"expiry_datetime",label:"結束時間"}}),n("el-table-column",{attrs:{label:"功能",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"danger"},on:{click:function(n){e.handleDelete(t.row.id)}}},[e._v("刪除")]),n("el-button",{on:{click:function(n){e.showUsers(t.row)}}},[e._v("顯示領取名單")])]}}])})],1)],1),n("div",{staticClass:"col-sm-12"},[n("h4",{staticClass:"mt-5"},[e._v("新增coupon群組")]),n("el-form",{staticClass:"row",attrs:{"label-width":"150px"}},[n("div",{staticClass:"col-sm-6"},[n("el-form-item",{attrs:{label:"標題"}},[n("el-input",{model:{value:e.newCoupon.title,callback:function(t){e.$set(e.newCoupon,"title",t)},expression:"newCoupon.title"}})],1),n("el-form-item",{attrs:{label:"類別"}},[n("el-select",{model:{value:e.newCoupon.type,callback:function(t){e.$set(e.newCoupon,"type",t)},expression:"newCoupon.type"}},[n("el-option",{attrs:{value:"single_time_hash",label:"批次序號 / 單次使用"}}),n("el-option",{attrs:{value:"multi_time_single_hash",label:"單一序號 / 多次領取"}})],1)],1),n("el-form-item",{attrs:{label:"可領取用戶別"}},[n("el-select",{attrs:{multiple:"multiple",filterable:"filterable","default-first-option":"default-first-option",placeholder:"請選擇群組"},model:{value:e.newCoupon.user_can_get,callback:function(t){e.$set(e.newCoupon,"user_can_get",t)},expression:"newCoupon.user_can_get"}},e._l(e.default_usergroup,function(e){return n("el-option",{key:e,attrs:{label:e.label,value:e.value}})}))],1),n("el-form-item",{attrs:{label:"開始時間"}},[n("el-date-picker",{attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.newCoupon.active_datetime,callback:function(t){e.$set(e.newCoupon,"active_datetime",t)},expression:"newCoupon.active_datetime"}})],1),n("el-form-item",{attrs:{label:"失效時間"}},[n("el-date-picker",{attrs:{type:"datetime","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.newCoupon.expiry_datetime,callback:function(t){e.$set(e.newCoupon,"expiry_datetime",t)},expression:"newCoupon.expiry_datetime"}})],1)],1),n("div",{staticClass:"col-sm-6"},[n("el-form-item",{attrs:{label:"封面圖片"}},[n("el-input",{model:{value:e.newCoupon.cover,callback:function(t){e.$set(e.newCoupon,"cover",t)},expression:"newCoupon.cover"}},[n("default_pic_selector",{attrs:{slot:"append"},on:{select_pic:e.select_pic},slot:"append"})],1),n("img",{staticStyle:{width:"100%","max-width":"100px"},attrs:{src:e.newCoupon.cover}})],1),n("el-form-item",{attrs:{label:"說明"}},[n("el-input",{model:{value:e.newCoupon.description,callback:function(t){e.$set(e.newCoupon,"description",t)},expression:"newCoupon.description"}})],1),n("el-form-item",{attrs:{label:"coupon序號"}},["single_time_hash"==e.newCoupon.type?n("el-input",{attrs:{type:"textarea",placeholder:"(從excel直接複製或以換行分隔)",rows:5},model:{value:e.newCoupon.coupons,callback:function(t){e.$set(e.newCoupon,"coupons",t)},expression:"newCoupon.coupons"}}):e._e(),"multi_time_single_hash"==e.newCoupon.type?n("el-input",{attrs:{placeholder:"請輸入單個序號"},model:{value:e.newCoupon.coupons,callback:function(t){e.$set(e.newCoupon,"coupons",t)},expression:"newCoupon.coupons"}}):e._e()],1)],1),n("el-button",{attrs:{type:"primary"},on:{click:e.addCouponType}},[e._v("新增類別")])],1),n("hr")],1)])])])},staticRenderFns:[]};var j=n("VU/8")(S,C,!1,function(e){n("73uB")},null,null).exports,E={data:function(){return{keyword:"",activeName:"regist",now_year:"2016",registexpos:[],statuses:[{label:"甄選中",value:"selecting"},{label:"入選",value:"selected"},{label:"未入選",value:"not-selected"},{label:"取消",value:"cancel"},{label:"合作",value:"cooperation"},{label:"贊助",value:"sponsor"},{label:"其他",value:"other"},{label:"-",value:""}]}},created:function(){console.log("loag"),this.loadAll()},methods:{getStatus:function(e){return this.statuses.find(function(t){return t.value==e})},filterYear:function(e,t){return t.year===e},loadAll:function(){var e=this;l.a.get("/api/registexpo",{params:{token:this.token}}).then(function(t){e.$set(e,"registexpos",t.data)})},handleClick:function(e,t){console.log(e,t)},uploadPaidStatus:function(e){var t=this;console.log("upload status!!!!!!!!"),l.a.post("/api/confirmPaid",{id:e.row.id,value:e.row.confirmed,token:this.token}).then(function(e){console.log(e.data),"success"==e.data.status?(t.loadAll(),t.$message({message:"更新成功",type:"success"})):t.$message({message:"更新狀態失敗",type:"error"})})}},computed:Object.assign({},Object(a.e)({catas:function(e){return e.manage.catas},token:function(e){return e.auth.token}}),{filteredRegistexpo:function(){var e=this;return(this.registexpos||[]).filter(function(t){return""==e.keyword||-1!=JSON.stringify(t).indexOf(e.keyword)}).map(function(e){var t="✖︎未回報";return e.paid_record&&e.paid_record.id&&(t=e.paid_record.confirmed?"✔︎已確認":"待確認"),Object.assign({},e,{paid_record_status:t})})},paidRecords:function(){return this.filteredRegistexpo.map(function(e){return Object.assign({},{registid:e.id,registname:e.name_cht},e.paid_record,{confirmed:!(!e.paid_record||!e.paid_record.confirmed)})}).filter(function(e){return e.id})},workshops:function(){return this.filteredRegistexpo.map(function(e){return Object.assign({},{registid:e.id,registname:e.name_cht},e.regist_workshop)}).filter(function(e){return e.id})},registSpeaks:function(){return this.filteredRegistexpo.map(function(e){return Object.assign({},{registid:e.id,registname:e.name_cht},e.regist_expo_speak)}).filter(function(e){return e.id})}})},P={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("h3",{staticClass:"mt-5"},[e._v("管理2018報名紀錄")]),n("el-input",{attrs:{placeholder:"輸入關鍵字"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),n("br"),n("el-tabs",{staticClass:"mt-5 mb-3",on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[n("el-tab-pane",{attrs:{label:"報名紀錄",name:"regist"}},[e._v("報名紀錄"),n("csv_export",{attrs:{data:e.filteredRegistexpo,title:"報名紀錄"}}),n("el-table",{attrs:{data:e.filteredRegistexpo,border:"border"}},[n("el-table-column",{attrs:{prop:"id",label:"編號",width:"80",sortable:!0}}),n("el-table-column",{attrs:{prop:"is_foreign",label:"國外",width:"80",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.is_foreign?"是":"否"))])]}}])}),n("el-table-column",{attrs:{prop:"status",label:"狀態",width:"120",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.getStatus(t.row.status).label))])]}}])}),n("el-table-column",{attrs:{prop:"paid_record_status",label:"繳款狀態",width:"120",sortable:!0}}),n("el-table-column",{attrs:{prop:"name_cht",label:"中文",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"name_eng",label:"英文",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"type",label:"單位種類",width:"250",sortable:!0}}),n("el-table-column",{attrs:{prop:"theme",label:"類別",width:"120",sortable:!0}}),n("el-table-column",{attrs:{prop:"file_proposal",label:"簡報",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("a",{attrs:{href:e.apiDomain+t.row.file_proposal.replace("/storage/app/public","storage"),target:"_href"}},[e._v("連結")])]}}])}),n("el-table-column",{attrs:{prop:"main_contact_name",label:"主要聯絡人",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"main_contact_email",label:"主要信箱",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"secondary_contact_name",label:"次要聯絡人",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"secondary_contact_email",label:"次要信箱",width:"200",sortable:!0}})],1)],1),n("el-tab-pane",{attrs:{label:"繳費記錄",name:"paidrecord"}},[e._v("繳費記錄"),n("csv_export",{attrs:{data:e.paidRecords,title:"繳費記錄"}}),n("el-table",{attrs:{data:e.paidRecords,border:"border"}},[n("el-table-column",{attrs:{prop:"registid",label:"報名編號",width:"120",sortable:!0}}),n("el-table-column",{attrs:{prop:"status",label:"狀態",width:"120",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.getStatus(t.row.status).label))])]}}])}),n("el-table-column",{attrs:{prop:"registname",label:"攤位名稱",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"paid_datetime",label:"確認繳費",width:"160",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("div",[t.row.confirmed?n("span",{staticClass:"mr-1"},[e._v("✔︎ 已確認")]):n("span",{staticClass:"mr-1"},[e._v("未確認")]),n("el-switch",{on:{change:function(n){e.uploadPaidStatus(t)}},model:{value:t.row.confirmed,callback:function(n){e.$set(t.row,"confirmed",n)},expression:"scope.row.confirmed"}})],1)]}}])}),n("el-table-column",{attrs:{prop:"paid_amount",label:"繳費金額",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"paid_datetime",label:"繳費時間",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"paid_direct",label:"臨櫃匯款",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.paid_direct?"是":"否"))])]}}])}),n("el-table-column",{attrs:{prop:"paid_name",label:"名字",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"paid_last_number",label:"後五碼",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"receipt_type",label:"發票種類",width:"120",sortable:!0}})],1)],1),n("el-tab-pane",{attrs:{label:"雜工坊報名",name:"workshop"}},[e._v("雜工坊報名"),n("csv_export",{attrs:{data:e.workshops,title:"雜工坊報名"}}),n("el-table",{attrs:{data:e.workshops,border:"border"}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:!0}}),n("el-table-column",{attrs:{prop:"registid",label:"報名編號",width:"120",sortable:!0}}),n("el-table-column",{attrs:{prop:"status",label:"狀態",width:"120",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.getStatus(t.row.status).label))])]}}])}),n("el-table-column",{attrs:{prop:"registname",label:"攤位名稱",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"class_type",label:"課程類型",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"audience_normal",label:"活動招生族群",width:"160"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.audience_normal||"無限制"))])]}}])}),n("el-table-column",{attrs:{prop:"class_person_count",label:"預計人數",width:"130",sortable:!0}}),n("el-table-column",{attrs:{prop:"class_proposal",label:"提案簡報",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("a",{attrs:{href:e.apiDomain+t.row.class_proposal.replace("/storage/app/public","storage"),target:"_href"}},[e._v("連結")])]}}])}),n("el-table-column",{attrs:{prop:"main_contact_name",label:"主要聯絡人",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"main_contact_email",label:"主要信箱",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"secondary_contact_name",label:"次要聯絡人",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"secondary_contact_email",label:"次要信箱",width:"200",sortable:!0}})],1)],1),n("el-tab-pane",{attrs:{label:"Zac.",name:"zac"}},[e._v("Zac."),n("csv_export",{attrs:{data:e.registSpeaks,title:"Zac."}}),n("el-table",{attrs:{data:e.registSpeaks,border:"border"}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:!0}}),n("el-table-column",{attrs:{prop:"registid",label:"報名編號",width:"120",sortable:!0}}),n("el-table-column",{attrs:{prop:"status",label:"狀態",width:"120",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(e.getStatus(t.row.status).label))])]}}])}),n("el-table-column",{attrs:{prop:"registname",label:"攤位名稱",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"agree_plan",label:"同意策展權益",width:"130",sortable:!0},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.agree_plan?"是":"否"))])]}}])}),n("el-table-column",{attrs:{prop:"startup_content",label:"創業內容",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"startup_problem",label:"想解決的問題",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"startup_proposal",label:"提案簡報",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("a",{attrs:{href:e.apiDomain+t.row.startup_proposal.replace("/storage/app/public","storage"),target:"_href"}},[e._v("連結")])]}}])}),n("el-table-column",{attrs:{prop:"main_contact_name",label:"主要聯絡人",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"main_contact_email",label:"主要信箱",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"secondary_contact_name",label:"次要聯絡人",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"secondary_contact_email",label:"次要信箱",width:"200",sortable:!0}})],1)],1)],1)],1)},staticRenderFns:[]};var O=n("VU/8")(E,P,!1,function(e){n("35Mi")},null,null).exports,H=n("aYpo"),A=(n("7t+N"),H.Quill.import("blots/block")),F=H.Quill.import("parchment"),$=H.Quill.import("delta"),R=H.Quill.import("blots/break"),z=H.Quill.import("blots/embed"),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(A);function W(){var e=new $;return e.insert({break:""}),e}N.blotName="my-thing",N.className="quote",N.tagName="p",H.Quill.register(N),R.prototype.insertInto=function(e,t){z.prototype.insertInto.call(this,e,t)},R.prototype.length=function(){return 1},R.prototype.value=function(){return"\n"};var I={data:function(){return{customToolbar:[["bold","italic","underline","strike"],["my-thing"],["blockquote","code-block","image","video","link"],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"]],editorSettings:{modules:{clipboard:{matchers:[["BR",W]]},keyboard:{bindings:{handleEnter:{key:13,handler:function(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var a=Object.keys(t.format).reduce(function(e,n){return F.query(n,F.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{}),i=this.quill.getText(e.index-1,1);this.quill.insertText(e.index,"\n",a,H.Quill.sources.USER),""==i||"\n"==i?this.quill.setSelection(e.index+2,H.Quill.sources.SILENT):this.quill.setSelection(e.index+1,H.Quill.sources.SILENT),this.quill.selection.scrollIntoView(),Object.keys(t.format).forEach(function(e){null==a[e]&&(Array.isArray(t.format[e])||"link"!==e&&n.quill.format(e,t.format[e],H.Quill.sources.USER))})}},linebreak:{key:13,shiftKey:!0,handler:function(e,t){var n=this.quill.getText(e.index+1,1);this.quill.insertEmbed(e.index,"break",!0,"user");if(0==n.length)this.quill.insertEmbed(e.index,"break",!0,"user");this.quill.setSelection(e.index+1,H.Quill.sources.SILENT)}}}}}},keyword:"",now_year:"2016",expos:[],currentExpo:null,newExpo:null}},created:function(){this.loadAll()},methods:{getUserLength:function(e){return e?JSON.parse(e).length:0},select_pic:function(e){console.log(e),this.$set(this.newExpo,"cover",e.url)},select_pic_report:function(e){console.log(e),this.$set(this.newExpo,"report_cover",e.url)},getexpoTotal:function(e){return{got:e.expos.filter(function(e){return e.user_id}).length,total:e.expos.length}},addNewExpo:function(){this.newExpo={}},postExpo:function(){var e=this;(this.newExpo.id?l.a.patch:l.a.post)("/api/expo"+(this.newExpo.id?"/"+this.newExpo.id:""),{token:this.token,data:this.newExpo}).then(function(t){e.$message.success("儲存成功"),console.log(t.data),e.loadAll(),e.newExpo=null})},loadAll:function(){var e=this;l.a.get("/api/expo",{params:{token:this.token}}).then(function(t){e.expos=t.data})},handleDelete:function(e){var t=this;this.$confirm("你確定要刪除嗎?").then(function(){t.axios.post("/api/expo/"+e,{_method:"DELETE",token:t.token,dataType:"JSON"}).then(function(e){t.$message.success("刪除完成"),t.loadAll()})})}},computed:Object.assign({},Object(a.e)({catas:function(e){return e.manage.catas},token:function(e){return e.auth.token}})),components:{default_pic_selector:D,VueEditor:H.VueEditor}},q={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-post text-left"},[n("div",{staticClass:"container-fluid"},[e._m(0),n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("el-table",{staticClass:"table",attrs:{data:e.expos}},[n("el-table-column",{attrs:{prop:"year",label:"年度",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"label",label:"標題"}}),n("el-table-column",{attrs:{prop:"cover",label:"封面"},scopedSlots:e._u([{key:"default",fn:function(e){return[n("img",{staticClass:"cover",attrs:{src:e.row.cover}})]}}])}),n("el-table-column",{attrs:{prop:"title",label:"中文slogan"}}),n("el-table-column",{attrs:{prop:"place",label:"地點"}}),n("el-table-column",{attrs:{prop:"start_date",label:"開始日期"}}),n("el-table-column",{attrs:{prop:"end_date",label:"結束日期"}}),n("el-table-column",{attrs:{prop:"label",label:"編輯",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{on:{click:function(n){e.newExpo=t.row}}},[e._v("編輯")]),n("el-button",{attrs:{type:"danger"},on:{click:function(n){e.handleDelete(t.row.id)}}},[e._v("刪除")])]}}])})],1),n("el-button",{staticClass:"w100",attrs:{type:"primary"},on:{click:e.addNewExpo}},[e._v("+ 新增資料")])],1),e.newExpo?n("div",{staticClass:"col-sm-12"},[n("h3",{staticClass:"mt-5"},[e._v(e._s((e.newExpo.id?"編輯資料--":"新增資料--")+e.newExpo.year+" | "+e.newExpo.title))]),n("el-form",{staticClass:"row",attrs:{"label-width":"150px"}},[n("div",{staticClass:"col-sm-4"},[n("el-form-item",{attrs:{label:"年度"}},[n("el-input",{model:{value:e.newExpo.year,callback:function(t){e.$set(e.newExpo,"year",t)},expression:"newExpo.year"}})],1),n("el-form-item",{attrs:{label:"標題"}},[n("el-input",{attrs:{placeholder:"雜學校第二屆"},model:{value:e.newExpo.label,callback:function(t){e.$set(e.newExpo,"label",t)},expression:"newExpo.label"}})],1),n("el-form-item",{attrs:{label:"中文Slogan"}},[n("el-input",{attrs:{placeholder:"有敢擇學"},model:{value:e.newExpo.title,callback:function(t){e.$set(e.newExpo,"title",t)},expression:"newExpo.title"}})],1),n("el-form-item",{attrs:{label:"英文Slogan"}},[n("el-input",{attrs:{placeholder:"Try Try See !"},model:{value:e.newExpo.title_eng,callback:function(t){e.$set(e.newExpo,"title_eng",t)},expression:"newExpo.title_eng"}})],1),n("el-form-item",{attrs:{label:"精神"}},[n("el-input",{attrs:{placeholder:"年度精神提倡「有敢擇學 」"},model:{value:e.newExpo.spirit,callback:function(t){e.$set(e.newExpo,"spirit",t)},expression:"newExpo.spirit"}})],1),n("el-form-item",{attrs:{label:"開始日期"}},[n("el-date-picker",{attrs:{type:"date","value-format":"yyyy-MM-dd"},model:{value:e.newExpo.start_date,callback:function(t){e.$set(e.newExpo,"start_date",t)},expression:"newExpo.start_date"}})],1),n("el-form-item",{attrs:{label:"結束日期"}},[n("el-date-picker",{attrs:{type:"date","value-format":"yyyy-MM-dd"},model:{value:e.newExpo.end_date,callback:function(t){e.$set(e.newExpo,"end_date",t)},expression:"newExpo.end_date"}})],1)],1),n("div",{staticClass:"col-sm-8"},[n("el-form-item",{attrs:{label:"地點"}},[n("el-input",{model:{value:e.newExpo.place,callback:function(t){e.$set(e.newExpo,"place",t)},expression:"newExpo.place"}})],1),n("el-form-item",{attrs:{label:"特色(換行分隔)"}},[n("el-input",{attrs:{type:"textarea",rows:4},model:{value:e.newExpo.features,callback:function(t){e.$set(e.newExpo,"features",t)},expression:"newExpo.features"}})],1),n("el-form-item",{attrs:{label:"詳細資訊"}},[n("VueEditor",{staticClass:"ve",staticStyle:{height:"300px","margin-bottom":"50px"},attrs:{id:"content",useCustomImageHandler:!0,editorToolbar:e.customToolbar,editorOptions:e.editorSettings},on:{imageAdded:e.handleImageAdded},model:{value:e.newExpo.content,callback:function(t){e.$set(e.newExpo,"content",t)},expression:"newExpo.content"}})],1),n("el-form-item",{attrs:{label:"封面圖片"}},[n("el-input",{model:{value:e.newExpo.cover,callback:function(t){e.$set(e.newExpo,"cover",t)},expression:"newExpo.cover"}},[n("default_pic_selector",{attrs:{slot:"append"},on:{select_pic:e.select_pic},slot:"append"})],1),n("img",{staticStyle:{width:"100%","max-width":"100px"},attrs:{src:e.newExpo.cover}})],1),n("el-form-item",{attrs:{label:"About封面圖片"}},[n("el-input",{model:{value:e.newExpo.report_cover,callback:function(t){e.$set(e.newExpo,"report_cover",t)},expression:"newExpo.report_cover"}},[n("default_pic_selector",{attrs:{slot:"append"},on:{select_pic:e.select_pic_report},slot:"append"})],1),n("img",{staticStyle:{width:"100%","max-width":"100px"},attrs:{src:e.newExpo.report_cover}})],1)],1)]),n("el-button",{attrs:{type:"primary"},on:{click:e.postExpo}},[e._v("更新資訊")]),n("hr")],1):e._e()])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"row"},[t("div",{staticClass:"col-sm-12"},[t("h3",{staticClass:"mt-5"},[this._v("展覽資料管理")]),t("br")])])}]};var B=n("VU/8")(I,q,!1,function(e){n("2oq1")},null,null).exports,U={data:function(){return{users:[],keyword:"",currentPage:1}},created:function(){var e=this;l.a.get("/api/user",{params:{token:this.token}}).then(function(t){e.users=t.data})},methods:{},computed:Object.assign({},Object(a.e)({token:function(e){return e.auth.token}}),{filteredUser:function(){var e=this;return this.users.filter(function(t){return""==e.keyword||-1!=JSON.stringify(t).indexOf(e.keyword)}).map(function(e){return Object.assign({},e)})},chunkedUsers:function(){return c.a.chunk(this.filteredUser,10)}})},J={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"page manage-user text-left"},[n("h3",{staticClass:"mt-5"},[e._v("管理使用者")]),n("el-input",{attrs:{placeholder:"輸入關鍵字"},model:{value:e.keyword,callback:function(t){e.keyword=t},expression:"keyword"}}),n("br"),n("br"),n("csv_export",{attrs:{data:e.users,title:"使用者清單"}}),n("el-pagination",{attrs:{layout:"prev, pager, next","page-count":e.chunkedUsers.length,"current-page":e.currentPage,"pager-count":10},on:{"update:currentPage":function(t){e.currentPage=t}}}),n("el-table",{attrs:{data:e.chunkedUsers[e.currentPage-1],border:"border","max-height":"800"}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"60",sortable:!0}}),n("el-table-column",{attrs:{prop:"name",label:"名字",width:"150",sortable:!0}}),n("el-table-column",{attrs:{prop:"email",label:"Email",width:"300",sortable:!0}}),n("el-table-column",{attrs:{prop:"job",label:"職業",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"jobcata",label:"職業類別",width:"200",sortable:!0}}),n("el-table-column",{attrs:{prop:"birthday",label:"生日",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"phone",label:"手機",width:"100",sortable:!0}}),n("el-table-column",{attrs:{prop:"created_at",label:"註冊時間",width:"160",sortable:!0}}),n("el-table-column",{attrs:{prop:"group",label:"權限",width:"100",sortable:!0}})],1)],1)},staticRenderFns:[]};var X=n("VU/8")(U,J,!1,function(e){n("zZ2h")},null,null).exports,V=H.Quill.import("blots/block"),Z=H.Quill.import("parchment"),G=H.Quill.import("delta"),K=H.Quill.import("blots/break"),Q=H.Quill.import("blots/embed"),ee=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(V);function te(){var e=new G;return e.insert({break:""}),e}ee.blotName="my-thing",ee.className="quote",ee.tagName="p",H.Quill.register(ee),K.prototype.insertInto=function(e,t){Q.prototype.insertInto.call(this,e,t)},K.prototype.length=function(){return 1},K.prototype.value=function(){return"\n"};var ne={data:function(){return{customToolbar:[["bold","italic","underline","strike"],["my-thing"],["blockquote","code-block","image","video","link"],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"]],editorSettings:{modules:{clipboard:{matchers:[["BR",te]]},keyboard:{bindings:{handleEnter:{key:13,handler:function(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var a=Object.keys(t.format).reduce(function(e,n){return Z.query(n,Z.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{}),i=this.quill.getText(e.index-1,1);this.quill.insertText(e.index,"\n",a,H.Quill.sources.USER),""==i||"\n"==i?this.quill.setSelection(e.index+2,H.Quill.sources.SILENT):this.quill.setSelection(e.index+1,H.Quill.sources.SILENT),this.quill.selection.scrollIntoView(),Object.keys(t.format).forEach(function(e){null==a[e]&&(Array.isArray(t.format[e])||"link"!==e&&n.quill.format(e,t.format[e],H.Quill.sources.USER))})}},linebreak:{key:13,shiftKey:!0,handler:function(e,t){var n=this.quill.getText(e.index+1,1);this.quill.insertEmbed(e.index,"break",!0,"user");if(0==n.length)this.quill.insertEmbed(e.index,"break",!0,"user");this.quill.setSelection(e.index+1,H.Quill.sources.SILENT)}}}}}},post:{year:"2017",established_time:(new Date).toLocaleDateString(),short_description:"",hashtag:[]},create_mode:!1,quill_editor:null}},mounted:function(){var e=this;this.$route.params.id?this.axios.get("/api/"+this.$route.meta.type+"/"+this.$route.params.id).then(function(t){e.post=t.data,e.post.stick_top_index=!!e.post.stick_top_index,e.post.stick_top_cata=!!e.post.stick_top_cata,e.post.stick_top_member=!!e.post.stick_top_member,e.post.admin_lock=!!e.post.admin_lock,e.post.hashtag||(e.post.hashtag=[]),e.post.admin_lock&&0==e.isAdmin&&(e.$message.error("此文章已經鎖定(總編)"),e.$router.push(-1)),"string"==typeof e.post.hashtag&&(e.post.hashtag=JSON.parse(e.post.hashtag))}):this.create_mode=!0},components:{VueEditor:H.VueEditor,default_pic_selector:D},methods:{select_pic:function(e){console.log(e),this.post.cover=e.url},getPreviewRoute:function(e){return"post"==this.$route.meta.type?"/expo/"+this.$route.meta.year+"/blog/"+e.id:"news"==this.$route.meta.type?"/news/"+e.id:void 0},handleSave:function(){var e=this;this.create_mode?this.axios.post("/api/"+this.$route.meta.type,this.post).then(function(t){e.$message({message:"建立成功",type:"success"}),console.log(t.data.data.id),e.$router.push("/manage/"+e.$route.meta.type+"/"+t.data.data.id)}):this.axios.patch("/api/"+this.$route.meta.type+"/"+this.$route.params.id,this.post).then(function(t){console.log(t.data),"success"==t.data.status?e.$message({message:"儲存成功",type:"success"}):e.$message.error({message:"儲存失敗"})})}},computed:Object.assign({},Object(a.e)({companies:function(e){return e.manage.companies},catas:function(e){return e.manage.catas},default_hashtags:function(e){return e.default_hashtags}}),Object(a.c)({isAdmin:"auth/isAdmin",isEditor:"auth/isEditor"}),{year_catas:function(){var e=this;return"news"==this.$route.meta.type?(this.catas||[]).filter(function(e){return"news"==e.year}):(this.catas||[]).filter(function(t){return t.year==e.post.year})},editType:function(){return"news"==this.$route.meta.type?{label:"新聞",route:"news"}:"post"==this.$route.meta.type?{label:"文章",route:"post"}:void 0}})},ae={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.post||e.create_mode,expression:"post || create_mode"}],staticClass:"page manage-post-edit"},[n("div",{staticClass:"container-fluid text-left"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("el-breadcrumb",{attrs:{separator:"/"}},[n("el-breadcrumb-item",{attrs:{to:{path:"/manage/post"}}},[e._v(e._s(e.editType.label)+"列表")]),n("el-breadcrumb-item",[e._v(e._s(e.editType.label)+"編輯")])],1),n("br"),n("br")],1)]),n("div",{staticClass:"row row-edit-part",class:{lock:e.post&&e.post.admin_lock&&!e.isAdmin}},[n("el-form",{staticClass:"container-fluid",attrs:{model:e.post,"label-width":"90px"}},[n("el-header",{staticClass:"header"},[n("el-row",[n("el-col",{attrs:{span:18}},[n("h2",{staticStyle:{"text-align":"left"}},[e.create_mode?n("span",[e._v("新增"+e._s(e.editType.label)+" -")]):n("span",[e.post.admin_lock?n("span",[n("i",{staticClass:"fa fa-lock"}),n("span",[e._v(" ")])]):e._e(),n("span",[e._v("編輯 "+e._s(e.editType.label)+" -")])]),e._v(e._s(e.post.title))])]),n("el-col",{attrs:{span:6}},[n("el-button",{attrs:{type:"primary"},on:{click:e.handleSave}},[e._v("儲存更新 ")]),n("router-link",{attrs:{to:e.getPreviewRoute(e.post),target:"_blank"}},[n("el-button",{attrs:{type:"secondary"}},[e._v("前往"+e._s(e.editType.label))])],1)],1)],1),n("hr"),n("br"),n("br")],1),n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-3 col-info"},[n("el-form-item",{attrs:{label:"發布狀態"}},[n("el-select",{model:{value:e.post.status,callback:function(t){e.$set(e.post,"status",t)},expression:"post.status"}},[n("el-option",{key:"draft",attrs:{value:"draft",label:"草稿"}}),n("el-option",{key:"published",attrs:{value:"published",label:"已發布"}})],1)],1),e.isAdmin?n("el-form-item",{attrs:{label:"文章鎖定"}},[n("el-switch",{model:{value:e.post.admin_lock,callback:function(t){e.$set(e.post,"admin_lock",t)},expression:"post.admin_lock"}})],1):e._e(),n("el-form-item",{attrs:{label:"首頁置頂"}},[n("el-switch",{model:{value:e.post.stick_top_index,callback:function(t){e.$set(e.post,"stick_top_index",t)},expression:"post.stick_top_index"}})],1),n("el-form-item",{attrs:{label:"類別置頂"}},[n("el-switch",{model:{value:e.post.stick_top_cata,callback:function(t){e.$set(e.post,"stick_top_cata",t)},expression:"post.stick_top_cata"}})],1),"news"==e.post.type?n("el-form-item",{attrs:{label:"會員新聞置頂"}},[n("el-switch",{model:{value:e.post.stick_top_member,callback:function(t){e.$set(e.post,"stick_top_member",t)},expression:"post.stick_top_member"}})],1):e._e(),n("el-form-item",{attrs:{label:"文章類別"}},[n("el-select",{attrs:{placeholder:"請選擇"},model:{value:e.post.cata_id,callback:function(t){e.$set(e.post,"cata_id",t)},expression:"post.cata_id"}},e._l(e.year_catas,function(e){return n("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}))],1),n("el-form-item",{attrs:{label:"媒體連結"}},[n("el-input",{attrs:{placeholder:"欲外連請填寫"},model:{value:e.post.media_link,callback:function(t){e.$set(e.post,"media_link",t)},expression:"post.media_link"}})],1),n("el-form-item",{attrs:{label:"參展單位"}},[n("el-select",{attrs:{filterable:"filterable",placeholder:"請選擇"},model:{value:e.post.company_id,callback:function(t){e.$set(e.post,"company_id",t)},expression:"post.company_id"}},e._l(e.companies,function(e){return n("el-option",{key:e.id,attrs:{label:e.name_cht+"("+e.year+")",value:e.id}})}))],1),n("el-form-item",{attrs:{label:"Hashtag"}},[n("el-select",{attrs:{multiple:"multiple",filterable:"filterable","allow-create":"allow-create","default-first-option":"default-first-option",placeholder:"請選擇Hashtag或建立"},model:{value:e.post.hashtag,callback:function(t){e.$set(e.post,"hashtag",t)},expression:"post.hashtag"}},e._l(e.default_hashtags.split("、"),function(e){return n("el-option",{key:e,attrs:{label:e,value:e}})}))],1),n("el-form-item",{attrs:{label:"年份"}},[n("el-select",{model:{value:e.post.year,callback:function(t){e.$set(e.post,"year",t)},expression:"post.year"}},[n("el-option",{attrs:{value:"2015",label:"2015"}}),n("el-option",{attrs:{value:"2016",label:"2016"}}),n("el-option",{attrs:{value:"2017",label:"2017"}}),n("el-option",{attrs:{value:"2018",label:"2018"}}),n("el-option",{attrs:{value:"2019",label:"2019"}}),n("el-option",{attrs:{value:"2020",label:"2020"}})],1)],1),n("el-form-item",{attrs:{label:"撰文者"}},[n("el-input",{model:{value:e.post.author,callback:function(t){e.$set(e.post,"author",t)},expression:"post.author"}})],1),n("el-form-item",{attrs:{label:"上稿時間"}},[n("el-date-picker",{attrs:{type:"date","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.post.established_time,callback:function(t){e.$set(e.post,"established_time",t)},expression:"post.established_time"}})],1),n("el-form-item",{attrs:{label:"封面圖片"}},[n("el-input",{model:{value:e.post.cover,callback:function(t){e.$set(e.post,"cover",t)},expression:"post.cover"}},[n("default_pic_selector",{attrs:{slot:"append"},on:{select_pic:e.select_pic},slot:"append"})],1),n("img",{staticStyle:{width:"100%","max-width":"100px"},attrs:{src:e.post.cover}})],1)],1),n("div",{staticClass:"col-sm-9 col-content"},[n("el-form-item",{attrs:{label:"標題",prop:"title"}},[n("el-input",{model:{value:e.post.title,callback:function(t){e.$set(e.post,"title",t)},expression:"post.title"}})],1),n("el-form-item",{attrs:{label:"短簡介",prop:"short_description"}},[n("el-input",{attrs:{type:"textarea"},model:{value:e.post.short_description,callback:function(t){e.$set(e.post,"short_description",t)},expression:"post.short_description"}})],1),n("el-form-item",{attrs:{label:"簡介",prop:"description"}},[n("el-input",{attrs:{type:"textarea",rows:4},model:{value:e.post.description,callback:function(t){e.$set(e.post,"description",t)},expression:"post.description"}})],1),n("el-form-item",[n("VueEditor",{staticClass:"ve",staticStyle:{height:"500px","margin-bottom":"50px"},attrs:{id:"content",useCustomImageHandler:!0,editorToolbar:e.customToolbar,editorOptions:e.editorSettings},on:{imageAdded:e.handleImageAdded},model:{value:e.post.content,callback:function(t){e.$set(e.post,"content",t)},expression:"post.content"}})],1)],1)])])],1)],1)])])},staticRenderFns:[]};var ie=n("VU/8")(ne,ae,!1,function(e){n("BDwe")},null,null).exports,se={data:function(){return{company:{year:"2017",established_time:(new Date).toLocaleDateString(),short_description:"",hashtag:[]},create_mode:!1}},mounted:function(){var e=this;"new"!=this.$route.params.id?this.axios.get("/api/company/"+this.$route.params.id).then(function(t){e.company=t.data}):this.create_mode=!0},components:{VueEditor:H.VueEditor,default_pic_selector:D},methods:{select_pic:function(e){console.log(e),this.company.logo=e.url},handleSave:function(){var e=this;this.create_mode?this.axios.post("/api/company",this.company).then(function(t){e.$message({message:"建立成功",type:"success"}),console.log(t.data.id),e.$router.push("/manage/company/"+t.data.id)}):this.axios.patch("/api/company/"+this.$route.params.id,this.company).then(function(t){console.log(t.data),"success"==t.data.status?e.$message({message:"儲存成功",type:"success"}):e.$message.error({message:"儲存失敗"})})}},computed:Object.assign({},Object(a.e)({companies:function(e){return e.manage.companies},catas:function(e){return e.manage.catas}}),{year_catas:function(){var e=this;return this.catas.filter(function(t){return t.year==e.company.year})}})},re={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.company||e.create_mode,expression:"company || create_mode"}],staticClass:"page manage-company-edit"},[n("div",{staticClass:"container-fluid text-left"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-12"},[n("el-breadcrumb",{attrs:{separator:"/"}},[n("el-breadcrumb-item",{attrs:{to:{path:"/manage/company"}}},[e._v("單位列表")]),n("el-breadcrumb-item",[e._v("單位編輯")])],1),n("br"),n("br")],1),n("el-form",{staticClass:"container-fluid",attrs:{model:e.company,"label-width":"90px"}},[n("el-header",{staticClass:"header"},[n("el-row",[n("el-col",{attrs:{span:18}},[n("h2",{staticStyle:{"text-align":"left"}},[e.create_mode?n("span",[e._v("新增單位 -")]):n("span",[e._v("編輯單位 -")]),e._v(e._s(e.company.name_cht))])]),n("el-col",{attrs:{span:6}},[n("el-button",{attrs:{type:"primary"},on:{click:e.handleSave}},[e._v("儲存更新 ")])],1)],1),n("hr"),n("br"),n("br")],1),n("div",{staticClass:"container-fluid"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-sm-5 col-info"},[n("el-form-item",{attrs:{label:"中文名字"}},[n("el-input",{model:{value:e.company.name_cht,callback:function(t){e.$set(e.company,"name_cht",t)},expression:"company.name_cht"}})],1),n("el-form-item",{attrs:{label:"英文名字"}},[n("el-input",{model:{value:e.company.name_eng,callback:function(t){e.$set(e.company,"name_eng",t)},expression:"company.name_eng"}})],1),n("el-form-item",{attrs:{label:"短名稱"}},[n("el-input",{model:{value:e.company.name_short,callback:function(t){e.$set(e.company,"name_short",t)},expression:"company.name_short"}})],1),n("el-form-item",{attrs:{label:"主題"}},[n("el-input",{model:{value:e.company.theme,callback:function(t){e.$set(e.company,"theme",t)},expression:"company.theme"}})],1),n("el-form-item",{attrs:{label:"類別"}},[n("el-input",{model:{value:e.company.cata,callback:function(t){e.$set(e.company,"cata",t)},expression:"company.cata"}})],1),n("el-form-item",{attrs:{label:"連結"}},[n("el-input",{model:{value:e.company.website,callback:function(t){e.$set(e.company,"website",t)},expression:"company.website"}})],1),n("el-form-item",{attrs:{label:"標籤"}},[n("el-input",{model:{value:e.company.tag,callback:function(t){e.$set(e.company,"tag",t)},expression:"company.tag"}})],1),n("el-form-item",{attrs:{label:"封面圖片"}},[n("el-input",{model:{value:e.company.logo,callback:function(t){e.$set(e.company,"logo",t)},expression:"company.logo"}},[n("default_pic_selector",{attrs:{slot:"append"},on:{select_pic:e.select_pic},slot:"append"})],1),n("img",{staticStyle:{width:"100%","max-width":"100px"},attrs:{src:e.company.logo}})],1),n("el-form-item",{attrs:{label:"年份"}},[n("el-select",{model:{value:e.company.year,callback:function(t){e.$set(e.company,"year",t)},expression:"company.year"}},[n("el-option",{attrs:{value:"2015",label:"2015"}}),n("el-option",{attrs:{value:"2016",label:"2016"}}),n("el-option",{attrs:{value:"2017",label:"2017"}})],1)],1)],1),n("div",{staticClass:"col-sm-7 col-content"},[n("el-form-item",{attrs:{label:"中文簡介"}},[n("el-input",{attrs:{type:"textarea",rows:"4"},model:{value:e.company.discribe_cht,callback:function(t){e.$set(e.company,"discribe_cht",t)},expression:"company.discribe_cht"}})],1),n("el-form-item",{attrs:{label:"英文簡介"}},[n("el-input",{attrs:{type:"textarea",rows:"4"},model:{value:e.company.discribe_eng,callback:function(t){e.$set(e.company,"discribe_eng",t)},expression:"company.discribe_eng"}})],1),n("el-form-item",{attrs:{label:"想要教的"}},[n("el-input",{attrs:{type:"textarea",rows:"2"},model:{value:e.company.teach_thing,callback:function(t){e.$set(e.company,"teach_thing",t)},expression:"company.teach_thing"}})],1),n("el-form-item",{attrs:{label:"想要學的"}},[n("el-input",{attrs:{type:"textarea",rows:"2"},model:{value:e.company.learn_thing,callback:function(t){e.$set(e.company,"learn_thing",t)},expression:"company.learn_thing"}})],1)],1)])])],1)],1)])])},staticRenderFns:[]};var oe={path:"/manage",meta:{manage:!0,navHide:!0,navPosition:"left"},component:r,children:[{path:"",redirect:"/manage/post"},{path:"user",name:"user list",component:X},{path:"post",name:"post list",component:p},{path:"news",name:"news list",component:g},{path:"company",name:"company list",component:b},{path:"cata",name:"cata list",component:k},{path:"coupon",name:"coupon list",component:j},{path:"regist",name:"regist list",component:O},{path:"expo",name:"expo list",component:B},{path:"news/new",component:ie,meta:{type:"news"}},{path:"post/new",component:ie,meta:{type:"post"}},{path:"post/:id",component:ie,meta:{type:"post"}},{path:"news/:id",component:ie,meta:{type:"news"}},{path:"company/:id",component:n("VU/8")(se,re,!1,function(e){n("pMrd")},null,null).exports}]};t.default=oe},pMrd:function(e,t){},pUJL:function(e,t,n){(function(e){"use strict";e.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 HH:mm dddd",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日 HH:mm dddd"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})})(n("a2/B"))},pUp6:function(e,t,n){(function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},week:{dow:1,doy:4}})})(n("a2/B"))},pdQq:function(e,t,n){(function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})})(n("a2/B"))},qToQ:function(e,t,n){(function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})})(n("a2/B"))},qW43:function(e,t,n){(function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],i=/^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:i,monthsShortRegex:i,monthsStrictRegex:/^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})})(n("a2/B"))},qb6w:function(e,t){},qyFW:function(e,t){},r7m6:function(e,t){},rj2i:function(e,t,n){"use strict";var a=n("S1cf");function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){a.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=i},"ro+U":function(e,t,n){(function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})})(n("a2/B"))},"rr7+":function(e,t,n){(function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,a){var i=t.words[a];return 1===a.length?n?i[0]:i[1]:e+" "+t.correctGrammaticalCase(e,i)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},ryJQ:function(e,t,n){(function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})})(n("a2/B"))},t1oD:function(e,t,n){(function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function a(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function i(e,t,n){var i=e+" ";switch(n){case"ss":return i+(a(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return i+(a(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return i+(a(e)?"godziny":"godzin");case"MM":return i+(a(e)?"miesiące":"miesięcy");case"yy":return i+(a(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,a){return e?""===a?"("+n[e.month()]+"|"+t[e.month()]+")":/D MMMM/.test(a)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:i,m:i,mm:i,h:i,hh:i,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:i,y:"rok",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},tQmj:function(e,t,n){(function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})})(n("a2/B"))},tsWd:function(e,t,n){"use strict";var a=n("mI+K");function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new a(e),t(n.reason))})}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i(function(t){e=t}),cancel:e}},e.exports=i},tvR6:function(e,t){},tzrV:function(e,t,n){(function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},uCop:function(e,t,n){(function(e){"use strict";function t(e,t,n,a){var i={s:["thodde secondanim","thodde second"],ss:[e+" secondanim",e+" second"],m:["eka mintan","ek minute"],mm:[e+" mintanim",e+" mintam"],h:["eka horan","ek hor"],hh:[e+" horanim",e+" hor"],d:["eka disan","ek dis"],dd:[e+" disanim",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineanim",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsanim",e+" vorsam"]};return t?i[n][0]:i[n][1]}e.defineLocale("gom-latn",{months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Ieta to] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fatlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:1,doy:4},meridiemParse:/rati|sokalli|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokalli"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokalli":e<16?"donparam":e<20?"sanje":"rati"}})})(n("a2/B"))},udNU:function(e,t){},uj4r:function(e,t){},ujpI:function(e,t,n){(function(e){(function(){var t,n,a,i,s,r,o,l,u,d=[].slice,c={}.hasOwnProperty;l=function(){},n=function(){function e(){}return e.prototype.addEventListener=e.prototype.on,e.prototype.on=function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},e.prototype.emit=function(){var e,t,n,a,i;if(n=arguments[0],e=2<=arguments.length?d.call(arguments,1):[],this._callbacks=this._callbacks||{},t=this._callbacks[n])for(a=0,i=t.length;a<i;a++)t[a].apply(this,e);return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=e.prototype.off,e.prototype.removeEventListener=e.prototype.off,e.prototype.off=function(e,t){var n,a,i,s;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(!(n=this._callbacks[e]))return this;if(1===arguments.length)return delete this._callbacks[e],this;for(a=i=0,s=n.length;i<s;a=++i)if(n[a]===t){n.splice(a,1);break}return this},e}(),(t=function(e){var t,i;function s(e,n){var a,i,r,o;if(this.element=e,this.version=s.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(s.instances.push(this),this.element.dropzone=this,a=null!=(r=s.optionsForElement(this.element))?r:{},this.options=t({},this.defaultOptions,a,null!=n?n:{}),this.options.forceFallback||!s.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),null!=this.options.renameFilename&&(this.options.renameFile=(o=this,function(e){return o.options.renameFilename.call(o,e.name,e)})),this.options.method=this.options.method.toUpperCase(),(i=this.getExistingFallback())&&i.parentNode&&i.parentNode.removeChild(i),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=s.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=s.getElements(this.options.clickable,"clickable")),this.init()}return function(e,t){for(var n in t)c.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(s,n),s.prototype.Emitter=n,s.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],s.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,params:{},headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){return l},accept:function(e,t){return t()},fallback:function(){var e,t,n,a,i,r;for(this.element.className=this.element.className+" dz-browser-not-supported",t=0,n=(i=this.element.getElementsByTagName("div")).length;t<n;t++)e=i[t],/(^| )dz-message($| )/.test(e.className)&&(a=e,e.className="dz-message");return a||(a=s.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(a)),(r=a.getElementsByTagName("span")[0])&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,a){var i,s,r;if(i={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},s=e.width/e.height,null==t&&null==n?(t=i.srcWidth,n=i.srcHeight):null==t?t=n*s:null==n&&(n=t/s),r=(t=Math.min(t,i.srcWidth))/(n=Math.min(n,i.srcHeight)),i.srcWidth>t||i.srcHeight>n)if("crop"===a)s>r?(i.srcHeight=e.height,i.srcWidth=i.srcHeight*r):(i.srcWidth=e.width,i.srcHeight=i.srcWidth/r);else{if("contain"!==a)throw new Error("Unknown resizeMethod '"+a+"'");s>r?n=t/s:t=n*s}return i.srcX=(e.width-i.srcWidth)/2,i.srcY=(e.height-i.srcHeight)/2,i.trgWidth=t,i.trgHeight=n,i},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:l,dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:l,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t,n,a,i,r,o,l,u,d,c,m,_,p;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=s.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),t=0,i=(l=e.previewElement.querySelectorAll("[data-dz-name]")).length;t<i;t++)l[t].textContent=e.name;for(n=0,r=(u=e.previewElement.querySelectorAll("[data-dz-size]")).length;n<r;n++)u[n].innerHTML=this.filesize(e.size);for(this.options.addRemoveLinks&&(e._removeLink=s.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),e.previewElement.appendChild(e._removeLink)),p=this,c=function(t){return t.preventDefault(),t.stopPropagation(),e.status===s.UPLOADING?s.confirm(p.options.dictCancelUploadConfirmation,function(){return p.removeFile(e)}):p.options.dictRemoveFileConfirmation?s.confirm(p.options.dictRemoveFileConfirmation,function(){return p.removeFile(e)}):p.removeFile(e)},_=[],a=0,o=(d=e.previewElement.querySelectorAll("[data-dz-remove]")).length;a<o;a++)m=d[a],_.push(m.addEventListener("click",c));return _}},removedfile:function(e){var t;return e.previewElement&&null!=(t=e.previewElement)&&t.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){var n,a,i,s;if(e.previewElement){for(e.previewElement.classList.remove("dz-file-preview"),n=0,a=(i=e.previewElement.querySelectorAll("[data-dz-thumbnail]")).length;n<a;n++)(s=i[n]).alt=e.name,s.src=t;return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){var n,a,i,s,r;if(e.previewElement){for(e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error),r=[],n=0,a=(s=e.previewElement.querySelectorAll("[data-dz-errormessage]")).length;n<a;n++)i=s[n],r.push(i.textContent=t);return r}},errormultiple:l,processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:l,uploadprogress:function(e,t,n){var a,i,s,r,o;if(e.previewElement){for(o=[],a=0,i=(r=e.previewElement.querySelectorAll("[data-dz-uploadprogress]")).length;a<i;a++)"PROGRESS"===(s=r[a]).nodeName?o.push(s.value=t):o.push(s.style.width=t+"%");return o}},totaluploadprogress:l,sending:l,sendingmultiple:l,success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:l,canceled:function(e){return this.emit("error",e,"Upload canceled.")},canceledmultiple:l,complete:function(e){if(e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:l,maxfilesexceeded:l,maxfilesreached:l,queuecomplete:l,addedfiles:l},t=function(){var e,t,n,a,i,s,r;for(s=arguments[0],e=0,n=(i=2<=arguments.length?d.call(arguments,1):[]).length;e<n;e++)for(t in a=i[e])r=a[t],s[t]=r;return s},s.prototype.getAcceptedFiles=function(){var e,t,n,a,i;for(i=[],t=0,n=(a=this.files).length;t<n;t++)(e=a[t]).accepted&&i.push(e);return i},s.prototype.getRejectedFiles=function(){var e,t,n,a,i;for(i=[],t=0,n=(a=this.files).length;t<n;t++)(e=a[t]).accepted||i.push(e);return i},s.prototype.getFilesWithStatus=function(e){var t,n,a,i,s;for(s=[],n=0,a=(i=this.files).length;n<a;n++)(t=i[n]).status===e&&s.push(t);return s},s.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(s.QUEUED)},s.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(s.UPLOADING)},s.prototype.getAddedFiles=function(){return this.getFilesWithStatus(s.ADDED)},s.prototype.getActiveFiles=function(){var e,t,n,a,i;for(i=[],t=0,n=(a=this.files).length;t<n;t++)(e=a[t]).status!==s.UPLOADING&&e.status!==s.QUEUED||i.push(e);return i},s.prototype.init=function(){var e,t,n,a,i,r,o,l;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(s.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(l=this,(o=function(){return l.hiddenFileInput&&l.hiddenFileInput.parentNode.removeChild(l.hiddenFileInput),l.hiddenFileInput=document.createElement("input"),l.hiddenFileInput.setAttribute("type","file"),(null==l.options.maxFiles||l.options.maxFiles>1)&&l.hiddenFileInput.setAttribute("multiple","multiple"),l.hiddenFileInput.className="dz-hidden-input",null!=l.options.acceptedFiles&&l.hiddenFileInput.setAttribute("accept",l.options.acceptedFiles),null!=l.options.capture&&l.hiddenFileInput.setAttribute("capture",l.options.capture),l.hiddenFileInput.style.visibility="hidden",l.hiddenFileInput.style.position="absolute",l.hiddenFileInput.style.top="0",l.hiddenFileInput.style.left="0",l.hiddenFileInput.style.height="0",l.hiddenFileInput.style.width="0",document.querySelector(l.options.hiddenInputContainer).appendChild(l.hiddenFileInput),l.hiddenFileInput.addEventListener("change",function(){var e,t,n,a;if((t=l.hiddenFileInput.files).length)for(n=0,a=t.length;n<a;n++)e=t[n],l.addFile(e);return l.emit("addedfiles",t),o()})})()),this.URL=null!=(i=window.URL)?i:window.webkitURL,t=0,n=(r=this.events).length;t<n;t++)e=r[t],this.on(e,this.options[e]);return this.on("uploadprogress",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("canceled",function(e){return function(t){return e.emit("complete",t)}}(this)),this.on("complete",function(e){return function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)}}(this)),a=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(e){return function(t){return e.emit("dragstart",t)}}(this),dragenter:function(e){return function(t){return a(t),e.emit("dragenter",t)}}(this),dragover:function(e){return function(t){var n;try{n=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",a(t),e.emit("dragover",t)}}(this),dragleave:function(e){return function(t){return e.emit("dragleave",t)}}(this),drop:function(e){return function(t){return a(t),e.drop(t)}}(this),dragend:function(e){return function(t){return e.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(e){return function(t){return e.listeners.push({element:t,events:{click:function(n){return(t!==e.element||n.target===e.element||s.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}}(this)),this.enable(),this.options.init.call(this)},s.prototype.destroy=function(){var e;return this.disable(),this.removeAllFiles(!0),(null!=(e=this.hiddenFileInput)?e.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,s.instances.splice(s.instances.indexOf(this),1)},s.prototype.updateTotalUploadProgress=function(){var e,t,n,a,i,s,r;if(s=0,i=0,this.getActiveFiles().length){for(t=0,n=(a=this.getActiveFiles()).length;t<n;t++)s+=(e=a[t]).upload.bytesSent,i+=e.upload.total;r=100*s/i}else r=100;return this.emit("totaluploadprogress",r,i,s)},s.prototype._getParamName=function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")},s.prototype._renameFile=function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)},s.prototype.getFallbackForm=function(){var e,t,n,a;return(e=this.getExistingFallback())?e:(n='<div class="dz-fallback">',this.options.dictFallbackText&&(n+="<p>"+this.options.dictFallbackText+"</p>"),n+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',t=s.createElement(n),"FORM"!==this.element.tagName?(a=s.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>')).appendChild(t):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=a?a:t)},s.prototype.getExistingFallback=function(){var e,t,n,a,i,s;for(t=function(e){var t,n,a;for(n=0,a=e.length;n<a;n++)if(t=e[n],/(^| )fallback($| )/.test(t.className))return t},n=0,a=(i=["div","form"]).length;n<a;n++)if(s=i[n],e=t(this.element.getElementsByTagName(s)))return e},s.prototype.setupEventListeners=function(){var e,t,n,a,i,s,r;for(r=[],n=0,a=(s=this.listeners).length;n<a;n++)e=s[n],r.push(function(){var n,a;for(t in a=[],n=e.events)i=n[t],a.push(e.element.addEventListener(t,i,!1));return a}());return r},s.prototype.removeEventListeners=function(){var e,t,n,a,i,s,r;for(r=[],n=0,a=(s=this.listeners).length;n<a;n++)e=s[n],r.push(function(){var n,a;for(t in a=[],n=e.events)i=n[t],a.push(e.element.removeEventListener(t,i,!1));return a}());return r},s.prototype.disable=function(){var e,t,n,a,i;for(this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),i=[],t=0,n=(a=this.files).length;t<n;t++)e=a[t],i.push(this.cancelUpload(e));return i},s.prototype.enable=function(){return this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()},s.prototype.filesize=function(e){var t,n,a,i,s,r,o;if(i=0,s="b",e>0){for(t=n=0,a=(o=["tb","gb","mb","kb","b"]).length;n<a;t=++n)if(r=o[t],e>=Math.pow(this.options.filesizeBase,4-t)/10){i=e/Math.pow(this.options.filesizeBase,4-t),s=r;break}i=Math.round(10*i)/10}return"<strong>"+i+"</strong> "+this.options.dictFileSizeUnits[s]},s.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},s.prototype.drop=function(e){var t,n;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,this.emit("addedfiles",t),t.length&&((n=e.dataTransfer.items)&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)))},s.prototype.paste=function(e){var t,n;if(null!=(null!=e&&null!=(n=e.clipboardData)?n.items:void 0))return this.emit("paste",e),(t=e.clipboardData.items).length?this._addFilesFromItems(t):void 0},s.prototype.handleFiles=function(e){var t,n,a,i;for(i=[],n=0,a=e.length;n<a;n++)t=e[n],i.push(this.addFile(t));return i},s.prototype._addFilesFromItems=function(e){var t,n,a,i,s;for(s=[],a=0,i=e.length;a<i;a++)null!=(n=e[a]).webkitGetAsEntry&&(t=n.webkitGetAsEntry())?t.isFile?s.push(this.addFile(n.getAsFile())):t.isDirectory?s.push(this._addFilesFromDirectory(t,t.name)):s.push(void 0):null!=n.getAsFile&&(null==n.kind||"file"===n.kind)?s.push(this.addFile(n.getAsFile())):s.push(void 0);return s},s.prototype._addFilesFromDirectory=function(e,t){var n,a,i,s;return n=e.createReader(),a=function(e){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(e):void 0},s=this,(i=function(){return n.readEntries(function(e){var n,a,r;if(e.length>0){for(a=0,r=e.length;a<r;a++)(n=e[a]).isFile?n.file(function(e){if(!s.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,s.addFile(e)}):n.isDirectory&&s._addFilesFromDirectory(n,t+"/"+n.name);i()}return null},a)})()},s.prototype.accept=function(e,t){return e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):s.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)},s.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=s.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(t=this,function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}));var t},s.prototype.enqueueFiles=function(e){var t,n,a;for(n=0,a=e.length;n<a;n++)t=e[n],this.enqueueFile(t);return null},s.prototype.enqueueFile=function(e){if(e.status!==s.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=s.QUEUED,this.options.autoProcessQueue)return setTimeout((t=this,function(){return t.processQueue()}),0);var t},s.prototype._thumbnailQueue=[],s.prototype._processingThumbnail=!1,s.prototype._enqueueThumbnail=function(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout((t=this,function(){return t._processThumbnailQueue()}),0);var t},s.prototype._processThumbnailQueue=function(){var e,t;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,e=this._thumbnailQueue.shift(),this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(t=this,function(n){return t.emit("thumbnail",e,n),t._processingThumbnail=!1,t._processThumbnailQueue()}))},s.prototype.removeFile=function(e){if(e.status===s.UPLOADING&&this.cancelUpload(e),this.files=u(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")},s.prototype.removeAllFiles=function(e){var t,n,a,i;for(null==e&&(e=!1),n=0,a=(i=this.files.slice()).length;n<a;n++)((t=i[n]).status!==s.UPLOADING||e)&&this.removeFile(t);return null},s.prototype.resizeImage=function(e,t,n,i,r){return this.createThumbnail(e,t,n,i,!1,(o=this,function(t,n){var i,l;return null===n?r(e):(null==(i=o.options.resizeMimeType)&&(i=e.type),l=n.toDataURL(i,o.options.resizeQuality),"image/jpeg"!==i&&"image/jpg"!==i||(l=a.restore(e.dataURL,l)),r(s.dataURItoBlob(l)))}));var o},s.prototype.createThumbnail=function(e,t,n,a,i,s){var r,o;return(r=new FileReader).onload=(o=this,function(){if(e.dataURL=r.result,"image/svg+xml"!==e.type)return o.createThumbnailFromUrl(e,t,n,a,i,s);null!=s&&s(r.result)}),r.readAsDataURL(e)},s.prototype.createThumbnailFromUrl=function(e,t,n,a,i,s,r){var l,u;return l=document.createElement("img"),r&&(l.crossOrigin=r),l.onload=(u=this,function(){var r;return r=function(e){return e(1)},"undefined"!=typeof EXIF&&null!==EXIF&&i&&(r=function(e){return EXIF.getData(l,function(){return e(EXIF.getTag(this,"Orientation"))})}),r(function(i){var r,d,c,m,_,p,h,f;switch(e.width=l.width,e.height=l.height,h=u.options.resize.call(u,e,t,n,a),d=(r=document.createElement("canvas")).getContext("2d"),r.width=h.trgWidth,r.height=h.trgHeight,i>4&&(r.width=h.trgHeight,r.height=h.trgWidth),i){case 2:d.translate(r.width,0),d.scale(-1,1);break;case 3:d.translate(r.width,r.height),d.rotate(Math.PI);break;case 4:d.translate(0,r.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-r.height);break;case 7:d.rotate(.5*Math.PI),d.translate(r.width,-r.height),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-r.width,0)}if(o(d,l,null!=(c=h.srcX)?c:0,null!=(m=h.srcY)?m:0,h.srcWidth,h.srcHeight,null!=(_=h.trgX)?_:0,null!=(p=h.trgY)?p:0,h.trgWidth,h.trgHeight),f=r.toDataURL("image/png"),null!=s)return s(f,r)})}),null!=s&&(l.onerror=s),l.src=e.dataURL},s.prototype.processQueue=function(){var e,t,n,a;if(t=this.options.parallelUploads,e=n=this.getUploadingFiles().length,!(n>=t)&&(a=this.getQueuedFiles()).length>0){if(this.options.uploadMultiple)return this.processFiles(a.slice(0,t-n));for(;e<t;){if(!a.length)return;this.processFile(a.shift()),e++}}},s.prototype.processFile=function(e){return this.processFiles([e])},s.prototype.processFiles=function(e){var t,n,a;for(n=0,a=e.length;n<a;n++)(t=e[n]).processing=!0,t.status=s.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},s.prototype._getFilesWithXhr=function(e){var t;return function(){var n,a,i,s;for(s=[],n=0,a=(i=this.files).length;n<a;n++)(t=i[n]).xhr===e&&s.push(t);return s}.call(this)},s.prototype.cancelUpload=function(e){var t,n,a,i,r,o,l;if(e.status===s.UPLOADING){for(a=0,r=(n=this._getFilesWithXhr(e.xhr)).length;a<r;a++)(t=n[a]).status=s.CANCELED;for(e.xhr.abort(),i=0,o=n.length;i<o;i++)t=n[i],this.emit("canceled",t);this.options.uploadMultiple&&this.emit("canceledmultiple",n)}else(l=e.status)!==s.ADDED&&l!==s.QUEUED||(e.status=s.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()},i=function(){var e,t;return t=arguments[0],e=2<=arguments.length?d.call(arguments,1):[],"function"==typeof t?t.apply(this,e):t},s.prototype.uploadFile=function(e){return this.uploadFiles([e])},s.prototype.uploadFiles=function(e){var n,a,r,o,l,u,d,c,m,_,p,h,f,g,y,v,b,M,w,k,L,x,T,Y,D,S,C,j,E,P,O,H,A,F,$,R,z;for(R=new XMLHttpRequest,f=0,b=e.length;f<b;f++)(r=e[f]).xhr=R;for(u in x=i(this.options.method,e),F=i(this.options.url,e),R.open(x,F,!0),R.timeout=i(this.options.timeout,e),R.withCredentials=!!this.options.withCredentials,O=null,z=this,l=function(){var t,n,a;for(a=[],t=0,n=e.length;t<n;t++)r=e[t],a.push(z._errorProcessing(e,O||z.options.dictResponseError.replace("{{statusCode}}",R.status),R));return a},A=function(t){return function(n){var a,i,s,o,l,u,d,c,m;if(null!=n)for(c=100*n.loaded/n.total,i=0,o=e.length;i<o;i++)(r=e[i]).upload.progress=c,r.upload.total=n.total,r.upload.bytesSent=n.loaded;else{for(a=!0,c=100,s=0,l=e.length;s<l;s++)100===(r=e[s]).upload.progress&&r.upload.bytesSent===r.upload.total||(a=!1),r.upload.progress=c,r.upload.bytesSent=r.upload.total;if(a)return}for(m=[],d=0,u=e.length;d<u;d++)r=e[d],m.push(t.emit("uploadprogress",r,c,r.upload.bytesSent));return m}}(this),R.onload=function(t){return function(n){var a,i;if(e[0].status!==s.CANCELED&&4===R.readyState){if("arraybuffer"!==R.responseType&&"blob"!==R.responseType&&(O=R.responseText,R.getResponseHeader("content-type")&&~R.getResponseHeader("content-type").indexOf("application/json")))try{O=JSON.parse(O)}catch(a){n=a,O="Invalid JSON response from server."}return A(),200<=(i=R.status)&&i<300?t._finished(e,O,n):l()}}}(this),R.onerror=function(){if(e[0].status!==s.CANCELED)return l()},(null!=(D=R.upload)?D:R).onprogress=A,c={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&t(c,this.options.headers),c)(d=c[u])&&R.setRequestHeader(u,d);if(o=new FormData,this.options.params)for(y in S=this.options.params)$=S[y],o.append(y,$);for(g=0,M=e.length;g<M;g++)r=e[g],this.emit("sending",r,R,o);if(this.options.uploadMultiple&&this.emit("sendingmultiple",e,R,o),"FORM"===this.element.tagName)for(v=0,w=(C=this.element.querySelectorAll("input, textarea, select, button")).length;v<w;v++)if(p=(_=C[v]).getAttribute("name"),h=_.getAttribute("type"),"SELECT"===_.tagName&&_.hasAttribute("multiple"))for(L=0,k=(j=_.options).length;L<k;L++)(Y=j[L]).selected&&o.append(p,Y.value);else(!h||"checkbox"!==(E=h.toLowerCase())&&"radio"!==E||_.checked)&&o.append(p,_.value);for(n=0,H=[],m=T=0,P=e.length-1;0<=P?T<=P:T>=P;m=0<=P?++T:--T)a=function(t){return function(a,i,s){return function(a){if(o.append(i,a,s),++n===e.length)return t.submitRequest(R,o,e)}}}(this),H.push(this.options.transformFile.call(this,e[m],a(e[m],this._getParamName(m),e[m].upload.filename)));return H},s.prototype.submitRequest=function(e,t,n){return e.send(t)},s.prototype._finished=function(e,t,n){var a,i,r;for(i=0,r=e.length;i<r;i++)(a=e[i]).status=s.SUCCESS,this.emit("success",a,t,n),this.emit("complete",a);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()},s.prototype._errorProcessing=function(e,t,n){var a,i,r;for(i=0,r=e.length;i<r;i++)(a=e[i]).status=s.ERROR,this.emit("error",a,t,n),this.emit("complete",a);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()},s}()).version="5.1.1",t.options={},t.optionsForElement=function(e){return e.getAttribute("id")?t.options[i(e.getAttribute("id"))]:void 0},t.instances=[],t.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},t.autoDiscover=!0,t.discover=function(){var e,n,a,i,s,r;for(document.querySelectorAll?a=document.querySelectorAll(".dropzone"):(a=[],(e=function(e){var t,n,i,s;for(s=[],n=0,i=e.length;n<i;n++)t=e[n],/(^| )dropzone($| )/.test(t.className)?s.push(a.push(t)):s.push(void 0);return s})(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))),r=[],i=0,s=a.length;i<s;i++)n=a[i],!1!==t.optionsForElement(n)?r.push(new t(n)):r.push(void 0);return r},t.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],t.isBrowserSupported=function(){var e,n,a,i;if(e=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(n=0,a=(i=t.blacklistedBrowsers).length;n<a;n++)i[n].test(navigator.userAgent)&&(e=!1);else e=!1;else e=!1;return e},t.dataURItoBlob=function(e){var t,n,a,i,s,r,o;for(n=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],t=new ArrayBuffer(n.length),i=new Uint8Array(t),a=s=0,o=n.length;0<=o?s<=o:s>=o;a=0<=o?++s:--s)i[a]=n.charCodeAt(a);return new Blob([t],{type:r})},u=function(e,t){var n,a,i,s;for(s=[],a=0,i=e.length;a<i;a++)(n=e[a])!==t&&s.push(n);return s},i=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})},t.createElement=function(e){var t;return(t=document.createElement("div")).innerHTML=e,t.childNodes[0]},t.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},t.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return n},t.getElements=function(e,t){var n,a,i,s,r,o,l,u;if(e instanceof Array){a=[];try{for(s=0,o=e.length;s<o;s++)n=e[s],a.push(this.getElement(n,t))}catch(i){i,a=null}}else if("string"==typeof e)for(a=[],r=0,l=(u=document.querySelectorAll(e)).length;r<l;r++)n=u[r],a.push(n);else null!=e.nodeType&&(a=[e]);if(null==a||!a.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return a},t.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},t.isValidFile=function(e,t){var n,a,i,s,r;if(!t)return!0;for(t=t.split(","),n=(s=e.type).replace(/\/.*$/,""),a=0,i=t.length;a<i;a++)if("."===(r=(r=t[a]).trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(r.toLowerCase(),e.name.length-r.length))return!0}else if(/\/\*$/.test(r)){if(n===r.replace(/\/.*$/,""))return!0}else if(s===r)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new t(this,e)})}),void 0!==e&&null!==e?e.exports=t:window.Dropzone=t,t.ADDED="added",t.QUEUED="queued",t.ACCEPTED=t.QUEUED,t.UPLOADING="uploading",t.PROCESSING=t.UPLOADING,t.CANCELED="canceled",t.ERROR="error",t.SUCCESS="success",r=function(e){var t,n,a,i,s,r,o,l;for(e.naturalWidth,s=e.naturalHeight,(t=document.createElement("canvas")).width=1,t.height=s,(n=t.getContext("2d")).drawImage(e,0,0),a=n.getImageData(1,0,1,s).data,l=0,i=s,r=s;r>l;)0===a[4*(r-1)+3]?i=r:l=r,r=i+l>>1;return 0===(o=r/s)?1:o},o=function(e,t,n,a,i,s,o,l,u,d){var c;return c=r(t),e.drawImage(t,n,a,i,s,o,l,u,d/c)},a=function(){function e(){}return e.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e.encode64=function(e){var t,n,a,i,s,r,o,l,u;for(u="",t=void 0,n=void 0,a="",i=void 0,s=void 0,r=void 0,o="",l=0;i=(t=e[l++])>>2,s=(3&t)<<4|(n=e[l++])>>4,r=(15&n)<<2|(a=e[l++])>>6,o=63&a,isNaN(n)?r=o=64:isNaN(a)&&(o=64),u=u+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(o),t=n=a="",i=s=r=o="",l<e.length;);return u},e.restore=function(e,t){var n,a,i;return e.match("data:image/jpeg;base64,")?(a=this.decode64(e.replace("data:image/jpeg;base64,","")),i=this.slice2Segments(a),n=this.exifManipulation(t,i),"data:image/jpeg;base64,"+this.encode64(n)):t},e.exifManipulation=function(e,t){var n,a;return n=this.getExifArray(t),a=this.insertExif(e,n),new Uint8Array(a)},e.getExifArray=function(e){var t,n;for(t=void 0,n=0;n<e.length;){if(255===(t=e[n])[0]&225===t[1])return t;n++}return[]},e.insertExif=function(e,t){var n,a,i,s,r;return i=e.replace("data:image/jpeg;base64,",""),r=(a=this.decode64(i)).indexOf(255,3),s=a.slice(0,r),n=a.slice(r),s.concat(t).concat(n)},e.slice2Segments=function(e){var t,n,a,i;for(n=0,i=[];!(255===e[n]&218===e[n+1]||(255===e[n]&216===e[n+1]?n+=2:(t=n+(256*e[n+2]+e[n+3])+2,a=e.slice(n,t),i.push(a),n=t),n>e.length)););return i},e.decode64=function(e){var t,n,a,i,s,r,o,l;for("",n=void 0,a=void 0,i="",void 0,s=void 0,r=void 0,o="",l=0,t=[],/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warning("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");n=this.KEY_STR.indexOf(e.charAt(l++))<<2|(s=this.KEY_STR.indexOf(e.charAt(l++)))>>4,a=(15&s)<<4|(r=this.KEY_STR.indexOf(e.charAt(l++)))>>2,i=(3&r)<<6|(o=this.KEY_STR.indexOf(e.charAt(l++))),t.push(n),64!==r&&t.push(a),64!==o&&t.push(i),n=a=i="",s=r=o="",l<e.length;);return t},e}(),s=function(e,t){var n,a,i,s,r,o,l,u,d;if(i=!1,d=!0,a=e.document,u=a.documentElement,n=a.addEventListener?"addEventListener":"attachEvent",l=a.addEventListener?"removeEventListener":"detachEvent",o=a.addEventListener?"":"on",s=function(n){if("readystatechange"!==n.type||"complete"===a.readyState)return("load"===n.type?e:a)[l](o+n.type,s,!1),!i&&(i=!0)?t.call(e,n.type||n):void 0},r=function(){var e;try{u.doScroll("left")}catch(e){return e,void setTimeout(r,50)}return s("poll")},"complete"!==a.readyState){if(a.createEventObject&&u.doScroll){try{d=!e.frameElement}catch(e){}d&&r()}return a[n](o+"DOMContentLoaded",s,!1),a[n](o+"readystatechange",s,!1),e[n](o+"load",s,!1)}},t._autoDiscoverFunction=function(){if(t.autoDiscover)return t.discover()},s(window,t._autoDiscoverFunction)}).call(this)}).call(t,n("3IRH")(e))},ux7g:function(e,t,n){(function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})})(n("a2/B"))},uz6X:function(e,t,n){"use strict";var a=n("S1cf"),i=n("woEt"),s=n("V3+0"),r=n("BXyq");function o(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return o(e),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=a.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),a.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||r.adapter)(e).then(function(t){return o(e),t.data=i(t.data,t.headers,e.transformResponse),t},function(t){return s(t)||(o(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},vnXZ:function(e,t,n){(function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})})(n("a2/B"))},wLaM:function(e,t,n){(function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1130?"上午":a<1230?"中午":a<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})})(n("a2/B"))},wRWs:function(e,t,n){(function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(n("a2/B"))},woEt:function(e,t,n){"use strict";var a=n("S1cf");e.exports=function(e,t,n){return a.forEach(n,function(n){e=n(e,t)}),e}},xC4Z:function(e,t,n){(function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})})(n("a2/B"))},y9sT:function(e,t){},yDpn:function(e,t,n){(function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function a(e){return e>1&&e<5}function i(e,t,n,i){var s=e+" ";switch(n){case"s":return t||i?"pár sekúnd":"pár sekundami";case"ss":return t||i?s+(a(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":i?"minútu":"minútou";case"mm":return t||i?s+(a(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":i?"hodinu":"hodinou";case"hh":return t||i?s+(a(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||i?"deň":"dňom";case"dd":return t||i?s+(a(e)?"dni":"dní"):s+"dňami";case"M":return t||i?"mesiac":"mesiacom";case"MM":return t||i?s+(a(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||i?"rok":"rokom";case"yy":return t||i?s+(a(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:i,ss:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))},yheM:function(e,t,n){(function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})})(n("a2/B"))},zDie:function(e,t,n){(function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,function(e){return n[e]})},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]})},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})})(n("a2/B"))},zZ2h:function(e,t){},zp5f:function(e,t,n){(function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(n("a2/B"))}},["NHnr"]);
//# sourceMappingURL=app.d810b559cfa17730f4e3.js.map | .t |
mesh.go | package command
import (
"errors"
"strings"
"github.com/alibaba/kt-connect/pkg/kt/cluster"
"github.com/alibaba/kt-connect/pkg/kt/connect"
"github.com/alibaba/kt-connect/pkg/kt/options"
"github.com/alibaba/kt-connect/pkg/kt/util"
v1 "k8s.io/api/apps/v1"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/urfave/cli"
)
// ComponentMesh mesh component
const ComponentMesh = "mesh"
// KubernetesTool kt sign
const KubernetesTool = "kt"
// newMeshCommand return new mesh command
func newMeshCommand(options *options.DaemonOptions, action ActionInterface) cli.Command {
return cli.Command{
Name: "mesh",
Usage: "mesh kubernetes deployment to local",
Flags: []cli.Flag{
cli.StringFlag{
Name: "expose",
Usage: "expose port [port] or [remote:local]",
Destination: &options.MeshOptions.Expose,
},
},
Action: func(c *cli.Context) error {
if options.Debug {
zerolog.SetGlobalLevel(zerolog.DebugLevel)
}
mesh := c.Args().First()
expose := options.MeshOptions.Expose
if len(mesh) == 0 {
return errors.New("mesh target is required")
}
if len(expose) == 0 {
return errors.New("-expose is required")
}
return action.Mesh(mesh, options)
},
}
}
//Mesh exchange kubernetes workload
func (action *Action) Mesh(mesh string, options *options.DaemonOptions) error {
checkConnectRunning(options.RuntimeOptions.PidFile)
ch := SetUpCloseHandler(options)
kubernetes, err := cluster.Create(options.KubeConfig)
if err != nil {
return err
}
app, err := kubernetes.Deployment(mesh, options.Namespace)
if err != nil {
return err
}
meshVersion := strings.ToLower(util.RandomString(5))
workload := app.GetObjectMeta().GetName() + "-kt-" + meshVersion
labels := getMeshLabels(workload, meshVersion, app, options)
podIP, podName, err := kubernetes.CreateShadow(workload, options.Namespace, options.Image, labels)
if err != nil {
return err
}
// record context data
options.RuntimeOptions.Shadow = workload
shadow := connect.Create(options)
err = shadow.Inbound(options.MeshOptions.Expose, podName, podIP)
if err != nil {
return err
}
s := <-ch
log.Info().Msgf("Terminal Signal is %s", s)
return nil
}
func | (workload string, meshVersion string, app *v1.Deployment, options *options.DaemonOptions) map[string]string {
labels := map[string]string{
"kt": workload,
"version": meshVersion,
"kt-component": ComponentMesh,
"control-by": KubernetesTool,
}
for k, v := range app.Spec.Selector.MatchLabels {
labels[k] = v
}
// extra labels must be applied after origin labels
for k, v := range util.String2Map(options.Labels) {
labels[k] = v
}
return labels
}
| getMeshLabels |
network_utils.go | package network
import (
"bufio"
"bytes"
"encoding/hex"
"fmt"
"io/ioutil"
"math/big"
"math/rand"
"net"
"os"
"strconv"
"strings"
"sync"
"time"
"github.com/pkg/errors"
"github.com/lxc/lxd/lxd/db"
deviceConfig "github.com/lxc/lxd/lxd/device/config"
"github.com/lxc/lxd/lxd/device/nictype"
"github.com/lxc/lxd/lxd/dnsmasq"
"github.com/lxc/lxd/lxd/dnsmasq/dhcpalloc"
"github.com/lxc/lxd/lxd/instance"
"github.com/lxc/lxd/lxd/instance/instancetype"
"github.com/lxc/lxd/lxd/ip"
"github.com/lxc/lxd/lxd/project"
"github.com/lxc/lxd/lxd/state"
"github.com/lxc/lxd/lxd/util"
"github.com/lxc/lxd/shared"
"github.com/lxc/lxd/shared/api"
"github.com/lxc/lxd/shared/logger"
"github.com/lxc/lxd/shared/version"
)
func networkValidPort(value string) error {
if value == "" {
return nil
}
valueInt, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return fmt.Errorf("Invalid value for an integer: %s", value)
}
if valueInt < 1 || valueInt > 65536 {
return fmt.Errorf("Invalid port number: %s", value)
}
return nil
}
// RandomDevName returns a random device name with prefix.
// If the random string combined with the prefix exceeds 13 characters then empty string is returned.
// This is to ensure we support buggy dhclient applications: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858580
func RandomDevName(prefix string) string {
// Return a new random veth device name.
randBytes := make([]byte, 4)
rand.Read(randBytes)
iface := prefix + hex.EncodeToString(randBytes)
if len(iface) > 13 {
return ""
}
return iface
}
// usedByInstanceDevices looks for instance NIC devices using the network and runs the supplied usageFunc for each.
func usedByInstanceDevices(s *state.State, networkProjectName string, networkName string, usageFunc func(inst db.Instance, nicName string, nicConfig map[string]string) error) error {
return s.Cluster.InstanceList(nil, func(inst db.Instance, p db.Project, profiles []api.Profile) error {
// Get the instance's effective network project name.
instNetworkProject := project.NetworkProjectFromRecord(&p)
// Skip instances who's effective network project doesn't match this Network's project.
if instNetworkProject != networkProjectName {
return nil
}
// Look for NIC devices using this network.
devices := db.ExpandInstanceDevices(deviceConfig.NewDevices(inst.Devices), profiles)
for devName, devConfig := range devices {
if isInUseByDevice(networkName, devConfig) {
err := usageFunc(inst, devName, devConfig)
if err != nil {
return err
}
}
}
return nil
})
}
// UsedBy returns list of API resources using network. Accepts firstOnly argument to indicate that only the first
// resource using network should be returned. This can help to quickly check if the network is in use.
func UsedBy(s *state.State, networkProjectName string, networkID int64, networkName string, firstOnly bool) ([]string, error) {
var err error
var usedBy []string
// If managed network being passed in, check if it has any peerings in a created state.
if networkID > 0 {
peers, err := s.Cluster.GetNetworkPeers(networkID)
if err != nil {
return nil, fmt.Errorf("Failed getting network peers: %w", err)
}
for _, peer := range peers {
if peer.Status == api.NetworkStatusCreated {
// Add the target project/network of the peering as using this network.
usedBy = append(usedBy, api.NewURL().Path(version.APIVersion, "networks", peer.TargetNetwork).Project(peer.TargetProject).String())
if firstOnly {
return usedBy, nil
}
}
}
}
// Only networks defined in the default project can be used by other networks. Cheapest to do.
if networkProjectName == project.Default {
// Get all managed networks across all projects.
var projectNetworks map[string]map[int64]api.Network
err = s.Cluster.Transaction(func(tx *db.ClusterTx) error {
projectNetworks, err = tx.GetCreatedNetworks()
return err
})
if err != nil {
return nil, errors.Wrapf(err, "Failed to load all networks")
}
for projectName, networks := range projectNetworks {
for _, network := range networks {
if networkName == network.Name && networkProjectName == projectName {
continue // Skip ourselves.
}
// The network's config references the network we are searching for. Either by
// directly referencing our network or by referencing our interface as its parent.
if network.Config["network"] == networkName || network.Config["parent"] == networkName {
usedBy = append(usedBy, api.NewURL().Path(version.APIVersion, "networks", network.Name).Project(projectName).String())
if firstOnly {
return usedBy, nil
}
}
}
}
}
// Look for profiles. Next cheapest to do.
var profiles []db.Profile
err = s.Cluster.Transaction(func(tx *db.ClusterTx) error {
profiles, err = tx.GetProfiles(db.ProfileFilter{})
if err != nil {
return err
}
return nil
})
if err != nil {
return nil, err
}
for _, profile := range profiles {
inUse, err := usedByProfileDevices(s, profile, networkProjectName, networkName)
if err != nil {
return nil, err
}
if inUse {
usedBy = append(usedBy, api.NewURL().Path(version.APIVersion, "profiles", profile.Name).Project(profile.Project).String())
if firstOnly {
return usedBy, nil
}
}
}
// Check if any instance devices use this network.
err = usedByInstanceDevices(s, networkProjectName, networkName, func(inst db.Instance, nicName string, nicConfig map[string]string) error {
usedBy = append(usedBy, api.NewURL().Path(version.APIVersion, "instances", inst.Name).Project(inst.Project).String())
if firstOnly {
// No need to consider other devices.
return db.ErrInstanceListStop
}
return nil
})
if err != nil {
if err == db.ErrInstanceListStop {
return usedBy, nil
}
return nil, err
}
return usedBy, nil
}
// usedByProfileDevices indicates if network is referenced by a profile's NIC devices.
// Checks if the device's parent or network properties match the network name.
func usedByProfileDevices(s *state.State, profile db.Profile, networkProjectName string, networkName string) (bool, error) {
// Get the translated network project name from the profiles's project.
profileNetworkProjectName, _, err := project.NetworkProject(s.Cluster, profile.Project)
if err != nil {
return false, err
}
// Skip profiles who's translated network project doesn't match the requested network's project.
// Because its devices can't be using this network.
if networkProjectName != profileNetworkProjectName {
return false, nil
}
for _, d := range deviceConfig.NewDevices(profile.Devices) {
if isInUseByDevice(networkName, d) {
return true, nil
}
}
return false, nil
}
// isInUseByDevices inspects a device's config to find references for a network being used.
func isInUseByDevice(networkName string, d deviceConfig.Device) bool {
if d["type"] != "nic" {
return false
}
if d["network"] != "" && d["network"] == networkName {
return true
}
if d["parent"] != "" && GetHostDevice(d["parent"], d["vlan"]) == networkName {
return true
}
return false
}
// GetDevMTU retrieves the current MTU setting for a named network device.
func GetDevMTU(devName string) (uint32, error) {
content, err := ioutil.ReadFile(fmt.Sprintf("/sys/class/net/%s/mtu", devName))
if err != nil {
return 0, err
}
// Parse value
mtu, err := strconv.ParseUint(strings.TrimSpace(string(content)), 10, 32)
if err != nil {
return 0, err
}
return uint32(mtu), nil
}
// DefaultGatewaySubnetV4 returns subnet of default gateway interface.
func DefaultGatewaySubnetV4() (*net.IPNet, string, error) {
file, err := os.Open("/proc/net/route")
if err != nil {
return nil, "", err
}
defer file.Close()
ifaceName := ""
scanner := bufio.NewReader(file)
for {
line, _, err := scanner.ReadLine()
if err != nil {
break
}
fields := strings.Fields(string(line))
if fields[1] == "00000000" && fields[7] == "00000000" {
ifaceName = fields[0]
break
}
}
if ifaceName == "" {
return nil, "", fmt.Errorf("No default gateway for IPv4")
}
iface, err := net.InterfaceByName(ifaceName)
if err != nil {
return nil, "", err
}
addrs, err := iface.Addrs()
if err != nil {
return nil, "", err
}
var subnet *net.IPNet
for _, addr := range addrs {
addrIP, addrNet, err := net.ParseCIDR(addr.String())
if err != nil {
return nil, "", err
}
if addrIP.To4() == nil {
continue
}
if subnet != nil |
subnet = addrNet
}
if subnet == nil {
return nil, "", fmt.Errorf("No IPv4 subnet on default interface")
}
return subnet, ifaceName, nil
}
// UpdateDNSMasqStatic rebuilds the DNSMasq static allocations.
func UpdateDNSMasqStatic(s *state.State, networkName string) error {
// We don't want to race with ourselves here.
dnsmasq.ConfigMutex.Lock()
defer dnsmasq.ConfigMutex.Unlock()
// Get all the networks.
var networks []string
if networkName == "" {
var err error
// Pass project.Default here, as currently dnsmasq (bridged) networks do not support projects.
networks, err = s.Cluster.GetNetworks(project.Default)
if err != nil {
return err
}
} else {
networks = []string{networkName}
}
// Get all the instances.
insts, err := instance.LoadNodeAll(s, instancetype.Any)
if err != nil {
return err
}
// Build a list of dhcp host entries.
entries := map[string][][]string{}
for _, inst := range insts {
// Go through all its devices (including profiles).
for k, d := range inst.ExpandedDevices() {
// Skip uninteresting entries.
if d["type"] != "nic" {
continue
}
nicType, err := nictype.NICType(s, inst.Project(), d)
if err != nil || nicType != "bridged" {
continue
}
// Temporarily populate parent from network setting if used.
if d["network"] != "" {
d["parent"] = d["network"]
}
// Skip devices not connected to managed networks.
if !shared.StringInSlice(d["parent"], networks) {
continue
}
// Fill in the hwaddr from volatile.
d, err = inst.FillNetworkDevice(k, d)
if err != nil {
continue
}
// Add the new host entries.
_, ok := entries[d["parent"]]
if !ok {
entries[d["parent"]] = [][]string{}
}
if (shared.IsTrue(d["security.ipv4_filtering"]) && d["ipv4.address"] == "") || (shared.IsTrue(d["security.ipv6_filtering"]) && d["ipv6.address"] == "") {
_, curIPv4, curIPv6, err := dnsmasq.DHCPStaticAllocation(d["parent"], inst.Project(), inst.Name())
if err != nil && !os.IsNotExist(err) {
return err
}
if d["ipv4.address"] == "" && curIPv4.IP != nil {
d["ipv4.address"] = curIPv4.IP.String()
}
if d["ipv6.address"] == "" && curIPv6.IP != nil {
d["ipv6.address"] = curIPv6.IP.String()
}
}
entries[d["parent"]] = append(entries[d["parent"]], []string{d["hwaddr"], inst.Project(), inst.Name(), d["ipv4.address"], d["ipv6.address"]})
}
}
// Update the host files.
for _, network := range networks {
entries, _ := entries[network]
// Skip networks we don't manage (or don't have DHCP enabled).
if !shared.PathExists(shared.VarPath("networks", network, "dnsmasq.pid")) {
continue
}
// Pass project.Default here, as currently dnsmasq (bridged) networks do not support projects.
n, err := LoadByName(s, project.Default, network)
if err != nil {
return errors.Wrapf(err, "Failed to load network %q in project %q for dnsmasq update", project.Default, network)
}
config := n.Config()
// Wipe everything clean.
files, err := ioutil.ReadDir(shared.VarPath("networks", network, "dnsmasq.hosts"))
if err != nil {
return err
}
for _, entry := range files {
err = os.Remove(shared.VarPath("networks", network, "dnsmasq.hosts", entry.Name()))
if err != nil {
return err
}
}
// Apply the changes.
for entryIdx, entry := range entries {
hwaddr := entry[0]
projectName := entry[1]
cName := entry[2]
ipv4Address := entry[3]
ipv6Address := entry[4]
line := hwaddr
// Look for duplicates.
duplicate := false
for iIdx, i := range entries {
if project.Instance(entry[1], entry[2]) == project.Instance(i[1], i[2]) {
// Skip ourselves.
continue
}
if entry[0] == i[0] {
// Find broken configurations
logger.Errorf("Duplicate MAC detected: %s and %s", project.Instance(entry[1], entry[2]), project.Instance(i[1], i[2]))
}
if i[3] == "" && i[4] == "" {
// Skip unconfigured.
continue
}
if entry[3] == i[3] && entry[4] == i[4] {
// Find identical containers (copies with static configuration).
if entryIdx > iIdx {
duplicate = true
} else {
line = fmt.Sprintf("%s,%s", line, i[0])
logger.Debugf("Found containers with duplicate IPv4/IPv6: %s and %s", project.Instance(entry[1], entry[2]), project.Instance(i[1], i[2]))
}
}
}
if duplicate {
continue
}
// Generate the dhcp-host line.
err := dnsmasq.UpdateStaticEntry(network, projectName, cName, config, hwaddr, ipv4Address, ipv6Address)
if err != nil {
return err
}
}
// Signal dnsmasq.
err = dnsmasq.Kill(network, true)
if err != nil {
return err
}
}
return nil
}
// ForkdnsServersList reads the server list file and returns the list as a slice.
func ForkdnsServersList(networkName string) ([]string, error) {
servers := []string{}
file, err := os.Open(shared.VarPath("networks", networkName, ForkdnsServersListPath, "/", ForkdnsServersListFile))
if err != nil {
return servers, err
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
fields := strings.Fields(scanner.Text())
if len(fields) > 0 {
servers = append(servers, fields[0])
}
}
if err := scanner.Err(); err != nil {
return servers, err
}
return servers, nil
}
func randomSubnetV4() (string, error) {
for i := 0; i < 100; i++ {
cidr := fmt.Sprintf("10.%d.%d.1/24", rand.Intn(255), rand.Intn(255))
_, subnet, err := net.ParseCIDR(cidr)
if err != nil {
continue
}
if inRoutingTable(subnet) {
continue
}
if pingSubnet(subnet) {
continue
}
return cidr, nil
}
return "", fmt.Errorf("Failed to automatically find an unused IPv4 subnet, manual configuration required")
}
func randomSubnetV6() (string, error) {
for i := 0; i < 100; i++ {
cidr := fmt.Sprintf("fd42:%x:%x:%x::1/64", rand.Intn(65535), rand.Intn(65535), rand.Intn(65535))
_, subnet, err := net.ParseCIDR(cidr)
if err != nil {
continue
}
if inRoutingTable(subnet) {
continue
}
if pingSubnet(subnet) {
continue
}
return cidr, nil
}
return "", fmt.Errorf("Failed to automatically find an unused IPv6 subnet, manual configuration required")
}
func inRoutingTable(subnet *net.IPNet) bool {
filename := "route"
if subnet.IP.To4() == nil {
filename = "ipv6_route"
}
file, err := os.Open(fmt.Sprintf("/proc/net/%s", filename))
if err != nil {
return false
}
defer file.Close()
scanner := bufio.NewReader(file)
for {
line, _, err := scanner.ReadLine()
if err != nil {
break
}
fields := strings.Fields(string(line))
// Get the IP
var ip net.IP
if filename == "ipv6_route" {
ip, err = hex.DecodeString(fields[0])
if err != nil {
continue
}
} else {
bytes, err := hex.DecodeString(fields[1])
if err != nil {
continue
}
ip = net.IPv4(bytes[3], bytes[2], bytes[1], bytes[0])
}
// Get the mask
var mask net.IPMask
if filename == "ipv6_route" {
size, err := strconv.ParseInt(fmt.Sprintf("0x%s", fields[1]), 0, 64)
if err != nil {
continue
}
mask = net.CIDRMask(int(size), 128)
} else {
bytes, err := hex.DecodeString(fields[7])
if err != nil {
continue
}
mask = net.IPv4Mask(bytes[3], bytes[2], bytes[1], bytes[0])
}
// Generate a new network
lineNet := net.IPNet{IP: ip, Mask: mask}
// Ignore default gateway
if lineNet.IP.Equal(net.ParseIP("::")) {
continue
}
if lineNet.IP.Equal(net.ParseIP("0.0.0.0")) {
continue
}
// Check if we have a route to our new subnet
if lineNet.Contains(subnet.IP) {
return true
}
}
return false
}
// pingIP sends a single ping packet to the specified IP, returns true if responds, false if not.
func pingIP(ip net.IP) bool {
cmd := "ping"
if ip.To4() == nil {
cmd = "ping6"
}
_, err := shared.RunCommand(cmd, "-n", "-q", ip.String(), "-c", "1", "-W", "1")
if err != nil {
// Remote didn't answer.
return false
}
return true
}
func pingSubnet(subnet *net.IPNet) bool {
var fail bool
var failLock sync.Mutex
var wgChecks sync.WaitGroup
ping := func(ip net.IP) {
defer wgChecks.Done()
if !pingIP(ip) {
return
}
// Remote answered
failLock.Lock()
fail = true
failLock.Unlock()
}
poke := func(ip net.IP) {
defer wgChecks.Done()
addr := fmt.Sprintf("%s:22", ip.String())
if ip.To4() == nil {
addr = fmt.Sprintf("[%s]:22", ip.String())
}
_, err := net.DialTimeout("tcp", addr, time.Second)
if err == nil {
// Remote answered
failLock.Lock()
fail = true
failLock.Unlock()
return
}
}
// Ping first IP
wgChecks.Add(1)
go ping(dhcpalloc.GetIP(subnet, 1))
// Poke port on first IP
wgChecks.Add(1)
go poke(dhcpalloc.GetIP(subnet, 1))
// Ping check
if subnet.IP.To4() != nil {
// Ping last IP
wgChecks.Add(1)
go ping(dhcpalloc.GetIP(subnet, -2))
// Poke port on last IP
wgChecks.Add(1)
go poke(dhcpalloc.GetIP(subnet, -2))
}
wgChecks.Wait()
return fail
}
// GetHostDevice returns the interface name to use for a combination of parent device name and VLAN ID.
// If no vlan ID supplied, parent name is returned unmodified. If non-empty VLAN ID is supplied then it will look
// for an existing VLAN device and return that, otherwise it will return the default "parent.vlan" format as name.
func GetHostDevice(parent string, vlan string) string {
// If no VLAN, just use the raw device
if vlan == "" {
return parent
}
// If no VLANs are configured, use the default pattern
defaultVlan := fmt.Sprintf("%s.%s", parent, vlan)
if !shared.PathExists("/proc/net/vlan/config") {
return defaultVlan
}
// Look for an existing VLAN
f, err := os.Open("/proc/net/vlan/config")
if err != nil {
return defaultVlan
}
defer f.Close()
scanner := bufio.NewScanner(f)
for scanner.Scan() {
// Only grab the lines we're interested in
s := strings.Split(scanner.Text(), "|")
if len(s) != 3 {
continue
}
vlanIface := strings.TrimSpace(s[0])
vlanID := strings.TrimSpace(s[1])
vlanParent := strings.TrimSpace(s[2])
if vlanParent == parent && vlanID == vlan {
return vlanIface
}
}
// Return the default pattern
return defaultVlan
}
// NeighbourIPState can be { PERMANENT | NOARP | REACHABLE | STALE | NONE | INCOMPLETE | DELAY | PROBE | FAILED }.
type NeighbourIPState string
// NeighbourIPStatePermanent the neighbour entry is valid forever and can be only be removed administratively.
const NeighbourIPStatePermanent = "PERMANENT"
// NeighbourIPStateNoARP the neighbour entry is valid. No attempts to validate this entry will be made but it can
// be removed when its lifetime expires.
const NeighbourIPStateNoARP = "NOARP"
// NeighbourIPStateReachable the neighbour entry is valid until the reachability timeout expires.
const NeighbourIPStateReachable = "REACHABLE"
// NeighbourIPStateStale the neighbour entry is valid but suspicious.
const NeighbourIPStateStale = "STALE"
// NeighbourIPStateNone this is a pseudo state used when initially creating a neighbour entry or after trying to
// remove it before it becomes free to do so.
const NeighbourIPStateNone = "NONE"
// NeighbourIPStateIncomplete the neighbour entry has not (yet) been validated/resolved.
const NeighbourIPStateIncomplete = "INCOMPLETE"
// NeighbourIPStateDelay neighbor entry validation is currently delayed.
const NeighbourIPStateDelay = "DELAY"
// NeighbourIPStateProbe neighbor is being probed.
const NeighbourIPStateProbe = "PROBE"
// NeighbourIPStateFailed max number of probes exceeded without success, neighbor validation has ultimately failed.
const NeighbourIPStateFailed = "FAILED"
// NeighbourIP represents an IP neighbour entry.
type NeighbourIP struct {
IP net.IP
State NeighbourIPState
}
// GetNeighbourIPs returns the IP addresses in the neighbour cache for a particular interface and MAC.
func GetNeighbourIPs(interfaceName string, hwaddr string) ([]NeighbourIP, error) {
neigh := &ip.Neigh{DevName: interfaceName}
out, err := neigh.Show()
if err != nil {
return nil, errors.Wrapf(err, "Failed to get IP neighbours for interface %q", interfaceName)
}
neighbours := []NeighbourIP{}
for _, line := range strings.Split(out, "\n") {
// Split fields and early validation.
fields := strings.Fields(line)
if len(fields) != 4 {
continue
}
// Check neighbour matches desired MAC address.
if fields[2] != hwaddr {
continue
}
ip := net.ParseIP(fields[0])
if ip == nil {
continue
}
neighbours = append(neighbours, NeighbourIP{
IP: ip,
State: NeighbourIPState(fields[3]),
})
}
return neighbours, nil
}
// GetLeaseAddresses returns the lease addresses for a network and hwaddr.
func GetLeaseAddresses(networkName string, hwaddr string) ([]net.IP, error) {
leaseFile := shared.VarPath("networks", networkName, "dnsmasq.leases")
if !shared.PathExists(leaseFile) {
return nil, fmt.Errorf("Leases file not found for network %q", networkName)
}
content, err := ioutil.ReadFile(leaseFile)
if err != nil {
return nil, err
}
addresses := []net.IP{}
for _, lease := range strings.Split(string(content), "\n") {
fields := strings.Fields(lease)
if len(fields) < 5 {
continue
}
// Parse the MAC.
mac := GetMACSlice(fields[1])
macStr := strings.Join(mac, ":")
if len(macStr) < 17 && fields[4] != "" {
macStr = fields[4][len(fields[4])-17:]
}
if macStr != hwaddr {
continue
}
// Parse the IP.
ip := net.ParseIP(fields[2])
if ip != nil {
addresses = append(addresses, ip)
}
}
return addresses, nil
}
// GetMACSlice parses MAC address.
func GetMACSlice(hwaddr string) []string {
var buf []string
if !strings.Contains(hwaddr, ":") {
if s, err := strconv.ParseUint(hwaddr, 10, 64); err == nil {
hwaddr = fmt.Sprintln(fmt.Sprintf("%x", s))
var tuple string
for i, r := range hwaddr {
tuple = tuple + string(r)
if i > 0 && (i+1)%2 == 0 {
buf = append(buf, tuple)
tuple = ""
}
}
}
} else {
buf = strings.Split(strings.ToLower(hwaddr), ":")
}
return buf
}
// usesIPv4Firewall returns whether network config will need to use the IPv4 firewall.
func usesIPv4Firewall(netConfig map[string]string) bool {
if netConfig == nil {
return false
}
if netConfig["ipv4.firewall"] == "" || shared.IsTrue(netConfig["ipv4.firewall"]) {
return true
}
if shared.IsTrue(netConfig["ipv4.nat"]) {
return true
}
return false
}
// usesIPv6Firewall returns whether network config will need to use the IPv6 firewall.
func usesIPv6Firewall(netConfig map[string]string) bool {
if netConfig == nil {
return false
}
if netConfig["ipv6.firewall"] == "" || shared.IsTrue(netConfig["ipv6.firewall"]) {
return true
}
if shared.IsTrue(netConfig["ipv6.nat"]) {
return true
}
return false
}
// RandomHwaddr generates a random MAC address from the provided random source.
func randomHwaddr(r *rand.Rand) string {
// Generate a new random MAC address using the usual prefix.
ret := bytes.Buffer{}
for _, c := range "00:16:3e:xx:xx:xx" {
if c == 'x' {
ret.WriteString(fmt.Sprintf("%x", r.Int31n(16)))
} else {
ret.WriteString(string(c))
}
}
return ret.String()
}
// parseIPRange parses an IP range in the format "start-end" and converts it to a shared.IPRange.
// If allowedNets are supplied, then each IP in the range is checked that it belongs to at least one of them.
// IPs in the range can be zero prefixed, e.g. "::1" or "0.0.0.1", however they should not overlap with any
// supplied allowedNets prefixes. If they are within an allowed network, any zero prefixed addresses are
// returned combined with the first allowed network they are within.
// If no allowedNets supplied they are returned as-is.
func parseIPRange(ipRange string, allowedNets ...*net.IPNet) (*shared.IPRange, error) {
inAllowedNet := func(ip net.IP, allowedNet *net.IPNet) net.IP {
if ip == nil {
return nil
}
ipv4 := ip.To4()
// Only match IPv6 addresses against IPv6 networks.
if ipv4 == nil && allowedNet.IP.To4() != nil {
return nil
}
// Combine IP with network prefix if IP starts with a zero.
// If IP is v4, then compare against 4-byte representation, otherwise use 16 byte representation.
if (ipv4 != nil && ipv4[0] == 0) || (ipv4 == nil && ip[0] == 0) {
allowedNet16 := allowedNet.IP.To16()
ipCombined := make(net.IP, net.IPv6len)
for i, b := range ip {
ipCombined[i] = allowedNet16[i] | b
}
ip = ipCombined
}
// Check start IP is within one of the allowed networks.
if !allowedNet.Contains(ip) {
return nil
}
return ip
}
rangeParts := strings.SplitN(ipRange, "-", 2)
if len(rangeParts) != 2 {
return nil, fmt.Errorf("IP range %q must contain start and end IP addresses", ipRange)
}
startIP := net.ParseIP(rangeParts[0])
endIP := net.ParseIP(rangeParts[1])
if startIP == nil {
return nil, fmt.Errorf("Start IP %q is invalid", rangeParts[0])
}
if endIP == nil {
return nil, fmt.Errorf("End IP %q is invalid", rangeParts[1])
}
if bytes.Compare(startIP, endIP) > 0 {
return nil, fmt.Errorf("Start IP %q must be less than End IP %q", startIP, endIP)
}
if len(allowedNets) > 0 {
matchFound := false
for _, allowedNet := range allowedNets {
if allowedNet == nil {
return nil, fmt.Errorf("Invalid allowed network")
}
combinedStartIP := inAllowedNet(startIP, allowedNet)
if combinedStartIP == nil {
continue
}
combinedEndIP := inAllowedNet(endIP, allowedNet)
if combinedEndIP == nil {
continue
}
// If both match then replace parsed IPs with combined IPs and stop searching.
matchFound = true
startIP = combinedStartIP
endIP = combinedEndIP
break
}
if !matchFound {
return nil, fmt.Errorf("IP range %q does not fall within any of the allowed networks %v", ipRange, allowedNets)
}
}
return &shared.IPRange{
Start: startIP,
End: endIP,
}, nil
}
// parseIPRanges parses a comma separated list of IP ranges using parseIPRange.
func parseIPRanges(ipRangesList string, allowedNets ...*net.IPNet) ([]*shared.IPRange, error) {
ipRanges := strings.Split(ipRangesList, ",")
netIPRanges := make([]*shared.IPRange, 0, len(ipRanges))
for _, ipRange := range ipRanges {
netIPRange, err := parseIPRange(strings.TrimSpace(ipRange), allowedNets...)
if err != nil {
return nil, err
}
netIPRanges = append(netIPRanges, netIPRange)
}
return netIPRanges, nil
}
// VLANInterfaceCreate creates a VLAN interface on parent interface (if needed).
// Returns boolean indicating if VLAN interface was created.
func VLANInterfaceCreate(parent string, vlanDevice string, vlanID string, gvrp bool) (bool, error) {
if vlanID == "" {
return false, nil
}
if InterfaceExists(vlanDevice) {
return false, nil
}
// Bring the parent interface up so we can add a vlan to it.
link := &ip.Link{Name: parent}
err := link.SetUp()
if err != nil {
return false, errors.Wrapf(err, "Failed to bring up parent %q", parent)
}
vlan := &ip.Vlan{
Link: ip.Link{
Name: vlanDevice,
Parent: parent,
},
VlanID: vlanID,
Gvrp: gvrp,
}
err = vlan.Add()
if err != nil {
return false, errors.Wrapf(err, "Failed to create VLAN interface %q on %q", vlanDevice, parent)
}
err = vlan.SetUp()
if err != nil {
return false, errors.Wrapf(err, "Failed to bring up interface %q", vlanDevice)
}
// Attempt to disable IPv6 router advertisement acceptance.
util.SysctlSet(fmt.Sprintf("net/ipv6/conf/%s/accept_ra", vlanDevice), "0")
// We created a new vlan interface, return true.
return true, nil
}
// InterfaceRemove removes a network interface by name.
func InterfaceRemove(nic string) error {
link := &ip.Link{Name: nic}
err := link.Delete()
return err
}
// InterfaceExists returns true if network interface exists.
func InterfaceExists(nic string) bool {
if nic != "" && shared.PathExists(fmt.Sprintf("/sys/class/net/%s", nic)) {
return true
}
return false
}
// SubnetContains returns true if outerSubnet contains innerSubnet.
func SubnetContains(outerSubnet *net.IPNet, innerSubnet *net.IPNet) bool {
if outerSubnet == nil || innerSubnet == nil {
return false
}
if !outerSubnet.Contains(innerSubnet.IP) {
return false
}
outerOnes, outerBits := outerSubnet.Mask.Size()
innerOnes, innerBits := innerSubnet.Mask.Size()
// Check number of bits in mask match.
if innerBits != outerBits {
return false
}
// Check that the inner subnet isn't outside of the outer subnet.
if innerOnes < outerOnes {
return false
}
return true
}
// SubnetContainsIP returns true if outsetSubnet contains IP address.
func SubnetContainsIP(outerSubnet *net.IPNet, ip net.IP) bool {
// Convert ip to ipNet.
ipIsIP4 := ip.To4() != nil
prefix := 32
if !ipIsIP4 {
prefix = 128
}
_, ipSubnet, err := net.ParseCIDR(fmt.Sprintf("%s/%d", ip.String(), prefix))
if err != nil {
return false
}
ipSubnet.IP = ip
if SubnetContains(outerSubnet, ipSubnet) {
return true
}
return false
}
// SubnetIterate iterates through each IP in a subnet calling a function for each IP.
// If the ipFunc returns a non-nil error then the iteration stops and the error is returned.
func SubnetIterate(subnet *net.IPNet, ipFunc func(ip net.IP) error) error {
inc := big.NewInt(1)
// Convert route start IP to native representations to allow incrementing.
startIP := subnet.IP.To4()
if startIP == nil {
startIP = subnet.IP.To16()
}
startBig := big.NewInt(0)
startBig.SetBytes(startIP)
// Iterate through IPs in subnet, calling ipFunc for each one.
for {
ip := net.IP(startBig.Bytes())
if !subnet.Contains(ip) {
break
}
err := ipFunc(ip)
if err != nil {
return err
}
startBig.Add(startBig, inc)
}
return nil
}
// SubnetParseAppend parses one or more string CIDR subnets. Appends to the supplied slice. Returns subnets slice.
func SubnetParseAppend(subnets []*net.IPNet, parseSubnet ...string) ([]*net.IPNet, error) {
for _, subnetStr := range parseSubnet {
_, subnet, err := net.ParseCIDR(subnetStr)
if err != nil {
return nil, errors.Wrapf(err, "Invalid subnet %q", subnetStr)
}
subnets = append(subnets, subnet)
}
return subnets, nil
}
// InterfaceBindWait waits for network interface to appear after being bound to a driver.
func InterfaceBindWait(ifName string) error {
for i := 0; i < 10; i++ {
if InterfaceExists(ifName) {
return nil
}
time.Sleep(50 * time.Millisecond)
}
return fmt.Errorf("Bind of interface %q took too long", ifName)
}
// IPRangesOverlap checks whether two ip ranges have ip addresses in common
func IPRangesOverlap(r1, r2 *shared.IPRange) bool {
if r1.End == nil {
return r2.ContainsIP(r1.Start)
}
if r2.End == nil {
return r1.ContainsIP(r2.Start)
}
return r1.ContainsIP(r2.Start) || r1.ContainsIP(r2.End)
}
// InterfaceStatus returns the global unicast IP addresses configured on an interface and whether it is up or not.
func InterfaceStatus(nicName string) ([]net.IP, bool, error) {
iface, err := net.InterfaceByName(nicName)
if err != nil {
return nil, false, errors.Wrapf(err, "Failed loading interface %q", nicName)
}
isUp := iface.Flags&net.FlagUp != 0
addresses, err := iface.Addrs()
if err != nil {
return nil, isUp, errors.Wrapf(err, "Failed getting interface addresses for %q", nicName)
}
var globalUnicastIPs []net.IP
for _, address := range addresses {
ip, _, _ := net.ParseCIDR(address.String())
if ip == nil {
continue
}
if ip.IsGlobalUnicast() {
globalUnicastIPs = append(globalUnicastIPs, ip)
}
}
return globalUnicastIPs, isUp, nil
}
// ParsePortRange validates a port range in the form start-end.
func ParsePortRange(r string) (int64, int64, error) {
entries := strings.Split(r, "-")
if len(entries) > 2 {
return -1, -1, fmt.Errorf("Invalid port range %q", r)
}
base, err := strconv.ParseInt(entries[0], 10, 64)
if err != nil {
return -1, -1, err
}
size := int64(1)
if len(entries) > 1 {
size, err = strconv.ParseInt(entries[1], 10, 64)
if err != nil {
return -1, -1, err
}
if size <= base {
return -1, -1, fmt.Errorf("End port should be higher than start port")
}
size -= base
size++
}
return base, size, nil
}
// ParseIPToNet parses a standalone IP address into a net.IPNet (with the IP field set to the IP supplied).
// The address family is detected and the subnet size set to /32 for IPv4 or /128 for IPv6.
func ParseIPToNet(ipAddress string) (*net.IPNet, error) {
subnetSize := 32
if strings.Contains(ipAddress, ":") {
subnetSize = 128
}
listenAddress, listenAddressNet, err := net.ParseCIDR(fmt.Sprintf("%s/%d", ipAddress, subnetSize))
if err != nil {
return nil, err
}
listenAddressNet.IP = listenAddress // Add IP back into parsed subnet.
return listenAddressNet, err
}
// ParseIPCIDRToNet parses an IP in CIDR format into a net.IPNet (with the IP field set to the IP supplied).
func ParseIPCIDRToNet(ipAddressCIDR string) (*net.IPNet, error) {
listenAddress, listenAddressNet, err := net.ParseCIDR(ipAddressCIDR)
if err != nil {
return nil, err
}
listenAddressNet.IP = listenAddress // Add IP back into parsed subnet.
return listenAddressNet, err
}
// NICUsesNetwork returns true if the nicDev's "network" or "parent" property matches one of the networks names.
func NICUsesNetwork(nicDev map[string]string, networks ...*api.Network) bool {
for _, network := range networks {
if network.Name == nicDev["network"] || network.Name == nicDev["parent"] {
return true
}
}
return false
}
// BridgeNetfilterEnabled checks whether the bridge netfilter feature is loaded and enabled.
// If it is not an error is returned. This is needed in order for instances connected to a bridge to access DNAT
// listeners on the LXD host, as otherwise the packets from the bridge do have the SNAT netfilter rules applied.
func BridgeNetfilterEnabled(ipVersion uint) error {
sysctlName := "iptables"
if ipVersion == 6 {
sysctlName = "ip6tables"
}
sysctlPath := fmt.Sprintf("net/bridge/bridge-nf-call-%s", sysctlName)
sysctlVal, err := util.SysctlGet(sysctlPath)
if err != nil {
return fmt.Errorf("br_netfilter kernel module not loaded")
}
sysctlVal = strings.TrimSpace(sysctlVal)
if sysctlVal != "1" {
return fmt.Errorf("sysctl net.bridge.bridge-nf-call-%s not enabled", sysctlName)
}
return nil
}
| {
return nil, "", fmt.Errorf("More than one IPv4 subnet on default interface")
} |
config.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.14.0
// source: transport/internet/domainsocket/config.proto
package domainsocket
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Config struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Path of the domain socket. This overrides the IP/Port parameter from
// upstream caller.
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
// Abstract speicifies whether to use abstract namespace or not.
// Traditionally Unix domain socket is file system based. Abstract domain
// socket can be used without acquiring file lock.
Abstract bool `protobuf:"varint,2,opt,name=abstract,proto3" json:"abstract,omitempty"`
// Some apps, eg. haproxy, use the full length of sockaddr_un.sun_path to
// connect(2) or bind(2) when using abstract UDS.
Padding bool `protobuf:"varint,3,opt,name=padding,proto3" json:"padding,omitempty"`
}
func (x *Config) Reset() {
*x = Config{}
if protoimpl.UnsafeEnabled {
mi := &file_transport_internet_domainsocket_config_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Config) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Config) ProtoMessage() {}
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_transport_internet_domainsocket_config_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (*Config) Descriptor() ([]byte, []int) {
return file_transport_internet_domainsocket_config_proto_rawDescGZIP(), []int{0}
}
func (x *Config) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
func (x *Config) GetAbstract() bool {
if x != nil {
return x.Abstract
}
return false
}
func (x *Config) GetPadding() bool {
if x != nil {
return x.Padding
}
return false
}
var File_transport_internet_domainsocket_config_proto protoreflect.FileDescriptor
var file_transport_internet_domainsocket_config_proto_rawDesc = []byte{
0x0a, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, 0x65,
0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2a,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x64, 0x6f,
0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x52, 0x0a, 0x06, 0x43, 0x6f,
0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x74,
0x72, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x62, 0x73, 0x74,
0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18,
0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x9f,
0x01, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x65, 0x74, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, 0x65,
0x74, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65,
0x2f, 0x76, 0x34, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e,
0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63,
0x6b, 0x65, 0x74, 0xaa, 0x02, 0x2a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65,
0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72,
0x6e, 0x65, 0x74, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_transport_internet_domainsocket_config_proto_rawDescOnce sync.Once
file_transport_internet_domainsocket_config_proto_rawDescData = file_transport_internet_domainsocket_config_proto_rawDesc
)
func file_transport_internet_domainsocket_config_proto_rawDescGZIP() []byte {
file_transport_internet_domainsocket_config_proto_rawDescOnce.Do(func() {
file_transport_internet_domainsocket_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_domainsocket_config_proto_rawDescData)
})
return file_transport_internet_domainsocket_config_proto_rawDescData
}
var file_transport_internet_domainsocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_transport_internet_domainsocket_config_proto_goTypes = []interface{}{
(*Config)(nil), // 0: v2ray.core.transport.internet.domainsocket.Config
}
var file_transport_internet_domainsocket_config_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_transport_internet_domainsocket_config_proto_init() }
func file_transport_internet_domainsocket_config_proto_init() | {
if File_transport_internet_domainsocket_config_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_transport_internet_domainsocket_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Config); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_transport_internet_domainsocket_config_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_transport_internet_domainsocket_config_proto_goTypes,
DependencyIndexes: file_transport_internet_domainsocket_config_proto_depIdxs,
MessageInfos: file_transport_internet_domainsocket_config_proto_msgTypes,
}.Build()
File_transport_internet_domainsocket_config_proto = out.File
file_transport_internet_domainsocket_config_proto_rawDesc = nil
file_transport_internet_domainsocket_config_proto_goTypes = nil
file_transport_internet_domainsocket_config_proto_depIdxs = nil
} |
|
lib.rs | #[macro_use]
extern crate lazy_static;
use {
regex::Regex,
std::{
error::Error,
io::{BufRead, BufReader, Read},
num::ParseIntError,
str::FromStr,
},
};
#[derive(Debug, PartialEq, Eq)]
pub struct Password {
policy_min: usize,
policy_max: usize,
policy_char: char,
password: String,
}
pub fn part1(input: &[Password]) -> usize {
input
.iter()
.filter(|line| {
let count = line
.password
.chars()
.filter(|&c| c == line.policy_char)
.count();
count >= line.policy_min && count <= line.policy_max
})
.count()
}
pub fn part2(input: &[Password]) -> usize {
input
.iter()
.filter(|line| {
let a = line.policy_char == line.password.chars().nth(line.policy_min - 1).unwrap();
let b = line.policy_char == line.password.chars().nth(line.policy_max - 1).unwrap();
a ^ b
})
.count()
}
pub fn get_input(f: impl Read) -> Result<Vec<Password>, Box<dyn Error>> {
let reader = BufReader::new(f);
let mut buffer = vec![];
// read the input line by line
for line in reader.lines() {
// attempt to parse each line
let value = line?.parse::<Password>()?;
buffer.push(value);
}
Ok(buffer)
}
lazy_static! {
static ref RE_PASSWORD: Regex = Regex::new(r"(\d+?)-(\d+?) (\w): (\w+)$").unwrap();
}
impl FromStr for Password {
type Err = ParseIntError;
fn from_str(s: &str) -> Result<Self, Self::Err> |
}
#[cfg(test)]
mod tests {
use super::*;
use std::io::Cursor;
static DATA: &str = r#"1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc"#;
#[test]
fn test_input() {
let input = get_input(Cursor::new(DATA)).unwrap();
assert_eq!(
input,
vec![
Password {
policy_min: 1,
policy_max: 3,
policy_char: 'a',
password: "abcde".to_owned()
},
Password {
policy_min: 1,
policy_max: 3,
policy_char: 'b',
password: "cdefg".to_owned()
},
Password {
policy_min: 2,
policy_max: 9,
policy_char: 'c',
password: "ccccccccc".to_owned()
},
]
);
}
#[test]
fn test_part1() {
let input = get_input(Cursor::new(DATA)).unwrap();
assert_eq!(part1(&input), 2);
}
#[test]
fn test_part2() {
let input = get_input(Cursor::new(DATA)).unwrap();
assert_eq!(part2(&input), 1);
}
}
| {
let cap = RE_PASSWORD.captures(s).expect("invalid input");
Ok(Password {
policy_min: cap.get(1).expect("invalid input").as_str().parse()?,
policy_max: cap.get(2).expect("invalid input").as_str().parse()?,
policy_char: cap
.get(3)
.expect("invalid input")
.as_str()
.chars()
.next()
.unwrap(),
password: cap.get(4).expect("invalid input").as_str().to_owned(),
})
} |
api_op_UpdateApnsVoipSandboxChannel.go | // Code generated by smithy-go-codegen DO NOT EDIT.
package pinpoint
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/pinpoint/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables the APNs VoIP sandbox channel for an application or updates the status
// and settings of the APNs VoIP sandbox channel for an application.
func (c *Client) UpdateApnsVoipSandboxChannel(ctx context.Context, params *UpdateApnsVoipSandboxChannelInput, optFns ...func(*Options)) (*UpdateApnsVoipSandboxChannelOutput, error) {
if params == nil {
params = &UpdateApnsVoipSandboxChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateApnsVoipSandboxChannel", params, optFns, c.addOperationUpdateApnsVoipSandboxChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateApnsVoipSandboxChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateApnsVoipSandboxChannelInput struct {
// Specifies the status and settings of the APNs (Apple Push Notification service)
// VoIP sandbox channel for an application.
//
// This member is required.
APNSVoipSandboxChannelRequest *types.APNSVoipSandboxChannelRequest
// The unique identifier for the application. This identifier is displayed as the
// Project ID on the Amazon Pinpoint console.
//
// This member is required.
ApplicationId *string
noSmithyDocumentSerde
}
type UpdateApnsVoipSandboxChannelOutput struct {
// Provides information about the status and settings of the APNs (Apple Push
// Notification service) VoIP sandbox channel for an application.
//
// This member is required.
APNSVoipSandboxChannelResponse *types.APNSVoipSandboxChannelResponse
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateApnsVoipSandboxChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApnsVoipSandboxChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApnsVoipSandboxChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil |
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateApnsVoipSandboxChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApnsVoipSandboxChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateApnsVoipSandboxChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mobiletargeting",
OperationName: "UpdateApnsVoipSandboxChannel",
}
}
| {
return err
} |
bitstamp_live_test.go | //+build mock_test_off
// This will build if build tag mock_test_off is parsed and will do live testing
// using all tests in (exchange)_test.go
package bitstamp
import (
"log"
"os"
"testing"
"github.com/openware/irix/sharedtestvalues"
)
var mockTests = false
func TestMain(m *testing.M) | {
bitstampConfig, err := configTest()
if err != nil {
log.Fatal("Bitstamp Setup() init error", err)
}
bitstampConfig.API.AuthenticatedSupport = true
bitstampConfig.API.Credentials.Key = apiKey
bitstampConfig.API.Credentials.Secret = apiSecret
bitstampConfig.API.Credentials.ClientID = customerID
b.SetDefaults()
b.Websocket = sharedtestvalues.NewTestWebsocket()
err = b.Setup(bitstampConfig)
if err != nil {
log.Fatal("Bitstamp setup error", err)
}
log.Printf(sharedtestvalues.LiveTesting, b.Name)
os.Exit(m.Run())
} |
|
lib.rs | #![recursion_limit = "256"]
use js_sys::Date;
use yew::services::ConsoleService;
use yew::{html, Component, ComponentLink, Html, ShouldRender};
pub struct Model {
link: ComponentLink<Self>,
console: ConsoleService,
value: i64,
}
pub enum Msg {
Increment,
Decrement,
}
impl Component for Model {
type Message = Msg;
type Properties = (); | Model {
link,
console: ConsoleService::new(),
value: 0,
}
}
fn update(&mut self, msg: Self::Message) -> ShouldRender {
match msg {
Msg::Increment => {
self.value += 1;
self.console.log("plus one");
}
Msg::Decrement => {
self.value -= 1;
self.console.log("minus one");
}
}
true
}
fn change(&mut self, _: Self::Properties) -> ShouldRender {
false
}
fn view(&self) -> Html {
html! {
<div>
<nav class="menu">
<button onclick=self.link.callback(|_| Msg::Increment)>
{ "Increment" }
</button>
<button onclick=self.link.callback(|_| Msg::Decrement)>
{ "Decrement" }
</button>
<button onclick=self.link.batch_callback(|_| vec![Msg::Increment, Msg::Increment])>
{ "Increment Twice" }
</button>
</nav>
<p>{ self.value }</p>
<p>{ Date::new_0().to_string().as_string().unwrap() }</p>
</div>
}
}
} |
fn create(_: Self::Properties, link: ComponentLink<Self>) -> Self { |
tests.rs | #![cfg(test)]
use super::*;
use crate::test_utils::*;
ssz_and_tree_hash_tests!(FoundationBeaconState);
fn test_beacon_proposer_index<T: EthSpec>() {
let spec = T::default_spec();
let relative_epoch = RelativeEpoch::Current;
// Build a state for testing.
let build_state = |validator_count: usize| -> BeaconState<T> {
let builder: TestingBeaconStateBuilder<T> =
TestingBeaconStateBuilder::from_deterministic_keypairs(validator_count, &spec);
let (mut state, _keypairs) = builder.build();
state.build_committee_cache(relative_epoch, &spec).unwrap();
state
};
// Get the i'th candidate proposer for the given state and slot
let ith_candidate = |state: &BeaconState<T>, slot: Slot, i: usize, spec: &ChainSpec| {
let epoch = slot.epoch(T::slots_per_epoch());
let seed = state.get_beacon_proposer_seed(slot, &spec).unwrap();
let active_validators = state.get_active_validator_indices(epoch, spec).unwrap();
active_validators[compute_shuffled_index(
i,
active_validators.len(),
&seed,
spec.shuffle_round_count,
)
.unwrap()]
};
// Run a test on the state.
let test = |state: &BeaconState<T>, slot: Slot, candidate_index: usize| {
assert_eq!(
state.get_beacon_proposer_index(slot, &spec),
Ok(ith_candidate(state, slot, candidate_index, &spec))
);
};
// Test where we have one validator per slot.
// 0th candidate should be chosen every time.
let state = build_state(T::slots_per_epoch() as usize);
for i in 0..T::slots_per_epoch() {
test(&state, Slot::from(i), 0);
}
// Test where we have two validators per slot.
// 0th candidate should be chosen every time.
let state = build_state(T::slots_per_epoch() as usize * 2);
for i in 0..T::slots_per_epoch() {
test(&state, Slot::from(i), 0);
}
// Test with two validators per slot, first validator has zero balance.
let mut state = build_state(T::slots_per_epoch() as usize * 2);
let slot0_candidate0 = ith_candidate(&state, Slot::new(0), 0, &spec);
state.validators[slot0_candidate0].effective_balance = 0;
test(&state, Slot::new(0), 1);
for i in 1..T::slots_per_epoch() {
test(&state, Slot::from(i), 0);
}
}
#[test]
fn beacon_proposer_index() {
test_beacon_proposer_index::<MinimalEthSpec>();
}
/// Test that
///
/// 1. Using the cache before it's built fails.
/// 2. Using the cache after it's build passes.
/// 3. Using the cache after it's dropped fails.
fn test_cache_initialization<'a, T: EthSpec>(
state: &'a mut BeaconState<T>,
relative_epoch: RelativeEpoch,
spec: &ChainSpec,
) {
let slot = relative_epoch
.into_epoch(state.slot.epoch(T::slots_per_epoch()))
.start_slot(T::slots_per_epoch());
// Assuming the cache isn't already built, assert that a call to a cache-using function fails.
assert_eq!(
state.get_attestation_duties(0, relative_epoch),
Err(BeaconStateError::CommitteeCacheUninitialized(Some(
relative_epoch
)))
);
// Build the cache.
state.build_committee_cache(relative_epoch, spec).unwrap();
// Assert a call to a cache-using function passes.
state.get_beacon_committee(slot, 0).unwrap();
// Drop the cache.
state.drop_committee_cache(relative_epoch);
// Assert a call to a cache-using function fail.
assert_eq!(
state.get_beacon_committee(slot, 0),
Err(BeaconStateError::CommitteeCacheUninitialized(Some(
relative_epoch
)))
);
}
#[test]
fn cache_initialization() {
let spec = MinimalEthSpec::default_spec();
let builder: TestingBeaconStateBuilder<MinimalEthSpec> =
TestingBeaconStateBuilder::from_deterministic_keypairs(16, &spec);
let (mut state, _keypairs) = builder.build();
state.slot =
(MinimalEthSpec::genesis_epoch() + 1).start_slot(MinimalEthSpec::slots_per_epoch());
test_cache_initialization(&mut state, RelativeEpoch::Previous, &spec);
test_cache_initialization(&mut state, RelativeEpoch::Current, &spec);
test_cache_initialization(&mut state, RelativeEpoch::Next, &spec);
}
fn test_clone_config<E: EthSpec>(base_state: &BeaconState<E>, clone_config: CloneConfig) {
let state = base_state.clone_with(clone_config.clone());
if clone_config.committee_caches {
state
.committee_cache(RelativeEpoch::Previous)
.expect("committee cache exists");
state
.committee_cache(RelativeEpoch::Current)
.expect("committee cache exists");
state
.committee_cache(RelativeEpoch::Next)
.expect("committee cache exists");
} else {
state
.committee_cache(RelativeEpoch::Previous)
.expect_err("shouldn't exist");
state
.committee_cache(RelativeEpoch::Current)
.expect_err("shouldn't exist");
state
.committee_cache(RelativeEpoch::Next)
.expect_err("shouldn't exist");
}
if clone_config.pubkey_cache {
assert_ne!(state.pubkey_cache.len(), 0);
} else {
assert_eq!(state.pubkey_cache.len(), 0);
}
if clone_config.exit_cache {
state
.exit_cache
.check_initialized()
.expect("exit cache exists");
} else {
state
.exit_cache
.check_initialized()
.expect_err("exit cache doesn't exist");
}
if clone_config.tree_hash_cache {
assert!(state.tree_hash_cache.is_some());
} else {
assert!(state.tree_hash_cache.is_none(), "{:?}", clone_config);
}
}
#[test]
fn clone_config() {
let spec = MinimalEthSpec::default_spec();
let builder: TestingBeaconStateBuilder<MinimalEthSpec> =
TestingBeaconStateBuilder::from_deterministic_keypairs(16, &spec);
let (mut state, _keypairs) = builder.build();
state.build_all_caches(&spec).unwrap();
let num_caches = 4;
let all_configs = (0..2u8.pow(num_caches)).map(|i| CloneConfig {
committee_caches: (i & 1) != 0,
pubkey_cache: ((i >> 1) & 1) != 0,
exit_cache: ((i >> 2) & 1) != 0,
tree_hash_cache: ((i >> 3) & 1) != 0,
});
for config in all_configs {
test_clone_config(&state, config);
}
}
#[test]
fn tree_hash_cache() {
use crate::test_utils::{SeedableRng, TestRandom, XorShiftRng};
use tree_hash::TreeHash;
let mut rng = XorShiftRng::from_seed([42; 16]);
let mut state: FoundationBeaconState = BeaconState::random_for_test(&mut rng);
let root = state.update_tree_hash_cache().unwrap();
assert_eq!(root.as_bytes(), &state.tree_hash_root()[..]);
state.slot += 1;
let root = state.update_tree_hash_cache().unwrap();
assert_eq!(root.as_bytes(), &state.tree_hash_root()[..]);
}
/// Tests committee-specific components
#[cfg(test)]
mod committees {
use super::*;
use crate::beacon_state::MinimalEthSpec;
use swap_or_not_shuffle::shuffle_list;
fn | <T: EthSpec>(
state: BeaconState<T>,
epoch: Epoch,
validator_count: usize,
spec: &ChainSpec,
) {
let active_indices: Vec<usize> = (0..validator_count).collect();
let seed = state.get_seed(epoch, Domain::BeaconAttester, spec).unwrap();
let relative_epoch = RelativeEpoch::from_epoch(state.current_epoch(), epoch).unwrap();
let mut ordered_indices = state
.get_cached_active_validator_indices(relative_epoch)
.unwrap()
.to_vec();
ordered_indices.sort_unstable();
assert_eq!(
active_indices, ordered_indices,
"Validator indices mismatch"
);
let shuffling =
shuffle_list(active_indices, spec.shuffle_round_count, &seed[..], false).unwrap();
let mut expected_indices_iter = shuffling.iter();
// Loop through all slots in the epoch being tested.
for slot in epoch.slot_iter(T::slots_per_epoch()) {
let beacon_committees = state.get_beacon_committees_at_slot(slot).unwrap();
// Assert that the number of committees in this slot is consistent with the reported number
// of committees in an epoch.
assert_eq!(
beacon_committees.len() as u64,
state.get_epoch_committee_count(relative_epoch).unwrap() / T::slots_per_epoch()
);
for (committee_index, bc) in beacon_committees.iter().enumerate() {
// Assert that indices are assigned sequentially across committees.
assert_eq!(committee_index as u64, bc.index);
// Assert that a committee lookup via slot is identical to a committee lookup via
// index.
assert_eq!(state.get_beacon_committee(bc.slot, bc.index).unwrap(), *bc);
// Loop through each validator in the committee.
for (committee_i, validator_i) in bc.committee.iter().enumerate() {
// Assert the validators are assigned contiguously across committees.
assert_eq!(
*validator_i,
*expected_indices_iter.next().unwrap(),
"Non-sequential validators."
);
// Assert a call to `get_attestation_duties` is consistent with a call to
// `get_beacon_committees_at_slot`
let attestation_duty = state
.get_attestation_duties(*validator_i, relative_epoch)
.unwrap()
.unwrap();
assert_eq!(attestation_duty.slot, slot);
assert_eq!(attestation_duty.index, bc.index);
assert_eq!(attestation_duty.committee_position, committee_i);
assert_eq!(attestation_duty.committee_len, bc.committee.len());
}
}
}
// Assert that all validators were assigned to a committee.
assert!(expected_indices_iter.next().is_none());
}
fn committee_consistency_test<T: EthSpec>(
validator_count: usize,
state_epoch: Epoch,
cache_epoch: RelativeEpoch,
) {
let spec = &T::default_spec();
let mut builder = TestingBeaconStateBuilder::from_single_keypair(
validator_count,
&Keypair::random(),
spec,
);
let slot = state_epoch.start_slot(T::slots_per_epoch());
builder.teleport_to_slot(slot);
let (mut state, _keypairs): (BeaconState<T>, _) = builder.build();
let distinct_hashes: Vec<Hash256> = (0..T::epochs_per_historical_vector())
.map(|i| Hash256::from_low_u64_be(i as u64))
.collect();
state.randao_mixes = FixedVector::from(distinct_hashes);
state
.build_committee_cache(RelativeEpoch::Previous, spec)
.unwrap();
state
.build_committee_cache(RelativeEpoch::Current, spec)
.unwrap();
state
.build_committee_cache(RelativeEpoch::Next, spec)
.unwrap();
let cache_epoch = cache_epoch.into_epoch(state_epoch);
execute_committee_consistency_test(state, cache_epoch, validator_count as usize, &spec);
}
fn committee_consistency_test_suite<T: EthSpec>(cached_epoch: RelativeEpoch) {
let spec = T::default_spec();
let validator_count = spec.max_committees_per_slot
* T::slots_per_epoch() as usize
* spec.target_committee_size
+ 1;
committee_consistency_test::<T>(validator_count as usize, Epoch::new(0), cached_epoch);
committee_consistency_test::<T>(
validator_count as usize,
T::genesis_epoch() + 4,
cached_epoch,
);
committee_consistency_test::<T>(
validator_count as usize,
T::genesis_epoch() + T::slots_per_historical_root() as u64 * T::slots_per_epoch() * 4,
cached_epoch,
);
}
#[test]
fn current_epoch_committee_consistency() {
committee_consistency_test_suite::<MinimalEthSpec>(RelativeEpoch::Current);
}
#[test]
fn previous_epoch_committee_consistency() {
committee_consistency_test_suite::<MinimalEthSpec>(RelativeEpoch::Previous);
}
#[test]
fn next_epoch_committee_consistency() {
committee_consistency_test_suite::<MinimalEthSpec>(RelativeEpoch::Next);
}
}
mod get_outstanding_deposit_len {
use super::*;
use crate::test_utils::TestingBeaconStateBuilder;
use crate::MinimalEthSpec;
fn state() -> BeaconState<MinimalEthSpec> {
let spec = MinimalEthSpec::default_spec();
let builder: TestingBeaconStateBuilder<MinimalEthSpec> =
TestingBeaconStateBuilder::from_deterministic_keypairs(16, &spec);
let (state, _keypairs) = builder.build();
state
}
#[test]
fn returns_ok() {
let mut state = state();
assert_eq!(state.get_outstanding_deposit_len(), Ok(0));
state.eth1_data.deposit_count = 17;
state.eth1_deposit_index = 16;
assert_eq!(state.get_outstanding_deposit_len(), Ok(1));
}
#[test]
fn returns_err_if_the_state_is_invalid() {
let mut state = state();
// The state is invalid, deposit count is lower than deposit index.
state.eth1_data.deposit_count = 16;
state.eth1_deposit_index = 17;
assert_eq!(
state.get_outstanding_deposit_len(),
Err(BeaconStateError::InvalidDepositState {
deposit_count: 16,
deposit_index: 17,
})
);
}
}
| execute_committee_consistency_test |
scrape_mars.py | from bs4 import BeautifulSoup
import requests
from splinter import Browser
import pandas as pd
import time
def init_browser():
# @NOTE: Replace the path with your actual path to the chromedriver
executable_path = {"executable_path": "./chromedriver"}
return Browser("chrome", **executable_path, headless=False)
def scrape():
browser = init_browser()
url_nasa = "https://mars.nasa.gov/news/?page=0&per_page=40&order=publish_date+desc%2Ccreated_at+desc&search=&category=19%2C165%2C184%2C204&blank_scope=Latest"
# Retrieve page with the requests module
response_nasa = requests.get(url_nasa)
# Create BeautifulSoup object; parse with 'html.parser'
soup_nasa = BeautifulSoup(response_nasa.text, 'html.parser')
##finding the title and summary of first article
results_titles = soup_nasa.find_all('div', class_='content_title')
summaries = soup_nasa.find_all("div", class_ = "rollover_description_inner")
title_first = results_titles[0].text.strip()
summaries_first = summaries[0].text.strip()
##finding feature image url
url_mars_img = 'https://www.jpl.nasa.gov/spaceimages/?search=&category=Mars'
browser.visit(url_mars_img)
browser.click_link_by_partial_text('FULL IMAGE')
time.sleep(5)
browser.click_link_by_partial_text('more info')
time.sleep(5)
browser.click_link_by_partial_href('spaceimages/images')
feature_image_url = browser.url
time.sleep(5)
##getting the twitter weather
url_twitter = "https://twitter.com/marswxreport?lang=en"
# Retrieve page with the requests module
response_twitter = requests.get(url_twitter)
# Create BeautifulSoup object; parse with 'html.parser'
soup3 = BeautifulSoup(response_twitter.text, 'html.parser')
mars_weather = soup3.find_all("p",class_ = "TweetTextSize TweetTextSize--normal js-tweet-text tweet-text")[0].text
##scraping Mars facts
url_facts = "https://space-facts.com/mars/"
tables = pd.read_html(url_facts)
df = tables[0]
df.columns = ["Parameter", "Values"]
mars_data_df = df.set_index(["Parameter"])
mars_data_df.to_html("mars_facts.html")
mars_data_html = mars_data_df.to_html()
mars_data_html = mars_data_html.replace("\n", "")
##hemisphere
url_hemis = "https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars"
browser.visit(url_hemis)
time.sleep(5)
html4 = browser.html
soup4 = BeautifulSoup(html4, 'html.parser')
links = []
for link in soup4.find_all('a'):
finds = link.get("href")
if ("/search/map/Mars" in finds):
links.append(finds)
links = list(set(links))
hemisphere_image_urls = []
for i in range(len(links)):
dicts1 = {}
dicts1["title"] = soup4.find_all("h3")[i].text
browser.click_link_by_partial_text(soup4.find_all("h3")[i].text)
time.sleep(5)
n_html = browser.html
soup5 = BeautifulSoup(n_html, "html.parser")
for link in soup5.find_all("a"):
finds = link.get("href")
if ("/full.jpg" in finds):
dicts1["img_url"] = finds
hemisphere_image_urls.append(dicts1)
browser.back()
print(hemisphere_image_urls)
| mars_data_dict = {"weather":mars_weather,"mars_facts":mars_data_html,"hemisphere":hemisphere_image_urls,"feature_image": feature_image_url,"title_feature":title_first,"summary_feature":summaries_first}
return mars_data_dict | |
startQiskit_Class2285.py | # qubit number=4
# total number=39
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_xor(s: str, t: str) -> str:
length = len(s)
res = []
for i in range(length):
res.append(str(int(s[i]) ^ int(t[i])))
return ''.join(res[::-1])
def bitwise_dot(s: str, t: str) -> str:
|
def build_oracle(n: int, f) -> QuantumCircuit:
# implement the oracle O_f
# NOTE: use multi_control_toffoli_gate ('noancilla' mode)
# https://qiskit.org/documentation/_modules/qiskit/aqua/circuits/gates/multi_control_toffoli_gate.html
# https://quantumcomputing.stackexchange.com/questions/3943/how-do-you-implement-the-toffoli-gate-using-only-single-qubit-and-cnot-gates
# https://quantumcomputing.stackexchange.com/questions/2177/how-can-i-implement-an-n-bit-toffoli-gate
controls = QuantumRegister(n, "ofc")
target = QuantumRegister(1, "oft")
oracle = QuantumCircuit(controls, target, name="Of")
for i in range(2 ** n):
rep = np.binary_repr(i, n)
if f(rep) == "1":
for j in range(n):
if rep[j] == "0":
oracle.x(controls[j])
oracle.mct(controls, target[0], None, mode='noancilla')
for j in range(n):
if rep[j] == "0":
oracle.x(controls[j])
# oracle.barrier()
return oracle
def make_circuit(n:int,f) -> QuantumCircuit:
# circuit begin
input_qubit = QuantumRegister(n,"qc")
classical = ClassicalRegister(n, "qm")
prog = QuantumCircuit(input_qubit, classical)
prog.h(input_qubit[3]) # number=36
prog.cz(input_qubit[0],input_qubit[3]) # number=37
prog.h(input_qubit[3]) # number=38
prog.h(input_qubit[3]) # number=23
prog.cz(input_qubit[0],input_qubit[3]) # number=24
prog.h(input_qubit[3]) # number=25
prog.x(input_qubit[3]) # number=18
prog.cx(input_qubit[0],input_qubit[3]) # number=19
prog.cx(input_qubit[0],input_qubit[3]) # number=15
prog.h(input_qubit[1]) # number=2
prog.h(input_qubit[2]) # number=3
prog.h(input_qubit[3]) # number=4
prog.y(input_qubit[3]) # number=12
prog.h(input_qubit[0]) # number=5
oracle = build_oracle(n-1, f)
prog.append(oracle.to_gate(),[input_qubit[i] for i in range(n-1)]+[input_qubit[n-1]])
prog.h(input_qubit[1]) # number=6
prog.h(input_qubit[2]) # number=7
prog.h(input_qubit[3]) # number=32
prog.cx(input_qubit[3],input_qubit[0]) # number=20
prog.cx(input_qubit[3],input_qubit[0]) # number=26
prog.z(input_qubit[3]) # number=27
prog.h(input_qubit[0]) # number=29
prog.cz(input_qubit[3],input_qubit[0]) # number=30
prog.h(input_qubit[0]) # number=31
prog.h(input_qubit[0]) # number=33
prog.cz(input_qubit[3],input_qubit[0]) # number=34
prog.h(input_qubit[0]) # number=35
prog.h(input_qubit[3]) # number=8
prog.h(input_qubit[0]) # number=9
prog.y(input_qubit[2]) # number=10
prog.y(input_qubit[2]) # number=11
# circuit end
return prog
if __name__ == '__main__':
a = "111"
b = "0"
f = lambda rep: bitwise_xor(bitwise_dot(a, rep), b)
prog = make_circuit(4,f)
backend = BasicAer.get_backend('statevector_simulator')
sample_shot =8000
info = execute(prog, backend=backend).result().get_statevector()
qubits = round(log2(len(info)))
info = {
np.binary_repr(i, qubits): round((info[i]*(info[i].conjugate())).real,3)
for i in range(2 ** qubits)
}
backend = FakeVigo()
circuit1 = transpile(prog,backend,optimization_level=2)
writefile = open("../data/startQiskit_Class2285.csv","w")
print(info,file=writefile)
print("results end", file=writefile)
print(circuit1.__len__(),file=writefile)
print(circuit1,file=writefile)
writefile.close()
| length = len(s)
res = 0
for i in range(length):
res += int(s[i]) * int(t[i])
return str(res % 2) |
ControlManager.py | import pygame
class ControlManager(object):
@classmethod
def up(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def down(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def left(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def | (cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def angle(cls, pos):
raise NotImplementedError('Error: Abstract class')
@classmethod
def prim_button(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def sec_button(cls):
raise NotImplementedError('Error: Abstract class')
@classmethod
def select_button(cls):
raise NotImplementedError('Error: Abstract class')
| right |
bench.rs | use futures::StreamExt;
use location::Location;
use osm_admin_hierarchies::{run_service, ServiceConfig};
use std::convert::TryInto;
use std::error::Error;
use std::fs::File;
use std::io::Read;
use std::io::{self, BufRead};
use std::net::TcpListener;
use std::path::PathBuf;
use structopt::StructOpt;
use tokio::time::Instant;
pub mod boundary;
pub mod geojson;
pub mod location;
pub mod service;
#[derive(StructOpt)]
#[structopt(about = "benchmark the service")]
enum Opt {
Bulk {
#[structopt(flatten)]
common_opts: CommonOpts,
},
Single {
/// block
#[structopt(long = "block")]
block: bool,
#[structopt(flatten)]
common_opts: CommonOpts,
},
}
#[derive(StructOpt)]
struct CommonOpts {
/// rtree bin path
#[structopt(short = "b", long = "bin")]
bin_path: PathBuf,
/// locations csv path
#[structopt(short = "l", long = "locs")]
locations_path: PathBuf,
/// iterations
#[structopt(short = "i", long = "iterations", default_value = "3")]
iterations: u32,
/// max concurrency
#[structopt(short = "m", long = "max", default_value = "4")]
concurrency: u8,
}
fn spawn_app(path: PathBuf) -> String {
let tree = service::load_tree(path).expect("could not build rtree");
let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind random port");
let port = listener.local_addr().unwrap().port();
let config = ServiceConfig {
tree,
parallel: false,
listener,
};
let server = run_service(config).expect("Failed to start server");
let _ = tokio::spawn(server);
format!("http://127.0.0.1:{}", port)
}
async fn perform_single_requests(
base_url: &str,
locations: impl Iterator<Item = Location>,
concurrency: u8,
block: bool,
) -> usize {
let client = reqwest::Client::new();
let fetches = futures::stream::iter(locations.into_iter().map(|location| {
let client = &client;
async move {
let route = if block { "locate_with_block" } else | ;
let path = format!("{}/{}?loc={}", &base_url, route, location);
let resp = client.get(&path).send().await?;
if resp.status() != 200 {
return Err("!= 200".into());
}
let _ = resp.text().await?;
Ok(())
}
}))
.buffer_unordered(concurrency.into())
.collect::<Vec<Result<(), Box<dyn Error>>>>();
fetches.await.into_iter().filter_map(|x| x.ok()).count()
}
async fn perform_bulk_request(base_url: &str, file: &mut File, concurrency: u8) -> usize {
let client = &reqwest::Client::new();
let bulks = futures::stream::iter(0..10)
.map(|_: i32| {
let mut data = Vec::new();
file.read_to_end(&mut data).expect("could not read file");
let route = format!("{}/bulk", &base_url);
async move {
let resp = client
.post(&route)
.body(data)
.send()
.await
.expect("request failed");
if resp.status() != 200 {
return Err("!= 200".into());
}
let _ = resp.text().await?;
Ok(())
}
})
.buffer_unordered(concurrency.into())
.collect::<Vec<Result<(), Box<dyn Error>>>>();
bulks.await.into_iter().filter_map(|x| x.ok()).count()
}
async fn single(opts: CommonOpts, block: bool) {
let base_url = spawn_app(opts.bin_path);
for _ in 0..opts.iterations {
let file = File::open(opts.locations_path.clone()).expect("cannot open locations file");
let lines = io::BufReader::new(file).lines();
let locations = lines.filter_map(|line| {
let line = line.ok()?;
let end_of_id_field = line.find(',')?;
let loc_str = &line[end_of_id_field + 1..];
let location: Location = loc_str.try_into().ok()?;
Some(location)
});
let now = Instant::now();
let oks = perform_single_requests(&base_url, locations, opts.concurrency, block).await;
let new_now = Instant::now();
println!(
"took {:?} for {} requests",
new_now.checked_duration_since(now).unwrap(),
oks,
);
}
}
async fn bulk(opts: CommonOpts) {
let base_url = spawn_app(opts.bin_path);
for _ in 0..opts.iterations {
let mut file = File::open(opts.locations_path.clone()).expect("cannot open locations file");
let now = Instant::now();
let oks = perform_bulk_request(&base_url, &mut file, opts.concurrency).await;
let new_now = Instant::now();
println!(
"took {:?} for {} bulk requests",
new_now.checked_duration_since(now).unwrap(),
oks,
);
}
}
#[actix_rt::main]
async fn main() {
let opt = Opt::from_args();
match opt {
Opt::Bulk { common_opts } => bulk(common_opts).await,
Opt::Single { common_opts, block } => single(common_opts, block).await,
};
// single(opt).await;
// bulk(opt).await;
}
| { "locate" } |
BaseModel.js | /**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
(function (Drupal, Backbone) {
Drupal.quickedit.BaseModel = Backbone.Model.extend({
initialize: function initialize(options) {
this.__initialized = true;
return Backbone.Model.prototype.initialize.call(this, options);
},
set: function set(key, val, options) {
if (this.__initialized) {
if (_typeof(key) === 'object') {
key.validate = true; | }
options.validate = true;
}
}
return Backbone.Model.prototype.set.call(this, key, val, options);
}
});
})(Drupal, Backbone); | } else {
if (!options) {
options = {}; |
main.go | package main
import (
"fmt"
"github.com/derat/advent-of-code/lib"
)
func | () {
input := lib.InputInt64s("2019/9")
// Part 1: Write 1 and print BOOST keycode (only output).
vm := lib.NewIntcode(input)
vm.Start()
vm.In <- 1
var vals []int64
for v := range vm.Out {
vals = append(vals, v)
}
lib.AssertEq(len(vals), 1)
fmt.Println(vals[0])
// Part 2: Write 2 and print coordinates of distress signal (only output).
vm = lib.NewIntcode(input)
vm.Start()
vm.In <- 2
fmt.Println(<-vm.Out)
}
| main |
data.go | // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
package sqs
import (
s "github.com/elastic/beats/libbeat/common/schema"
c "github.com/elastic/beats/libbeat/common/schema/mapstrstr"
)
| schemaRequestFields = s.Schema{
"oldest_message_age": s.Object{
"sec": c.Float("ApproximateAgeOfOldestMessage"),
},
"messages": s.Object{
"delayed": c.Float("ApproximateNumberOfMessagesDelayed"),
"not_visible": c.Float("ApproximateNumberOfMessagesNotVisible"),
"visible": c.Float("ApproximateNumberOfMessagesVisible"),
"deleted": c.Float("NumberOfMessagesDeleted"),
"received": c.Float("NumberOfMessagesReceived"),
"sent": c.Float("NumberOfMessagesSent"),
},
"empty_receives": c.Float("NumberOfEmptyReceives"),
"sent_message_size": s.Object{
"bytes": c.Float("SentMessageSize"),
},
"queue.name": c.Str("QueueName"),
}
) | var ( |
Mapboxgl3D.js | // import 'mapbox-gl/dist/mapbox-gl.css';
import style from './Mapboxgl3D.less';
export default class Mapboxgl3D extends Component {
componentDidMount() {
mapboxgl.accessToken =
'pk.eyJ1IjoibGljaGFvbGluZyIsImEiOiJjamllNnA2M3YwNWk5M3BtcXFxYnpucG9vIn0.OLQogaz-U5zui_-MpHJzoQ';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v9',
zoom: 14,
center: [121.02058410644533, 30.697563734811315],
});
map.on('load', function() {
map.addLayer(
{
id: 'wms-test-layer',
type: 'raster',
source: {
type: 'raster',
tiles: [
// 'https://geodata.state.nj.us/imagerywms/Natural2015?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=Natural2015',
'http://t0.tianditu.com/vec_w/wmts?LAYER=vec&tileMatrixSet=w&service=wmts&request=GetTile&version=1.0.0&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&format=tiles',
'http://t0.tianditu.com/cva_w/wmts?LAYER=cva&tileMatrixSet=w&service=wmts&request=GetTile&version=1.0.0&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&format=tiles',
],
tileSize: 256,
},
paint: {},
},
'aeroway-taxiway'
);
});
// this.map.on('click', function () {
// var map = this.map;
// debugger;
// }.bind(this));
// this.map.on('zoom', function () {
// var map = this.map;
// if (map.getZoom() <= 15)
// map.setLayoutProperty('3d-buildings', 'visibility', 'none');
// else
// map.setLayoutProperty('3d-buildings', 'visibility', 'visible');
// }.bind(this));
// this.map.on('load', function () {
// // Insert the layer beneath any symbol layer.
// var map = this.map;
// var layers = map.getStyle().layers;
// var labelLayerId;
// for (var i = 0; i < layers.length; i++) {
// if (layers[i].type === 'symbol' && layers[i].layout['text-field']) { //如果是标注,且标注有字
// labelLayerId = layers[i].id;
// break;
// }
// }
// map.addLayer({
// 'id': '3d-buildings',
// 'source': 'composite',
// 'source-layer': 'building',
// 'filter': ['==', 'extrude', 'true'],
// 'type': 'fill-extrusion',
// 'minzoom': 15,
// 'paint': {
// 'fill-extrusion-color': '#fff',
// // use an 'interpolate' expression to add a smooth transition effect to the
// // buildings as the user zooms in
// 'fill-extrusion-height': [
// "interpolate", ["linear"], ["zoom"],
// 15, 0,
// 15.05, ["get", "height"]
// ],
// 'fill-extrusion-base': [
// "interpolate", ["linear"], ["zoom"],
// 15, 0,
// 15.05, ["get", "min_height"]
// ],
// 'fill-extrusion-opacity': .6
// }
// }, labelLayerId);
// }.bind(this));
}
render() {
return (
<div className={style.content}>
<div id="map" className={style.map} />
</div>
);
}
} | import { Component } from 'react';
import mapboxgl from 'mapbox-gl'; |
|
mod.rs | use clap::ArgMatches;
pub struct Context {
pub yes: bool,
pub no_script: bool,
pub verbose: bool,
}
impl Context {
pub fn new(args: &ArgMatches) -> Context |
fn set_yes(&mut self, yes: bool) {
self.yes = yes;
}
fn set_no_script(&mut self, ns: bool) {
self.no_script = ns;
}
fn set_verbose(&mut self, verbose: bool) {
self.verbose = verbose
}
}
| {
let mut ctx = Context {
yes: false,
no_script: false,
verbose: false,
};
ctx.set_yes(args.is_present("yes"));
ctx.set_no_script(args.is_present("no-script"));
ctx.set_verbose(args.is_present("verbose"));
return ctx;
} |
delta.go | // Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.
// Code generated by ack-generate. DO NOT EDIT.
package db_subnet_group
import (
"reflect"
ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
)
// Hack to avoid import errors during build...
var (
_ = &reflect.Method{}
)
// newResourceDelta returns a new `ackcompare.Delta` used to compare two
// resources
func newResourceDelta(
a *resource,
b *resource,
) *ackcompare.Delta | {
delta := ackcompare.NewDelta()
if (a == nil && b != nil) ||
(a != nil && b == nil) {
delta.Add("", a, b)
return delta
}
if ackcompare.HasNilDifference(a.ko.Spec.Description, b.ko.Spec.Description) {
delta.Add("Spec.Description", a.ko.Spec.Description, b.ko.Spec.Description)
} else if a.ko.Spec.Description != nil && b.ko.Spec.Description != nil {
if *a.ko.Spec.Description != *b.ko.Spec.Description {
delta.Add("Spec.Description", a.ko.Spec.Description, b.ko.Spec.Description)
}
}
if ackcompare.HasNilDifference(a.ko.Spec.Name, b.ko.Spec.Name) {
delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
} else if a.ko.Spec.Name != nil && b.ko.Spec.Name != nil {
if *a.ko.Spec.Name != *b.ko.Spec.Name {
delta.Add("Spec.Name", a.ko.Spec.Name, b.ko.Spec.Name)
}
}
if !ackcompare.SliceStringPEqual(a.ko.Spec.SubnetIDs, b.ko.Spec.SubnetIDs) {
delta.Add("Spec.SubnetIDs", a.ko.Spec.SubnetIDs, b.ko.Spec.SubnetIDs)
}
if !reflect.DeepEqual(a.ko.Spec.Tags, b.ko.Spec.Tags) {
delta.Add("Spec.Tags", a.ko.Spec.Tags, b.ko.Spec.Tags)
}
return delta
} |
|
_ortmodule_utils.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
from . import _utils
from onnxruntime.capi.onnxruntime_inference_collection import OrtValue
from onnxruntime.capi import _pybind_state as C
import torch
from torch.utils.dlpack import from_dlpack, to_dlpack
from torch.utils.cpp_extension import load_inline
def _ortvalue_to_torch_tensor(ortvalue):
# PyTorch's to_dlpack() uses same config for both torch.bool and torch.uint8,
# and convert the config to torch.uint8 tensor duing from_dlpack().
# So we need to convert the torch tensor to torch.bool type if OrtValue is bool tensor.
torch_tensor = from_dlpack(ortvalue._ortvalue.to_dlpack())
return torch_tensor.to(torch.bool) if ortvalue.data_type() == 'tensor(bool)' else torch_tensor
def _ortvalue_from_torch_tensor(torch_tensor):
|
def _load_torch_gpu_allocator_cpp_extension(verbosity, is_rocm_pytorch):
gpu_identifier = "hip" if is_rocm_pytorch else "cuda"
gpu_allocator_header = "HIPCachingAllocator" if is_rocm_pytorch else "CUDACachingAllocator"
torch_gpu_allocator_addresses_cpp_source = f'''
#include <torch/extension.h>
#include <c10/{gpu_identifier}/{gpu_allocator_header}.h>
size_t gpu_caching_allocator_raw_alloc_address() {{
return reinterpret_cast<size_t>(&c10::{gpu_identifier}::{gpu_allocator_header}::raw_alloc);
}}
size_t gpu_caching_allocator_raw_delete_address() {{
return reinterpret_cast<size_t>(&c10::{gpu_identifier}::{gpu_allocator_header}::raw_delete);
}}
'''
return load_inline(name='inline_extension',
cpp_sources=[torch_gpu_allocator_addresses_cpp_source],
extra_cflags=['-D__HIP_PLATFORM_HCC__=1' if is_rocm_pytorch else ''],
functions=['gpu_caching_allocator_raw_alloc_address',
'gpu_caching_allocator_raw_delete_address'],
verbose=verbosity,
with_cuda=True)
def _check_same_device(device, argument_str, *args):
'''Check that all tensor arguments in *args reside on the same device as the input device'''
assert isinstance(device, torch.device), '`device` must be a valid `torch.device` object'
for arg in args:
if arg is not None and isinstance(arg, torch.Tensor):
arg_device = torch.device(arg.device)
if arg_device != device:
raise RuntimeError(
f"{argument_str} found on device {arg_device}, but expected it to be on module device {device}.")
def get_device_from_module(module):
'''Returns the first device found in the `module`'s parameters or None'''
device = None
try:
device = next(module.parameters()).device
for param in module.parameters():
if param.device != device:
raise RuntimeError('ORTModule supports a single device per model for now')
except StopIteration:
# Model doesn't have a device set to any of the model parameters
pass
return device
def _create_iobinding(io_binding, inputs, model, device):
'''Creates IO binding for a `model` inputs and output'''
for idx, value_info in enumerate(model.graph.input):
io_binding.bind_ortvalue_input(value_info.name, _ortvalue_from_torch_tensor(inputs[idx]))
for value_info in model.graph.output:
io_binding.bind_output(value_info.name, device.type, device_id=_utils.get_device_index(device))
| return OrtValue(C.OrtValue.from_dlpack(to_dlpack(torch_tensor), torch_tensor.dtype == torch.bool)) |
usage.go | package types
import "github.com/pkg/errors"
type withUsages struct {
// https://dictionaryapi.com/products/json#sec-2.usages
UsageParagraphs []UsageParagraphs `json:"usages"`
}
// UsageParagraphs https://dictionaryapi.com/products/json#sec-2.usages
type UsageParagraphs struct {
Label string `json:"pl"`
Text UsageParagraphText `json:"pt"`
}
// UsageParagraphText https://dictionaryapi.com/products/json#sec-2.usages
type UsageParagraphText arrayContainer
// UsageParagraphTextElementType is an enum type for the types of elements in the paragraph
type UsageParagraphTextElementType int
// Values for UsageParagraphTextElementType
const (
UsageParagraphTextElementTypeUnknown UsageParagraphTextElementType = iota
UsageParagraphTextElementTypeText
UsageParagraphTextElementTypeVerbalIllustration
UsageParagraphTextElementTypeSeeAlso
)
// UsageParagraphTextElementTypeFromString returns a UsageParagraphTextElementTYpe from its string ID
func | (id string) UsageParagraphTextElementType {
switch id {
case "text":
return UsageParagraphTextElementTypeText
case "vis":
return UsageParagraphTextElementTypeVerbalIllustration
case "uarefs":
return UsageParagraphTextElementTypeSeeAlso
default:
return UsageParagraphTextElementTypeUnknown
}
}
func (t UsageParagraphTextElementType) String() string {
return []string{"", "text", "vis", "uarefs"}[t]
}
// Contents returns a copied slice of the contents in the UsageParagraphText
func (upt UsageParagraphText) Contents() ([]UsageParagraphTextElement, error) {
elements := []UsageParagraphTextElement{}
for _, el := range upt {
key, err := el.Key()
if err != nil {
return nil, err
}
typ := UsageParagraphTextElementTypeFromString(key)
switch typ {
case UsageParagraphTextElementTypeText:
var out string
err = el.UnmarshalValue(&out)
elements = append(elements, UsageParagraphTextElement{Type: typ, Text: &out})
case UsageParagraphTextElementTypeVerbalIllustration:
var out VerbalIllustration
err = el.UnmarshalValue(&out)
elements = append(elements, UsageParagraphTextElement{Type: typ, VerbalIllustration: &out})
case UsageParagraphTextElementTypeSeeAlso:
var out []UsageSeeAlso
err = el.UnmarshalValue(&out)
elements = append(elements, UsageParagraphTextElement{Type: typ, SeeAlso: out})
default:
err = errors.New("unknown element type in run-in")
}
}
return elements, nil
}
// UsageParagraphTextElement is an element of the UsageParagraphText container
type UsageParagraphTextElement struct {
Type UsageParagraphTextElementType
Text *string
VerbalIllustration *VerbalIllustration
SeeAlso []UsageSeeAlso
}
// UsageSeeAlso is "uaref" here https://dictionaryapi.com/products/json#sec-2.usages
type UsageSeeAlso struct {
Reference string `json:"uaref"`
}
| UsageParagraphTextElementTypeFromString |
urls.py | """dailyfresh URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
#from django.conf.urls import include, url
from django.urls import path, include
from django.contrib import admin
#import xadmin
urlpatterns = [
# url(r'^admin/', include(admin.site.urls)),
# #url(r'^xadmin/', include(xadmin.site.urls)),
# url(r'^search', include('haystack.urls')), # 全文检索框架
# url(r'^tinymce/', include('tinymce.urls')), # 富文本编辑器url
# url(r'^user/', include('apps.user.urls', namespace='user')), # 用户模块 user.urls
# url(r'^cart/', include('apps.cart.urls', namespace='cart')), # 购物车模块
# url(r'^order/', include('apps.order.urls', namespace='order')), # 订单模块
# url(r'^', include('apps.goods.urls', namespace='goods')), # 商品模块
path('admin/', admin.site.urls), | path('search/', include('haystack.urls')), # 全文检索框架
path('tinymce/', include('tinymce.urls')), # 富文本编辑器url
path('user/', include(('user.urls','user'), namespace='user')), # 用户模块 user.urls
path('cart/', include(('cart.urls','cart'), namespace='cart')), # 购物车模块
path('order/', include(('order.urls','order'), namespace='order')), # 订单模块
path('', include(('goods.urls','goods'), namespace='goods')), # 商品模块
] | #path('xadmin/', xadmin.site.urls), |
customTools.js | import PluginId from '../pluginId'
import Embed from '@editorjs/embed'
import Table from '@editorjs/table'
import List from '@editorjs/list'
import Warning from '@editorjs/warning'
import Code from '@editorjs/code'
import LinkTool from '@editorjs/link'
import Raw from '@editorjs/raw'
import Header from '@editorjs/header'
import Quote from '@editorjs/quote'
import Marker from '@editorjs/marker'
import CheckList from '@editorjs/checklist'
import Delimiter from '@editorjs/delimiter'
import InlineCode from '@editorjs/inline-code'
import Introduction from './customPlugins/introduction/introduction'
const customTools = {
embed: Embed,
table: {
class: Table,
inlineToolbar: true,
},
list: {
class: List,
inlineToolbar: true,
},
warning: {
class: Warning,
inlineToolbar: true,
config: {
titlePlaceholder: 'Title',
messagePlaceholder: 'Message',
},
},
code: Code,
LinkTool: {
class: LinkTool,
config: {
endpoint: `/api/${PluginId}/link`,
},
},
raw: {
class: Raw,
inlineToolbar: true,
},
header: {
class: Header,
inlineToolbar: true,
},
quote: {
class: Quote,
inlineToolbar: true,
config: {
quotePlaceholder: 'Quote',
captionPlaceholder: 'Quote`s author',
},
},
marker: {
class: Marker,
inlineToolbar: true, | class: CheckList,
inlineToolbar: true,
},
delimiter: Delimiter,
inlineCode: InlineCode,
introduction: {
class: Introduction,
inlineToolbar: true,
},
}
export default customTools | },
checklist: { |
max_non_negative_subArray.py | # Max Non Negative SubArray
# https://www.interviewbit.com/problems/max-non-negative-subarray/
#
# Find out the maximum sub-array of non negative numbers from an array.
# The sub-array should be continuous. That is, a sub-array created by choosing
# the second and fourth element and skipping the third element is invalid.
#
# Maximum sub-array is defined in terms of the sum of the elements in the sub-array.
# Sub-array A is greater than sub-array B if sum(A) > sum(B).
#
# Example:
#
# A : [1, 2, 5, -7, 2, 3]
# The two sub-arrays are [1, 2, 5] [2, 3].
# The answer is [1, 2, 5] as its sum is larger than [2, 3]
#
# NOTE: If there is a tie, then compare with segment's length and return segment which has maximum length
# NOTE 2: If there is still a tie, then return the segment with minimum starting index
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
class | :
# @param A : list of integers
# @return a list of integers
def maxset(self, A):
max_sum = max_left = max_right = -1
tmp_sum = left = 0
for i, elem in enumerate(A):
if elem >= 0:
tmp_sum += elem
else:
if tmp_sum > max_sum:
max_sum, max_left, max_right = tmp_sum, left, i
tmp_sum = 0
left = i + 1
else:
if tmp_sum > max_sum:
max_left, max_right = left, len(A)
return [] if max_left == max_right == -1 else A[max_left: max_right]
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if __name__ == "__main__":
s = Solution()
print(s.maxset([0, 0, -1, 0])) | Solution |
index.ts | import * as api from './communication/api';
import * as stmp from './communication/smtp';
| // start SMTP Server at Port 25
api.start(3000);
stmp.start(25); | |
programrequest.go | package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json" | "strings"
)
// Programrequest
type Programrequest struct {
// Name - The program name
Name *string `json:"name,omitempty"`
// Description - The program description
Description *string `json:"description,omitempty"`
// TopicIds - The ids of topics associated to the program
TopicIds *[]string `json:"topicIds,omitempty"`
// Tags - The program tags
Tags *[]string `json:"tags,omitempty"`
}
func (o *Programrequest) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Programrequest
return json.Marshal(&struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
TopicIds *[]string `json:"topicIds,omitempty"`
Tags *[]string `json:"tags,omitempty"`
*Alias
}{
Name: o.Name,
Description: o.Description,
TopicIds: o.TopicIds,
Tags: o.Tags,
Alias: (*Alias)(o),
})
}
func (o *Programrequest) UnmarshalJSON(b []byte) error {
var ProgramrequestMap map[string]interface{}
err := json.Unmarshal(b, &ProgramrequestMap)
if err != nil {
return err
}
if Name, ok := ProgramrequestMap["name"].(string); ok {
o.Name = &Name
}
if Description, ok := ProgramrequestMap["description"].(string); ok {
o.Description = &Description
}
if TopicIds, ok := ProgramrequestMap["topicIds"].([]interface{}); ok {
TopicIdsString, _ := json.Marshal(TopicIds)
json.Unmarshal(TopicIdsString, &o.TopicIds)
}
if Tags, ok := ProgramrequestMap["tags"].([]interface{}); ok {
TagsString, _ := json.Marshal(Tags)
json.Unmarshal(TagsString, &o.Tags)
}
return nil
}
// String returns a JSON representation of the model
func (o *Programrequest) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
} | "strconv" |
animation.rs | use dominator::animation::{easing, Percentage, MutableAnimation, AnimatedMapBroadcaster};
use futures_signals::signal::{Signal, SignalExt};
use web_sys::HtmlElement;
use utils::resize::{ResizeInfo, get_resize_info};
use super::super::state::*;
use components::module::_groups::cards::lookup::Side;
pub struct Animation {
pub animation: MutableAnimation,
pub orig_x: f64,
pub orig_y: f64,
pub dest_x: f64,
pub dest_y: f64,
pub dest_scale: f64,
pub side: Side,
}
pub struct AnimationState {
pub x: f64,
pub y: f64,
pub scale: f64,
pub finished: bool,
}
impl Animation {
pub fn new(base: &Base, element:&HtmlElement, found_index: usize, side:Side) -> Self {
let animation = MutableAnimation::new(crate::config::TRANISITION_DURATION);
animation.animate_to(Percentage::new(1.0));
let (orig_x, orig_y) = get_resize_info().get_element_pos_rem(element);
let mut dest_x = ((found_index % 2) * 280) as f64;
let mut dest_y = 100.0 + (((found_index as f64) / 2.0).floor() * 280.0);
if side == Side::Right {
dest_x += 10.0;
dest_y += 10.0;
}
let dest_scale = 0.5;
Self {
animation,
orig_x,
orig_y,
dest_x,
dest_y,
dest_scale,
side,
}
}
pub fn ended_signal(&self) -> impl Signal<Item = bool> {
self.state_signal()
.map(|t| t.finished)
.dedupe()
}
pub fn state_signal(&self) -> impl Signal<Item = AnimationState> |
}
| {
let orig_x = self.orig_x;
let orig_y = self.orig_y;
let dest_x = self.dest_x;
let dest_y = self.dest_y;
let dest_scale = self.dest_scale;
self.animation.signal()
.map(move |t| easing::in_out(t, easing::cubic))
.map(move |t| {
AnimationState {
x: t.range_inclusive(orig_x, dest_x),
y: t.range_inclusive(orig_y, dest_y),
scale: t.range_inclusive(1.0, dest_scale),
finished: t.into_f64() == 1.0
}
})
} |
hole_arena.py | from robosuite.models.arenas import TableArena
class HoleArena(TableArena):
| """
Workspace that contains a tabletop with two fixed pegs.
Args:
table_full_size (3-tuple): (L,W,H) full dimensions of the table
table_friction (3-tuple): (sliding, torsional, rolling) friction parameters of the table
table_offset (3-tuple): (x,y,z) offset from center of arena when placing table.
Note that the z value sets the upper limit of the table
"""
def __init__(
self,
table_full_size=(0.45, 0.69, 0.05),
table_friction=(1, 0.005, 0.0001),
table_offset=(0, 0, 0),
):
super().__init__(
table_full_size=table_full_size,
table_friction=table_friction,
table_offset=table_offset,
xml="arenas/hole_arena.xml",
)
# Get references to peg bodies
self.holebody = self.worldbody.find("./body[@name='hole_body']") |
|
auth.module.ts | import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common"
import { AuthMiddleware } from "./auth.middleware";
@Module({})
export class | implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(AuthMiddleware)
.forRoutes('(.*)');
}
}
| AuthModule |
App.js | import "./styles.css";
import { LiturgyOfTheDay } from "./lib"
export default function App() {
return (
<div className="App">
| locale="en"
LiturgyOfTheDayOuterClassnames="border rounded"
LiturgicalColorAsBG={false}
allowPrevNext={true}
/>
{/**<LiturgyOfTheDay
diocesanCalendar="DIOCESIDIROMA"
locale="it"
LiturgyOfTheDayOuterClassnames="border rounded"
LiturgicalColorAsBG={true}
allowPrevNext={true}
/>**/}
</div>
);
} | <LiturgyOfTheDay
nationalCalendar="USA"
|
quotly.py | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Port From UniBorg to UserBot by MoveAngel
import random
import requests
from asyncio.exceptions import TimeoutError
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from userbot import CMD_HELP, bot
from userbot.events import register
if 1 == 1:
strings = {
"name": "Quotes",
"api_token_cfg_doc": "API Key/Token for Quotes.",
"api_url_cfg_doc": "API URL for Quotes.",
"colors_cfg_doc": "Username colors",
"default_username_color_cfg_doc": "Default color for the username.",
"no_reply": "You didn't reply to a message.",
"no_template": "You didn't specify the template.",
"delimiter": "</code>, <code>",
"server_error": "Server error. Please report to developer.",
"invalid_token": "You've set an invalid token, get it from `http://antiddos.systems`.",
"unauthorized": "You're unauthorized to do this.",
"not_enough_permissions": "Wrong template. You can use only the default one.",
"templates": "Available Templates: <code>{}</code>",
"cannot_send_stickers": "You cannot send stickers in this chat.",
"admin": "admin",
"creator": "creator",
"hidden": "hidden",
"channel": "Channel"}
config = {"api_url": "http://api.antiddos.systems",
"username_colors": ["#fb6169", "#faa357", "#b48bf2", "#85de85",
"#62d4e3", "#65bdf3", "#ff5694"],
"default_username_color": "#b48bf2"}
@register(outgoing=True, pattern=r"^\.q")
async def quotess(qotli):
if qotli.fwd_from:
return
if not qotli.reply_to_msg_id:
return await qotli.edit("```Reply Pesannya GOBLOKKK!!.```")
reply_message = await qotli.get_reply_message()
if not reply_message.text:
return await qotli.edit("```Reply Pesannya GOBLOKKK!!```")
chat = "@QuotLyBot"
if reply_message.sender.bot:
return await qotli.edit("```Reply Pesannya GOBLOKKK!!.```")
await qotli.edit("```Bim Salabim Jadi Stiker Prok Prok Prok......```")
try:
async with bot.conversation(chat) as conv:
try:
response = conv.wait_event(
events.NewMessage(
incoming=True,
from_users=1031952739))
msg = await bot.forward_messages(chat, reply_message)
response = await response
""" - don't spam notif - """
await bot.send_read_acknowledge(conv.chat_id)
except YouBlockedUserError:
return await qotli.reply("```Unblock @QuotLyBot lalu coba lagi```")
if response.text.startswith("Hi!"):
await qotli.edit("```Hidupkan privasi pesan terusan lalu coba lagi```")
else:
await qotli.delete()
await bot.forward_messages(qotli.chat_id, response.message)
await bot.send_read_acknowledge(qotli.chat_id)
""" - cleanup chat after completed - """
await qotli.client.delete_messages(conv.chat_id,
[msg.id, response.id])
except TimeoutError:
await qotli.edit()
@register(outgoing=True, pattern="^.xquote(?: |$)(.*)")
async def quote_search(event):
|
CMD_HELP.update({
"quotly":
"`.q`\
\nUsage: Enhance ur text to sticker.\
\n\n`.xquote`\
\nUsage: Enhance ur text to stickers."
})
| if event.fwd_from:
return
await event.edit("Processing...")
search_string = event.pattern_match.group(1)
input_url = "https://bots.shrimadhavuk.me/Telegram/GoodReadsQuotesBot/?q={}".format(
search_string)
headers = {"USER-AGENT": "UniBorg"}
try:
response = requests.get(input_url, headers=headers).json()
except BaseException:
response = None
if response is not None:
result = random.choice(response).get(
"input_message_content").get("message_text")
else:
result = None
if result:
await event.edit(result.replace("<code>", "`").replace("</code>", "`"))
else:
await event.edit("Zero results found") |
BUS_XRayPatient.py | from DAL.DAL_XRayPatient import DAL_XRayPatient
class BUS_XRayPatient():
def | (self):
self.dalXRayPatient = DAL_XRayPatient()
def firstLoadLinkXRay(self, IDPatient):
return self.dalXRayPatient.selectLinkXRayViaIDPatient(IDPatient=IDPatient)
def loadLinkXRay(self, IDPatient, XRayType):
return self.dalXRayPatient.selectLinkXRay(IDPatient=IDPatient, XRayType=XRayType) | __init__ |
stream.rs | use crate::{GrabResult, InstantCamera, TimeoutHandling};
use std::pin::Pin;
use std::task::{Context, Poll};
use tokio_stream::Stream;
impl<'a> Stream for InstantCamera<'a> {
type Item = GrabResult;
fn | (self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<GrabResult>> {
let mut grab_result = GrabResult::new().expect("Creating a GrabResult should not fail");
if !self.is_grabbing() {
return Poll::Ready(None);
}
let fd = self.fd.borrow_mut();
// poll the wait object fd for readyness and continue if ready, if not ready
// poll_read_ready calls the ctx's waker if we can make progress
match fd.as_ref()
.expect("No waitobject fd present (during start_grabbing, no tokio handler was available).")
.poll_read_ready(cx)
{
Poll::Ready(Ok(mut g)) => {
// vital: clear the ready state to make it run again
g.clear_ready();
}
Poll::Ready(Err(_)) => {
return Poll::Ready(None);
}
Poll::Pending => {
return Poll::Pending;
}
};
// we know we're ready, so we don't have to wait at all
match self.retrieve_result(0, &mut grab_result, TimeoutHandling::Return) {
Ok(true) => Poll::Ready(Some(grab_result)),
Ok(false) => Poll::Pending,
Err(_) => Poll::Ready(None),
}
}
}
#[cfg(test)]
mod tests {
use crate::{GrabOptions, Pylon, PylonError, PylonResult, TlFactory};
use tokio_stream::{StreamExt, StreamMap};
#[tokio::test]
async fn streaming_works() -> PylonResult<()> {
let mut images = 10;
let pylon = Pylon::new();
let cam = TlFactory::instance(&pylon).create_first_device()?;
cam.open()?;
cam.start_grabbing(&GrabOptions::default().count(images))?;
tokio::pin!(cam);
while let Some(res) = cam.next().await {
images -= 1;
assert!(res.grab_succeeded()?);
}
assert_eq!(images, 0);
Ok(())
}
#[tokio::test]
async fn streaming_all_cams_works() -> PylonResult<()> {
let pylon = Pylon::new();
let mut streams = StreamMap::new();
TlFactory::instance(&pylon)
.enumerate_devices()?
.iter()
.enumerate()
.try_for_each(|(n, info)| {
let cam = TlFactory::instance(&pylon).create_device(info)?;
cam.open()?;
cam.start_grabbing(&GrabOptions::default())?;
streams.insert(format!("{}-{}", info.model_name()?, n), Box::pin(cam));
Ok::<_, PylonError>(())
})?;
for _ in 0..50 {
let (id, res) = streams.next().await.unwrap();
assert!(res.grab_succeeded()?);
println!("Cam: {:?}", id);
}
Ok(())
}
}
| poll_next |
utils.py | import collections
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
def requests_retry_session(
retries=3,
backoff_factor=0.3,
status_forcelist=(500, 502, 504),
session=None
):
"""
Exponential back off for requests.
via https://www.peterbe.com/plog/best-practice-with-retries-with-requests
"""
session = session or requests.Session()
retry = Retry(
total=retries,
read=retries,
connect=retries,
backoff_factor=backoff_factor,
status_forcelist=status_forcelist,
)
adapter = HTTPAdapter(max_retries=retry)
session.mount('http://', adapter)
session.mount('https://', adapter)
return session
def flatten(d, parent_key='', sep='_'):
"""
Flattens a dictionary using a seperator.
via https://stackoverflow.com/a/6027615
"""
items = []
for k, v in d.items():
new_key = parent_key + sep + k if parent_key else k
if isinstance(v, collections.MutableMapping):
items.extend(flatten(v, new_key, sep=sep).items())
else:
items.append((new_key, v))
return dict(items)
def | (pmid):
""" Given a PMID, return that PMID's (title, [authors]). """
try:
j_url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=" + str(pmid) + "&retmode=json&tool=refinebio&[email protected]"
resp = requests_retry_session().get(j_url, timeout=60)
title = resp.json()['result'][str(pmid)]['title']
author_names = []
for author in resp.json()['result'][str(pmid)]['authors']:
author_names.append(author['name'])
return (title, author_names)
except:
# This is fine for a timeout
return ("", [])
| get_title_and_authors_for_pubmed_id |
dummy.rs | use std::collections::{VecDeque};
use ::channel::{SinglePoll};
use ::proxy::{self, Proxy, Control, Eid};
use ::proxy_handle::{self, ProxyWrapper, Handle, UserProxy, UserHandle};
pub use proxy_handle::{Tx, Rx};
pub struct DummyProxy {}
impl DummyProxy {
fn new() -> Self {
Self {}
}
}
impl Proxy for DummyProxy {
fn attach(&mut self, _ctrl: &Control) -> ::Result<()> {
Ok(())
}
fn | (&mut self, _ctrl: &Control) -> ::Result<()> {
Ok(())
}
fn process(&mut self, _ctrl: &mut Control, _readiness: mio::Ready, _eid: Eid) -> ::Result<()> {
Ok(())
}
}
impl UserProxy<Tx, Rx> for DummyProxy {
fn process_channel(&mut self, _ctrl: &mut Control, _msg: Tx) -> ::Result<()> {
Ok(())
}
}
pub struct DummyHandle {
pub msgs: VecDeque<Rx>,
}
impl DummyHandle {
fn new() -> Self {
Self {
msgs: VecDeque::new(),
}
}
}
impl UserHandle<Tx, Rx> for DummyHandle {
fn process_channel(&mut self, msg: Rx) -> ::Result<()> {
self.msgs.push_back(msg);
Ok(())
}
}
pub fn create() -> ::Result<(ProxyWrapper<DummyProxy, Tx, Rx>, Handle<DummyHandle, Tx, Rx>)> {
proxy_handle::create(DummyProxy::new(), DummyHandle::new())
}
pub fn wait_msgs(h: &mut Handle<DummyHandle, Tx, Rx>, sp: &mut SinglePoll, n: usize) -> ::Result<()> {
let ns = h.user.msgs.len();
loop {
if let Err(e) = sp.wait(None) {
break Err(::Error::Channel(e.into()));
}
if let Err(e) = h.process() {
break Err(e);
}
if h.user.msgs.len() - ns >= n {
break Ok(());
}
}
}
pub fn wait_close(h: &mut Handle<DummyHandle, Tx, Rx>, sp: &mut SinglePoll) -> ::Result<()> {
loop {
if let Err(e) = sp.wait(None) {
break Err(::Error::Channel(e.into()));
}
match h.process() {
Ok(()) => continue,
Err(err) => match err {
::Error::Proxy(proxy::Error::Closed) => break Ok(()),
other => break Err(other),
}
}
}
} | detach |
Solution.py | import re |
print(str(bool(re.match(regex_pattern, input())))) |
regex_pattern = r'M{0,3}(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[VX]|V?I{0,3})$' |
config.js | /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/*************************************************************
*
* MathJax/jax/input/AsciiMath/config.js
*
* Initializes the AsciiMath InputJax (the main definition is in
* MathJax/jax/input/AsciiMath/jax.js, which is loaded when needed).
*
* Originally adapted for MathJax by David Lippman.
* Additional work done by Davide P. Cervone. | *
* ---------------------------------------------------------------------
*
* Copyright (c) 2012-2016 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.InputJax.AsciiMath = MathJax.InputJax({
id: "AsciiMath",
version: "2.7.0",
directory: MathJax.InputJax.directory + "/AsciiMath",
extensionDir: MathJax.InputJax.extensionDir + "/AsciiMath",
config: {
fixphi: true, // switch phi and varphi unicode values
useMathMLspacing: true, // use MathML spacing rather than TeX spacing?
displaystyle: true, // put limits above and below operators
decimalsign: "." // can change to "," but watch out for "(1,2)"
}
});
MathJax.InputJax.AsciiMath.Register("math/asciimath");
MathJax.InputJax.AsciiMath.loadComplete("config.js"); | |
model.py | # Copyright (C) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions
# and limitations under the License.
""" This module contains architecture of Text Recognition model."""
import tensorflow as tf
from tensorflow.contrib import rnn
import tensorflow.contrib.slim as slim
class TextRecognition:
""" Text recognition model definition. """
def __init__(self, is_training, num_classes, backbone_dropout=0.0):
self.is_training = is_training
self.lstm_dim = 256
self.num_classes = num_classes
self.backbone_dropout = backbone_dropout
def __call__(self, inputdata):
with tf.variable_scope('shadow'):
features = self.feature_extractor(inputdata=inputdata)
logits = self.encoder_decoder(inputdata=tf.squeeze(features, axis=1))
return logits
# pylint: disable=too-many-locals
def feature_extractor(self, inputdata):
""" Extracts features from input text image. """
with slim.arg_scope([slim.conv2d], padding='SAME',
weights_initializer=tf.contrib.layers.variance_scaling_initializer(),
weights_regularizer=slim.l2_regularizer(0.00025),
biases_initializer=None, activation_fn=None):
with slim.arg_scope([slim.batch_norm], updates_collections=None):
bn0 = slim.batch_norm(inputdata, 0.9, scale=True, is_training=self.is_training,
activation_fn=None)
dropout1 = slim.dropout(bn0, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv1 = slim.conv2d(dropout1, num_outputs=64, kernel_size=3)
bn1 = slim.batch_norm(conv1, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
pool1 = slim.max_pool2d(bn1, kernel_size=2, stride=2)
dropout2 = slim.dropout(pool1, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv2 = slim.conv2d(dropout2, num_outputs=128, kernel_size=3)
bn2 = slim.batch_norm(conv2, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
pool2 = slim.max_pool2d(bn2, kernel_size=2, stride=2)
dropout3 = slim.dropout(pool2, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv3 = slim.conv2d(dropout3, num_outputs=256, kernel_size=3)
bn3 = slim.batch_norm(conv3, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
dropout4 = slim.dropout(bn3, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv4 = slim.conv2d(dropout4, num_outputs=256, kernel_size=3)
bn4 = slim.batch_norm(conv4, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
pool4 = slim.max_pool2d(bn4, kernel_size=[2, 1], stride=[2, 1])
dropout5 = slim.dropout(pool4, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv5 = slim.conv2d(dropout5, num_outputs=512, kernel_size=3)
bn5 = slim.batch_norm(conv5, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
dropout6 = slim.dropout(bn5, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv6 = slim.conv2d(dropout6, num_outputs=512, kernel_size=3)
bn6 = slim.batch_norm(conv6, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
pool6 = slim.max_pool2d(bn6, kernel_size=[2, 1], stride=[2, 1])
dropout7 = slim.dropout(pool6, keep_prob=1.0 - self.backbone_dropout,
is_training=self.is_training)
conv7 = slim.conv2d(dropout7, num_outputs=512, kernel_size=2, stride=[2, 1])
bn7 = slim.batch_norm(conv7, 0.9, scale=True, is_training=self.is_training,
activation_fn=tf.nn.relu)
return bn7
def encoder_decoder(self, inputdata):
""" LSTM-based encoder-decoder module. """
with tf.variable_scope('LSTMLayers'):
[batch_size, width, _] = inputdata.get_shape().as_list() | with tf.variable_scope('encoder'):
forward_cells = []
backward_cells = []
for _ in range(2):
forward_cells.append(tf.nn.rnn_cell.LSTMCell(self.lstm_dim))
backward_cells.append(tf.nn.rnn_cell.LSTMCell(self.lstm_dim))
encoder_layer, _, _ = rnn.stack_bidirectional_dynamic_rnn(
forward_cells, backward_cells, inputdata, dtype=tf.float32)
with tf.variable_scope('decoder'):
forward_cells = []
backward_cells = []
for _ in range(2):
forward_cells.append(tf.nn.rnn_cell.LSTMCell(self.lstm_dim))
backward_cells.append(tf.nn.rnn_cell.LSTMCell(self.lstm_dim))
decoder_layer, _, _ = rnn.stack_bidirectional_dynamic_rnn(
forward_cells, backward_cells, encoder_layer, dtype=tf.float32)
rnn_reshaped = tf.reshape(decoder_layer, [batch_size * width, -1])
logits = slim.fully_connected(rnn_reshaped, self.num_classes, activation_fn=None)
logits = tf.reshape(logits, [batch_size, width, self.num_classes])
rnn_out = tf.transpose(logits, (1, 0, 2))
return rnn_out | |
health_api_test.go | // +build python,test
package python
import "testing"
func TestHealthCheckData(t *testing.T) {
testHealthCheckData(t)
}
func TestHealthStartSnapshot(t *testing.T) {
testHealthStartSnapshot(t)
}
func TestHealthStopSnapshot(t *testing.T) {
testHealthStopSnapshot(t)
}
func | (t *testing.T) {
testNoSubStream(t)
}
| TestNoSubStream |
all.go | package all
import (
//Blank imports for plugins to register themselves
_ "github.com/influxdata/telegraf/plugins/outputs/amon"
_ "github.com/influxdata/telegraf/plugins/outputs/amqp"
_ "github.com/influxdata/telegraf/plugins/outputs/application_insights"
_ "github.com/influxdata/telegraf/plugins/outputs/azure_data_explorer"
_ "github.com/influxdata/telegraf/plugins/outputs/azure_monitor" | _ "github.com/influxdata/telegraf/plugins/outputs/datadog"
_ "github.com/influxdata/telegraf/plugins/outputs/discard"
_ "github.com/influxdata/telegraf/plugins/outputs/dynatrace"
_ "github.com/influxdata/telegraf/plugins/outputs/elasticsearch"
_ "github.com/influxdata/telegraf/plugins/outputs/exec"
_ "github.com/influxdata/telegraf/plugins/outputs/execd"
_ "github.com/influxdata/telegraf/plugins/outputs/file"
_ "github.com/influxdata/telegraf/plugins/outputs/graphite"
_ "github.com/influxdata/telegraf/plugins/outputs/graylog"
_ "github.com/influxdata/telegraf/plugins/outputs/health"
_ "github.com/influxdata/telegraf/plugins/outputs/http"
_ "github.com/influxdata/telegraf/plugins/outputs/influxdb"
_ "github.com/influxdata/telegraf/plugins/outputs/influxdb_v2"
_ "github.com/influxdata/telegraf/plugins/outputs/instrumental"
_ "github.com/influxdata/telegraf/plugins/outputs/kafka"
_ "github.com/influxdata/telegraf/plugins/outputs/kinesis"
_ "github.com/influxdata/telegraf/plugins/outputs/librato"
_ "github.com/influxdata/telegraf/plugins/outputs/logzio"
_ "github.com/influxdata/telegraf/plugins/outputs/loki"
_ "github.com/influxdata/telegraf/plugins/outputs/mqtt"
_ "github.com/influxdata/telegraf/plugins/outputs/nats"
_ "github.com/influxdata/telegraf/plugins/outputs/newrelic"
_ "github.com/influxdata/telegraf/plugins/outputs/nsq"
_ "github.com/influxdata/telegraf/plugins/outputs/opentelemetry"
_ "github.com/influxdata/telegraf/plugins/outputs/opentsdb"
_ "github.com/influxdata/telegraf/plugins/outputs/postgresql"
_ "github.com/influxdata/telegraf/plugins/outputs/prometheus_client"
_ "github.com/influxdata/telegraf/plugins/outputs/riemann"
_ "github.com/influxdata/telegraf/plugins/outputs/riemann_legacy"
_ "github.com/influxdata/telegraf/plugins/outputs/sensu"
_ "github.com/influxdata/telegraf/plugins/outputs/signalfx"
_ "github.com/influxdata/telegraf/plugins/outputs/socket_writer"
_ "github.com/influxdata/telegraf/plugins/outputs/sql"
_ "github.com/influxdata/telegraf/plugins/outputs/stackdriver"
_ "github.com/influxdata/telegraf/plugins/outputs/sumologic"
_ "github.com/influxdata/telegraf/plugins/outputs/syslog"
_ "github.com/influxdata/telegraf/plugins/outputs/timestream"
_ "github.com/influxdata/telegraf/plugins/outputs/warp10"
_ "github.com/influxdata/telegraf/plugins/outputs/wavefront"
_ "github.com/influxdata/telegraf/plugins/outputs/websocket"
_ "github.com/influxdata/telegraf/plugins/outputs/yandex_cloud_monitoring"
) | _ "github.com/influxdata/telegraf/plugins/outputs/cloud_pubsub"
_ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch"
_ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch_logs"
_ "github.com/influxdata/telegraf/plugins/outputs/cratedb" |
app.ts | import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
/*
* Angular Modules
*/
import { enableProdMode, NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
import { RouterModule, Router } from '@angular/router';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { Ng2TableModule } from 'ng2-table/ng2-table';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { TabsModule } from 'ngx-bootstrap/tabs';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { NAV_DROPDOWN_DIRECTIVES } from './components/shared/nav-dropdown.directive';
import { SIDEBAR_TOGGLE_DIRECTIVES } from './components/shared/sidebar.directive';
import { AsideToggleDirective } from './components/shared/aside.directive';
import { BreadcrumbsComponent } from './components/shared/breadcrumb.component';
//import { NgTableComponent, NgTableFilteringDirective, NgTablePagingDirective, NgTableSortingDirective } from 'ng2-table/ng2-table';
//Layouts
import { FullLayoutComponent } from './components/layouts/full-layout.component';
import { SimpleLayoutComponent } from './components/layouts/simple-layout.component';
import {DashboardModule} from './dashboard/dashboard.module';
// Setup redux with ngrx
import { Store, StoreModule } from '@ngrx/store';
import { reducers, initialState } from './store/index';
/**
* Import our child components
*/
import { HomeComponent } from './components/home/home.component';
import { AppComponent } from './components/app.component';
import { PACSComponent } from './components/pacs/pacs.component';
/**
* Import material UI Components
*/
import { MdButtonModule, MdSlideToggleModule } from '@angular/material';
import { routes } from './app.routes';
/**
* Import the authentication service to be injected into our component
*/
import {FilesRecievedService} from './components/pacs/filesrecieved.service';
/*
* provide('AppStore', { useValue: appStore }),
*/
@NgModule({
imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
BrowserAnimationsModule,
MdButtonModule,
MdSlideToggleModule,
Ng2TableModule,
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
ChartsModule,
DashboardModule,
RouterModule.forRoot(routes, { useHash: true }),
StoreModule.forRoot(reducers, <any>initialState),
],
providers: [FilesRecievedService],
declarations: [AppComponent,
HomeComponent,
PACSComponent,
FullLayoutComponent,
SimpleLayoutComponent,
NAV_DROPDOWN_DIRECTIVES,
BreadcrumbsComponent,
SIDEBAR_TOGGLE_DIRECTIVES,
AsideToggleDirective],
bootstrap: [AppComponent]
})
export class | { }
platformBrowserDynamic().bootstrapModule(AppModule);
| AppModule |
__main__.py | # -*- coding: utf-8 -*-
|
from .cli import main
main() |
"""dash.cli.__main__: executed when bootstrap directory is called as script."""
|
admin.py | from django.contrib import admin
from mig_main.models import (
UserProfile,
OfficerPosition,
Standing,
Status,
Major,
ShirtSize,
TBPChapter,
AcademicTerm,
OfficerTeam,
MemberProfile,
SlideShowPhoto,
UserPreference,
Committee,
)
class MemberProfileAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['user']}),
('Name', {
'fields': [
'title',
'first_name',
'middle_name',
'last_name',
'suffix',
'nickname',
'maiden_name'
]
}), | ('Education/University', {
'fields': [
'uniqname',
'UMID',
'major',
'standing',
'expect_grad_date'
]
}),
('Chapter', {
'fields': [
'status',
'init_chapter',
'init_term',
'still_electing'
]
}),
('Contact Info', {
'fields': [
'alt_email',
'preferred_email',
'phone',
'jobs_email'
]
}),
('About', {
'fields': [
'photo',
'resume',
'short_bio',
'gender',
'shirt_size'
]
}),
('Alumni Info', {
'fields': [
'alum_mail_freq',
],
'classes': ['collapse']
}),
]
admin.site.register(MemberProfile, MemberProfileAdmin)
admin.site.register(OfficerPosition)
admin.site.register(OfficerTeam)
admin.site.register(Standing)
admin.site.register(Status)
admin.site.register(Major)
admin.site.register(ShirtSize)
admin.site.register(TBPChapter)
admin.site.register(AcademicTerm)
admin.site.register(UserProfile)
admin.site.register(SlideShowPhoto)
admin.site.register(UserPreference)
admin.site.register(Committee) | |
drag_source.rs | // This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT
use crate::EventController;
use crate::Gesture;
use crate::GestureSingle;
use crate::PropagationLimit;
use crate::PropagationPhase;
use glib::object::Cast;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
pub struct DragSource(Object<ffi::GtkDragSource, ffi::GtkDragSourceClass>) @extends GestureSingle, Gesture, EventController;
match fn {
type_ => || ffi::gtk_drag_source_get_type(),
}
}
impl DragSource {
#[doc(alias = "gtk_drag_source_new")]
pub fn new() -> DragSource {
assert_initialized_main_thread!();
unsafe { from_glib_full(ffi::gtk_drag_source_new()) }
}
// rustdoc-stripper-ignore-next
/// Creates a new builder-style object to construct a [`DragSource`]
/// This method returns an instance of [`DragSourceBuilder`] which can be used to create a [`DragSource`].
pub fn builder() -> DragSourceBuilder {
DragSourceBuilder::default()
}
#[doc(alias = "gtk_drag_source_drag_cancel")]
pub fn drag_cancel(&self) {
unsafe {
ffi::gtk_drag_source_drag_cancel(self.to_glib_none().0);
}
}
#[doc(alias = "gtk_drag_source_get_actions")]
#[doc(alias = "get_actions")]
pub fn actions(&self) -> gdk::DragAction {
unsafe { from_glib(ffi::gtk_drag_source_get_actions(self.to_glib_none().0)) }
}
#[doc(alias = "gtk_drag_source_get_content")]
#[doc(alias = "get_content")]
pub fn content(&self) -> Option<gdk::ContentProvider> {
unsafe { from_glib_none(ffi::gtk_drag_source_get_content(self.to_glib_none().0)) }
}
#[doc(alias = "gtk_drag_source_get_drag")]
#[doc(alias = "get_drag")]
pub fn drag(&self) -> Option<gdk::Drag> {
unsafe { from_glib_none(ffi::gtk_drag_source_get_drag(self.to_glib_none().0)) }
}
#[doc(alias = "gtk_drag_source_set_actions")]
pub fn set_actions(&self, actions: gdk::DragAction) {
unsafe {
ffi::gtk_drag_source_set_actions(self.to_glib_none().0, actions.into_glib());
}
}
#[doc(alias = "gtk_drag_source_set_content")]
pub fn set_content<P: IsA<gdk::ContentProvider>>(&self, content: Option<&P>) {
unsafe {
ffi::gtk_drag_source_set_content(
self.to_glib_none().0,
content.map(|p| p.as_ref()).to_glib_none().0,
);
}
}
#[doc(alias = "gtk_drag_source_set_icon")]
pub fn set_icon<P: IsA<gdk::Paintable>>(&self, paintable: Option<&P>, hot_x: i32, hot_y: i32) {
unsafe {
ffi::gtk_drag_source_set_icon(
self.to_glib_none().0, | paintable.map(|p| p.as_ref()).to_glib_none().0,
hot_x,
hot_y,
);
}
}
#[doc(alias = "drag-begin")]
pub fn connect_drag_begin<F: Fn(&Self, &gdk::Drag) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn drag_begin_trampoline<F: Fn(&DragSource, &gdk::Drag) + 'static>(
this: *mut ffi::GtkDragSource,
drag: *mut gdk::ffi::GdkDrag,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), &from_glib_borrow(drag))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"drag-begin\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
drag_begin_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "drag-cancel")]
pub fn connect_drag_cancel<
F: Fn(&Self, &gdk::Drag, gdk::DragCancelReason) -> bool + 'static,
>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn drag_cancel_trampoline<
F: Fn(&DragSource, &gdk::Drag, gdk::DragCancelReason) -> bool + 'static,
>(
this: *mut ffi::GtkDragSource,
drag: *mut gdk::ffi::GdkDrag,
reason: gdk::ffi::GdkDragCancelReason,
f: glib::ffi::gpointer,
) -> glib::ffi::gboolean {
let f: &F = &*(f as *const F);
f(
&from_glib_borrow(this),
&from_glib_borrow(drag),
from_glib(reason),
)
.into_glib()
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"drag-cancel\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
drag_cancel_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "drag-end")]
pub fn connect_drag_end<F: Fn(&Self, &gdk::Drag, bool) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn drag_end_trampoline<F: Fn(&DragSource, &gdk::Drag, bool) + 'static>(
this: *mut ffi::GtkDragSource,
drag: *mut gdk::ffi::GdkDrag,
delete_data: glib::ffi::gboolean,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(
&from_glib_borrow(this),
&from_glib_borrow(drag),
from_glib(delete_data),
)
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"drag-end\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
drag_end_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "prepare")]
pub fn connect_prepare<F: Fn(&Self, f64, f64) -> Option<gdk::ContentProvider> + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn prepare_trampoline<
F: Fn(&DragSource, f64, f64) -> Option<gdk::ContentProvider> + 'static,
>(
this: *mut ffi::GtkDragSource,
x: libc::c_double,
y: libc::c_double,
f: glib::ffi::gpointer,
) -> *mut gdk::ffi::GdkContentProvider {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this), x, y).to_glib_full()
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"prepare\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
prepare_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "actions")]
pub fn connect_actions_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_actions_trampoline<F: Fn(&DragSource) + 'static>(
this: *mut ffi::GtkDragSource,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::actions\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_actions_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
#[doc(alias = "content")]
pub fn connect_content_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_content_trampoline<F: Fn(&DragSource) + 'static>(
this: *mut ffi::GtkDragSource,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
let f: &F = &*(f as *const F);
f(&from_glib_borrow(this))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::content\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_content_trampoline::<F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}
impl Default for DragSource {
fn default() -> Self {
Self::new()
}
}
#[derive(Clone, Default)]
// rustdoc-stripper-ignore-next
/// A builder for generating a [`DragSource`].
pub struct DragSourceBuilder {
actions: Option<gdk::DragAction>,
content: Option<gdk::ContentProvider>,
button: Option<u32>,
exclusive: Option<bool>,
touch_only: Option<bool>,
n_points: Option<u32>,
name: Option<String>,
propagation_limit: Option<PropagationLimit>,
propagation_phase: Option<PropagationPhase>,
}
impl DragSourceBuilder {
// rustdoc-stripper-ignore-next
/// Create a new [`DragSourceBuilder`].
pub fn new() -> Self {
Self::default()
}
// rustdoc-stripper-ignore-next
/// Build the [`DragSource`].
pub fn build(self) -> DragSource {
let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
if let Some(ref actions) = self.actions {
properties.push(("actions", actions));
}
if let Some(ref content) = self.content {
properties.push(("content", content));
}
if let Some(ref button) = self.button {
properties.push(("button", button));
}
if let Some(ref exclusive) = self.exclusive {
properties.push(("exclusive", exclusive));
}
if let Some(ref touch_only) = self.touch_only {
properties.push(("touch-only", touch_only));
}
if let Some(ref n_points) = self.n_points {
properties.push(("n-points", n_points));
}
if let Some(ref name) = self.name {
properties.push(("name", name));
}
if let Some(ref propagation_limit) = self.propagation_limit {
properties.push(("propagation-limit", propagation_limit));
}
if let Some(ref propagation_phase) = self.propagation_phase {
properties.push(("propagation-phase", propagation_phase));
}
glib::Object::new::<DragSource>(&properties)
.expect("Failed to create an instance of DragSource")
}
pub fn actions(mut self, actions: gdk::DragAction) -> Self {
self.actions = Some(actions);
self
}
pub fn content<P: IsA<gdk::ContentProvider>>(mut self, content: &P) -> Self {
self.content = Some(content.clone().upcast());
self
}
pub fn button(mut self, button: u32) -> Self {
self.button = Some(button);
self
}
pub fn exclusive(mut self, exclusive: bool) -> Self {
self.exclusive = Some(exclusive);
self
}
pub fn touch_only(mut self, touch_only: bool) -> Self {
self.touch_only = Some(touch_only);
self
}
pub fn n_points(mut self, n_points: u32) -> Self {
self.n_points = Some(n_points);
self
}
pub fn name(mut self, name: &str) -> Self {
self.name = Some(name.to_string());
self
}
pub fn propagation_limit(mut self, propagation_limit: PropagationLimit) -> Self {
self.propagation_limit = Some(propagation_limit);
self
}
pub fn propagation_phase(mut self, propagation_phase: PropagationPhase) -> Self {
self.propagation_phase = Some(propagation_phase);
self
}
}
impl fmt::Display for DragSource {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("DragSource")
}
} | |
ixf.rs | use std::io::{self, Read, Write, Cursor};
use error::*;
use byteorder::{ReadBytesExt, WriteBytesExt, LE};
pub const IXF_FILE_HEADER_IDENTIFIER: &[u8] = &[0xD7, 0x81, 0xC3, 0x80];
pub const IXF_FILE_RECORD_LENGTH: usize = 20;
pub const IXF_FILE_NULL_RECORD: &[u8] = &[0u8; IXF_FILE_RECORD_LENGTH];
#[derive(Debug, PartialEq)]
pub struct IXFFile {
pub records: Vec<IXFRecord>,
}
#[derive(Debug, PartialEq)]
pub struct IXFRecord {
pub type_id: u32,
pub group_id: u32,
pub instance_id: u32,
pub body: Vec<u8>,
}
impl IXFFile {
pub fn parse(data: &[u8], skip_bad: bool) -> Result<IXFFile> {
let mut ident = [0u8; 4];
let mut stream = io::Cursor::new(data);
stream.read_exact(&mut ident)?;
if ident != IXF_FILE_HEADER_IDENTIFIER {
return Err(Error::IXFFile(format!("invalid header: {:x?}", ident)));
}
let mut records = Vec::new();
loop {
let type_id = stream.read_u32::<LE>()?;
let group_id = stream.read_u32::<LE>()?;
let instance_id = stream.read_u32::<LE>()?;
if type_id == 0 && group_id == 0 && instance_id == 0 {
break
}
let address = stream.read_u32::<LE>()? as usize;
let length = stream.read_u32::<LE>()? as usize;
if address >= data.len() || address > data.len() - length {
if skip_bad {
continue
}
return Err(Error::IXFFile(
format!("record out of bounds: address 0x{:X?}, length 0x{:X?}, max: 0x{:X?}", address, length,
data.len() - 1)));
}
records.push(IXFRecord {
type_id: type_id,
group_id: group_id,
instance_id: instance_id,
body: data[address..address + length].to_vec(),
});
}
Ok(IXFFile {
records: records,
})
}
pub fn | (&self) -> Result<Vec<u8>> {
let mut cursor = Cursor::new(Vec::new());
cursor.write_all(IXF_FILE_HEADER_IDENTIFIER)?;
let mut offset = IXF_FILE_HEADER_IDENTIFIER.len() + IXF_FILE_RECORD_LENGTH * (self.records.len() + 1);
for elem in self.records.iter() {
cursor.write_u32::<LE>(elem.type_id)?;
cursor.write_u32::<LE>(elem.group_id)?;
cursor.write_u32::<LE>(elem.instance_id)?;
cursor.write_u32::<LE>(offset as u32)?;
cursor.write_u32::<LE>(elem.body.len() as u32)?;
offset += elem.body.len();
}
cursor.write_all(IXF_FILE_NULL_RECORD)?;
for elem in self.records.iter() {
cursor.write_all(&elem.body)?;
}
Ok(cursor.into_inner())
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
#[should_panic]
fn invalid_header() {
let data = [0xDE, 0xAD, 0xBA, 0xBE, 0xFA, 0x11];
IXFFile::parse(&data, true).unwrap();
}
#[test]
fn normal() {
let data = [
0xD7, 0x81, 0xC3, 0x80,
0x12, 0x34, 0x56, 0x78,
0x9A, 0xBC, 0xDE, 0xF0,
0x29, 0x99, 0x79, 0x24,
0x28, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0xBE, 0xEF, 0xCA, 0xCE,
];
let record = {
let mut records = IXFFile::parse(&data, false).unwrap().records;
assert_eq!(records.len(), 1);
records.pop().unwrap()
};
assert_eq!(record.type_id, 0x78563412);
assert_eq!(record.group_id, 0xF0DEBC9A);
assert_eq!(record.instance_id, 0x24799929);
assert_eq!(record.body, &data[0x28..]);
}
#[test]
#[should_panic]
fn bad_record() {
let data = [
0xD7, 0x81, 0xC3, 0x80,
0x12, 0x34, 0x56, 0x78,
0x9A, 0xBC, 0xDE, 0xF0,
0x29, 0x99, 0x79, 0x24,
0x28, 0xFF, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
];
IXFFile::parse(&data, false).unwrap();
}
#[test]
fn bad_record_ignore() {
let data = [
0xD7, 0x81, 0xC3, 0x80,
0x12, 0x34, 0x56, 0x78,
0x9A, 0xBC, 0xDE, 0xF0,
0x29, 0x99, 0x79, 0x24,
0x28, 0xFF, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0xBE, 0xEF, 0xCA, 0xCE,
];
let records = IXFFile::parse(&data, true).unwrap().records;
assert_eq!(records.len(), 0);
}
#[test]
fn reencode() {
let data = [
0xD7, 0x81, 0xC3, 0x80,
0x12, 0x34, 0x56, 0x78,
0x9A, 0xBC, 0xDE, 0xF0,
0x29, 0x99, 0x79, 0x24,
0x2C, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
// Yes, I missing this one. Still, they can be overlapped. I think the last 2*4 bytes of null record
// can be removed.
0x00, 0x00, 0x00, 0x00,
0xBE, 0xEF, 0xCA, 0xCE,
];
let parsed = IXFFile::parse(&data, false).unwrap();
assert_eq!(parsed.as_vec().unwrap(), data.to_vec());
}
}
| as_vec |
app.container.js | /**
* @author arman
* @since 8/20/18
*
*/
'use strict';
import React from 'react';
import isUrl from 'is-url';
import styled from 'react-emotion';
import { Block, Value } from 'slate';
import initialValue from './value.json';
import App from './app.component';
import ListItemContainer from './list-item.container';
import { isKeyHotkey } from 'is-hotkey';
import imageExtensions from 'image-extensions';
import { Button, Icon, Toolbar } from './components';
import { LAST_CHILD_TYPE_INVALID } from 'slate-schema-violations';
import { Editor, getEventRange, getEventTransfer } from 'slate-react';
const DEFAULT_NODE = 'paragraph';
const isBoldHotkey = isKeyHotkey('mod+b');
const isItalicHotkey = isKeyHotkey('mod+i');
const isUnderlinedHotkey = isKeyHotkey('mod+u');
const isCodeHotkey = isKeyHotkey('mod+`');
const Image = styled('img')`
display: block;
max-width: 100%;
max-height: 20em;
box-shadow: ${props => (props.selected ? '0 0 0 2px blue;' : 'none')};
`;
function isImage(url) {
return !!imageExtensions.find(url.endsWith)
}
const schema = {
document: {
last: { type: 'paragraph' },
normalize: (change, reason, { node, child }) => {
switch (reason) {
case LAST_CHILD_TYPE_INVALID: {
const paragraph = Block.create('paragraph')
return change.insertNodeByKey(node.key, node.nodes.size, paragraph)
}
}
},
},
};
class AppContainer extends React.Component {
constructor(props) {
super(props);
this.state = {
value: Value.fromJSON(initialValue)
};
}
componentDidMount() {
this._handleImageUpload();
}
onChange = ({ value }) => {
this.setState({ value });
};
renderNode = (props) => {
const { attributes, children, node, isFocused } = props;
switch (node.type) {
case 'block-quote':
return <blockquote {...attributes}>{children}</blockquote>;
case 'bulleted-list':
return <ul {...attributes}>{children}</ul>;
case 'heading-one':
return <h1 {...attributes}>{children}</h1>;
case 'heading-two':
return <h2 {...attributes}>{children}</h2>;
case 'list-item':
return <li {...attributes}>{children}</li>;
case 'numbered-list':
return <ol {...attributes}>{children}</ol>;
case 'check-list-item':
return <ListItemContainer {...props} />;
case 'image': {
const src = node.data.get('src');
return <Image src={src} selected={isFocused} {...attributes} />
}
}
};
onKeyDown = (event, change) => {
let mark;
const { value } = change;
if (isBoldHotkey(event)) {
mark = 'bold';
} else if (isItalicHotkey(event)) {
mark = 'italic';
} else if (isUnderlinedHotkey(event)) {
mark = 'underlined';
} else if (isCodeHotkey(event)) {
mark = 'code';
} else if (event.key == 'Enter' && value.startBlock.type == 'check-list-item') {
change.splitBlock().setBlocks({ data: { checked: false } });
return true;
} else if (event.key == 'Backspace' && value.isCollapsed && value.startBlock.type == 'check-list-item' && value.selection.startOffset === 0) {
change.setBlocks('paragraph');
return true;
} else {
return
}
event.preventDefault();
change.toggleMark(mark);
return true;
};
/****************************************** Image Specific Handlers*******************************************/
_handleImageUpload = () => {
let insertImage = this.insertImage;
let _self = this;
document.querySelector('form input[type=file]').addEventListener('change', (event) => {
event.preventDefault();
let files = event.target.files;
if (typeof files[0] !== 'object') return false;
_self.state.value.change().call(insertImage, files[0], undefined, _self);
});
};
insertImage(change, file, target, context) {
let _self = context;
if (target) {
change.select(target);
}
let reader = new FileReader();
// listen for 'load' events on the FileReader
reader.addEventListener("load", function () {
let src = reader.result;
change.insertBlock({
type: 'image',
isVoid: true,
data: { src },
});
_self.onChange(change);
}, false);
if (file) {
reader.readAsDataURL(file);
}
};
onClickUpload = (event) => {
event.preventDefault();
document.querySelector('form input[type=file]').click();
};
onDropOrPaste = (event, change, editor) => {
const target = getEventRange(event, change.value);
if (!target && event.type == 'drop') return;
const transfer = getEventTransfer(event);
const { type, text, files } = transfer;
if (type == 'files') {
for (const file of files) {
const reader = new FileReader();
const [mime] = file.type.split('/');
if (mime != 'image') continue;
reader.addEventListener('load', () => {
editor.change(c => {
c.call(this.insertImage, reader.result, target);
})
});
reader.readAsDataURL(file);
}
}
if (type == 'text') {
if (!isUrl(text)) return;
if (!isImage(text)) return;
change.call(insertImage, text, target);
}
};
/********************************************* Text Specific Handlers *****************************************/
hasMark = (type) => {
const { value } = this.state;
return value.activeMarks.some(mark => mark.type === type);
};
hasBlock = (type) => {
const { value } = this.state;
return value.blocks.some(node => node.type == type);
};
renderMarkButton = (type, icon) => { | const isActive = this.hasMark(type);
return (
<Button
active={isActive}
onMouseDown={event => this.onClickMark(event, type)} >
<Icon>{icon}</Icon>
</Button>
)
};
renderBlockButton = (type, icon) => {
let isActive = this.hasBlock(type);
if (['numbered-list', 'bulleted-list'].includes(type)) {
const { value } = this.state;
const parent = value.document.getParent(value.blocks.first().key);
isActive = this.hasBlock('list-item') && parent && parent.type === type;
}
return (
<Button
active={isActive}
onMouseDown={event => this.onClickBlock(event, type)} >
<Icon>{icon}</Icon>
</Button>
)
};
renderMark = props => {
const { children, mark, attributes } = props;
switch (mark.type) {
case 'bold':
return <strong {...attributes}>{children}</strong>;
case 'code':
return <code {...attributes}>{children}</code>;
case 'italic':
return <em {...attributes}>{children}</em>;
case 'underlined':
return <u {...attributes}>{children}</u>;
}
};
onClickMark = (event, type) => {
event.preventDefault();
const { value } = this.state;
const change = value.change().toggleMark(type);
this.onChange(change);
};
onClickBlock = (event, type) => {
event.preventDefault();
const { value } = this.state;
const change = value.change();
const { document } = value;
if (type !== 'bulleted-list' && type !== 'numbered-list') {
const isActive = this.hasBlock(type);
const isList = this.hasBlock('list-item');
if (isList) {
change
.setBlocks(isActive ? DEFAULT_NODE : type)
.unwrapBlock('bulleted-list')
.unwrapBlock('numbered-list');
} else {
change.setBlocks(isActive ? DEFAULT_NODE : type);
}
} else {
// Handle the extra wrapping required for list buttons.
const isList = this.hasBlock('list-item');
const isType = value.blocks.some(block => {
return !!document.getClosest(block.key, parent => parent.type == type)
});
if (isList && isType) {
change
.setBlocks(DEFAULT_NODE)
.unwrapBlock('bulleted-list')
.unwrapBlock('numbered-list');
} else if (isList) {
change
.unwrapBlock(
type == 'bulleted-list' ? 'numbered-list' : 'bulleted-list'
)
.wrapBlock(type);
} else {
change.setBlocks('list-item').wrapBlock(type);
}
}
this.onChange(change);
};
render() {
let { value } = this.state;
return (
<App
value={value}
schema={schema}
onKeyDown={this.onKeyDown}
renderMark={this.renderMark}
renderMarkButton={this.renderMarkButton}
renderBlockButton={this.renderBlockButton}
onChange={this.onChange}
onDrop={this.onDropOrPaste}
onPaste={this.onDropOrPaste}
renderNode={this.renderNode}
onClickUpload={this.onClickUpload} />
);
}
}
export default AppContainer; | |
cli.rs | use std::collections::{HashMap, HashSet};
use std::ffi::OsString;
use std::path::PathBuf;
use lazy_static::lazy_static;
use structopt::clap::AppSettings::{ColorAlways, ColoredHelp, DeriveDisplayOrder};
use structopt::{clap, StructOpt};
use syntect::highlighting::Theme as SyntaxTheme;
use syntect::parsing::SyntaxSet;
use crate::git_config::{GitConfig, GitConfigEntry};
use crate::options;
use crate::utils::bat::assets::HighlightingAssets;
use crate::utils::bat::output::PagingMode;
// No Default trait as this ignores `default_value = ..`
#[derive(StructOpt)]
#[structopt(
name = "delta",
about = "A viewer for git and diff output",
setting(ColorAlways),
setting(ColoredHelp),
setting(DeriveDisplayOrder),
after_help = "\
GIT CONFIG
----------
By default, delta takes settings from a section named \"delta\" in git config files, if one is
present. The git config file to use for delta options will usually be ~/.gitconfig, but delta
follows the rules given in https://git-scm.com/docs/git-config#FILES. Most delta options can be
given in a git config file, using the usual option names but without the initial '--'. An example
is
[delta]
line-numbers = true
zero-style = dim syntax
FEATURES
--------
A feature is a named collection of delta options in git config. An example is:
[delta \"my-delta-feature\"]
syntax-theme = Dracula
plus-style = bold syntax \"#002800\"
To activate those options, you would use:
delta --features my-delta-feature
A feature name may not contain whitespace. You can activate multiple features:
[delta]
features = my-highlight-styles-colors-feature my-line-number-styles-feature
If more than one feature sets the same option, the last one wins.
STYLES
------
All options that have a name like --*-style work the same way. It is very similar to how
colors/styles are specified in a gitconfig file:
https://git-scm.com/docs/git-config#Documentation/git-config.txt-color
Here is an example:
--minus-style 'red bold ul \"#ffeeee\"'
That means: For removed lines, set the foreground (text) color to 'red', make it bold and
underlined, and set the background color to '#ffeeee'.
See the COLORS section below for how to specify a color. In addition to real colors, there are 4
special color names: 'auto', 'normal', 'raw', and 'syntax'.
Here is an example of using special color names together with a single attribute:
--minus-style 'syntax bold auto'
That means: For removed lines, syntax-highlight the text, and make it bold, and do whatever delta
normally does for the background.
The available attributes are: 'blink', 'bold', 'dim', 'hidden', 'italic', 'reverse', 'strike',
and 'ul' (or 'underline').
The attribute 'omit' is supported by commit-style, file-style, and hunk-header-style, meaning to
remove the element entirely from the output.
A complete description of the style string syntax follows:
- If the input that delta is receiving already has colors, and you want delta to output those
colors unchanged, then use the special style string 'raw'. Otherwise, delta will strip any colors
from its input.
- A style string consists of 0, 1, or 2 colors, together with an arbitrary number of style | attributes, all separated by spaces.
- The first color is the foreground (text) color. The second color is the background color.
Attributes can go in any position.
- This means that in order to specify a background color you must also specify a foreground (text)
color.
- If you want delta to choose one of the colors automatically, then use the special color 'auto'.
This can be used for both foreground and background.
- If you want the foreground/background color to be your terminal's foreground/background color,
then use the special color 'normal'.
- If you want the foreground text to be syntax-highlighted according to its language, then use the
special foreground color 'syntax'. This can only be used for the foreground (text).
- The minimal style specification is the empty string ''. This means: do not apply any colors or
styling to the element in question.
COLORS
------
There are three ways to specify a color (this section applies to foreground and background colors
within a style string):
1. RGB hex code
An example of using an RGB hex code is:
--file-style=\"#0e7c0e\"
2. ANSI color name
There are 8 ANSI color names:
black, red, green, yellow, blue, magenta, cyan, white.
In addition, all of them have a bright form:
brightblack, brightred, brightgreen, brightyellow, brightblue, brightmagenta, brightcyan, brightwhite.
An example of using an ANSI color name is:
--file-style=\"green\"
Unlike RGB hex codes, ANSI color names are just names: you can choose the exact color that each
name corresponds to in the settings of your terminal application (the application you use to
enter commands at a shell prompt). This means that if you use ANSI color names, and you change
the color theme used by your terminal, then delta's colors will respond automatically, without
needing to change the delta command line.
\"purple\" is accepted as a synonym for \"magenta\". Color names and codes are case-insensitive.
3. ANSI color number
An example of using an ANSI color number is:
--file-style=28
There are 256 ANSI color numbers: 0-255. The first 16 are the same as the colors described in
the \"ANSI color name\" section above. See https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit.
Specifying colors like this is useful if your terminal only supports 256 colors (i.e. doesn\'t
support 24-bit color).
LINE NUMBERS
------------
To display line numbers, use --line-numbers.
Line numbers are displayed in two columns. Here's what it looks like by default:
1 ⋮ 1 │ unchanged line
2 ⋮ │ removed line
⋮ 2 │ added line
In that output, the line numbers for the old (minus) version of the file appear in the left column,
and the line numbers for the new (plus) version of the file appear in the right column. In an
unchanged (zero) line, both columns contain a line number.
The following options allow the line number display to be customized:
--line-numbers-left-format: Change the contents of the left column
--line-numbers-right-format: Change the contents of the right column
--line-numbers-left-style: Change the style applied to the left column
--line-numbers-right-style: Change the style applied to the right column
--line-numbers-minus-style: Change the style applied to line numbers in minus lines
--line-numbers-zero-style: Change the style applied to line numbers in unchanged lines
--line-numbers-plus-style: Change the style applied to line numbers in plus lines
Options --line-numbers-left-format and --line-numbers-right-format allow you to change the contents
of the line number columns. Their values are arbitrary format strings, which are allowed to contain
the placeholders {nm} for the line number associated with the old version of the file and {np} for
the line number associated with the new version of the file. The placeholders support a subset of
the string formatting syntax documented here: https://doc.rust-lang.org/std/fmt/#formatting-parameters.
Specifically, you can use the alignment and width syntax.
For example, the default value of --line-numbers-left-format is '{nm:^4}⋮'. This means that the
left column should display the minus line number (nm), center-aligned, padded with spaces to a
width of 4 characters, followed by a unicode dividing-line character (⋮).
Similarly, the default value of --line-numbers-right-format is '{np:^4}│'. This means that the
right column should display the plus line number (np), center-aligned, padded with spaces to a
width of 4 characters, followed by a unicode dividing-line character (│).
Use '<' for left-align, '^' for center-align, and '>' for right-align.
If something isn't working correctly, or you have a feature request, please open an issue at
https://github.com/dandavison/delta/issues.
"
)]
pub struct Opt {
/// Use default colors appropriate for a light terminal background. For more control, see the
/// style options and --syntax-theme.
#[structopt(long = "light")]
pub light: bool,
/// Use default colors appropriate for a dark terminal background. For more control, see the
/// style options and --syntax-theme.
#[structopt(long = "dark")]
pub dark: bool,
/// Display line numbers next to the diff. See LINE NUMBERS section.
#[structopt(short = "n", long = "line-numbers")]
pub line_numbers: bool,
/// Display a side-by-side diff view instead of the traditional view.
#[structopt(short = "s", long = "side-by-side")]
pub side_by_side: bool,
#[structopt(long = "diff-highlight")]
/// Emulate diff-highlight (https://github.com/git/git/tree/master/contrib/diff-highlight)
pub diff_highlight: bool,
#[structopt(long = "diff-so-fancy")]
/// Emulate diff-so-fancy (https://github.com/so-fancy/diff-so-fancy)
pub diff_so_fancy: bool,
#[structopt(long = "navigate")]
/// Activate diff navigation: use n to jump forwards and N to jump backwards. To change the
/// file labels used see --file-modified-label, --file-removed-label, --file-added-label,
/// --file-renamed-label.
pub navigate: bool,
#[structopt(long = "relative-paths")]
/// Output all file paths relative to the current directory so that they
/// resolve correctly when clicked on or used in shell commands.
pub relative_paths: bool,
#[structopt(long = "hyperlinks")]
/// Render commit hashes, file names, and line numbers as hyperlinks,
/// according to the hyperlink spec for terminal emulators:
/// https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. By
/// default, file names and line numbers link to the local file using a file
/// URL, whereas commit hashes link to the commit in GitHub, if the remote
/// repository is hosted by GitHub. See --hyperlinks-file-link-format for
/// full control over the file URLs emitted. Hyperlinks are supported by
/// several common terminal emulators. To make them work, you must use less
/// version >= 581 with the -R flag (or use -r with older less versions, but
/// this will break e.g. --navigate). If you use tmux, then you will also
/// need a patched fork of tmux (see https://github.com/dandavison/tmux).
pub hyperlinks: bool,
#[structopt(long = "keep-plus-minus-markers")]
/// Prefix added/removed lines with a +/- character, exactly as git does. By default, delta
/// does not emit any prefix, so code can be copied directly from delta's output.
pub keep_plus_minus_markers: bool,
/// Display the active values for all Delta options. Style options are displayed with
/// foreground and background colors. This can be used to experiment with colors by combining
/// this option with other options such as --minus-style, --zero-style, --plus-style, --light,
/// --dark, etc.
#[structopt(long = "show-config")]
pub show_config: bool,
/// List supported languages and associated file extensions.
#[structopt(long = "list-languages")]
pub list_languages: bool,
/// List available syntax-highlighting color themes.
#[structopt(long = "list-syntax-themes")]
pub list_syntax_themes: bool,
/// Show all available syntax-highlighting themes, each with an example of highlighted diff output.
/// If diff output is supplied on standard input then this will be used for the demo. For
/// example: `git show | delta --show-syntax-themes`.
#[structopt(long = "show-syntax-themes")]
pub show_syntax_themes: bool,
/// Show available delta themes, each with an example of highlighted diff
/// output. A delta theme is a delta named feature (see --features) that
/// sets either `light` or `dark`. See
/// https://github.com/dandavison/delta#custom-color-themes. If diff output
/// is supplied on standard input then this will be used for the demo. For
/// example: `git show | delta --show-themes`. By default shows dark or
/// light themes only, according to whether delta is in dark or light mode
/// (as set by the user or inferred from BAT_THEME). To control the themes
/// shown, use --dark or --light, or both, on the command line together with
/// this option.
#[structopt(long = "show-themes")]
pub show_themes: bool,
#[structopt(long = "no-gitconfig")]
/// Do not take any settings from git config. See GIT CONFIG section.
pub no_gitconfig: bool,
#[structopt(long = "raw")]
/// Do not alter the input in any way. This is mainly intended for testing delta.
pub raw: bool,
#[structopt(long = "color-only")]
/// Do not alter the input structurally in any way, but color and highlight hunk lines
/// according to your delta configuration. This is mainly intended for other tools that use
/// delta.
pub color_only: bool,
////////////////////////////////////////////////////////////////////////////////////////////
#[structopt(long = "features", default_value = "", env = "DELTA_FEATURES")]
/// Name of delta features to use (space-separated). A feature is a named collection of delta
/// options in ~/.gitconfig. See FEATURES section.
pub features: String,
#[structopt(long = "syntax-theme", env = "BAT_THEME")]
/// The code syntax-highlighting theme to use. Use --show-syntax-themes to demo available
/// themes. If the syntax-highlighting theme is not set using this option, it will be taken
/// from the BAT_THEME environment variable, if that contains a valid theme name.
/// --syntax-theme=none disables all syntax highlighting.
pub syntax_theme: Option<String>,
#[structopt(long = "minus-style", default_value = "normal auto")]
/// Style (foreground, background, attributes) for removed lines. See STYLES section.
pub minus_style: String,
#[structopt(long = "zero-style", default_value = "syntax normal")]
/// Style (foreground, background, attributes) for unchanged lines. See STYLES section.
pub zero_style: String,
#[structopt(long = "plus-style", default_value = "syntax auto")]
/// Style (foreground, background, attributes) for added lines. See STYLES section.
pub plus_style: String,
#[structopt(long = "minus-emph-style", default_value = "normal auto")]
/// Style (foreground, background, attributes) for emphasized sections of removed lines. See
/// STYLES section.
pub minus_emph_style: String,
#[structopt(long = "minus-non-emph-style", default_value = "auto auto")]
/// Style (foreground, background, attributes) for non-emphasized sections of removed lines
/// that have an emphasized section. Defaults to --minus-style. See STYLES section.
pub minus_non_emph_style: String,
#[structopt(long = "plus-emph-style", default_value = "syntax auto")]
/// Style (foreground, background, attributes) for emphasized sections of added lines. See
/// STYLES section.
pub plus_emph_style: String,
#[structopt(long = "plus-non-emph-style", default_value = "auto auto")]
/// Style (foreground, background, attributes) for non-emphasized sections of added lines that
/// have an emphasized section. Defaults to --plus-style. See STYLES section.
pub plus_non_emph_style: String,
#[structopt(long = "commit-style", default_value = "raw")]
/// Style (foreground, background, attributes) for the commit hash line. See STYLES section.
/// The style 'omit' can be used to remove the commit hash line from the output.
pub commit_style: String,
#[structopt(long = "commit-decoration-style", default_value = "")]
/// Style (foreground, background, attributes) for the commit hash decoration. See STYLES
/// section. The style string should contain one of the special attributes 'box', 'ul'
/// (underline), 'ol' (overline), or the combination 'ul ol'.
pub commit_decoration_style: String,
/// The regular expression used to identify the commit line when parsing git output.
#[structopt(long = "commit-regex", default_value = r"^commit ")]
pub commit_regex: String,
#[structopt(long = "file-style", default_value = "blue")]
/// Style (foreground, background, attributes) for the file section. See STYLES section. The
/// style 'omit' can be used to remove the file section from the output.
pub file_style: String,
#[structopt(long = "file-decoration-style", default_value = "blue ul")]
/// Style (foreground, background, attributes) for the file decoration. See STYLES section. The
/// style string should contain one of the special attributes 'box', 'ul' (underline), 'ol'
/// (overline), or the combination 'ul ol'.
pub file_decoration_style: String,
/// Format string for commit hyperlinks (requires --hyperlinks). The
/// placeholder "{commit}" will be replaced by the commit hash. For example:
/// --hyperlinks-commit-link-format='https://mygitrepo/{commit}/'
#[structopt(long = "hyperlinks-commit-link-format")]
pub hyperlinks_commit_link_format: Option<String>,
/// Format string for file hyperlinks (requires --hyperlinks). The
/// placeholders "{path}" and "{line}" will be replaced by the absolute file
/// path and the line number, respectively. The default value of this option
/// creates hyperlinks using standard file URLs; your operating system
/// should open these in the application registered for that file type.
/// However, these do not make use of the line number. In order for the link
/// to open the file at the correct line number, you could use a custom URL
/// format such as "file-line://{path}:{line}" and register an application
/// to handle the custom "file-line" URL scheme by opening the file in your
/// editor/IDE at the indicated line number. See
/// https://github.com/dandavison/open-in-editor for an example.
#[structopt(long = "hyperlinks-file-link-format", default_value = "file://{path}")]
pub hyperlinks_file_link_format: String,
#[structopt(long = "hunk-header-style", default_value = "line-number syntax")]
/// Style (foreground, background, attributes) for the hunk-header. See STYLES section. Special
/// attributes 'file' and 'line-number' can be used to include the file path, and number of
/// first hunk line, in the hunk header. The style 'omit' can be used to remove the hunk header
/// section from the output.
pub hunk_header_style: String,
#[structopt(long = "hunk-header-file-style", default_value = "blue")]
/// Style (foreground, background, attributes) for the file path part of the hunk-header. See
/// STYLES section. The file path will only be displayed if hunk-header-style contains the
/// 'file' special attribute.
pub hunk_header_file_style: String,
#[structopt(long = "hunk-header-line-number-style", default_value = "blue")]
/// Style (foreground, background, attributes) for the line number part of the hunk-header. See
/// STYLES section. The line number will only be displayed if hunk-header-style contains the
/// 'line-number' special attribute.
pub hunk_header_line_number_style: String,
#[structopt(long = "hunk-header-decoration-style", default_value = "blue box")]
/// Style (foreground, background, attributes) for the hunk-header decoration. See STYLES
/// section. The style string should contain one of the special attributes 'box', 'ul'
/// (underline), 'ol' (overline), or the combination 'ul ol'.
pub hunk_header_decoration_style: String,
/// Format string for git blame commit metadata. Available placeholders are
/// "{timestamp}", "{author}", and "{commit}".
#[structopt(
long = "blame-format",
default_value = "{timestamp:<15} {author:<15.14} {commit:<8} │ "
)]
pub blame_format: String,
/// Background colors used for git blame lines (space-separated string).
/// Lines added by the same commit are painted with the same color; colors
/// are recycled as needed.
#[structopt(long = "blame-palette")]
pub blame_palette: Option<String>,
/// Format of `git blame` timestamp in raw git output received by delta.
#[structopt(
long = "blame-timestamp-format",
default_value = "%Y-%m-%d %H:%M:%S %z"
)]
pub blame_timestamp_format: String,
/// Default language used for syntax highlighting when this cannot be
/// inferred from a filename. It will typically make sense to set this in
/// per-repository git config (.git/config)
#[structopt(long = "default-language")]
pub default_language: Option<String>,
#[structopt(long = "inline-hint-style", default_value = "blue")]
/// Style (foreground, background, attributes) for content added by delta to
/// the original diff such as special characters to highlight tabs, and the
/// symbols used to indicate wrapped lines. See STYLES section.
pub inline_hint_style: String,
/// The regular expression used to decide what a word is for the within-line highlight
/// algorithm. For less fine-grained matching than the default try --word-diff-regex="\S+"
/// --max-line-distance=1.0 (this is more similar to `git --word-diff`).
#[structopt(long = "word-diff-regex", default_value = r"\w+")]
pub tokenization_regex: String,
/// The maximum distance between two lines for them to be inferred to be homologous. Homologous
/// line pairs are highlighted according to the deletion and insertion operations transforming
/// one into the other.
#[structopt(long = "max-line-distance", default_value = "0.6")]
pub max_line_distance: f64,
/// Style (foreground, background, attributes) for line numbers in the old (minus) version of
/// the file. See STYLES and LINE NUMBERS sections.
#[structopt(long = "line-numbers-minus-style", default_value = "auto")]
pub line_numbers_minus_style: String,
/// Style (foreground, background, attributes) for line numbers in unchanged (zero) lines. See
/// STYLES and LINE NUMBERS sections.
#[structopt(long = "line-numbers-zero-style", default_value = "auto")]
pub line_numbers_zero_style: String,
/// Style (foreground, background, attributes) for line numbers in the new (plus) version of
/// the file. See STYLES and LINE NUMBERS sections.
#[structopt(long = "line-numbers-plus-style", default_value = "auto")]
pub line_numbers_plus_style: String,
/// Format string for the left column of line numbers. A typical value would be "{nm:^4}⋮"
/// which means to display the line numbers of the minus file (old version), center-aligned,
/// padded to a width of 4 characters, followed by a dividing character. See the LINE NUMBERS
/// section.
#[structopt(long = "line-numbers-left-format", default_value = "{nm:^4}⋮")]
pub line_numbers_left_format: String,
/// Format string for the right column of line numbers. A typical value would be "{np:^4}│ "
/// which means to display the line numbers of the plus file (new version), center-aligned,
/// padded to a width of 4 characters, followed by a dividing character, and a space. See the
/// LINE NUMBERS section.
#[structopt(long = "line-numbers-right-format", default_value = "{np:^4}│")]
pub line_numbers_right_format: String,
/// Style (foreground, background, attributes) for the left column of line numbers. See STYLES
/// and LINE NUMBERS sections.
#[structopt(long = "line-numbers-left-style", default_value = "auto")]
pub line_numbers_left_style: String,
/// Style (foreground, background, attributes) for the right column of line numbers. See STYLES
/// and LINE NUMBERS sections.
#[structopt(long = "line-numbers-right-style", default_value = "auto")]
pub line_numbers_right_style: String,
/// How often a line should be wrapped if it does not fit. Zero means to never wrap. Any content
/// which does not fit will be truncated. A value of "unlimited" means a line will be wrapped
/// as many times as required.
#[structopt(long = "wrap-max-lines", default_value = "2")]
pub wrap_max_lines: String,
/// Symbol added to the end of a line indicating that the content has been wrapped
/// onto the next line and continues left-aligned.
#[structopt(long = "wrap-left-symbol", default_value = "↵")]
pub wrap_left_symbol: String,
/// Symbol added to the end of a line indicating that the content has been wrapped
/// onto the next line and continues right-aligned.
#[structopt(long = "wrap-right-symbol", default_value = "↴")]
pub wrap_right_symbol: String,
/// Threshold for right-aligning wrapped content. If the length of the remaining wrapped
/// content, as a percentage of width, is less than this quantity it will be right-aligned.
/// Otherwise it will be left-aligned.
#[structopt(long = "wrap-right-percent", default_value = "37.0")]
pub wrap_right_percent: String,
/// Symbol displayed in front of right-aligned wrapped content.
#[structopt(long = "wrap-right-prefix-symbol", default_value = "…")]
pub wrap_right_prefix_symbol: String,
#[structopt(long = "file-modified-label", default_value = "")]
/// Text to display in front of a modified file path.
pub file_modified_label: String,
#[structopt(long = "file-removed-label", default_value = "removed:")]
/// Text to display in front of a removed file path.
pub file_removed_label: String,
#[structopt(long = "file-added-label", default_value = "added:")]
/// Text to display in front of a added file path.
pub file_added_label: String,
#[structopt(long = "file-copied-label", default_value = "copied:")]
/// Text to display in front of a copied file path.
pub file_copied_label: String,
#[structopt(long = "file-renamed-label", default_value = "renamed:")]
/// Text to display in front of a renamed file path.
pub file_renamed_label: String,
#[structopt(long = "hunk-label", default_value = "")]
/// Text to display in front of a hunk header.
pub hunk_label: String,
#[structopt(long = "max-line-length", default_value = "512")]
/// Truncate lines longer than this. To prevent any truncation, set to zero. Note that
/// delta will be slow on very long lines (e.g. minified .js) if truncation is disabled.
/// When wrapping lines it is automatically set to fit at least all visible characters.
pub max_line_length: usize,
/// How to extend the background color to the end of the line in side-by-side mode. Can
/// be ansi (default) or spaces (default if output is not to a terminal). Has no effect
/// if --width=variable is given.
#[structopt(long = "line-fill-method")]
pub line_fill_method: Option<String>,
/// The width of underline/overline decorations. Examples: "72" (exactly 72 characters),
// "-2" (auto-detected terminal width minus 2). An expression such as "74-2" is also valid
// (equivalent to 72 but may be useful if the caller has a variable holding the value "74").
/// Use --width=variable to extend decorations and background colors to the end of the text
/// only. Otherwise background colors extend to the full terminal width.
#[structopt(short = "w", long = "width")]
pub width: Option<String>,
/// Width allocated for file paths in a diff stat section. If a relativized
/// file path exceeds this width then the diff stat will be misaligned.
#[structopt(long = "diff-stat-align-width", default_value = "48")]
pub diff_stat_align_width: usize,
/// The number of spaces to replace tab characters with. Use --tabs=0 to pass tab characters
/// through directly, but note that in that case delta will calculate line widths assuming tabs
/// occupy one character's width on the screen: if your terminal renders tabs as more than than
/// one character wide then delta's output will look incorrect.
#[structopt(long = "tabs", default_value = "4")]
pub tab_width: usize,
/// Whether to emit 24-bit ("true color") RGB color codes. Options are auto, always, and never.
/// "auto" means that delta will emit 24-bit color codes if the environment variable COLORTERM
/// has the value "truecolor" or "24bit". If your terminal application (the application you use
/// to enter commands at a shell prompt) supports 24 bit colors, then it probably already sets
/// this environment variable, in which case you don't need to do anything.
#[structopt(long = "true-color", default_value = "auto")]
pub true_color: String,
/// Deprecated: use --true-color.
#[structopt(long = "24-bit-color")]
pub _24_bit_color: Option<String>,
/// Whether to examine ANSI color escape sequences in raw lines received from Git and handle
/// lines colored in certain ways specially. This is on by default: it is how Delta supports
/// Git's --color-moved feature. Set this to "false" to disable this behavior.
#[structopt(long = "inspect-raw-lines", default_value = "true")]
pub inspect_raw_lines: String,
#[structopt(long)]
/// Which pager to use. The default pager is `less`. You can also change pager
/// by setting the environment variables DELTA_PAGER, BAT_PAGER, or PAGER
/// (and that is their order of priority). This option overrides all environment
/// variables above.
pub pager: Option<String>,
/// Whether to use a pager when displaying output. Options are: auto, always, and never.
#[structopt(long = "paging", default_value = "auto")]
pub paging_mode: String,
/// First file to be compared when delta is being used in diff mode: `delta file_1 file_2` is
/// equivalent to `diff -u file_1 file_2 | delta`.
#[structopt(parse(from_os_str))]
pub minus_file: Option<PathBuf>,
/// Second file to be compared when delta is being used in diff mode.
#[structopt(parse(from_os_str))]
pub plus_file: Option<PathBuf>,
/// Style for removed empty line marker (used only if --minus-style has no background color)
#[structopt(
long = "--minus-empty-line-marker-style",
default_value = "normal auto"
)]
pub minus_empty_line_marker_style: String,
/// Style for added empty line marker (used only if --plus-style has no background color)
#[structopt(long = "--plus-empty-line-marker-style", default_value = "normal auto")]
pub plus_empty_line_marker_style: String,
/// Style for whitespace errors. Defaults to color.diff.whitespace if that is set in git
/// config, or else 'magenta reverse'.
#[structopt(long = "whitespace-error-style", default_value = "auto auto")]
pub whitespace_error_style: String,
#[structopt(long = "line-buffer-size", default_value = "32")]
/// Size of internal line buffer. Delta compares the added and removed versions of nearby lines
/// in order to detect and highlight changes at the level of individual words/tokens.
/// Therefore, nearby lines must be buffered internally before they are painted and emitted.
/// Increasing this value might improve highlighting of some large diff hunks. However, setting
/// this to a high value will adversely affect delta's performance when entire files are
/// added/removed.
pub line_buffer_size: usize,
#[structopt(long = "minus-color")]
/// Deprecated: use --minus-style='normal my_background_color'.
pub deprecated_minus_background_color: Option<String>,
#[structopt(long = "minus-emph-color")]
/// Deprecated: use --minus-emph-style='normal my_background_color'.
pub deprecated_minus_emph_background_color: Option<String>,
#[structopt(long = "plus-color")]
/// Deprecated: Use --plus-style='syntax my_background_color' to change the background color
/// while retaining syntax-highlighting.
pub deprecated_plus_background_color: Option<String>,
#[structopt(long = "plus-emph-color")]
/// Deprecated: Use --plus-emph-style='syntax my_background_color' to change the background
/// color while retaining syntax-highlighting.
pub deprecated_plus_emph_background_color: Option<String>,
#[structopt(long = "highlight-removed")]
/// Deprecated: use --minus-style='syntax'.
pub deprecated_highlight_minus_lines: bool,
#[structopt(long = "commit-color")]
/// Deprecated: use --commit-style='my_foreground_color'
/// --commit-decoration-style='my_foreground_color'.
pub deprecated_commit_color: Option<String>,
#[structopt(long = "file-color")]
/// Deprecated: use --file-style='my_foreground_color'
/// --file-decoration-style='my_foreground_color'.
pub deprecated_file_color: Option<String>,
#[structopt(long = "hunk-style")]
/// Deprecated: synonym of --hunk-header-decoration-style.
pub deprecated_hunk_style: Option<String>,
#[structopt(long = "hunk-color")]
/// Deprecated: use --hunk-header-style='my_foreground_color'
/// --hunk-header-decoration-style='my_foreground_color'.
pub deprecated_hunk_color: Option<String>,
#[structopt(long = "theme")]
/// Deprecated: use --syntax-theme.
pub deprecated_theme: Option<String>,
#[structopt(skip)]
pub computed: ComputedValues,
#[structopt(skip)]
pub git_config: Option<GitConfig>,
#[structopt(skip)]
pub git_config_entries: HashMap<String, GitConfigEntry>,
}
#[derive(Default, Clone, Debug)]
pub struct ComputedValues {
pub available_terminal_width: usize,
pub stdout_is_term: bool,
pub background_color_extends_to_terminal_width: bool,
pub decorations_width: Width,
pub inspect_raw_lines: InspectRawLines,
pub is_light_mode: bool,
pub paging_mode: PagingMode,
pub syntax_set: SyntaxSet,
pub syntax_theme: Option<SyntaxTheme>,
pub true_color: bool,
}
#[derive(Clone, Debug, PartialEq)]
pub enum Width {
Fixed(usize),
Variable,
}
impl Default for Width {
fn default() -> Self {
Width::Variable
}
}
#[derive(Clone, Debug, PartialEq)]
pub enum InspectRawLines {
True,
False,
}
impl Default for InspectRawLines {
fn default() -> Self {
InspectRawLines::False
}
}
impl Default for PagingMode {
fn default() -> Self {
PagingMode::Never
}
}
impl Opt {
pub fn from_args_and_git_config(
git_config: Option<GitConfig>,
assets: HighlightingAssets,
) -> Self {
Self::from_clap_and_git_config(Self::clap().get_matches(), git_config, assets)
}
pub fn from_iter_and_git_config<I>(iter: I, git_config: Option<GitConfig>) -> Self
where
I: IntoIterator,
I::Item: Into<OsString> + Clone,
{
let assets = HighlightingAssets::new();
Self::from_clap_and_git_config(Self::clap().get_matches_from(iter), git_config, assets)
}
fn from_clap_and_git_config(
arg_matches: clap::ArgMatches,
mut git_config: Option<GitConfig>,
assets: HighlightingAssets,
) -> Self {
let mut opt = Opt::from_clap(&arg_matches);
options::rewrite::apply_rewrite_rules(&mut opt, &arg_matches);
options::set::set_options(&mut opt, &mut git_config, &arg_matches, assets);
opt.git_config = git_config;
opt
}
#[allow(dead_code)]
pub fn get_option_names<'a>() -> HashMap<&'a str, &'a str> {
itertools::chain(
Self::clap()
.p
.opts
.iter()
.map(|opt| (opt.b.name, opt.s.long.unwrap())),
Self::clap()
.p
.flags
.iter()
.map(|opt| (opt.b.name, opt.s.long.unwrap())),
)
.filter(|(name, _)| !IGNORED_OPTION_NAMES.contains(name))
.collect()
}
}
// Option names to exclude when listing options to process for various purposes. These are
// (1) Deprecated options
// (2) Pseudo-flag commands such as --list-languages
lazy_static! {
static ref IGNORED_OPTION_NAMES: HashSet<&'static str> = vec![
"deprecated-file-color",
"deprecated-hunk-style",
"deprecated-minus-background-color",
"deprecated-minus-emph-background-color",
"deprecated-hunk-color",
"deprecated-plus-emph-background-color",
"deprecated-plus-background-color",
"deprecated-highlight-minus-lines",
"deprecated-theme",
"deprecated-commit-color",
"list-languages",
"list-syntax-themes",
"show-config",
"show-syntax-themes",
]
.into_iter()
.collect();
} | |
messages.go | // here be dragons
package main
import (
"fmt"
"log"
"strings"
)
const (
CLIENT_MESSAGE = iota
CLIENT_ERROR
SERVER_MESSAGE
SERVER_ERROR
JOINPART_MESSAGE
UPDATE_MESSAGE
NOTICE_MESSAGE
ACTION_MESSAGE
PRIVATE_MESSAGE
CUSTOM_MESSAGE
)
func msgTypeString(t int) string {
switch t {
case CLIENT_MESSAGE:
return "CLIENT_MESSAGE"
case CLIENT_ERROR:
return "CLIENT_ERROR"
case SERVER_MESSAGE:
return "SERVER_MESSAGE"
case SERVER_ERROR:
return "SERVER_ERROR"
case JOINPART_MESSAGE:
return "JOINPART_MESSAGE"
case UPDATE_MESSAGE:
return "UPDATE_MESSAGE"
case NOTICE_MESSAGE:
return "NOTICE_MESSAGE"
case ACTION_MESSAGE:
return "ACTION_MESSAGE"
case PRIVATE_MESSAGE:
return "PRIVATE_MESSAGE"
case CUSTOM_MESSAGE:
return "CUSTOM_MESSAGE"
}
return "(unknown)"
}
func clientError(tab tabWithTextBuffer, msg ...string) {
Println(CLIENT_ERROR, T(tab), msg...)
}
func clientMessage(tab tabWithTextBuffer, msg ...string) {
Println(CLIENT_MESSAGE, T(tab), msg...)
}
func serverMessage(tab tabWithTextBuffer, msg ...string) {
Println(SERVER_MESSAGE, T(tab), msg...)
}
func serverError(tab tabWithTextBuffer, msg ...string) {
Println(SERVER_ERROR, T(tab), msg...)
}
func joinpartMessage(tab tabWithTextBuffer, msg ...string) {
Println(JOINPART_MESSAGE, T(tab), msg...)
}
func updateMessage(tab tabWithTextBuffer, msg ...string) {
Println(UPDATE_MESSAGE, T(tab), msg...)
}
func noticeMessage(tab tabWithTextBuffer, msg ...string) {
Println(NOTICE_MESSAGE, T(tab), msg...)
}
func actionMessage(tab tabWithTextBuffer, msg ...string) {
Println(ACTION_MESSAGE, T(tab), msg...)
}
func privateMessage(tab tabWithTextBuffer, msg ...string) {
Println(PRIVATE_MESSAGE, T(tab), msg...)
}
type highlighterFn func(nick, msg string) bool
func noticeMessageWithHighlight(tab tabWithTextBuffer, hl highlighterFn, msg ...string) {
PrintlnWithHighlight(NOTICE_MESSAGE, hl, T(tab), msg...)
}
func actionMessageWithHighlight(tab tabWithTextBuffer, hl highlighterFn, msg ...string) {
PrintlnWithHighlight(ACTION_MESSAGE, hl, T(tab), msg...)
}
func privateMessageWithHighlight(tab tabWithTextBuffer, hl highlighterFn, msg ...string) {
PrintlnWithHighlight(PRIVATE_MESSAGE, hl, T(tab), msg...)
}
func T(tabs ...tabWithTextBuffer) []tabWithTextBuffer { return tabs } // expected type, found ILLEGAL
func PrintlnWithHighlight(msgType int, hl highlighterFn, tabs []tabWithTextBuffer, msg ...string) {
switch msgType {
case NOTICE_MESSAGE:
for _, tab := range tabs {
logmsg := now() + " *** NOTICE: " + strings.Join(msg, " ")
tab.Logln(logmsg)
tab.Notify(true) // always put a * for NOTICE
h := false
if len(msg) >= 3 {
h = hl(msg[1], strings.Join(msg[2:], " "))
}
if h && !mainWindowFocused {
systray.ShowMessage("", logmsg)
}
tab.Println(parseString(noticeMsg(h, msg...)))
}
case PRIVATE_MESSAGE:
nick, msg := msg[0], strings.Join(msg[1:], " ")
logmsg := now() + " <" + nick + "> " + msg
h := hl(nick, msg)
if h && !mainWindowFocused {
systray.ShowMessage("", logmsg)
}
for _, tab := range tabs {
nick := colorNick(tab, h, nick)
nick = leftpadNick(tab, nick)
tab.Notify(h)
tab.Logln(logmsg)
tab.Println(parseString(privateMsg(h, nick, msg)))
}
case ACTION_MESSAGE:
logmsg := now() + " *" + strings.Join(msg, " ") + "*"
nick, msg := msg[0], strings.Join(msg[1:], " ")
h := hl(nick, msg)
if h && !mainWindowFocused {
systray.ShowMessage("", logmsg)
}
for _, tab := range tabs {
nick := colorNick(tab, h, nick)
tab.Notify(h)
tab.Logln(logmsg)
tab.Println(parseString(actionMsg(h, nick, msg)))
}
default:
log.Printf("highlighting unsupported for msgType %v", msgTypeString(msgType))
}
}
func Println(msgType int, tabs []tabWithTextBuffer, msg ...string) {
if len(msg) == 0 {
log.Printf("tried to print an empty line of type %v", msgTypeString(msgType))
return
}
switch msgType {
case CLIENT_MESSAGE:
for _, tab := range tabs {
tab.Println(parseString(clientMsg(msg...)))
}
case CLIENT_ERROR:
for _, tab := range tabs {
tab.Errorln(parseString(clientErrorMsg(msg...)))
}
case SERVER_MESSAGE:
text, styles := parseString(serverMsg(msg...))
for _, tab := range tabs {
tab.Logln(text)
tab.Println(text, styles)
}
case SERVER_ERROR:
text, styles := parseString(serverErrorMsg(msg...))
for _, tab := range tabs {
tab.Logln(text)
tab.Errorln(text, styles)
}
case JOINPART_MESSAGE:
if !clientCfg.HideJoinParts {
text, styles := parseString(joinpartMsg(msg...))
for _, tab := range tabs {
tab.Logln(text)
tab.Println(text, styles)
}
}
case UPDATE_MESSAGE:
// TODO(tso): option to hide?
text, styles := parseString(updateMsg(msg...))
for _, tab := range tabs {
tab.Logln(text)
tab.Println(text, styles)
}
case NOTICE_MESSAGE:
for _, tab := range tabs {
tab.Notify(true)
tab.Logln(now() + " *** NOTICE: " + strings.Join(msg, " "))
tab.Println(parseString(noticeMsg(false, msg...)))
}
case PRIVATE_MESSAGE:
nick, msg := msg[0], strings.Join(msg[1:], " ")
logmsg := now() + " <" + nick + "> " + msg
for _, tab := range tabs {
nick := colorNick(tab, false, nick)
nick = leftpadNick(tab, nick)
tab.Notify(false)
tab.Logln(logmsg)
tab.Println(parseString(privateMsg(false, nick, msg)))
}
case ACTION_MESSAGE:
logmsg := now() + " *" + strings.Join(msg, " ") + "*"
nick, msg := msg[0], strings.Join(msg[1:], " ")
for _, tab := range tabs {
nick := colorNick(tab, false, nick)
tab.Notify(false)
tab.Logln(logmsg)
tab.Println(parseString(actionMsg(false, nick, msg)))
}
case CUSTOM_MESSAGE:
text, styles := parseString(strings.Join(msg, " "))
for _, tab := range tabs {
tab.Println(text, styles)
}
default:
log.Printf("Println: unhandled msgType: %v", msgType)
}
}
func clientMsg(text ...string) string {
return color(strings.Join(text, " "), DarkGrey)
}
func clientErrorMsg(text ...string) string |
func serverErrorMsg(text ...string) string {
if len(text) < 2 {
return fmt.Sprintf("wrong argument count for server error: want 2 got %d:\n%#v",
len(text), text)
}
return color(now(), Red) +
color("E", White, Red) +
color("("+text[0]+"): "+strings.Join(text[1:], " "), Red)
}
func serverMsg(text ...string) string {
if len(text) < 2 {
return fmt.Sprintf("wrong argument count for server message: want 2 got %d:\n%#v",
len(text), text)
}
return color(now()+"S("+text[0]+"): "+strings.Join(text[1:], " "), DarkGray)
}
func joinpartMsg(text ...string) string {
return color(now(), LightGray) + " " + italic(color(strings.Join(text, " "), Orange))
}
func updateMsg(text ...string) string {
return color(now(), DarkGray) + " " + color(strings.Join(text, " "), DarkGrey)
}
func noticeMsg(hl bool, text ...string) string {
if len(text) < 3 {
return fmt.Sprintf("wrong argument count for notice: want 3, got %d:\n%v", len(text), text)
}
line := color(now(), LightGray) +
color("N", White, Orange) +
color("("+text[0]+"->"+text[1]+"):", Orange)
if hl {
line += "»"
line += color(strings.Join(text[2:], " "), White, Orange)
} else {
line += " "
line += strings.Join(text[2:], " ")
}
return line
}
func actionMsg(hl bool, text ...string) string {
line := color(now(), LightGray)
if hl {
line += "»"
} else {
line += " "
}
return line + "*" + strings.TrimSpace(strings.Join(text, " ")) + "*"
}
func privateMsg(hl bool, text ...string) string {
if len(text) < 2 {
return fmt.Sprintf("wrong argument count for notice: want 2, got %d:\n%v", len(text), text)
}
nick := text[0]
line := color(now(), LightGray)
if hl {
line += "»"
} else {
line += " "
}
return line + nick + " " + strings.Join(text[1:], " ")
}
func colorNick(tab tabWithTextBuffer, hl bool, nick string) string {
if hl {
bg := tab.NickColor(nick)
fg := White
if !colorVisible(0xffffff, colorPalette[bg]) {
fg = Black
}
return color(nick, fg, bg)
}
return color(nick, tab.NickColor(nick))
}
func leftpadNick(tab tabWithTextBuffer, nick string) string {
padamt := tab.Padlen(nick)
if padamt > len(stripFmtChars(nick)) {
return strings.Repeat(" ", padamt-len(stripFmtChars(nick))) + nick
}
return nick
}
| {
return color(strings.Join(text, " "), Red)
} |
telegram.go | package telegram
import (
"bytes"
"fmt"
"strings"
"text/template"
"github.com/crazy-max/diun/v4/internal/model"
"github.com/crazy-max/diun/v4/internal/notif/notifier"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
)
// Client represents an active Telegram notification object
type Client struct {
*notifier.Notifier
cfg *model.NotifTelegram
meta model.Meta
}
// New creates a new Telegram notification instance
func New(config *model.NotifTelegram, meta model.Meta) notifier.Notifier {
return notifier.Notifier{
Handler: &Client{
cfg: config,
meta: meta,
},
}
}
// Name returns notifier's name
func (c *Client) Name() string {
return "telegram"
}
// Send creates and sends a Telegram notification with an entry
func (c *Client) Send(entry model.NotifEntry) error {
bot, err := tgbotapi.NewBotAPI(c.cfg.Token)
if err != nil {
return err
}
tagTpl := "{{ .Entry.Image.Domain }}/{{ .Entry.Image.Path }}:{{ .Entry.Image.Tag }}"
if len(entry.Image.HubLink) > 0 {
tagTpl = "[{{ .Entry.Image.Domain }}/{{ .Entry.Image.Path }}:{{ .Entry.Image.Tag }}]({{ .Entry.Image.HubLink }})"
}
var msgBuf bytes.Buffer
msgTpl := template.Must(template.New("email").Parse(fmt.Sprintf("Docker tag %s which you subscribed to through {{ .Entry.Provider }} provider has been {{ if (eq .Entry.Status \"new\") }}newly added{{ else }}updated{{ end }} on {{ .Hostname }}.", tagTpl)))
if err := msgTpl.Execute(&msgBuf, struct {
Hostname string
Entry model.NotifEntry
}{
Hostname: escapeMarkdown(c.meta.Hostname),
Entry: entry,
}); err != nil {
return err
}
for _, chatID := range c.cfg.ChatIDs {
_, err := bot.Send(tgbotapi.MessageConfig{
BaseChat: tgbotapi.BaseChat{
ChatID: chatID,
},
Text: msgBuf.String(),
ParseMode: "markdown",
DisableWebPagePreview: true,
})
if err != nil {
return err
}
}
return nil
}
func escapeMarkdown(txt string) string | {
txt = strings.ReplaceAll(txt, "_", "\\_")
txt = strings.ReplaceAll(txt, "*", "\\*")
txt = strings.ReplaceAll(txt, "[", "\\[")
txt = strings.ReplaceAll(txt, "`", "\\`")
return txt
} |
|
favorites-create-routing.module.ts | import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { FavoritesCreatePage } from './page/favorites-create.page';
const routes: Routes = [
{
path: '',
component: FavoritesCreatePage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class | {}
| FavoritesCreatePageRoutingModule |
msgdelegate.go | package event
import (
"bytes"
"github.com/crypto-com/chain-indexing/usecase/coin"
"github.com/crypto-com/chain-indexing/usecase/model"
entity_event "github.com/crypto-com/chain-indexing/entity/event"
jsoniter "github.com/json-iterator/go"
"github.com/luci/go-render/render"
)
const MSG_DELEGATE = "MsgDelegate"
const MSG_DELEGATE_CREATED = "MsgDelegateCreated"
const MSG_DELEGATE_FAILED = "MsgDelegateFailed"
// MsgDelegate defines a Cosmos SDK message for performing a delegation of coins
// from a delegator to a validator.
type MsgDelegate struct {
MsgBase
DelegatorAddress string `json:"delegatorAddress"`
ValidatorAddress string `json:"validatorAddress"`
Amount coin.Coin `json:"amount"`
}
// NewMsgDelegate creates a new instance of MsgDelegate
func NewMsgDelegate(msgCommonParams MsgCommonParams, params model.MsgDelegateParams) *MsgDelegate {
return &MsgDelegate{
NewMsgBase(MsgBaseParams{
MsgName: MSG_DELEGATE,
Version: 1,
MsgCommonParams: msgCommonParams,
}),
params.DelegatorAddress,
params.ValidatorAddress,
params.Amount,
}
}
// ToJSON encodes the event into JSON string payload
func (event *MsgDelegate) ToJSON() (string, error) {
encoded, err := jsoniter.Marshal(event)
if err != nil |
return string(encoded), nil
}
func (event *MsgDelegate) String() string {
return render.Render(event)
}
// DecodeMsgDelegate decodes the event from encoded bytes
func DecodeMsgDelegate(encoded []byte) (entity_event.Event, error) {
jsonDecoder := jsoniter.NewDecoder(bytes.NewReader(encoded))
jsonDecoder.DisallowUnknownFields()
var event *MsgDelegate
if err := jsonDecoder.Decode(&event); err != nil {
return nil, err
}
return event, nil
}
| {
return "", err
} |
resolver_test.go | package ref_test
import (
"context"
"errors"
"fmt"
"testing"
"time"
"github.com/go-test/deep"
"github.com/treeverse/lakefs/graveler"
"github.com/treeverse/lakefs/testutil"
)
func TestRefManager_Dereference(t *testing.T) {
r := testRefManager(t)
ctx := context.Background()
testutil.Must(t, r.CreateRepository(ctx, "repo1", graveler.Repository{
StorageNamespace: "s3://",
CreationDate: time.Now(),
DefaultBranchID: "master",
}, graveler.Branch{}))
ts, _ := time.Parse(time.RFC3339, "2020-12-01T15:00:00Z")
var previous graveler.CommitID
for i := 0; i < 20; i++ {
c := graveler.Commit{
Committer: "user1",
Message: "message1",
MetaRangeID: "deadbeef123",
CreationDate: ts,
Parents: graveler.CommitParents{previous},
Metadata: graveler.Metadata{"foo": "bar"},
}
cid, err := r.AddCommit(ctx, "repo1", c)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
previous = cid
}
iter, err := r.Log(ctx, "repo1", previous)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
var commitIDs []graveler.CommitID
for iter.Next() {
commit := iter.Value()
if commit == nil {
t.Fatal("Log iterator returned nil value after Next")
}
commitIDs = append(commitIDs, commit.CommitID)
}
if err := iter.Err(); err != nil {
t.Fatalf("unexpected error: %v", err)
}
// commit log:
commitLog := []graveler.CommitID{
"c3f815d633789cd7c1325352277d4de528844c758a9beedfa8a3cfcfb5c75627",
"8549d7544244ba1b63b5967b6b328b331658f627369cb89bd442684719c318ae",
"13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774",
"7de38592b9e6046ffb55915a40848f05749f168531f0cd6a2aa61fe6e8d92d02",
"94c7773c89650e99671c33d46e31226230cdaeed79a77cdbd7c7419ea68b91ca",
"0efcb6e81db6bdd2cfeb77664b6573a7d69f555bbe561fd1fd018a4e4cac7603",
"d85e4ae46b63f641b439afde9ebab794a3c39c203a42190c0b9d7773ab71a60e",
"a766cfdb311fe5f18f489d90d283f65ed522e719fe1ad5397277339eee0d1964",
"67ea954d570e20172775f41ac9763905d16d73490d9b72731d353db33f85d437",
"d3b16c2cf7f5b9adc2770976bcabe463a5bdd3b5dbf740034f09a9c663620aed",
"d420fbf793716d6d53798218d7a247f38a5bbed095d57df71ee79e05446e46ec",
"cc72bda1adade1a72b3de617472c16af187063c79e7edc7921c04e883b44de4c",
"752581ac60bd8e38a2e65a754591a93a1703dc6c658f91380b8836013188c566",
"3cf70857454c71fd0bbf69af8a5360671ba98f6ac9371b047144208c58c672a2",
"bfa1e0382ff3c51905dc62ced0a67588b5219c1bba71a517ae7e7857f0c26afe",
"d2248dcc1a4de004e10e3bc6b820655e649b8d986d983b60ec98a357a0df194b",
"a2d98d820f6ff3f221223dbe6a22548f78549830d3b19286b101f13a0ee34085",
"4f13621ec00d4e44e8a0f0ad340224f9d51db9b6518ee7bef17f598aea9e0431",
"df87d5329f4438662d6ecb9b90ee17c0bdc9a78a884acc93c0c4fe9f0f79d059",
"29706d36de7219e0796c31b278f87201ef835e8cdafbcc3c907d292cd31f77d5",
}
if diff := deep.Equal(commitIDs, commitLog); diff != nil {
t.Fatal("Difference found on commit log", diff)
}
testutil.Must(t, r.SetBranch(ctx, "repo1", "branch1", graveler.Branch{
CommitID: "13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774",
}))
testutil.Must(t, r.SetBranch(ctx, "repo1", "branch2", graveler.Branch{
CommitID: "d420fbf793716d6d53798218d7a247f38a5bbed095d57df71ee79e05446e46ec",
}))
| table := []struct {
Name string
Ref graveler.Ref
Expected graveler.CommitID
ExpectedErr error
}{
{
Name: "branch_exist",
Ref: graveler.Ref("branch1"),
Expected: graveler.CommitID("13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774"),
},
{
Name: "branch_doesnt_exist",
Ref: graveler.Ref("branch3"),
ExpectedErr: graveler.ErrNotFound,
},
{
Name: "tag_exist",
Ref: graveler.Ref("v1.0"),
Expected: graveler.CommitID("d85e4ae46b63f641b439afde9ebab794a3c39c203a42190c0b9d7773ab71a60e"),
},
{
Name: "tag_doesnt_exist",
Ref: graveler.Ref("v1.bad"),
ExpectedErr: graveler.ErrNotFound,
},
{
Name: "commit",
Ref: graveler.Ref("13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774"),
Expected: graveler.CommitID("13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774"),
},
{
Name: "commit_prefix_good",
Ref: graveler.Ref("13daf"),
Expected: graveler.CommitID("13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774"),
},
{
Name: "commit_prefix_ambiguous",
Ref: graveler.Ref("a"),
ExpectedErr: graveler.ErrNotFound,
},
{
Name: "commit_prefix_missing",
Ref: graveler.Ref("66666"),
ExpectedErr: graveler.ErrNotFound,
},
{
Name: "branch_with_modifier",
Ref: graveler.Ref("branch1~2"),
Expected: graveler.CommitID("94c7773c89650e99671c33d46e31226230cdaeed79a77cdbd7c7419ea68b91ca"),
},
{
Name: "commit_with_modifier",
Ref: graveler.Ref("13dafa9c45bcf67e6997776039cbf8ab571ace560ce9e13665f383434a495774~2"),
Expected: graveler.CommitID("94c7773c89650e99671c33d46e31226230cdaeed79a77cdbd7c7419ea68b91ca"),
},
{
Name: "commit_prefix_with_modifier",
Ref: graveler.Ref("13dafa~2"),
Expected: graveler.CommitID("94c7773c89650e99671c33d46e31226230cdaeed79a77cdbd7c7419ea68b91ca"),
},
{
Name: "commit_prefix_with_modifier_too_big",
Ref: graveler.Ref("2c14ddd9b097a8f96db3f27a454877c9513378635d313ba0f0277d793a183e72~200"),
ExpectedErr: graveler.ErrNotFound,
},
}
for _, cas := range table {
t.Run(cas.Name, func(t *testing.T) {
ref, err := r.RevParse(ctx, "repo1", cas.Ref)
if err != nil {
if cas.ExpectedErr == nil || !errors.Is(err, cas.ExpectedErr) {
t.Fatalf("unexpected error: %v", err)
}
return
}
if cas.Expected != ref.CommitID() {
t.Fatalf("got unexpected commit ID: %s - expected %s", ref.CommitID(), cas.Expected)
}
})
}
}
func TestRefManager_DereferenceWithGraph(t *testing.T) {
/*
This is taken from `git help rev-parse` - let's run these tests
G H I J
\ / \ /
D E F
\ | / \
\ | / |
\|/ |
B C
\ /
\ /
A
A = = A^0
B = A^ = A^1 = A~1
C = = A^2
D = A^^ = A^1^1 = A~2
E = B^2 = A^^2
F = B^3 = A^^3
G = A^^^ = A^1^1^1 = A~3
H = D^2 = B^^2 = A^^^2 = A~2^2
I = F^ = B^3^ = A^^3^
J = F^2 = B^3^2 = A^^3^2
*/
r := testRefManager(t)
testutil.Must(t, r.CreateRepository(context.Background(), "repo1", graveler.Repository{
StorageNamespace: "s3://",
CreationDate: time.Now(),
DefaultBranchID: "master",
}, graveler.Branch{}))
G, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
H, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
I, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
J, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
D, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{G, H},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
E, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
F, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{I, J},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
B, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{D, E, F},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
C, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{F},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
A, err := r.AddCommit(context.Background(), "repo1", graveler.Commit{
Parents: graveler.CommitParents{B, C},
})
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
resolve := func(base graveler.CommitID, mod string, expected graveler.CommitID) {
ref := fmt.Sprintf("%s%s", base, mod)
resolved, err := r.RevParse(context.Background(), "repo1", graveler.Ref(ref))
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if resolved.CommitID() != expected {
t.Fatalf("expected %s == %s", ref, expected)
}
}
// now the tests:
resolve(A, "^0", A)
resolve(A, "^", B)
resolve(A, "^1", B)
resolve(A, "~1", B)
resolve(A, "^2", C)
resolve(A, "^^", D)
resolve(A, "^1^1", D)
resolve(A, "~2", D)
resolve(B, "^2", E)
resolve(A, "^^2", E)
resolve(B, "^2", E)
resolve(A, "^^2", E)
resolve(B, "^3", F)
resolve(A, "^^3", F)
resolve(A, "^^^", G)
resolve(A, "^1^1^1", G)
resolve(A, "~3", G)
resolve(D, "^2", H)
resolve(B, "^^2", H)
resolve(A, "^^^2", H)
resolve(A, "~2^2", H)
resolve(F, "^", I)
resolve(B, "^3^", I)
resolve(A, "^^3^", I)
resolve(F, "^2", J)
resolve(B, "^3^2", J)
resolve(A, "^^3^2", J)
} | testutil.Must(t, r.CreateTag(ctx, "repo1", "v1.0", "d85e4ae46b63f641b439afde9ebab794a3c39c203a42190c0b9d7773ab71a60e"))
|
loadbalancers.go | package network
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// LoadBalancersClient is the network Client
type LoadBalancersClient struct {
BaseClient
}
// NewLoadBalancersClient creates an instance of the LoadBalancersClient client.
func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient |
// NewLoadBalancersClientWithBaseURI creates an instance of the LoadBalancersClient client using a custom endpoint.
// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient {
return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put LoadBalancer operation creates/updates a LoadBalancer
// Parameters:
// resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the loadBalancer.
// parameters - parameters supplied to the create/delete LoadBalancer operation
func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.CreateOrUpdate")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", nil, "Failure preparing request")
return
}
result, err = client.CreateOrUpdateSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "CreateOrUpdate", result.Response(), "Failure sending request")
return
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (*http.Request, error) {
pathParameters := map[string]interface{}{
"loadBalancerName": autorest.Encode("path", loadBalancerName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancersCreateOrUpdateFuture, err error) {
var resp *http.Response
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (result LoadBalancer, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete the delete LoadBalancer operation deletes the specified load balancer.
// Parameters:
// resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the loadBalancer.
func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancersDeleteFuture, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Delete")
defer func() {
sc := -1
if result.Response() != nil {
sc = result.Response().StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", nil, "Failure preparing request")
return
}
result, err = client.DeleteSender(req)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Delete", result.Response(), "Failure sending request")
return
}
return
}
// DeletePreparer prepares the Delete request.
func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGroupName string, loadBalancerName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"loadBalancerName": autorest.Encode("path", loadBalancerName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBalancersDeleteFuture, err error) {
var resp *http.Response
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get the Get LoadBalancer operation retrieves information about the specified LoadBalancer.
// Parameters:
// resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the loadBalancer.
// expand - expand references resources.
func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.Get")
defer func() {
sc := -1
if result.Response.Response != nil {
sc = result.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", nil, "Failure preparing request")
return
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure sending request")
return
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"loadBalancerName": autorest.Encode("path", loadBalancerName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) GetSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client LoadBalancersClient) GetResponder(resp *http.Response) (result LoadBalancer, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List the List loadBalancer operation retrieves all the load balancers in a resource group.
// Parameters:
// resourceGroupName - the name of the resource group.
func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List")
defer func() {
sc := -1
if result.lblr.Response.Response != nil {
sc = result.lblr.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", nil, "Failure preparing request")
return
}
resp, err := client.ListSender(req)
if err != nil {
result.lblr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure sending request")
return
}
result.lblr, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client LoadBalancersClient) ListResponder(resp *http.Response) (result LoadBalancerListResult, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listNextResults retrieves the next set of results, if any.
func (client LoadBalancersClient) listNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) {
req, err := lastResults.loadBalancerListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client LoadBalancersClient) ListComplete(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.List")
defer func() {
sc := -1
if result.Response().Response.Response != nil {
sc = result.page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.page, err = client.List(ctx, resourceGroupName)
return
}
// ListAll the List loadBalancer operation retrieves all the load balancers in a subscription.
func (client LoadBalancersClient) ListAll(ctx context.Context) (result LoadBalancerListResultPage, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll")
defer func() {
sc := -1
if result.lblr.Response.Response != nil {
sc = result.lblr.Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.fn = client.listAllNextResults
req, err := client.ListAllPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", nil, "Failure preparing request")
return
}
resp, err := client.ListAllSender(req)
if err != nil {
result.lblr.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure sending request")
return
}
result.lblr, err = client.ListAllResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "ListAll", resp, "Failure responding to request")
}
return
}
// ListAllPreparer prepares the ListAll request.
func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2016-06-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx))
}
// ListAllSender sends the ListAll request. The method will close the
// http.Response Body if it receives an error.
func (client LoadBalancersClient) ListAllSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
}
// ListAllResponder handles the response to the ListAll request. The method always
// closes the http.Response Body.
func (client LoadBalancersClient) ListAllResponder(resp *http.Response) (result LoadBalancerListResult, err error) {
err = autorest.Respond(
resp,
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// listAllNextResults retrieves the next set of results, if any.
func (client LoadBalancersClient) listAllNextResults(ctx context.Context, lastResults LoadBalancerListResult) (result LoadBalancerListResult, err error) {
req, err := lastResults.loadBalancerListResultPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListAllSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure sending next results request")
}
result, err = client.ListAllResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.LoadBalancersClient", "listAllNextResults", resp, "Failure responding to next results request")
}
return
}
// ListAllComplete enumerates all values, automatically crossing page boundaries as required.
func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result LoadBalancerListResultIterator, err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancersClient.ListAll")
defer func() {
sc := -1
if result.Response().Response.Response != nil {
sc = result.page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
result.page, err = client.ListAll(ctx)
return
}
| {
return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID)
} |
overview32MedNaN.d.ts | export const overview32MedNaN: string; |
||
Automatic_RP_Registration_for_IotHub_RP_should_not_be_registered_initially.nock.js | // This file has been autogenerated.
exports.setEnvironment = function() {
process.env['AZURE_TEST_LOCATION'] = 'westus';
process.env['AZURE_TEST_RESOURCE_GROUP'] = 'testg1012';
process.env['AZURE_SUBSCRIPTION_ID'] = '9ed7cca5-c306-4f66-9d1c-2766e67013d8';
};
exports.scopes = [[function (nock) { | pragma: 'no-cache',
'content-type': 'application/json; charset=utf-8',
expires: '-1',
'x-ms-ratelimit-remaining-subscription-reads': '14999',
'x-ms-request-id': '474b2b2d-2ff4-4428-8525-b4ba220a7bcf',
'x-ms-correlation-request-id': '474b2b2d-2ff4-4428-8525-b4ba220a7bcf',
'x-ms-routing-request-id': 'WESTUS2:20170714T225307Z:474b2b2d-2ff4-4428-8525-b4ba220a7bcf',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
date: 'Fri, 14 Jul 2017 22:53:06 GMT',
connection: 'close',
'content-length': '861' });
return result; },
function (nock) {
var result =
nock('https://management.azure.com:443')
.get('/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8/providers/Microsoft.Devices?api-version=2017-05-10')
.reply(200, "{\"id\":\"/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8/providers/Microsoft.Devices\",\"namespace\":\"Microsoft.Devices\",\"resourceTypes\":[{\"resourceType\":\"checkNameAvailability\",\"locations\":[],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"]},{\"resourceType\":\"usages\",\"locations\":[],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"]},{\"resourceType\":\"operations\",\"locations\":[],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"]},{\"resourceType\":\"IotHubs\",\"locations\":[\"West US\",\"North Europe\",\"East Asia\",\"East US\",\"West Europe\",\"Southeast Asia\",\"Japan East\",\"Japan West\",\"Australia East\",\"Australia Southeast\",\"West US 2\",\"West Central US\"],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"}],\"registrationState\":\"NotRegistered\"}", { 'cache-control': 'no-cache',
pragma: 'no-cache',
'content-type': 'application/json; charset=utf-8',
expires: '-1',
'x-ms-ratelimit-remaining-subscription-reads': '14999',
'x-ms-request-id': '474b2b2d-2ff4-4428-8525-b4ba220a7bcf',
'x-ms-correlation-request-id': '474b2b2d-2ff4-4428-8525-b4ba220a7bcf',
'x-ms-routing-request-id': 'WESTUS2:20170714T225307Z:474b2b2d-2ff4-4428-8525-b4ba220a7bcf',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
date: 'Fri, 14 Jul 2017 22:53:06 GMT',
connection: 'close',
'content-length': '861' });
return result; }]]; | var result =
nock('http://management.azure.com:443')
.get('/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8/providers/Microsoft.Devices?api-version=2017-05-10')
.reply(200, "{\"id\":\"/subscriptions/9ed7cca5-c306-4f66-9d1c-2766e67013d8/providers/Microsoft.Devices\",\"namespace\":\"Microsoft.Devices\",\"resourceTypes\":[{\"resourceType\":\"checkNameAvailability\",\"locations\":[],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"]},{\"resourceType\":\"usages\",\"locations\":[],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"]},{\"resourceType\":\"operations\",\"locations\":[],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"]},{\"resourceType\":\"IotHubs\",\"locations\":[\"West US\",\"North Europe\",\"East Asia\",\"East US\",\"West Europe\",\"Southeast Asia\",\"Japan East\",\"Japan West\",\"Australia East\",\"Australia Southeast\",\"West US 2\",\"West Central US\"],\"apiVersions\":[\"2017-01-19\",\"2016-02-03\",\"2015-08-15-preview\"],\"capabilities\":\"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"}],\"registrationState\":\"NotRegistered\"}", { 'cache-control': 'no-cache', |
property-determiner.ts | import patterns from "./patterns";
// Determines whether each line represents an attribute, tag, or continuation
export function determineClassification(line) {
if (line.crux === "#") {
return "attribute";
} else if (line.crux === ".") {
return "attribute";
} else if (line.crux === ">") {
return "attribute";
} else if (line.prefix === "'") {
return "attribute";
} else if (line.prefix === '"') {
return "attribute";
} else if (line.prefix === "-") {
return "attribute";
} else if (line.prefix === "@") {
return "attribute";
} else if (line.prefix === ":") {
return "attribute";
} else if (line.crux === "|" || line.crux === '|"') {
return "continuation";
} else {
return "tag";
}
}
export function determinePrefix(line) {
if (line.lineType === "louk") {
const matches = line.crux.match(patterns.prefix);
if (matches) {
return matches[1];
}
} else {
return null;
}
}
export function determineSuffix(line) {
if (line.lineType === "louk" && line.crux) {
const matches = line.crux.match(patterns.suffix);
if (matches) {
return matches[1];
} else {
return null;
}
} else {
return null;
}
}
export function determineSelfClosing(line) {
if (line.suffix === "/") {
return true;
} else if (line.lineType === "html") {
return true;
} else if (line.lineType === "comment") {
return true;
} else {
return false;
}
}
/* Determines whether something should be interpretted dynamically (that is, as JavaScript in Vue)
or statically (as plain HTML) */
export function determineInterpretation(line) {
if (line.lineType === "louk") {
if (
(line.classification === "tag" || line.classification === "continuation") &&
line.suffix && line.suffix.match(patterns.staticSuffix)
) {
return "static";
} else if (line.crux && line.crux.match(patterns.staticCrux)) {
return "static";
} else if (line.classification === "attribute" && line.prefix && line.prefix.match(patterns.staticPrefix)) {
return "static";
} else {
return "dynamic";
}
} else {
return null;
}
}
// Determines how far a line is indented
export function determineIndent(line) {
let trimmed = line;
let indent = 0;
while (trimmed.match(patterns.initialSpace)) {
trimmed = trimmed.substr(1);
indent = indent + 1;
}
return [indent, trimmed];
}
export function | (line) {
if (line.lineType === "louk") {
if (line.unindented.match(patterns.continuationCrux)) {
return line.unindented.match(patterns.continuationCrux)[1];
} else if (line.unindented.match(patterns.staticCrux)) {
return line.unindented.match(patterns.staticCrux)[1];
} else if (line.unindented.match(patterns.modifiedCrux)) {
return line.unindented.match(patterns.modifiedCrux)[1];
} else if (line.unindented.match(patterns.plainCrux)) {
return line.unindented.match(patterns.plainCrux)[1];
}
} else {
return null;
}
}
// Figures out what tag a tag is and what attribute an attribute is
export function determineFill(line) {
// Handles static attribute shorthands (> . #)
if (line.crux && line.crux.match(patterns.staticFill)) {
return line.unindented.match(patterns.staticFill)[1];
} else if (line.unindented.match(patterns.fill)) {
return line.unindented.match(patterns.fill)[1];
} else {
return null;
}
}
export function determineDirectiveType(line) {
if (line.lineType === "louk") {
if (line.prefix === "-" && line.fill !== "") {
return "simple";
} else if (line.prefix === "@") {
return "action";
} else if (line.prefix === ":") {
return "bind";
}
} else {
return null;
}
}
// Expands key shorthands
// For example, converts "#" to "id"
export function determineKey(line) {
if (line.lineType === "louk") {
if (line.crux === ".") {
return "class";
} else if (line.crux === "#") {
return "id";
} else if (line.crux === ">") {
return "href";
} else if (line.crux === "|") {
return "";
} else if (line.unindented.match(patterns.key)) {
return line.unindented.match(patterns.key)[1];
}
} else {
return null;
}
}
export function determineLineType(line) {
if (line.unindented.match(patterns.comment)) {
return "comment";
} else if (line.unindented.match(patterns.html)) {
return "html";
} else {
return "louk";
}
}
export function determineIndentationUnit(line) {
const whitespace = line.raw.match(patterns.whitespace)[1];
if (whitespace.length > 0) {
return whitespace[0];
} else {
return "\t";
}
}
export function determineWhitespace(line) {
const whitespace = line.raw.match(patterns.whitespace)[1];
return whitespace;
}
| determineCrux |
hello_test.go | package hello
import "testing"
// ファイル名 xxx_test.go
// 関数名 Testxxx
// 引数 t *testing.T
// 無理やりFailさせるなら t.Fail()
// %qというプレースホルダーはダブルクォーテーション付きでエラー所つ力する
// godoc -http :8000
// http://localhost:8000/pkg
// 余談
// go mod init github.com/sunakan/tdd
// これで現在いる場所をgithub.com/sunakan/tddと誤認させることが可能
func TestHello(t *testing.T) {
// t.Helper()とは...?
// ヘルパーとして必要な文
// t.Helperを書かずに失敗させると、failした行数がt.Errorfを書いた行になってしまう
assertCorrectMessage := func(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("got %q want %q", got, want)
}
}
// t.Runとは...?
// t.Run("テスト名", 無名関数)でサブテストができるよ
// サブサブテストもできるよ
t.Run("saying hello to people", func(t *testing.T) {
got := Hello("Chris", "")
want := "Hello, Chris"
assertCorrectMessage(t, got, want)
t.Run("sub sub test", func(t *testing.T) {
got := Hello("Suna", "")
want := "Hello, Suna"
assertCorrectMessage(t, got, want)
})
})
t.Run("empty string defaults to 'World'", func(t *testing.T) {
got := Hello("", "")
want := "Hello, World"
assertCorrectMessage(t, got, want)
})
t.Run("in Spanish", func(t *testing.T) {
got := Hello("Elodie", "Spanish")
want := "Hola, Elodie"
assertCorrectMessage(t, got, want)
})
t.Run("in French", func(t *testing.T) {
got := Hello("Gabriel", "French")
want := "Bonjour, Gabriel"
assertCorrectMessage(t, got, want) | } | }) |
util.py | from __future__ import print_function
import sys
def errprinter(*args):
logger(*args)
def logger(*args):
| print(*args, file=sys.stderr)
sys.stderr.flush() |
|
index.js | import Vue from 'vue'
import Vuex from 'vuex'
import { state } from './state'
const actions = require('./actions.js').default
import { getters } from './getters'
import * as mutations from './mutations'
import plugins from './plugins'
Vue.use(Vuex)
const store = new Vuex.Store({
actions,
state,
getters,
mutations,
plugins
})
| export default store |
|
location.rs | use std::{
error::Error,
str::FromStr,
};
use chunky_bits::file::{
Location,
LocationContext,
};
use tempfile::tempdir;
use tokio::io::AsyncReadExt;
use url::Url;
const DEFAULT_PAYLOAD: &[u8] = "HELLO WORLD".as_bytes();
mod http_server {
use std::{
collections::HashMap,
convert::Infallible,
net::SocketAddr,
ops::Deref,
sync::Arc,
};
use bytes::Bytes;
use tokio::{
sync::{
oneshot,
Mutex,
},
task::JoinHandle,
};
use warp::{
path::FullPath,
Filter,
};
use super::*;
pub struct | (Url, oneshot::Sender<()>, JoinHandle<()>);
impl Deref for HttpServer {
type Target = Url;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl HttpServer {
pub async fn kill(self) {
let HttpServer(_, tx, handle) = self;
drop(tx);
let _ = handle.await;
}
}
/// Port is required since the tests run in parallel
pub fn start(port: usize) -> HttpServer {
let url = Url::parse(&format!("http://127.0.0.1:{}", port)).unwrap();
let addr: SocketAddr = url.socket_addrs(|| None).unwrap().first().unwrap().clone();
let content: Arc<Mutex<HashMap<String, Vec<u8>>>> = Default::default();
let content_put = content.clone();
let get_filter = warp::get()
.or(warp::head())
.map(move |_| content.clone())
.and(warp::path::full())
.and_then(
|content: Arc<Mutex<HashMap<String, Vec<u8>>>>, path: FullPath| async move {
let content = content.lock().await;
match content.get(&path.as_str().to_string()) {
Some(bytes) => Ok::<Vec<u8>, Infallible>(bytes.clone()),
None => Ok(DEFAULT_PAYLOAD.to_owned()),
}
},
);
let put_filter =
warp::put()
.map(move || content_put.clone())
.and(warp::path::full())
.and(warp::body::bytes())
.and_then(
|content: Arc<Mutex<HashMap<String, Vec<u8>>>>,
path: FullPath,
bytes: Bytes| async move {
let mut content = content.lock().await;
content.insert(path.as_str().to_string(), bytes.to_vec());
Ok::<_, Infallible>(warp::reply())
},
);
let (tx, rx) = oneshot::channel::<()>();
let (_, server) = warp::serve(get_filter.or(put_filter))
.try_bind_with_graceful_shutdown(addr, async {
let _ = rx.await;
})
.unwrap();
let handle = tokio::spawn(server);
HttpServer(url, tx, handle)
}
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_fs_read() -> Result<(), Box<dyn Error>> {
let location = Location::from_str("/bin/sh")?;
let bytes = location.read().await?;
assert!(bytes.len() > 0);
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_fs_write() -> Result<(), Box<dyn Error>> {
let payload = DEFAULT_PAYLOAD;
let dir = tempdir()?;
let dir_location = Location::from(dir.path());
let location = dir_location.write_subfile("TESTFILE", payload).await?;
let payload_read = location.read().await?;
dir.close()?;
assert_eq!(
format!("{}/TESTFILE", dir_location),
format!("{}", location),
);
assert!(location.is_child_of(&dir_location));
assert_eq!(payload, payload_read);
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_fs_reader_writer() -> Result<(), Box<dyn Error>> {
let dir = tempdir()?;
let location = Location::from_str(&format!("{}/hello", dir.path().display()))?;
let payload = DEFAULT_PAYLOAD;
let mut reader = payload.clone();
let len = location
.write_from_reader_with_context(&Default::default(), &mut reader)
.await
.unwrap();
assert_eq!(len, payload.len() as u64);
let mut reader = location.reader_with_context(&Default::default()).await?;
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await.unwrap();
assert_eq!(bytes, payload);
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_fs_conflict_ignore() -> Result<(), Box<dyn Error>> {
let dir = tempdir()?;
let cx = LocationContext::builder().conflict_ignore().build();
let location = Location::from_str(&format!("{}/hello", dir.path().display()))?;
location.write_with_context(&cx, DEFAULT_PAYLOAD).await?;
let read_payload = location.read_with_context(&cx).await?;
if read_payload != DEFAULT_PAYLOAD {
panic!("Invalid first read payload");
}
let other_payload = "OTHER PAYLOAD".as_bytes();
location.write_with_context(&cx, other_payload).await?;
let read_payload = location.read_with_context(&cx).await?;
// Write should have been ignored
if read_payload != DEFAULT_PAYLOAD {
panic!("Invalid second read payload");
}
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_fs_conflict_overwrite() -> Result<(), Box<dyn Error>> {
let dir = tempdir()?;
let cx = LocationContext::builder().conflict_overwrite().build();
let location = Location::from_str(&format!("{}/hello", dir.path().display()))?;
location.write_with_context(&cx, DEFAULT_PAYLOAD).await?;
let read_payload = location.read_with_context(&cx).await?;
if read_payload != DEFAULT_PAYLOAD {
panic!("Invalid first read payload");
}
let other_payload = "OTHER PAYLOAD".as_bytes();
location.write_with_context(&cx, other_payload).await?;
let read_payload = location.read_with_context(&cx).await?;
// File should have been rewritten
if read_payload != other_payload {
panic!("Invalid second read payload");
}
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_http_read() -> Result<(), Box<dyn Error>> {
let server = http_server::start(64000);
let location = Location::from_str(&format!("{}", *server))?;
let bytes = location.read().await?;
assert_eq!(bytes, DEFAULT_PAYLOAD);
server.kill().await;
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_http_write() -> Result<(), Box<dyn Error>> {
let server = http_server::start(64001);
let location = Location::from_str(&format!("{}hello", *server))?;
let bytes = location.read().await?;
assert_eq!(bytes, DEFAULT_PAYLOAD);
let new_bytes = "NEW DATA".as_bytes();
location.write(new_bytes).await.unwrap();
let bytes = location.read().await.unwrap();
assert_eq!(bytes, new_bytes);
server.kill().await;
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_http_reader_writer() -> Result<(), Box<dyn Error>> {
let server = http_server::start(64003);
let location = Location::from_str(&format!("{}hello", *server))?;
let mut reader = location.reader_with_context(&Default::default()).await?;
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await.unwrap();
assert_eq!(bytes, DEFAULT_PAYLOAD);
let new_bytes = "NEW DATA".as_bytes();
let mut reader = new_bytes.clone();
let len = location
.write_from_reader_with_context(&Default::default(), &mut reader)
.await
.unwrap();
assert_eq!(len, new_bytes.len() as u64);
let mut reader = location.reader_with_context(&Default::default()).await?;
let mut bytes = Vec::new();
reader.read_to_end(&mut bytes).await.unwrap();
assert_eq!(bytes, new_bytes);
server.kill().await;
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_http_conflict_ignore() -> Result<(), Box<dyn Error>> {
let server = http_server::start(64004);
let cx = LocationContext::builder().conflict_ignore().build();
let location = Location::from_str(&format!("{}hello", *server))?;
location.write_with_context(&cx, DEFAULT_PAYLOAD).await?;
let read_payload = location.read_with_context(&cx).await?;
if read_payload != DEFAULT_PAYLOAD {
panic!("Invalid first read payload");
}
let other_payload = "OTHER PAYLOAD".as_bytes();
location.write_with_context(&cx, other_payload).await?;
let read_payload = location.read_with_context(&cx).await?;
// Write should have been ignored
if read_payload != DEFAULT_PAYLOAD {
panic!("Invalid second read payload");
}
Ok(())
}
#[tokio::test(flavor = "multi_thread", worker_threads = 10)]
async fn location_http_conflict_overwrite() -> Result<(), Box<dyn Error>> {
let server = http_server::start(64005);
let cx = LocationContext::builder().conflict_overwrite().build();
let location = Location::from_str(&format!("{}hello", *server))?;
location.write_with_context(&cx, DEFAULT_PAYLOAD).await?;
let read_payload = location.read_with_context(&cx).await?;
if read_payload != DEFAULT_PAYLOAD {
panic!("Invalid first read payload");
}
let other_payload = "OTHER PAYLOAD".as_bytes();
location.write_with_context(&cx, other_payload).await?;
let read_payload = location.read_with_context(&cx).await?;
// File should have been rewritten
if read_payload != other_payload {
panic!("Invalid second read payload");
}
Ok(())
}
| HttpServer |
update_test.go | package main
import (
"fmt"
"net/http"
"testing"
"github.com/google/uuid"
"github.com/kyma-project/control-plane/components/kyma-environment-broker/internal"
"github.com/kyma-project/control-plane/components/kyma-environment-broker/internal/reconciler"
"github.com/kyma-project/control-plane/components/provisioner/pkg/gqlschema"
"github.com/pivotal-cf/brokerapi/v8/domain"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestUpdate(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-initial",
"signingAlgs": ["xxx"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
// OSB update:
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
GroupsClaim: "",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "",
UsernamePrefix: "",
},
},
Administrators: []string{"[email protected]"},
})
}
func TestUpdateFailedInstance(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.failProvisioningByOperationID(opID)
// when
// OSB update:
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
errResponse := suite.DecodeErrorResponse(resp)
assert.Equal(t, "Unable to process an update of a failed instance", errResponse.Description)
}
func TestUpdateDeprovisioningInstance(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// deprovision
resp = suite.CallAPI("DELETE", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
``)
depOpID := suite.DecodeOperationID(resp)
suite.WaitForOperationState(depOpID, domain.InProgress)
// when
// OSB update:
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
errResponse := suite.DecodeErrorResponse(resp)
assert.Equal(t, "Unable to process an update of a deprovisioned instance", errResponse.Description)
}
func TestUpdateWithNoOIDCParams(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
// OSB update:
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
}
}`)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: defaultOIDCConfig(),
},
Administrators: []string{"[email protected]"},
})
}
func TestUpdateWithNoOidcOnUpdate(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
// OSB update:
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
}
}`)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
GroupsClaim: "",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "",
UsernamePrefix: "",
},
},
Administrators: []string{"[email protected]"},
})
}
func TestUpdateContext(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
// OSB update
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
}
}`)
assert.Equal(t, http.StatusOK, resp.StatusCode)
}
func TestUnsuspensionTrialWithDefaultProviderChangedForNonDefaultRegion(t *testing.T) {
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-us10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
suite.Log("*** Suspension ***")
// Process Suspension
// OSB context update (suspension)
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-us10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"active": false
}
}`)
assert.Equal(t, http.StatusOK, resp.StatusCode)
suspensionOpID := suite.WaitForLastOperation(iid, domain.InProgress)
suite.FinishDeprovisioningOperationByProvisioner(suspensionOpID)
suite.WaitForOperationState(suspensionOpID, domain.Succeeded)
// WHEN
suite.ChangeDefaultTrialProvider(internal.AWS)
// OSB update
suite.Log("*** Unsuspension ***")
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-us10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"active": true
}
}`)
assert.Equal(t, http.StatusOK, resp.StatusCode)
suite.processProvisioningByInstanceID(iid)
// check that the region and zone is set
suite.AssertAWSRegionAndZone("us-east-1")
}
func TestUpdateOidcForSuspendedInstance(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
// uncomment to see graphql queries
//suite.EnableDumpingProvisionerRequests()
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
suite.Log("*** Suspension ***")
// Process Suspension
// OSB context update (suspension)
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"active": false
}
}`)
assert.Equal(t, http.StatusOK, resp.StatusCode)
suspensionOpID := suite.WaitForLastOperation(iid, domain.InProgress)
suite.FinishDeprovisioningOperationByProvisioner(suspensionOpID)
suite.WaitForOperationState(suspensionOpID, domain.Succeeded)
// WHEN
// OSB update
suite.Log("*** Update ***")
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"oidc": {
"clientID": "id-oooxx",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
updateOpID := suite.DecodeOperationID(resp)
suite.WaitForOperationState(updateOpID, domain.Succeeded)
// THEN
instance := suite.GetInstance(iid)
assert.Equal(t, "id-oooxx", instance.Parameters.Parameters.OIDC.ClientID)
// Start unsuspension
// OSB update (unsuspension)
suite.Log("*** Update (unsuspension) ***")
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"active": true
}
}`)
assert.Equal(t, http.StatusOK, resp.StatusCode)
// WHEN
suite.processProvisioningByInstanceID(iid)
// THEN
instance = suite.GetInstance(iid)
assert.Equal(t, "id-oooxx", instance.Parameters.Parameters.OIDC.ClientID)
input := suite.LastProvisionInput(iid)
assert.Equal(t, "id-oooxx", input.ClusterConfig.GardenerConfig.OidcConfig.ClientID)
}
func TestUpdateNotExistingInstance(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// provisioning done, let's start an update
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/not-existing"),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "4deee563-e5ec-4731-b9b1-53b42d855f0c",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
}
}`)
assert.Equal(t, http.StatusNotFound, resp.StatusCode)
}
func TestUpdateDefaultAdminNotChanged(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
},
Administrators: expectedAdmins,
})
}
func TestUpdateDefaultAdminNotChangedWithCustomOIDC(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
},
},
Administrators: expectedAdmins,
})
}
func TestUpdateDefaultAdminNotChangedWithOIDCUpdate(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
},
},
Administrators: expectedAdmins,
})
}
func TestUpdateDefaultAdminOverwritten(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]", "[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"administrators":["[email protected]", "[email protected]"]
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
},
Administrators: expectedAdmins,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins)
}
func TestUpdateCustomAdminsNotChanged(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]", "[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"administrators":["[email protected]", "[email protected]"]
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
},
Administrators: expectedAdmins,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins)
}
func TestUpdateCustomAdminsNotChangedWithOIDCUpdate(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]", "[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"administrators":["[email protected]", "[email protected]"]
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
},
},
Administrators: expectedAdmins,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins)
}
func TestUpdateCustomAdminsOverwritten(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]", "[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"administrators":["[email protected]", "[email protected]"]
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"administrators":["[email protected]", "[email protected]"]
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
},
Administrators: expectedAdmins,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins)
}
func TestUpdateCustomAdminsOverwrittenWithOIDCUpdate(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins := []string{"[email protected]", "[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"administrators":["[email protected]", "[email protected]"]
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
},
"administrators":["[email protected]", "[email protected]"]
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
},
},
Administrators: expectedAdmins,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins)
}
func TestUpdateCustomAdminsOverwrittenTwice(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
expectedAdmins1 := []string{"[email protected]", "[email protected]"}
expectedAdmins2 := []string{"[email protected]", "[email protected]"}
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"administrators":["[email protected]", "[email protected]"]
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"administrators":["[email protected]", "[email protected]"]
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
},
Administrators: expectedAdmins1,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins1)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id"
},
"parameters": {
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
},
"administrators":["[email protected]", "[email protected]"]
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID = suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "id-ooo",
IssuerURL: "https://issuer.url.com",
SigningAlgs: []string{"RSA256"},
},
},
Administrators: expectedAdmins2,
})
suite.AssertInstanceRuntimeAdmins(id, expectedAdmins2)
}
func TestUpdateAutoscalerParams(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"autoScalerMin":5,
"autoScalerMax":7,
"maxSurge":3,
"maxUnavailable":4
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"autoScalerMin":15,
"autoScalerMax":25,
"maxSurge":10,
"maxUnavailable":7
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
// when
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
min, max, surge, unav := 15, 25, 10, 7
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
AutoScalerMin: &min,
AutoScalerMax: &max,
MaxSurge: &surge,
MaxUnavailable: &unav,
},
Administrators: []string{"[email protected]"},
})
}
func TestUpdateAutoscalerWrongParams(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"autoScalerMin":5,
"autoScalerMax":7,
"maxSurge":3,
"maxUnavailable":4
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"autoScalerMin":26,
"autoScalerMax":25,
"maxSurge":10,
"maxUnavailable":7
}
}`)
// then
assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
}
func TestUpdateAutoscalerPartialSequence(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"autoScalerMin":15
}
}`)
// then
assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"autoScalerMax":15
}
}`)
// then
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
upgradeOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
max := 15
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
AutoScalerMax: &max,
},
Administrators: []string{"[email protected]"},
})
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"autoScalerMin":14
}
}`)
// then
suite.WaitForOperationState(upgradeOperationID, domain.Succeeded)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
upgradeOperationID = suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(upgradeOperationID)
min := 14
suite.AssertShootUpgrade(upgradeOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
AutoScalerMin: &min,
},
Administrators: []string{"[email protected]"},
})
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]"
},
"parameters": {
"autoScalerMin":16
}
}`)
// then
assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
}
func TestUpdateWhenBothErsContextAndUpdateParametersProvided(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
// uncomment to see graphql queries
//suite.EnableDumpingProvisionerRequests()
defer suite.TearDown()
iid := uuid.New().String()
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"oidc": {
"clientID": "id-ooo",
"signingAlgs": ["RSA256"],
"issuerURL": "https://issuer.url.com"
}
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
suite.Log("*** Suspension ***")
// when
// Process Suspension
// OSB context update (suspension)
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", iid),
`{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"active": false
},
"parameters": {
"name": "testing-cluster"
}
}`)
assert.Equal(t, http.StatusOK, resp.StatusCode)
suspensionOpID := suite.WaitForLastOperation(iid, domain.InProgress)
suite.FinishDeprovisioningOperationByProvisioner(suspensionOpID)
suite.WaitForOperationState(suspensionOpID, domain.Succeeded)
// THEN
lastOp, err := suite.db.Operations().GetLastOperation(iid)
require.NoError(t, err)
assert.Equal(t, internal.OperationTypeDeprovision, lastOp.Type, "last operation should be type deprovision")
updateOps, err := suite.db.Operations().ListUpdatingOperationsByInstanceID(iid)
require.NoError(t, err)
assert.Len(t, updateOps, 0, "should not create any update operations")
}
func TestUpdateSCMigrationSuccess(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
mockBTPOperatorClusterID()
defer suite.TearDown()
id := "InstanceID-SCMigration"
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {
"basic": {
"username": "u-name",
"password": "pass"
}
}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster",
"kymaVersion": "2.0"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processReconcilingByOperationID(opID)
suite.WaitForOperationState(opID, domain.Succeeded)
i, err := suite.db.Instances().GetByID(id)
assert.NoError(t, err, "getting instance after provisioning, before update")
rs, err := suite.db.RuntimeStates().GetLatestWithReconcilerInputByRuntimeID(i.RuntimeID)
if rs.ClusterSetup == nil {
t.Fatal("expected cluster setup post provisioning kyma 2.0 cluster")
}
if rs.ClusterSetup.KymaConfig.Version != "2.0" {
t.Fatalf("expected cluster setup kyma config version to match 2.0, got %v", rs.ClusterSetup.KymaConfig.Version)
}
assert.Equal(t, opID, rs.OperationID, "runtime state provisioning operation ID")
assert.NoError(t, err, "getting runtime state after provisioning, before update")
assert.ElementsMatch(t, rs.KymaConfig.Components, []*gqlschema.ComponentConfigurationInput{})
assert.ElementsMatch(t, componentNames(rs.ClusterSetup.KymaConfig.Components), []string{"service-catalog-addons", "ory", "monitoring", "helm-broker", "service-manager-proxy", "service-catalog"})
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"sm_operator_credentials": {
"clientid": "testClientID",
"clientsecret": "testClientSecret",
"sm_url": "https://service-manager.kyma.com",
"url": "https://test.auth.com",
"xsappname": "testXsappname"
},
"isMigration": true
}
}`)
assert.Equal(t, http.StatusAccepted, resp.StatusCode)
updateOperationID := suite.DecodeOperationID(resp)
suite.FinishUpdatingOperationByProvisioner(updateOperationID)
// check first call to reconciler installing BTP-Operator and sc-migration
rsu1, err := suite.db.RuntimeStates().GetLatestWithReconcilerInputByRuntimeID(i.RuntimeID)
assert.NoError(t, err, "getting runtime mid update")
assert.Equal(t, updateOperationID, rsu1.OperationID, "runtime state update operation ID")
assert.ElementsMatch(t, rsu1.KymaConfig.Components, []*gqlschema.ComponentConfigurationInput{})
assert.ElementsMatch(t, componentNames(rs.ClusterSetup.KymaConfig.Components), []string{"service-catalog-addons", "ory", "monitoring", "helm-broker", "service-manager-proxy", "service-catalog", "btp-operator", "sc-migration"})
// check second call to reconciler and see that sc-migration and svcat related components are gone
suite.FinishUpdatingOperationByReconciler(updateOperationID)
suite.AssertShootUpgrade(updateOperationID, gqlschema.UpgradeShootInput{
GardenerConfig: &gqlschema.GardenerUpgradeInput{
OidcConfig: &gqlschema.OIDCConfigInput{
ClientID: "clinet-id-oidc",
GroupsClaim: "gropups",
IssuerURL: "https://issuer.url",
SigningAlgs: []string{"RSA256"},
UsernameClaim: "sub",
UsernamePrefix: "-",
},
},
Administrators: []string{"[email protected]"},
})
i, err = suite.db.Instances().GetByID(id)
assert.NoError(t, err, "getting instance after update")
assert.True(t, i.InstanceDetails.SCMigrationTriggered, "instance SCMigrationTriggered after update")
rsu2, err := suite.db.RuntimeStates().GetLatestWithReconcilerInputByRuntimeID(i.RuntimeID)
assert.NoError(t, err, "getting runtime after update")
assert.NotEqual(t, rsu1.ID, rsu2.ID, "runtime_state ID from first call should differ runtime_state ID from second call")
assert.Equal(t, updateOperationID, rsu2.OperationID, "runtime state update operation ID")
assert.ElementsMatch(t, rsu2.KymaConfig.Components, []*gqlschema.ComponentConfigurationInput{})
assert.ElementsMatch(t, componentNames(rsu2.ClusterSetup.KymaConfig.Components), []string{"ory", "monitoring", "btp-operator"})
for _, c := range rsu2.ClusterSetup.KymaConfig.Components {
if c.Component == "btp-operator" {
exp := reconciler.Component{
Component: "btp-operator",
Namespace: "kyma-system",
URL: "https://btp-operator",
Configuration: []reconciler.Configuration{
{Key: "manager.secret.clientid", Value: "testClientID", Secret: true},
{Key: "manager.secret.clientsecret", Value: "testClientSecret", Secret: true},
{Key: "manager.secret.url", Value: "https://service-manager.kyma.com"},
{Key: "manager.secret.tokenurl", Value: "https://test.auth.com"},
{Key: "cluster.id", Value: "cluster_id"},
},
}
assert.Equal(t, exp, c)
}
}
// finalize second call to reconciler and wait for the operation to finish
suite.FinishUpdatingOperationByReconciler(updateOperationID)
suite.WaitForOperationState(updateOperationID, domain.Succeeded)
}
func TestUpdateSCMigrationRejection(t *testing.T) {
// given
suite := NewBrokerSuiteTest(t)
defer suite.TearDown()
id := "InstanceID-SCMigration"
resp := suite.CallAPI("PUT", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true&plan_id=7d55d31d-35ae-4438-bf13-6ffdfa107d9f&service_id=47c9dcbf-ff30-448e-ab36-d3bad66ba281", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"plan_id": "7d55d31d-35ae-4438-bf13-6ffdfa107d9f",
"context": {
"sm_platform_credentials": {
"url": "https://sm.url",
"credentials": {
"basic": {
"username": "u-name",
"password": "pass"
}
}
},
"globalaccount_id": "g-account-id",
"subaccount_id": "sub-id",
"user_id": "[email protected]"
},
"parameters": {
"name": "testing-cluster"
}
}`)
opID := suite.DecodeOperationID(resp)
suite.processProvisioningByOperationID(opID)
suite.WaitForOperationState(opID, domain.Succeeded)
// when
resp = suite.CallAPI("PATCH", fmt.Sprintf("oauth/cf-eu10/v2/service_instances/%s?accepts_incomplete=true", id), `
{
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281",
"context": {
"globalaccount_id": "g-account-id",
"user_id": "[email protected]",
"sm_operator_credentials": {
"clientid": "testClientID",
"clientsecret": "testClientSecret",
"sm_url": "https://service-manager.kyma.com",
"url": "https://test.auth.com",
"xsappname": "testXsappname"
},
"isMigration": true
}
}`)
assert.Equal(t, http.StatusUnprocessableEntity, resp.StatusCode)
}
func componentNames(components []reconciler.Component) []string | {
names := make([]string, 0, len(components))
for _, c := range components {
names = append(names, c.Component)
}
return names
} |
|
resources.py | from flask import abort, request
from marshmallow import ValidationError
from webargs.flaskparser import use_args
from dataservice.extensions import db
from dataservice.api.common.pagination import paginated, Pagination
from dataservice.api.outcome.models import Outcome
from dataservice.api.outcome.schemas import OutcomeSchema
from dataservice.api.common.views import CRUDView
from dataservice.api.common.schemas import filter_schema_factory
class OutcomeListAPI(CRUDView):
"""
Outcome REST API
"""
endpoint = 'outcomes_list'
rule = '/outcomes'
schemas = {'Outcome': OutcomeSchema}
@paginated
@use_args(filter_schema_factory(OutcomeSchema),
locations=('query',))
def | (self, filter_params, after, limit):
"""
Get all outcomes
---
description: Get all outcomes
template:
path:
get_list.yml
properties:
resource:
Outcome
"""
# Get study id and remove from model filter params
study_id = filter_params.pop('study_id', None)
q = Outcome.query.filter_by(**filter_params)
# Filter by study
from dataservice.api.participant.models import Participant
if study_id:
q = (q.join(Participant.outcomes)
.filter(Participant.study_id == study_id))
return (OutcomeSchema(many=True)
.jsonify(Pagination(q, after, limit)))
def post(self):
"""
Create a new outcome
---
template:
path:
new_resource.yml
properties:
resource:
Outcome
"""
body = request.get_json(force=True)
# Deserialize
try:
o = OutcomeSchema(strict=True).load(body).data
# Request body not valid
except ValidationError as e:
abort(400, 'could not create outcome: {}'.format(e.messages))
# Add to and save in database
db.session.add(o)
db.session.commit()
return OutcomeSchema(201, 'outcome {} created'
.format(o.kf_id)).jsonify(o), 201
class OutcomeAPI(CRUDView):
"""
Outcome REST API
"""
endpoint = 'outcomes'
rule = '/outcomes/<string:kf_id>'
schemas = {'Outcome': OutcomeSchema}
def get(self, kf_id):
"""
Get a outcome by id
---
template:
path:
get_by_id.yml
properties:
resource:
Outcome
"""
# Get one
o = Outcome.query.get(kf_id)
# Not found in database
if o is None:
abort(404, 'could not find {} `{}`'
.format('outcome', kf_id))
return OutcomeSchema().jsonify(o)
def patch(self, kf_id):
"""
Update an existing outcome
Allows partial update of resource
---
template:
path:
update_by_id.yml
properties:
resource:
Outcome
"""
# Check if outcome exists
o = Outcome.query.get(kf_id)
# Not found in database
if o is None:
abort(404, 'could not find {} `{}`'.format('outcome', kf_id))
# Partial update - validate but allow missing required fields
body = request.get_json(force=True) or {}
# Validation only
try:
o = OutcomeSchema(strict=True).load(body, instance=o,
partial=True).data
# Request body not valid
except ValidationError as e:
abort(400, 'could not update outcome: {}'.format(e.messages))
# Save to database
db.session.add(o)
db.session.commit()
return OutcomeSchema(200, 'outcome {} updated'
.format(o.kf_id)).jsonify(o), 200
def delete(self, kf_id):
"""
Delete outcome by id
Deletes a outcome given a Kids First id
---
template:
path:
delete_by_id.yml
properties:
resource:
Outcome
"""
# Check if outcome exists
o = Outcome.query.get(kf_id)
# Not found in database
if o is None:
abort(404, 'could not find {} `{}`'.format('outcome', kf_id))
# Save in database
db.session.delete(o)
db.session.commit()
return OutcomeSchema(200, 'outcome {} deleted'
.format(o.kf_id)).jsonify(o), 200
| get |
register.rs | use super::super::bus::Bus;
use super::Mode;
#[derive(Debug, Copy, Clone)]
pub enum Register {
LCDC, // LCD Control
STAT, // LCD Control Status
SCY, // Scroll Y
SCX, // Scroll X
LY, // Y-Coordinate
LYC, // LY Compare
DMA, // DMA Transfer and Start Address
BGP, // BG Palette Data
OBP0, // Object Palette 0 Data
OBP1, // Object Palette 1 Data
WY, // Window Y Position
WX, // Window X Position - 7
}
impl Register {
pub fn read<B: Bus>(&self, bus: &mut B) -> u8 {
bus.read8(self.address())
}
pub fn write<B: Bus>(&self, bus: &mut B, v: u8) {
bus.write8(self.address(), v);
}
fn address(&self) -> u16 {
use self::Register::*;
match *self {
LCDC => 0xFF40,
STAT => 0xFF41,
SCY => 0xFF42,
SCX => 0xFF43,
LY => 0xFF44,
LYC => 0xFF45,
DMA => 0xFF46,
BGP => 0xFF47,
OBP0 => 0xFF48,
OBP1 => 0xFF49,
WY => 0xFF4A,
WX => 0xFF4B,
}
}
}
#[derive(Copy, Clone)]
pub struct LCDControl(u8);
impl LCDControl {
pub fn new(v: u8) -> Self {
LCDControl(v)
}
pub fn raw(&self) -> u8 {
self.0
}
pub fn bgwin_enabled(&self) -> bool {
self.0 & (1 << 0) != 0
}
pub fn obj_enabled(&self) -> bool {
self.0 & (1 << 1) != 0
}
pub fn obj_height(&self) -> u8 |
pub fn bg_map_loc(&self) -> u16 {
if self.0 & (1 << 3) == 0 {
0x9800
} else {
0x9C00
}
}
pub fn bgwin_tile_loc(&self) -> u16 {
if self.0 & (1 << 4) == 0 {
0x8800
} else {
0x8000
}
}
pub fn win_enabled(&self) -> bool {
self.0 & (1 << 5) != 0
}
pub fn win_map_loc(&self) -> u16 {
if self.0 & (1 << 6) == 0 {
0x9800
} else {
0x9C00
}
}
pub fn lcd_enabled(&self) -> bool {
self.0 & (1 << 7) != 0
}
}
#[derive(Copy, Clone)]
pub struct LCDStatus(u8);
impl LCDStatus {
pub fn new(v: u8) -> Self {
LCDStatus(v)
}
pub fn raw(&self) -> u8 {
self.0
}
pub fn mode(&self) -> Mode {
match self.0 & 0b0000_0011 {
0 => Mode::HBlank,
1 => Mode::VBlank,
2 => Mode::OAMRead,
3 => Mode::VRAMRead,
_ => unreachable!(),
}
}
pub fn set_mode(&mut self, mode: Mode) {
self.0 &= 0b1111_1100;
self.0 |= match mode {
Mode::HBlank => 0b00,
Mode::VBlank => 0b01,
Mode::OAMRead => 0b10,
Mode::VRAMRead => 0b11,
};
}
pub fn set_lyc_coincidence(&mut self, v: bool) {
self.0 &= 0b1111_1011;
if v {
self.0 |= 0b0100;
}
}
pub fn hblank_interrupt_enabled(&self) -> bool {
self.0 & 0b0000_1000 != 0
}
pub fn vblank_interrupt_enabled(&self) -> bool {
self.0 & 0b0001_0000 != 0
}
pub fn oam_interrupt_enabled(&self) -> bool {
self.0 & 0b0010_0000 != 0
}
pub fn lyc_coincidence_interrupt_enabled(&self) -> bool {
self.0 & 0b0100_0000 != 0
}
}
| {
if self.0 & (1 << 2) == 0 {
8
} else {
16
}
} |
Decompress Run-Length Encoded List.py | class Solution:
| def decompressRLElist(self, nums: List[int]) -> List[int]:
ans = []
for i in range(0, len(nums), 2):
for n in [nums[i + 1]] * nums[i]:
ans.append(n)
return ans |
|
vss_test.go | package feldmanvss
import (
"github.com/binance-chain/tss-lib/common"
"github.com/binance-chain/tss-lib/crypto/vss"
"github.com/binance-chain/tss-lib/tss"
"github.com/stretchr/testify/assert"
"math/big"
"testing"
)
func TestReconstruct2(t *testing.T) | {
num, threshold := 5, 3
secret1 := common.GetRandomPositiveInt(tss.EC().Params().N)
secret2 := common.GetRandomPositiveInt(tss.EC().Params().N)
ids := make([]*big.Int, 0)
for i := 0; i < num; i++ {
ids = append(ids, common.GetRandomPositiveInt(tss.EC().Params().N))
}
vs1, shares1, err := vss.Create(threshold, secret1, ids)
assert.NoError(t, err)
vs2, shares2, err := vss.Create(threshold, secret2, ids)
assert.NoError(t, err)
vsf, _ := AddVs(vs1, vs2)
shf, _ := AddShares(shares1, shares2)
secretf := new(big.Int).Add(secret1, secret2)
secretf = secretf.Mod(secretf, tss.EC().Params().N)
sec, err := shf[:threshold+1].ReConstruct()
assert.Nil(t, err)
assert.Equal(t, sec, secretf)
for _, next := range shf {
assert.True(t, next.Verify(threshold, vsf))
}
} |
|
test_poetry.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from poetry.poetry import Poetry
from poetry.utils._compat import Path
from poetry.utils.toml_file import TomlFile
fixtures_dir = Path(__file__).parent / "fixtures"
def test_poetry():
poetry = Poetry.create(str(fixtures_dir / "sample_project"))
package = poetry.package
assert package.name == "my-package"
assert package.version.text == "1.2.3"
assert package.description == "Some description."
assert package.authors == ["Sébastien Eustace <[email protected]>"]
assert package.license.id == "MIT"
assert (
package.readme.relative_to(fixtures_dir).as_posix()
== "sample_project/README.rst"
)
assert package.homepage == "https://poetry.eustace.io"
assert package.repository_url == "https://github.com/sdispater/poetry"
assert package.keywords == ["packaging", "dependency", "poetry"]
assert package.python_versions == "~2.7 || ^3.6"
assert str(package.python_constraint) == ">=2.7,<2.8 || >=3.6,<4.0"
dependencies = {}
for dep in package.requires:
dependencies[dep.name] = dep
cleo = dependencies["cleo"]
assert cleo.pretty_constraint == "^0.6"
assert not cleo.is_optional()
pendulum = dependencies["pendulum"]
assert pendulum.pretty_constraint == "branch 2.0"
assert pendulum.is_vcs()
assert pendulum.vcs == "git"
assert pendulum.branch == "2.0"
assert pendulum.source == "https://github.com/sdispater/pendulum.git"
assert pendulum.allows_prereleases()
requests = dependencies["requests"]
assert requests.pretty_constraint == "^2.18"
assert not requests.is_vcs()
assert not requests.allows_prereleases()
assert requests.is_optional()
assert requests.extras == ["security"]
pathlib2 = dependencies["pathlib2"]
assert pathlib2.pretty_constraint == "^2.2"
assert pathlib2.python_versions == "~2.7"
assert not pathlib2.is_optional()
demo = dependencies["demo"]
assert demo.is_file()
assert not demo.is_vcs()
assert demo.name == "demo"
assert demo.pretty_constraint == "0.1.0"
demo = dependencies["my-package"]
assert not demo.is_file()
assert demo.is_directory()
assert not demo.is_vcs()
assert demo.name == "my-package"
assert demo.pretty_constraint == "0.1.2"
assert demo.package.requires[0].name == "pendulum"
assert demo.package.requires[1].name == "cachy"
assert demo.package.requires[1].extras == ["msgpack"]
simple_project = dependencies["simple-project"]
assert not simple_project.is_file()
assert simple_project.is_directory()
assert not simple_project.is_vcs()
assert simple_project.name == "simple-project"
assert simple_project.pretty_constraint == "1.2.3"
assert simple_project.package.requires == []
assert "db" in package.extras
classifiers = package.classifiers
assert classifiers == [
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
]
assert package.all_classifiers == [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Libraries :: Python Modules",
]
def test_poetry_with_packages_and_includes():
p |
def test_check():
complete = TomlFile(fixtures_dir / "complete.toml")
content = complete.read(raw=True)["tool"]["poetry"]
assert Poetry.check(content)
| oetry = Poetry.create(
str(fixtures_dir.parent / "masonry" / "builders" / "fixtures" / "with-include")
)
package = poetry.package
assert package.packages == [
{"include": "extra_dir/**/*.py"},
{"include": "my_module.py"},
{"include": "package_with_include"},
]
assert package.include == ["extra_dir/vcs_excluded.txt", "notes.txt"]
|
mail.py | #!/usr/bin/env python3
import datetime
import pytz
import smtplib, ssl
import re
from email.utils import make_msgid
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
from email.charset import Charset, QP
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
from read_play import *
SMTP_HOST = 'mail.ffh.zone'
SMTP_PORT = 25
SMTP_USE_STARTTLS = False
SMTP_FROM = "[email protected]"
SMTP_REPLY_TO_EMAIL = "[email protected]"
SMTP_TO = '[email protected]'
def | (subject, message, message_html, to):
msgid = make_msgid()
msg = MIMEMultipart('alternative')
msg['Subject'] = str(Header(subject, 'utf-8'))
msg['From'] = str(Header(SMTP_FROM, 'utf-8'))
msg['To'] = str(Header(to, 'utf-8'))
msg['Message-ID'] = msgid
msg['Reply-To'] = SMTP_REPLY_TO_EMAIL
msg['Date'] = datetime.datetime.now(pytz.utc).strftime("%a, %e %b %Y %T %z")
# add message
charset = Charset('utf-8')
# QP = quoted printable; this is better readable instead of base64, when
# the mail is read in plaintext!
charset.body_encoding = QP
message_part = MIMEText(message.encode('utf-8'), 'plain', charset)
msg.attach(message_part)
message_part2 = MIMEText(message_html.encode('utf-8'), 'html', charset)
msg.attach(message_part2)
with smtplib.SMTP(SMTP_HOST, SMTP_PORT) as server:
server.ehlo()
if SMTP_USE_STARTTLS:
context = ssl.create_default_context()
server.starttls(context=context)
server.sendmail(SMTP_FROM, to, msg.as_string())
if __name__ == '__main__':
filename = sys.argv[1]
machine = re.findall('^.*-(.*?)\.json$', filename)[0]
msg_txt = read_play(filename)
msg_html = read_play(filename, 'html')
if msg_txt:
send_mail('Daily Report of Ansible Run on '+machine, msg_txt, msg_html, SMTP_TO)
| send_mail |
parts.rs | extern crate nom;
use nom::{
branch::alt,
bytes::complete::{tag_no_case, take_while},
character::complete::{line_ending, one_of, space0, space1},
combinator::{map, map_res},
multi::many1,
sequence::{terminated, tuple},
IResult,
};
use super::super::vm::instruction::{Comparator, Instruction, Label, Target};
fn is_digit_or_sign(c: char) -> bool {
c.is_digit(10) || c == '+' || c == '-'
}
fn is_alphanum_or_hash(c: char) -> bool {
c.is_ascii_alphabetic() || c.is_numeric() || c == '#'
}
fn to_i32(i: &str) -> Result<i32, std::num::ParseIntError> {
i.parse::<i32>()
}
fn parse_literal(i: &str) -> IResult<&str, i32> {
map_res(take_while(is_digit_or_sign), to_i32)(i)
}
fn parse_register(i: &str) -> IResult<&str, String> {
map(take_while(is_alphanum_or_hash), |s: &str| {
s.to_ascii_lowercase()
})(i)
}
fn parse_register_target(i: &str) -> IResult<&str, Target> {
match parse_register(i) {
Ok(parsed) => Ok((parsed.0, Target::Register(parsed.1))),
Err(error) => Err(error),
}
}
fn parse_target(i: &str) -> IResult<&str, Target> {
if let Ok(parsed) = parse_literal(i) {
return Ok((parsed.0, Target::Literal(parsed.1)));
}
parse_register_target(i)
}
fn parse_label(i: &str) -> IResult<&str, Label> {
map(
take_while(|c: char| c.is_alphanumeric() || c == '_'),
|s: &str| s.to_ascii_lowercase(),
)(i)
}
fn parse_copy(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("copy"),
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Copy(t.1 .2, t.1 .4)))
}
fn parse_link(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("link"), space1, parse_target))(i)?;
Ok((t.0, Instruction::Link(t.1 .2)))
}
fn parse_addi(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("addi"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Addi(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_subi(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("subi"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Subi(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_muli(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("muli"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Muli(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_divi(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("divi"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Divi(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_modi(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("modi"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Modi(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_swiz(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("swiz"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Swiz(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_mark(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("mark"), space1, parse_label))(i)?;
Ok((t.0, Instruction::Mark(t.1 .2)))
}
fn parse_jump(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("jump"), space1, parse_label))(i)?;
Ok((t.0, Instruction::Jump(t.1 .2))) | Ok((t.0, Instruction::Tjmp(t.1 .2)))
}
fn parse_fjmp(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("fjmp"), space1, parse_label))(i)?;
Ok((t.0, Instruction::Fjmp(t.1 .2)))
}
fn parse_comparator(i: &str) -> IResult<&str, Comparator> {
map(one_of("=><"), |s: char| match s {
'=' => Comparator::Equal,
'>' => Comparator::GreaterThan,
'<' => Comparator::LessThan,
_ => panic!("unreachable"),
})(i)
}
fn parse_test(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("test"),
space1,
parse_target,
space1,
parse_comparator,
space1,
parse_target,
))(i)?;
Ok((t.0, Instruction::Test(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_repl(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("repl"), space1, parse_label))(i)?;
Ok((t.0, Instruction::Repl(t.1 .2)))
}
fn parse_halt(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("halt")(i)?;
Ok((t.0, Instruction::Halt))
}
fn parse_kill(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("kill")(i)?;
Ok((t.0, Instruction::Kill))
}
fn parse_host(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("kill"), space1, parse_register_target))(i)?;
Ok((t.0, Instruction::Host(t.1 .2)))
}
fn parse_mode(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("mode")(i)?;
Ok((t.0, Instruction::Mode))
}
fn parse_void_m(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("void"), space1, tag_no_case("m")))(i)?;
Ok((t.0, Instruction::VoidM))
}
fn parse_test_mrd(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("test"), space1, tag_no_case("mrd")))(i)?;
Ok((t.0, Instruction::TestMrd))
}
fn parse_make(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("make")(i)?;
Ok((t.0, Instruction::Make))
}
fn parse_grab(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("grab"), space1, parse_target))(i)?;
Ok((t.0, Instruction::Grab(t.1 .2)))
}
fn parse_file(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("file"), space1, parse_register_target))(i)?;
Ok((t.0, Instruction::File(t.1 .2)))
}
fn parse_seek(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("seek"), space1, parse_target))(i)?;
Ok((t.0, Instruction::Seek(t.1 .2)))
}
fn parse_void_f(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("void"), space1, tag_no_case("f")))(i)?;
Ok((t.0, Instruction::VoidF))
}
fn parse_drop(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("drop")(i)?;
Ok((t.0, Instruction::Drop))
}
fn parse_wipe(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("wipe")(i)?;
Ok((t.0, Instruction::Wipe))
}
fn parse_test_eof(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("test"), space1, tag_no_case("eof")))(i)?;
Ok((t.0, Instruction::TestEof))
}
fn parse_noop(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("noop")(i)?;
Ok((t.0, Instruction::Noop))
}
fn parse_rand(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("rand"),
space1,
parse_target,
space1,
parse_target,
space1,
parse_register_target,
))(i)?;
Ok((t.0, Instruction::Rand(t.1 .2, t.1 .4, t.1 .6)))
}
fn parse_wait(i: &str) -> IResult<&str, Instruction> {
let t = tag_no_case("wait")(i)?;
Ok((t.0, Instruction::Wait))
}
fn parse_data(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
tag_no_case("data"),
space1,
many1(terminated(parse_literal, space0)),
))(i)?;
Ok((t.0, Instruction::Data(t.1 .2)))
}
pub fn parse_line(i: &str) -> IResult<&str, Instruction> {
let t = tuple((
alt((
// Broken down based on the categories in the wiki, but it's
// not semantically meaningful
parse_copy,
alt((
parse_addi, parse_subi, parse_muli, parse_divi, parse_modi, parse_swiz,
)),
alt((parse_mark, parse_jump, parse_tjmp, parse_fjmp)),
parse_test,
alt((parse_repl, parse_halt, parse_kill)),
alt((parse_link, parse_host)),
alt((parse_mode, parse_void_m, parse_test_mrd)),
alt((
parse_make,
parse_grab,
parse_file,
parse_seek,
parse_void_f,
parse_drop,
parse_wipe,
parse_test_eof,
)),
alt((parse_noop, parse_rand)),
parse_wait,
parse_data,
)),
space0,
line_ending,
))(i)?;
Ok((t.0, t.1 .0))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_literal() {
assert_eq!(parse_literal("302 bacon"), Ok((" bacon", 302)));
assert_eq!(parse_literal("-32 fwef"), Ok((" fwef", -32)));
// overflow errors
assert!(parse_literal("10000000000 ohno").is_err());
assert_eq!(parse_literal("2897bacon"), Ok(("bacon", 2897)));
// nothing to parse
assert!(parse_literal("something 123 oh no").is_err());
// sign shenanigans are an error
assert!(parse_literal("+-123").is_err());
assert!(parse_literal("++123").is_err());
assert!(parse_literal("--123").is_err());
}
#[test]
fn test_register() {
assert_eq!(
parse_register("#NRV reg"),
Ok((" reg", String::from("#nrv")))
);
assert_eq!(parse_register("X 123"), Ok((" 123", String::from("x"))));
}
#[test]
fn test_target() {
assert_eq!(parse_target("329 ok"), Ok((" ok", Target::Literal(329))));
assert_eq!(parse_target("-1 ok"), Ok((" ok", Target::Literal(-1))));
assert_eq!(parse_target("+9999 ok"), Ok((" ok", Target::Literal(9999))));
assert_eq!(
parse_target("#NRV ok"),
Ok((" ok", Target::Register(String::from("#nrv")))),
);
assert_eq!(
parse_target("x ok"),
Ok((" ok", Target::Register(String::from("x")))),
);
}
#[test]
fn test_label() {
assert_eq!(
parse_label("jumppoint 3"),
Ok((" 3", String::from("jumppoint")))
);
assert_eq!(
parse_label("label1withnumber whatever"),
Ok((" whatever", String::from("label1withnumber")))
);
}
#[test]
fn test_link() {
assert_eq!(
parse_line("LINK -1\nok"),
Ok(("ok", Instruction::Link(Target::Literal(-1))))
);
assert_eq!(
parse_line("LINK #NRV\nok"),
Ok((
"ok",
Instruction::Link(Target::Register(String::from("#nrv")))
))
);
assert_eq!(
parse_line("LINK 999 \nok"),
Ok(("ok", Instruction::Link(Target::Literal(999))))
);
}
#[test]
fn test_copy() {
assert_eq!(
parse_line("copy 5887 x\nlink 1"),
Ok((
"link 1",
Instruction::Copy(Target::Literal(5887), Target::Register(String::from("x")))
)),
)
}
#[test]
fn test_mark() {
assert_eq!(
parse_mark("mark up1\n"),
Ok(("\n", Instruction::Mark(String::from("up1"))))
)
}
#[test]
fn test_data() {
assert_eq!(
parse_data("data 1\n"),
Ok(("\n", Instruction::Data(vec![1]))),
);
assert_eq!(
parse_data("data 1 2 3\n"),
Ok(("\n", Instruction::Data(vec![1, 2, 3]))),
);
}
#[test]
fn test_test() {
assert_eq!(
parse_test("test x = 3\n"),
Ok((
"\n",
Instruction::Test(
Target::Register(String::from("x")),
Comparator::Equal,
Target::Literal(3)
)
)),
);
assert_eq!(
parse_test("test x > t\n"),
Ok((
"\n",
Instruction::Test(
Target::Register(String::from("x")),
Comparator::GreaterThan,
Target::Register(String::from("t")),
)
)),
);
assert_eq!(
parse_test("test x < #nrv\n"),
Ok((
"\n",
Instruction::Test(
Target::Register(String::from("x")),
Comparator::LessThan,
Target::Register(String::from("#nrv")),
)
)),
);
}
#[test]
fn test_label_with_underscore() {
assert_eq!(
parse_mark("mark my_label\n"),
Ok(("\n", Instruction::Mark("my_label".into()))),
)
}
} | }
fn parse_tjmp(i: &str) -> IResult<&str, Instruction> {
let t = tuple((tag_no_case("tjmp"), space1, parse_label))(i)?; |
profile_items.tsx | import React, { Component } from 'react';
import { Table, Icon, Pagination, Dropdown } from 'semantic-ui-react';
import { Link } from 'gatsby';
import { mergeItems } from '../utils/itemutils';
import CONFIG from '../components/CONFIG';
type ProfileItemsProps = {
playerData: any;
};
type ProfileItemsState = {
column: any;
direction: 'descending' | 'ascending' | null;
searchFilter: string;
data: any[];
pagination_rows: number;
pagination_page: number;
};
const pagingOptions = [
{ key: '0', value: '10', text: '10' },
{ key: '1', value: '25', text: '25' },
{ key: '2', value: '50', text: '50' },
{ key: '3', value: '100', text: '100' }
];
class ProfileItems extends Component<ProfileItemsProps, ProfileItemsState> {
constructor(props: ProfileItemsProps) {
super(props);
this.state = {
column: null,
direction: null,
searchFilter: '',
pagination_rows: 10,
pagination_page: 1,
data: []
};
}
componentDidMount() {
fetch('/structured/items.json')
.then(response => response.json())
.then(items => {
let data = mergeItems(this.props.playerData.player.character.items, items);
this.setState({ data });
});
}
_onChangePage(activePage) {
this.setState({ pagination_page: activePage });
}
_handleSort(clickedColumn) {
const { column, direction } = this.state;
let { data } = this.state;
if (column !== clickedColumn) {
const compare = (a, b) => (a > b ? 1 : b > a ? -1 : 0);
let sortedData = data.sort((a, b) => compare(a[clickedColumn], b[clickedColumn]));
this.setState({
column: clickedColumn,
direction: 'ascending',
pagination_page: 1,
data: sortedData
});
} else {
this.setState({
direction: direction === 'ascending' ? 'descending' : 'ascending',
pagination_page: 1,
data: data.reverse()
});
}
}
render() {
const { column, direction, pagination_rows, pagination_page } = this.state;
let { data } = this.state;
let totalPages = Math.ceil(data.length / this.state.pagination_rows);
// Pagination
data = data.slice(pagination_rows * (pagination_page - 1), pagination_rows * pagination_page);
return (
<Table sortable celled selectable striped collapsing unstackable compact="very">
<Table.Header> | <Table.HeaderCell
width={3}
sorted={column === 'name' ? direction : null}
onClick={() => this._handleSort('name')}
>
Item
</Table.HeaderCell>
<Table.HeaderCell
width={1}
sorted={column === 'quantity' ? direction : null}
onClick={() => this._handleSort('quantity')}
>
Quantity
</Table.HeaderCell>
<Table.HeaderCell
width={1}
sorted={column === 'type' ? direction : null}
onClick={() => this._handleSort('type')}
>
Item type
</Table.HeaderCell>
<Table.HeaderCell
width={1}
sorted={column === 'rarity' ? direction : null}
onClick={() => this._handleSort('rarity')}
>
Rarity
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
{data.map((item, idx) => (
<Table.Row key={idx}>
<Table.Cell>
<div
style={{
display: 'grid',
gridTemplateColumns: '60px auto',
gridTemplateAreas: `'icon stats' 'icon description'`,
gridGap: '1px'
}}
>
<div style={{ gridArea: 'icon' }}>
<img width={48} src={`${process.env.GATSBY_ASSETS_URL}${item.imageUrl}`} />
</div>
<div style={{ gridArea: 'stats' }}>
<Link to={`/item_info?symbol=${item.symbol}`}>
<span style={{ fontWeight: 'bolder', fontSize: '1.25em' }}>
{item.rarity > 0 && (
<span>
{item.rarity} <Icon name="star" />{' '}
</span>
)}
{item.name}
</span>
</Link>
</div>
<div style={{ gridArea: 'description' }}>{item.flavor}</div>
</div>
</Table.Cell>
<Table.Cell>{item.quantity}</Table.Cell>
<Table.Cell>{CONFIG.REWARDS_ITEM_TYPE[item.type]}</Table.Cell>
<Table.Cell>{CONFIG.RARITIES[item.rarity].name}</Table.Cell>
</Table.Row>
))}
</Table.Body>
<Table.Footer>
<Table.Row>
<Table.HeaderCell colSpan="8">
<Pagination
totalPages={totalPages}
activePage={pagination_page}
onPageChange={(event, { activePage }) => this._onChangePage(activePage)}
/>
<span style={{ paddingLeft: '2em' }}>
Items per page:{' '}
<Dropdown
inline
options={pagingOptions}
value={pagination_rows}
onChange={(event, { value }) =>
this.setState({ pagination_page: 1, pagination_rows: value as number })
}
/>
</span>
</Table.HeaderCell>
</Table.Row>
</Table.Footer>
</Table>
);
}
}
export default ProfileItems; | <Table.Row> |
retry.rs | // Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
//! A utility module for managing and retrying PD requests.
use crate::{stats::pd_stats, Error, Region, RegionId, Result, SecurityManager, StoreId};
use async_trait::async_trait;
use futures_timer::Delay;
use grpcio::Environment;
use std::{
fmt,
sync::Arc,
time::{Duration, Instant},
};
use tikv_client_pd::{Cluster, Connection};
use tikv_client_proto::{
metapb,
pdpb::{self, Timestamp},
};
use tokio::sync::RwLock;
// FIXME: these numbers and how they are used are all just cargo-culted in, there
// may be more optimal values.
const RECONNECT_INTERVAL_SEC: u64 = 1;
const MAX_REQUEST_COUNT: usize = 3;
const LEADER_CHANGE_RETRY: usize = 10;
/// Client for communication with a PD cluster. Has the facility to reconnect to the cluster.
pub struct RetryClient<Cl = Cluster> {
// Tuple is the cluster and the time of the cluster's last reconnect.
cluster: RwLock<(Cl, Instant)>,
connection: Connection,
timeout: Duration,
}
#[cfg(test)]
impl<Cl> RetryClient<Cl> {
pub fn new_with_cluster(
env: Arc<Environment>,
security_mgr: Arc<SecurityManager>,
timeout: Duration,
cluster: Cl,
) -> RetryClient<Cl> {
let connection = Connection::new(env, security_mgr);
RetryClient {
cluster: RwLock::new((cluster, Instant::now())),
connection,
timeout,
}
}
}
macro_rules! retry {
($self: ident, $tag: literal, |$cluster: ident| $call: expr) => {{
let stats = pd_stats($tag);
let mut last_err = Ok(());
for _ in 0..LEADER_CHANGE_RETRY {
// use the block here to drop the guard of the read lock,
// otherwise `reconnect` will try to acquire the write lock and results in a deadlock
let res = {
let $cluster = &$self.cluster.read().await.0;
let res = $call.await;
res
};
match stats.done(res) {
Ok(r) => return Ok(r),
Err(e) => last_err = Err(e),
}
let mut reconnect_count = MAX_REQUEST_COUNT;
while let Err(e) = $self.reconnect(RECONNECT_INTERVAL_SEC).await {
reconnect_count -= 1;
if reconnect_count == 0 {
return Err(e);
}
Delay::new(Duration::from_secs(RECONNECT_INTERVAL_SEC)).await;
}
}
last_err?;
unreachable!();
}};
}
impl RetryClient<Cluster> {
pub async fn connect(
env: Arc<Environment>,
endpoints: &[String],
security_mgr: Arc<SecurityManager>,
timeout: Duration,
) -> Result<RetryClient> {
let connection = Connection::new(env, security_mgr);
let cluster = RwLock::new((
connection.connect_cluster(endpoints, timeout).await?,
Instant::now(),
));
Ok(RetryClient {
cluster,
connection,
timeout,
})
}
// These get_* functions will try multiple times to make a request, reconnecting as necessary.
// It does not know about encoding. Caller should take care of it.
pub async fn get_region(self: Arc<Self>, key: Vec<u8>) -> Result<Region> {
retry!(self, "get_region", |cluster| {
let key = key.clone();
async {
cluster
.get_region(key.clone(), self.timeout)
.await
.and_then(|resp| {
region_from_response(resp, || Error::RegionForKeyNotFound { key })
})
}
})
}
pub async fn get_region_by_id(self: Arc<Self>, region_id: RegionId) -> Result<Region> {
retry!(self, "get_region_by_id", |cluster| async {
cluster
.get_region_by_id(region_id, self.timeout)
.await
.and_then(|resp| region_from_response(resp, || Error::RegionNotFound { region_id }))
})
}
pub async fn get_store(self: Arc<Self>, id: StoreId) -> Result<metapb::Store> {
retry!(self, "get_store", |cluster| async {
cluster
.get_store(id, self.timeout)
.await
.map(|mut resp| resp.take_store())
}) | }
#[allow(dead_code)]
pub async fn get_all_stores(self: Arc<Self>) -> Result<Vec<metapb::Store>> {
retry!(self, "get_all_stores", |cluster| async {
cluster
.get_all_stores(self.timeout)
.await
.map(|mut resp| resp.take_stores().into_iter().map(Into::into).collect())
})
}
pub async fn get_timestamp(self: Arc<Self>) -> Result<Timestamp> {
retry!(self, "get_timestamp", |cluster| cluster.get_timestamp())
}
pub async fn update_safepoint(self: Arc<Self>, safepoint: u64) -> Result<bool> {
retry!(self, "update_gc_safepoint", |cluster| async {
cluster
.update_safepoint(safepoint, self.timeout)
.await
.map(|resp| resp.get_new_safe_point() == safepoint)
})
}
}
impl fmt::Debug for RetryClient {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("pd::RetryClient")
.field("timeout", &self.timeout)
.finish()
}
}
fn region_from_response(
resp: pdpb::GetRegionResponse,
err: impl FnOnce() -> Error,
) -> Result<Region> {
let region = resp.region.ok_or_else(err)?;
Ok(Region::new(region, resp.leader))
}
// A node-like thing that can be connected to.
#[async_trait]
trait Reconnect {
type Cl;
async fn reconnect(&self, interval_sec: u64) -> Result<()>;
}
#[async_trait]
impl Reconnect for RetryClient<Cluster> {
type Cl = Cluster;
async fn reconnect(&self, interval_sec: u64) -> Result<()> {
let reconnect_begin = Instant::now();
let mut lock = self.cluster.write().await;
let (cluster, last_connected) = &mut *lock;
// If `last_connected + interval_sec` is larger or equal than reconnect_begin,
// a concurrent reconnect is just succeed when this thread trying to get write lock
let should_connect = reconnect_begin > *last_connected + Duration::from_secs(interval_sec);
if should_connect {
self.connection.reconnect(cluster, self.timeout).await?;
*last_connected = Instant::now();
}
Ok(())
}
}
#[cfg(test)]
mod test {
use super::*;
use futures::{executor, future::ready};
use std::sync::Mutex;
use tikv_client_common::internal_err;
#[test]
fn test_reconnect() {
struct MockClient {
reconnect_count: Mutex<usize>,
cluster: RwLock<((), Instant)>,
}
#[async_trait]
impl Reconnect for MockClient {
type Cl = ();
async fn reconnect(&self, _: u64) -> Result<()> {
*self.reconnect_count.lock().unwrap() += 1;
// Not actually unimplemented, we just don't care about the error.
Err(Error::Unimplemented)
}
}
async fn retry_err(client: Arc<MockClient>) -> Result<()> {
retry!(client, "test", |_c| ready(Err(internal_err!("whoops"))))
}
async fn retry_ok(client: Arc<MockClient>) -> Result<()> {
retry!(client, "test", |_c| ready(Ok::<_, Error>(())))
}
executor::block_on(async {
let client = Arc::new(MockClient {
reconnect_count: Mutex::new(0),
cluster: RwLock::new(((), Instant::now())),
});
assert!(retry_err(client.clone()).await.is_err());
assert_eq!(*client.reconnect_count.lock().unwrap(), MAX_REQUEST_COUNT);
*client.reconnect_count.lock().unwrap() = 0;
assert!(retry_ok(client.clone()).await.is_ok());
assert_eq!(*client.reconnect_count.lock().unwrap(), 0);
})
}
#[test]
fn test_retry() {
struct MockClient {
cluster: RwLock<(Mutex<usize>, Instant)>,
}
#[async_trait]
impl Reconnect for MockClient {
type Cl = Mutex<usize>;
async fn reconnect(&self, _: u64) -> Result<()> {
Ok(())
}
}
async fn retry_max_err(
client: Arc<MockClient>,
max_retries: Arc<Mutex<usize>>,
) -> Result<()> {
retry!(client, "test", |c| {
let mut c = c.lock().unwrap();
*c += 1;
let mut max_retries = max_retries.lock().unwrap();
*max_retries -= 1;
if *max_retries == 0 {
ready(Ok(()))
} else {
ready(Err(internal_err!("whoops")))
}
})
}
async fn retry_max_ok(
client: Arc<MockClient>,
max_retries: Arc<Mutex<usize>>,
) -> Result<()> {
retry!(client, "test", |c| {
let mut c = c.lock().unwrap();
*c += 1;
let mut max_retries = max_retries.lock().unwrap();
*max_retries -= 1;
if *max_retries == 0 {
ready(Ok(()))
} else {
ready(Err(internal_err!("whoops")))
}
})
}
executor::block_on(async {
let client = Arc::new(MockClient {
cluster: RwLock::new((Mutex::new(0), Instant::now())),
});
let max_retries = Arc::new(Mutex::new(1000));
assert!(retry_max_err(client.clone(), max_retries).await.is_err());
assert_eq!(
*client.cluster.read().await.0.lock().unwrap(),
LEADER_CHANGE_RETRY
);
let client = Arc::new(MockClient {
cluster: RwLock::new((Mutex::new(0), Instant::now())),
});
let max_retries = Arc::new(Mutex::new(2));
assert!(retry_max_ok(client.clone(), max_retries).await.is_ok());
assert_eq!(*client.cluster.read().await.0.lock().unwrap(), 2);
})
}
} | |
server.go | // Copyright 2020 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package cdc
import (
"context"
"fmt"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/pingcap/errors"
"github.com/pingcap/log"
"github.com/pingcap/ticdc/cdc/capture"
"github.com/pingcap/ticdc/cdc/kv"
"github.com/pingcap/ticdc/cdc/sorter/unified"
"github.com/pingcap/ticdc/pkg/config"
cerror "github.com/pingcap/ticdc/pkg/errors"
"github.com/pingcap/ticdc/pkg/etcd"
"github.com/pingcap/ticdc/pkg/fsutil"
"github.com/pingcap/ticdc/pkg/httputil"
"github.com/pingcap/ticdc/pkg/util"
"github.com/pingcap/ticdc/pkg/version"
tidbkv "github.com/pingcap/tidb/kv"
"github.com/prometheus/client_golang/prometheus"
pd "github.com/tikv/pd/client"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/logutil"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"
"google.golang.org/grpc/backoff"
)
const (
defaultDataDir = "/tmp/cdc_data"
// dataDirThreshold is used to warn if the free space of the specified data-dir is lower than it, unit is GB
dataDirThreshold = 500
)
// Server is the capture server
type Server struct {
capture *capture.Capture
statusServer *http.Server
pdClient pd.Client
etcdClient *etcd.CDCEtcdClient
kvStorage tidbkv.Storage
pdEndpoints []string
}
// NewServer creates a Server instance.
func NewServer(pdEndpoints []string) (*Server, error) {
conf := config.GetGlobalServerConfig()
log.Info("creating CDC server",
zap.Strings("pd-addrs", pdEndpoints),
zap.Stringer("config", conf),
)
s := &Server{
pdEndpoints: pdEndpoints,
}
return s, nil
}
// Run runs the server.
func (s *Server) Run(ctx context.Context) error {
conf := config.GetGlobalServerConfig()
grpcTLSOption, err := conf.Security.ToGRPCDialOption()
if err != nil {
return errors.Trace(err)
}
pdClient, err := pd.NewClientWithContext(
ctx, s.pdEndpoints, conf.Security.PDSecurityOption(),
pd.WithGRPCDialOptions(
grpcTLSOption,
grpc.WithBlock(),
grpc.WithConnectParams(grpc.ConnectParams{
Backoff: backoff.Config{
BaseDelay: time.Second,
Multiplier: 1.1,
Jitter: 0.1,
MaxDelay: 3 * time.Second,
},
MinConnectTimeout: 3 * time.Second,
}),
))
if err != nil |
s.pdClient = pdClient
tlsConfig, err := conf.Security.ToTLSConfig()
if err != nil {
return errors.Trace(err)
}
logConfig := logutil.DefaultZapLoggerConfig
logConfig.Level = zap.NewAtomicLevelAt(zapcore.ErrorLevel)
etcdCli, err := clientv3.New(clientv3.Config{
Endpoints: s.pdEndpoints,
TLS: tlsConfig,
Context: ctx,
LogConfig: &logConfig,
DialTimeout: 5 * time.Second,
DialOptions: []grpc.DialOption{
grpcTLSOption,
grpc.WithBlock(),
grpc.WithConnectParams(grpc.ConnectParams{
Backoff: backoff.Config{
BaseDelay: time.Second,
Multiplier: 1.1,
Jitter: 0.1,
MaxDelay: 3 * time.Second,
},
MinConnectTimeout: 3 * time.Second,
}),
},
})
if err != nil {
return errors.Annotate(cerror.WrapError(cerror.ErrNewCaptureFailed, err), "new etcd client")
}
cdcEtcdClient := etcd.NewCDCEtcdClient(ctx, etcdCli)
s.etcdClient = &cdcEtcdClient
err = s.initDir(ctx)
if err != nil {
return errors.Trace(err)
}
// To not block CDC server startup, we need to warn instead of error
// when TiKV is incompatible.
errorTiKVIncompatible := false
err = version.CheckClusterVersion(ctx, s.pdClient, s.pdEndpoints, conf.Security, errorTiKVIncompatible)
if err != nil {
return err
}
kv.InitWorkerPool()
kvStore, err := kv.CreateTiStore(strings.Join(s.pdEndpoints, ","), conf.Security)
if err != nil {
return errors.Trace(err)
}
defer func() {
err := kvStore.Close()
if err != nil {
log.Warn("kv store close failed", zap.Error(err))
}
}()
s.kvStorage = kvStore
ctx = util.PutKVStorageInCtx(ctx, kvStore)
s.capture = capture.NewCapture(s.pdClient, s.kvStorage, s.etcdClient)
err = s.startStatusHTTP()
if err != nil {
return err
}
return s.run(ctx)
}
func (s *Server) etcdHealthChecker(ctx context.Context) error {
ticker := time.NewTicker(time.Second * 3)
defer ticker.Stop()
conf := config.GetGlobalServerConfig()
httpCli, err := httputil.NewClient(conf.Security)
if err != nil {
return err
}
defer httpCli.CloseIdleConnections()
metrics := make(map[string]prometheus.Observer)
for _, pdEndpoint := range s.pdEndpoints {
metrics[pdEndpoint] = etcdHealthCheckDuration.WithLabelValues(conf.AdvertiseAddr, pdEndpoint)
}
for {
select {
case <-ctx.Done():
return ctx.Err()
case <-ticker.C:
for _, pdEndpoint := range s.pdEndpoints {
start := time.Now()
ctx, cancel := context.WithTimeout(ctx, time.Second*10)
req, err := http.NewRequestWithContext(
ctx, http.MethodGet, fmt.Sprintf("%s/health", pdEndpoint), nil)
if err != nil {
log.Warn("etcd health check failed", zap.Error(err))
cancel()
continue
}
_, err = httpCli.Do(req)
if err != nil {
log.Warn("etcd health check error", zap.Error(err))
} else {
metrics[pdEndpoint].Observe(float64(time.Since(start)) / float64(time.Second))
}
cancel()
}
}
}
}
func (s *Server) run(ctx context.Context) (err error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
wg, cctx := errgroup.WithContext(ctx)
wg.Go(func() error {
return s.capture.Run(cctx)
})
wg.Go(func() error {
return s.etcdHealthChecker(cctx)
})
wg.Go(func() error {
return unified.RunWorkerPool(cctx)
})
wg.Go(func() error {
return kv.RunWorkerPool(cctx)
})
return wg.Wait()
}
// Close closes the server.
func (s *Server) Close() {
if s.capture != nil {
s.capture.AsyncClose()
}
if s.statusServer != nil {
err := s.statusServer.Close()
if err != nil {
log.Error("close status server", zap.Error(err))
}
s.statusServer = nil
}
}
func (s *Server) initDir(ctx context.Context) error {
if err := s.setUpDir(ctx); err != nil {
return errors.Trace(err)
}
conf := config.GetGlobalServerConfig()
// Ensure data dir exists and read-writable.
diskInfo, err := checkDir(conf.DataDir)
if err != nil {
return errors.Trace(err)
}
log.Info(fmt.Sprintf("%s is set as data-dir (%dGB available), sort-dir=%s. "+
"It is recommended that the disk for data-dir at least have %dGB available space",
conf.DataDir, diskInfo.Avail, conf.Sorter.SortDir, dataDirThreshold))
// Ensure sorter dir exists and read-writable.
_, err = checkDir(conf.Sorter.SortDir)
if err != nil {
return errors.Trace(err)
}
return nil
}
func (s *Server) setUpDir(ctx context.Context) error {
conf := config.GetGlobalServerConfig()
if conf.DataDir != "" {
conf.Sorter.SortDir = filepath.Join(conf.DataDir, config.DefaultSortDir)
config.StoreGlobalServerConfig(conf)
return nil
}
// data-dir will be decided by exist changefeed for backward compatibility
allInfo, err := s.etcdClient.GetAllChangeFeedInfo(ctx)
if err != nil {
return errors.Trace(err)
}
candidates := make([]string, 0, len(allInfo))
for _, info := range allInfo {
if info.SortDir != "" {
candidates = append(candidates, info.SortDir)
}
}
conf.DataDir = defaultDataDir
best, ok := findBestDataDir(candidates)
if ok {
conf.DataDir = best
}
conf.Sorter.SortDir = filepath.Join(conf.DataDir, config.DefaultSortDir)
config.StoreGlobalServerConfig(conf)
return nil
}
func checkDir(dir string) (*fsutil.DiskInfo, error) {
err := os.MkdirAll(dir, 0o700)
if err != nil {
return nil, errors.Trace(err)
}
if err := fsutil.IsDirReadWritable(dir); err != nil {
return nil, errors.Trace(err)
}
return fsutil.GetDiskInfo(dir)
}
// try to find the best data dir by rules
// at the moment, only consider available disk space
func findBestDataDir(candidates []string) (result string, ok bool) {
var low uint64 = 0
for _, dir := range candidates {
info, err := checkDir(dir)
if err != nil {
log.Warn("check the availability of dir", zap.String("dir", dir), zap.Error(err))
continue
}
if info.Avail > low {
result = dir
low = info.Avail
ok = true
}
}
if !ok && len(candidates) != 0 {
log.Warn("try to find directory for data-dir failed, use `/tmp/cdc_data` as data-dir", zap.Strings("candidates", candidates))
}
return result, ok
}
| {
return cerror.WrapError(cerror.ErrServerNewPDClient, err)
} |
[id].tsx | import MainLayout from '@components/Layouts/MainLayout';
import ProductDetails from '@components/ProductDetails';
import React from 'react';
import { useSelector } from 'react-redux';
import { wrapper } from 'src/redux/store';
import { addProductToCart } from '../../src/redux/actions/cartActions';
import { getProduct } from '../../src/redux/actions/productsActions';
import ProductDetailLoader from '../../src/utils/Loaders/productDetailsLoader';
const productDetails = () => {
const { products } = useSelector((state) => state);
console.log(products);
return (
<MainLayout>
<div className="container flex justify-center">
{!products ? (
<div className="self-center">
<ProductDetailLoader />
</div>
) : (
<div className="mx-auto"> | )}
</div>
</MainLayout>
);
};
export const getServerSideProps = wrapper.getServerSideProps((store) => async ({ req, params }) => {
// const { store } = context;
await store.dispatch(getProduct(req, params.id));
});
export default productDetails; | <ProductDetails productDetails={products.productDetails} currency={products.currency} />
</div> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.